Issue a new serial for every new D3D texture.

TRAC #16284 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@838 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent f45e81de
...@@ -1195,8 +1195,10 @@ void Image::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, ...@@ -1195,8 +1195,10 @@ void Image::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width,
mDirty = true; mDirty = true;
} }
Texture::Texture(GLuint id) : RefCountObject(id), mSerial(issueSerial()) Texture::Texture(GLuint id) : RefCountObject(id)
{ {
mSerial = 0;
mMinFilter = GL_NEAREST_MIPMAP_LINEAR; mMinFilter = GL_NEAREST_MIPMAP_LINEAR;
mMagFilter = GL_LINEAR; mMagFilter = GL_LINEAR;
mWrapS = GL_REPEAT; mWrapS = GL_REPEAT;
...@@ -1584,6 +1586,7 @@ void Texture2D::redefineImage(GLint level, GLenum format, GLsizei width, GLsizei ...@@ -1584,6 +1586,7 @@ void Texture2D::redefineImage(GLint level, GLenum format, GLsizei width, GLsizei
mTexture->Release(); mTexture->Release();
mTexture = NULL; mTexture = NULL;
mSerial = 0;
mDirtyImages = true; mDirtyImages = true;
mColorbufferProxy.set(NULL); mColorbufferProxy.set(NULL);
} }
...@@ -1618,6 +1621,7 @@ void Texture2D::bindTexImage(egl::Surface *surface) ...@@ -1618,6 +1621,7 @@ 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(); mTexture = surface->getOffscreenTexture();
mSerial = issueSerial();
mDirtyImages = true; mDirtyImages = true;
mIsRenderable = true; mIsRenderable = true;
mSurface = surface; mSurface = surface;
...@@ -1635,6 +1639,7 @@ void Texture2D::releaseTexImage() ...@@ -1635,6 +1639,7 @@ void Texture2D::releaseTexImage()
{ {
mTexture->Release(); mTexture->Release();
mTexture = NULL; mTexture = NULL;
mSerial = 0;
} }
for (int i = 0; i < IMPLEMENTATION_MAX_TEXTURE_LEVELS; i++) for (int i = 0; i < IMPLEMENTATION_MAX_TEXTURE_LEVELS; i++)
...@@ -1907,6 +1912,7 @@ void Texture2D::createTexture() ...@@ -1907,6 +1912,7 @@ void Texture2D::createTexture()
} }
mTexture = texture; mTexture = texture;
mSerial = issueSerial();
mDirtyImages = true; mDirtyImages = true;
mIsRenderable = false; mIsRenderable = false;
} }
...@@ -2001,6 +2007,7 @@ void Texture2D::convertToRenderTarget() ...@@ -2001,6 +2007,7 @@ void Texture2D::convertToRenderTarget()
} }
mTexture = texture; mTexture = texture;
mSerial = issueSerial();
mDirtyImages = true; mDirtyImages = true;
mIsRenderable = true; mIsRenderable = true;
} }
...@@ -2355,6 +2362,7 @@ void TextureCubeMap::createTexture() ...@@ -2355,6 +2362,7 @@ void TextureCubeMap::createTexture()
} }
mTexture = texture; mTexture = texture;
mSerial = issueSerial();
mDirtyImages = true; mDirtyImages = true;
mIsRenderable = false; mIsRenderable = false;
} }
...@@ -2454,6 +2462,7 @@ void TextureCubeMap::convertToRenderTarget() ...@@ -2454,6 +2462,7 @@ void TextureCubeMap::convertToRenderTarget()
} }
mTexture = texture; mTexture = texture;
mSerial = issueSerial();
mDirtyImages = true; mDirtyImages = true;
mIsRenderable = true; mIsRenderable = true;
} }
...@@ -2505,6 +2514,7 @@ void TextureCubeMap::redefineImage(int face, GLint level, GLenum format, GLsizei ...@@ -2505,6 +2514,7 @@ void TextureCubeMap::redefineImage(int face, GLint level, GLenum format, GLsizei
mTexture->Release(); mTexture->Release();
mTexture = NULL; mTexture = NULL;
mSerial = 0;
mDirtyImages = true; mDirtyImages = true;
} }
} }
......
...@@ -207,12 +207,11 @@ class Texture : public RefCountObject ...@@ -207,12 +207,11 @@ class Texture : public RefCountObject
bool mIsRenderable; bool mIsRenderable;
private: unsigned int mSerial;
DISALLOW_COPY_AND_ASSIGN(Texture);
static unsigned int issueSerial(); static unsigned int issueSerial();
const unsigned int mSerial; private:
DISALLOW_COPY_AND_ASSIGN(Texture);
static unsigned int mCurrentSerial; static unsigned int mCurrentSerial;
}; };
......
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