Encapsulate D3D textures into Storage classes.

TRAC #18730 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@851 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 8747f18f
...@@ -1199,6 +1199,19 @@ void Image::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, ...@@ -1199,6 +1199,19 @@ void Image::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width,
mDirty = true; mDirty = true;
} }
TextureStorage::TextureStorage(bool renderable) : mIsRenderable(renderable)
{
}
TextureStorage::~TextureStorage()
{
}
bool TextureStorage::isRenderable()
{
return mIsRenderable;
}
Texture::Texture(GLuint id) : RefCountObject(id) Texture::Texture(GLuint id) : RefCountObject(id)
{ {
mSerial = 0; mSerial = 0;
...@@ -1210,8 +1223,6 @@ Texture::Texture(GLuint id) : RefCountObject(id) ...@@ -1210,8 +1223,6 @@ Texture::Texture(GLuint id) : RefCountObject(id)
mDirtyParameters = true; mDirtyParameters = true;
mDirtyImages = true; mDirtyImages = true;
mIsRenderable = false;
} }
Texture::~Texture() Texture::~Texture()
...@@ -1508,6 +1519,34 @@ unsigned int Texture::issueSerial() ...@@ -1508,6 +1519,34 @@ unsigned int Texture::issueSerial()
return mCurrentSerial++; return mCurrentSerial++;
} }
TextureStorage2D::TextureStorage2D(IDirect3DTexture9 *texture, bool renderable) : TextureStorage(renderable)
{
mTexture = texture;
}
TextureStorage2D::~TextureStorage2D()
{
mTexture->Release();
}
IDirect3DSurface9 *TextureStorage2D::getSurfaceLevel(int level)
{
IDirect3DSurface9 *surface = NULL;
if (mTexture)
{
HRESULT result = mTexture->GetSurfaceLevel(level, &surface);
ASSERT(SUCCEEDED(result));
}
return surface;
}
IDirect3DBaseTexture9 *TextureStorage2D::getBaseTexture() const
{
return mTexture;
}
Texture2D::Texture2D(GLuint id) : Texture(id) Texture2D::Texture2D(GLuint id) : Texture(id)
{ {
mTexture = NULL; mTexture = NULL;
...@@ -1518,12 +1557,9 @@ Texture2D::~Texture2D() ...@@ -1518,12 +1557,9 @@ Texture2D::~Texture2D()
{ {
mColorbufferProxy.set(NULL); mColorbufferProxy.set(NULL);
if (mTexture) delete mTexture;
{ mTexture = NULL;
mTexture->Release();
mTexture = NULL;
}
if (mSurface) if (mSurface)
{ {
mSurface->setBoundTexture(NULL); mSurface->setBoundTexture(NULL);
...@@ -1574,7 +1610,7 @@ void Texture2D::redefineImage(GLint level, GLenum format, GLsizei width, GLsizei ...@@ -1574,7 +1610,7 @@ void Texture2D::redefineImage(GLint level, GLenum format, GLsizei width, GLsizei
mImageArray[i].markDirty(); mImageArray[i].markDirty();
} }
mTexture->Release(); delete mTexture;
mTexture = NULL; mTexture = NULL;
mSerial = 0; mSerial = 0;
mDirtyImages = true; mDirtyImages = true;
...@@ -1610,11 +1646,11 @@ void Texture2D::bindTexImage(egl::Surface *surface) ...@@ -1610,11 +1646,11 @@ void Texture2D::bindTexImage(egl::Surface *surface)
mImageArray[0].redefine(format, surface->getWidth(), surface->getHeight(), GL_UNSIGNED_BYTE); mImageArray[0].redefine(format, surface->getWidth(), surface->getHeight(), GL_UNSIGNED_BYTE);
mTexture = surface->getOffscreenTexture(); delete mTexture;
mTexture = new TextureStorage2D(surface->getOffscreenTexture(), true);
mSerial = issueSerial(); mSerial = issueSerial();
mColorbufferProxy.set(NULL); mColorbufferProxy.set(NULL);
mDirtyImages = true; mDirtyImages = true;
mIsRenderable = true;
mSurface = surface; mSurface = surface;
mSurface->setBoundTexture(this); mSurface->setBoundTexture(this);
} }
...@@ -1628,7 +1664,7 @@ void Texture2D::releaseTexImage() ...@@ -1628,7 +1664,7 @@ void Texture2D::releaseTexImage()
if (mTexture) if (mTexture)
{ {
mTexture->Release(); delete mTexture;
mTexture = NULL; mTexture = NULL;
mSerial = 0; mSerial = 0;
mColorbufferProxy.set(NULL); mColorbufferProxy.set(NULL);
...@@ -1654,19 +1690,16 @@ void Texture2D::commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei wi ...@@ -1654,19 +1690,16 @@ void Texture2D::commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei wi
if (level < levelCount()) if (level < levelCount())
{ {
IDirect3DSurface9 *destLevel = NULL; IDirect3DSurface9 *destLevel = mTexture->getSurfaceLevel(level);
HRESULT result = mTexture->GetSurfaceLevel(level, &destLevel);
ASSERT(SUCCEEDED(result));
if (SUCCEEDED(result)) if (destLevel)
{ {
Image *image = &mImageArray[level]; Image *image = &mImageArray[level];
RECT sourceRect = transformPixelRect(xoffset, yoffset, width, height, image->getHeight());; RECT sourceRect = transformPixelRect(xoffset, yoffset, width, height, image->getHeight());
POINT destPoint = {sourceRect.left, sourceRect.top}; POINT destPoint = {sourceRect.left, sourceRect.top};
result = getDevice()->UpdateSurface(image->getSurface(), &sourceRect, destLevel, &destPoint); HRESULT result = getDevice()->UpdateSurface(image->getSurface(), &sourceRect, destLevel, &destPoint);
ASSERT(SUCCEEDED(result)); ASSERT(SUCCEEDED(result));
destLevel->Release(); destLevel->Release();
...@@ -1711,7 +1744,7 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei ...@@ -1711,7 +1744,7 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei
} }
else else
{ {
if (!mTexture || !mIsRenderable) if (!mTexture || !mTexture->isRenderable())
{ {
convertToRenderTarget(); convertToRenderTarget();
} }
...@@ -1728,8 +1761,7 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei ...@@ -1728,8 +1761,7 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei
GLint destYOffset = transformPixelYOffset(0, height, mImageArray[level].getHeight()); GLint destYOffset = transformPixelYOffset(0, height, mImageArray[level].getHeight());
IDirect3DSurface9 *dest; IDirect3DSurface9 *dest = mTexture->getSurfaceLevel(level);
HRESULT hr = mTexture->GetSurfaceLevel(level, &dest);
getBlitter()->copy(source->getRenderTarget(), sourceRect, format, 0, destYOffset, dest); getBlitter()->copy(source->getRenderTarget(), sourceRect, format, 0, destYOffset, dest);
dest->Release(); dest->Release();
...@@ -1759,7 +1791,7 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo ...@@ -1759,7 +1791,7 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo
} }
else else
{ {
if (!mTexture || !mIsRenderable) if (!mTexture || !mTexture->isRenderable())
{ {
convertToRenderTarget(); convertToRenderTarget();
} }
...@@ -1776,8 +1808,7 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo ...@@ -1776,8 +1808,7 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo
GLint destYOffset = transformPixelYOffset(yoffset, height, mImageArray[level].getHeight()); GLint destYOffset = transformPixelYOffset(yoffset, height, mImageArray[level].getHeight());
IDirect3DSurface9 *dest; IDirect3DSurface9 *dest = mTexture->getSurfaceLevel(level);
HRESULT hr = mTexture->GetSurfaceLevel(level, &dest);
getBlitter()->copy(source->getRenderTarget(), sourceRect, mImageArray[0].getFormat(), xoffset, destYOffset, dest); getBlitter()->copy(source->getRenderTarget(), sourceRect, mImageArray[0].getFormat(), xoffset, destYOffset, dest);
dest->Release(); dest->Release();
...@@ -1879,7 +1910,7 @@ bool Texture2D::isCompressed() const ...@@ -1879,7 +1910,7 @@ bool Texture2D::isCompressed() const
IDirect3DBaseTexture9 *Texture2D::getBaseTexture() const IDirect3DBaseTexture9 *Texture2D::getBaseTexture() const
{ {
return mTexture; return mTexture ? mTexture->getBaseTexture() : NULL;
} }
// Constructs a Direct3D 9 texture resource from the texture images // Constructs a Direct3D 9 texture resource from the texture images
...@@ -1898,16 +1929,11 @@ void Texture2D::createTexture() ...@@ -1898,16 +1929,11 @@ void Texture2D::createTexture()
return error(GL_OUT_OF_MEMORY); return error(GL_OUT_OF_MEMORY);
} }
if (mTexture) delete mTexture;
{ mTexture = new TextureStorage2D(texture, false);
mTexture->Release();
}
mTexture = texture;
mSerial = issueSerial(); mSerial = issueSerial();
mColorbufferProxy.set(NULL); mColorbufferProxy.set(NULL);
mDirtyImages = true; mDirtyImages = true;
mIsRenderable = false;
} }
void Texture2D::updateTexture() void Texture2D::updateTexture()
...@@ -1949,10 +1975,9 @@ void Texture2D::convertToRenderTarget() ...@@ -1949,10 +1975,9 @@ void Texture2D::convertToRenderTarget()
int levels = levelCount(); int levels = levelCount();
for (int i = 0; i < levels; i++) for (int i = 0; i < levels; i++)
{ {
IDirect3DSurface9 *source; IDirect3DSurface9 *source = mTexture->getSurfaceLevel(i);
result = mTexture->GetSurfaceLevel(i, &source);
if (FAILED(result)) if (!source)
{ {
ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY); ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
...@@ -1994,16 +2019,11 @@ void Texture2D::convertToRenderTarget() ...@@ -1994,16 +2019,11 @@ void Texture2D::convertToRenderTarget()
} }
} }
if (mTexture != NULL) delete mTexture;
{ mTexture = new TextureStorage2D(texture, true);
mTexture->Release();
}
mTexture = texture;
mSerial = issueSerial(); mSerial = issueSerial();
mColorbufferProxy.set(NULL); mColorbufferProxy.set(NULL);
mDirtyImages = true; mDirtyImages = true;
mIsRenderable = true;
} }
void Texture2D::generateMipmaps() void Texture2D::generateMipmaps()
...@@ -2026,15 +2046,12 @@ void Texture2D::generateMipmaps() ...@@ -2026,15 +2046,12 @@ void Texture2D::generateMipmaps()
mImageArray[0].getType()); mImageArray[0].getType());
} }
if (mTexture && mIsRenderable) if (mTexture && mTexture->isRenderable())
{ {
for (unsigned int i = 1; i <= q; i++) for (unsigned int i = 1; i <= q; i++)
{ {
IDirect3DSurface9 *upper = NULL; IDirect3DSurface9 *upper = mTexture->getSurfaceLevel(i - 1);
IDirect3DSurface9 *lower = NULL; IDirect3DSurface9 *lower = mTexture->getSurfaceLevel(i);
mTexture->GetSurfaceLevel(i-1, &upper);
mTexture->GetSurfaceLevel(i, &lower);
if (upper != NULL && lower != NULL) if (upper != NULL && lower != NULL)
{ {
...@@ -2085,7 +2102,7 @@ IDirect3DSurface9 *Texture2D::getRenderTarget(GLenum target) ...@@ -2085,7 +2102,7 @@ IDirect3DSurface9 *Texture2D::getRenderTarget(GLenum target)
{ {
ASSERT(target == GL_TEXTURE_2D); ASSERT(target == GL_TEXTURE_2D);
if (!mTexture || !mIsRenderable) if (!mTexture || !mTexture->isRenderable())
{ {
convertToRenderTarget(); convertToRenderTarget();
} }
...@@ -2097,12 +2114,39 @@ IDirect3DSurface9 *Texture2D::getRenderTarget(GLenum target) ...@@ -2097,12 +2114,39 @@ IDirect3DSurface9 *Texture2D::getRenderTarget(GLenum target)
updateTexture(); updateTexture();
IDirect3DSurface9 *renderTarget = NULL; IDirect3DSurface9 *renderTarget = mTexture->getSurfaceLevel(0);
mTexture->GetSurfaceLevel(0, &renderTarget);
return renderTarget; return renderTarget;
} }
TextureStorageCubeMap::TextureStorageCubeMap(IDirect3DCubeTexture9 *texture, bool renderable) : TextureStorage(renderable)
{
mTexture = texture;
}
TextureStorageCubeMap::~TextureStorageCubeMap()
{
mTexture->Release();
}
IDirect3DSurface9 *TextureStorageCubeMap::getCubeMapSurface(int face, int level)
{
IDirect3DSurface9 *surface = NULL;
if (mTexture)
{
HRESULT result = mTexture->GetCubeMapSurface(static_cast<D3DCUBEMAP_FACES>(face), level, &surface);
ASSERT(SUCCEEDED(result));
}
return surface;
}
IDirect3DBaseTexture9 *TextureStorageCubeMap::getBaseTexture() const
{
return mTexture;
}
TextureCubeMap::TextureCubeMap(GLuint id) : Texture(id) TextureCubeMap::TextureCubeMap(GLuint id) : Texture(id)
{ {
mTexture = NULL; mTexture = NULL;
...@@ -2115,11 +2159,7 @@ TextureCubeMap::~TextureCubeMap() ...@@ -2115,11 +2159,7 @@ TextureCubeMap::~TextureCubeMap()
mFaceProxies[i].set(NULL); mFaceProxies[i].set(NULL);
} }
if (mTexture) delete mTexture;
{
mTexture->Release();
mTexture = NULL;
}
} }
GLenum TextureCubeMap::getTarget() const GLenum TextureCubeMap::getTarget() const
...@@ -2202,7 +2242,7 @@ void TextureCubeMap::commitRect(int face, GLint level, GLint xoffset, GLint yoff ...@@ -2202,7 +2242,7 @@ void TextureCubeMap::commitRect(int face, GLint level, GLint xoffset, GLint yoff
{ {
Image *image = &mImageArray[face][level]; Image *image = &mImageArray[face][level];
RECT sourceRect = transformPixelRect(xoffset, yoffset, width, height, image->getHeight());; RECT sourceRect = transformPixelRect(xoffset, yoffset, width, height, image->getHeight());
POINT destPoint = {sourceRect.left, sourceRect.top}; POINT destPoint = {sourceRect.left, sourceRect.top};
HRESULT result = getDevice()->UpdateSurface(image->getSurface(), &sourceRect, destLevel, &destPoint); HRESULT result = getDevice()->UpdateSurface(image->getSurface(), &sourceRect, destLevel, &destPoint);
...@@ -2331,7 +2371,7 @@ bool TextureCubeMap::isCompressed() const ...@@ -2331,7 +2371,7 @@ bool TextureCubeMap::isCompressed() const
IDirect3DBaseTexture9 *TextureCubeMap::getBaseTexture() const IDirect3DBaseTexture9 *TextureCubeMap::getBaseTexture() const
{ {
return mTexture; return mTexture ? mTexture->getBaseTexture() : NULL;
} }
// Constructs a Direct3D 9 texture resource from the texture images, or returns an existing one // Constructs a Direct3D 9 texture resource from the texture images, or returns an existing one
...@@ -2350,16 +2390,11 @@ void TextureCubeMap::createTexture() ...@@ -2350,16 +2390,11 @@ void TextureCubeMap::createTexture()
return error(GL_OUT_OF_MEMORY); return error(GL_OUT_OF_MEMORY);
} }
if (mTexture) delete mTexture;
{ mTexture = new TextureStorageCubeMap(texture, false);
mTexture->Release();
}
mTexture = texture;
mSerial = issueSerial(); mSerial = issueSerial();
for(int face = 0; face < 6; face++) mFaceProxies[face].set(NULL); for(int face = 0; face < 6; face++) mFaceProxies[face].set(NULL);
mDirtyImages = true; mDirtyImages = true;
mIsRenderable = false;
} }
void TextureCubeMap::updateTexture() void TextureCubeMap::updateTexture()
...@@ -2405,8 +2440,7 @@ void TextureCubeMap::convertToRenderTarget() ...@@ -2405,8 +2440,7 @@ void TextureCubeMap::convertToRenderTarget()
{ {
for (int i = 0; i < levels; i++) for (int i = 0; i < levels; i++)
{ {
IDirect3DSurface9 *source; IDirect3DSurface9 *source = mTexture->getCubeMapSurface(static_cast<D3DCUBEMAP_FACES>(f), i);
result = mTexture->GetCubeMapSurface(static_cast<D3DCUBEMAP_FACES>(f), i, &source);
if (FAILED(result)) if (FAILED(result))
{ {
...@@ -2451,16 +2485,11 @@ void TextureCubeMap::convertToRenderTarget() ...@@ -2451,16 +2485,11 @@ void TextureCubeMap::convertToRenderTarget()
} }
} }
if (mTexture != NULL) delete mTexture;
{ mTexture = new TextureStorageCubeMap(texture, true);
mTexture->Release();
}
mTexture = texture;
mSerial = issueSerial(); mSerial = issueSerial();
for(int face = 0; face < 6; face++) mFaceProxies[face].set(NULL); for(int face = 0; face < 6; face++) mFaceProxies[face].set(NULL);
mDirtyImages = true; mDirtyImages = true;
mIsRenderable = true;
} }
void TextureCubeMap::setImage(int faceIndex, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels) void TextureCubeMap::setImage(int faceIndex, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
...@@ -2495,7 +2524,7 @@ void TextureCubeMap::redefineImage(int face, GLint level, GLenum format, GLsizei ...@@ -2495,7 +2524,7 @@ void TextureCubeMap::redefineImage(int face, GLint level, GLenum format, GLsizei
} }
} }
mTexture->Release(); delete mTexture;
mTexture = NULL; mTexture = NULL;
mSerial = 0; mSerial = 0;
for(int face = 0; face < 6; face++) mFaceProxies[face].set(NULL); for(int face = 0; face < 6; face++) mFaceProxies[face].set(NULL);
...@@ -2523,7 +2552,7 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint ...@@ -2523,7 +2552,7 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint
} }
else else
{ {
if (!mTexture || !mIsRenderable) if (!mTexture || !mTexture->isRenderable())
{ {
convertToRenderTarget(); convertToRenderTarget();
} }
...@@ -2558,11 +2587,7 @@ IDirect3DSurface9 *TextureCubeMap::getCubeMapSurface(GLenum target, unsigned int ...@@ -2558,11 +2587,7 @@ IDirect3DSurface9 *TextureCubeMap::getCubeMapSurface(GLenum target, unsigned int
return NULL; return NULL;
} }
IDirect3DSurface9 *surface = NULL; return mTexture->getCubeMapSurface(es2dx::ConvertCubeFace(target), level);
HRESULT hr = mTexture->GetCubeMapSurface(es2dx::ConvertCubeFace(target), level, &surface);
return (SUCCEEDED(hr)) ? surface : NULL;
} }
void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source) void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source)
...@@ -2591,7 +2616,7 @@ void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLi ...@@ -2591,7 +2616,7 @@ void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLi
} }
else else
{ {
if (!mTexture || !mIsRenderable) if (!mTexture || !mTexture->isRenderable())
{ {
convertToRenderTarget(); convertToRenderTarget();
} }
...@@ -2663,7 +2688,7 @@ void TextureCubeMap::generateMipmaps() ...@@ -2663,7 +2688,7 @@ void TextureCubeMap::generateMipmaps()
} }
} }
if (mTexture && mIsRenderable) if (mTexture && mTexture->isRenderable())
{ {
for (unsigned int f = 0; f < 6; f++) for (unsigned int f = 0; f < 6; f++)
{ {
...@@ -2727,7 +2752,7 @@ IDirect3DSurface9 *TextureCubeMap::getRenderTarget(GLenum target) ...@@ -2727,7 +2752,7 @@ IDirect3DSurface9 *TextureCubeMap::getRenderTarget(GLenum target)
{ {
ASSERT(IsCubemapTextureTarget(target)); ASSERT(IsCubemapTextureTarget(target));
if (!mTexture || !mIsRenderable) if (!mTexture || !mTexture->isRenderable())
{ {
convertToRenderTarget(); convertToRenderTarget();
} }
...@@ -2739,10 +2764,7 @@ IDirect3DSurface9 *TextureCubeMap::getRenderTarget(GLenum target) ...@@ -2739,10 +2764,7 @@ IDirect3DSurface9 *TextureCubeMap::getRenderTarget(GLenum target)
updateTexture(); updateTexture();
IDirect3DSurface9 *renderTarget = NULL; return mTexture->getCubeMapSurface(es2dx::ConvertCubeFace(target), 0);
mTexture->GetCubeMapSurface(es2dx::ConvertCubeFace(target), 0, &renderTarget);
return renderTarget;
} }
} }
\ No newline at end of file
...@@ -135,6 +135,21 @@ class Image ...@@ -135,6 +135,21 @@ class Image
IDirect3DSurface9 *mSurface; IDirect3DSurface9 *mSurface;
}; };
class TextureStorage
{
public:
explicit TextureStorage(bool renderable);
virtual ~TextureStorage();
bool isRenderable();
private:
DISALLOW_COPY_AND_ASSIGN(TextureStorage);
bool mIsRenderable;
};
class Texture : public RefCountObject class Texture : public RefCountObject
{ {
public: public:
...@@ -205,8 +220,6 @@ class Texture : public RefCountObject ...@@ -205,8 +220,6 @@ class Texture : public RefCountObject
bool mDirtyImages; bool mDirtyImages;
bool mIsRenderable;
unsigned int mSerial; unsigned int mSerial;
static unsigned int issueSerial(); static unsigned int issueSerial();
...@@ -216,6 +229,22 @@ class Texture : public RefCountObject ...@@ -216,6 +229,22 @@ class Texture : public RefCountObject
static unsigned int mCurrentSerial; static unsigned int mCurrentSerial;
}; };
class TextureStorage2D : public TextureStorage
{
public:
TextureStorage2D(IDirect3DTexture9 *texture, bool renderable);
virtual ~TextureStorage2D();
IDirect3DSurface9 *getSurfaceLevel(int level);
IDirect3DBaseTexture9 *getBaseTexture() const;
private:
DISALLOW_COPY_AND_ASSIGN(TextureStorage2D);
IDirect3DTexture9 *mTexture;
};
class Texture2D : public Texture class Texture2D : public Texture
{ {
public: public:
...@@ -261,12 +290,28 @@ class Texture2D : public Texture ...@@ -261,12 +290,28 @@ class Texture2D : public Texture
Image mImageArray[IMPLEMENTATION_MAX_TEXTURE_LEVELS]; Image mImageArray[IMPLEMENTATION_MAX_TEXTURE_LEVELS];
IDirect3DTexture9 *mTexture; TextureStorage2D *mTexture;
egl::Surface *mSurface; egl::Surface *mSurface;
BindingPointer<Renderbuffer> mColorbufferProxy; BindingPointer<Renderbuffer> mColorbufferProxy;
}; };
class TextureStorageCubeMap : public TextureStorage
{
public:
TextureStorageCubeMap(IDirect3DCubeTexture9 *texture, bool renderable);
virtual ~TextureStorageCubeMap();
IDirect3DSurface9 *getCubeMapSurface(int face, int level);
IDirect3DBaseTexture9 *getBaseTexture() const;
private:
DISALLOW_COPY_AND_ASSIGN(TextureStorageCubeMap);
IDirect3DCubeTexture9 *mTexture;
};
class TextureCubeMap : public Texture class TextureCubeMap : public Texture
{ {
public: public:
...@@ -326,7 +371,7 @@ class TextureCubeMap : public Texture ...@@ -326,7 +371,7 @@ class TextureCubeMap : public Texture
Image mImageArray[6][IMPLEMENTATION_MAX_TEXTURE_LEVELS]; Image mImageArray[6][IMPLEMENTATION_MAX_TEXTURE_LEVELS];
IDirect3DCubeTexture9 *mTexture; TextureStorageCubeMap *mTexture;
BindingPointer<Renderbuffer> mFaceProxies[6]; BindingPointer<Renderbuffer> mFaceProxies[6];
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment