Commit 79460702 by Geoff Lang Committed by Commit Bot

Don't discard the storage on forceRelease, simply mark the image as dirty.

It was overkill to always destroy the storage, especially for cube maps. Instead, just make sure the image thinks it's dirty when robust resource init is enabled so that it is always copied to the storage after redefinition. BUG=angleproject:1635 Change-Id: Ieba065d1873ca66a216bd05f4f8afa9c75349ff9 Reviewed-on: https://chromium-review.googlesource.com/526295Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 966cb898
...@@ -1483,8 +1483,8 @@ void TextureD3D_2D::redefineImage(size_t level, ...@@ -1483,8 +1483,8 @@ void TextureD3D_2D::redefineImage(size_t level,
mImageArray[0]->copyFromTexStorage(gl::ImageIndex::Make2D(0), mTexStorage); mImageArray[0]->copyFromTexStorage(gl::ImageIndex::Make2D(0), mTexStorage);
} }
if (forceRelease || (level >= storageLevels && storageLevels != 0) || if ((level >= storageLevels && storageLevels != 0) || size.width != storageWidth ||
size.width != storageWidth || size.height != storageHeight || size.height != storageHeight ||
internalformat != storageFormat) // Discard mismatched storage internalformat != storageFormat) // Discard mismatched storage
{ {
SafeDelete(mTexStorage); SafeDelete(mTexStorage);
...@@ -2161,8 +2161,8 @@ void TextureD3D_Cube::redefineImage(int faceIndex, GLint level, GLenum internalf ...@@ -2161,8 +2161,8 @@ void TextureD3D_Cube::redefineImage(int faceIndex, GLint level, GLenum internalf
{ {
const int storageLevels = mTexStorage->getLevelCount(); const int storageLevels = mTexStorage->getLevelCount();
if (forceRelease || (level >= storageLevels && storageLevels != 0) || if ((level >= storageLevels && storageLevels != 0) || size.width != storageWidth ||
size.width != storageWidth || size.height != storageHeight || size.height != storageHeight ||
internalformat != storageFormat) // Discard mismatched storage internalformat != storageFormat) // Discard mismatched storage
{ {
markAllImagesDirty(); markAllImagesDirty();
...@@ -2695,9 +2695,8 @@ void TextureD3D_3D::redefineImage(GLint level, GLenum internalformat, const gl:: ...@@ -2695,9 +2695,8 @@ void TextureD3D_3D::redefineImage(GLint level, GLenum internalformat, const gl::
{ {
const int storageLevels = mTexStorage->getLevelCount(); const int storageLevels = mTexStorage->getLevelCount();
if (forceRelease || (level >= storageLevels && storageLevels != 0) || if ((level >= storageLevels && storageLevels != 0) || size.width != storageWidth ||
size.width != storageWidth || size.height != storageHeight || size.height != storageHeight || size.depth != storageDepth ||
size.depth != storageDepth ||
internalformat != storageFormat) // Discard mismatched storage internalformat != storageFormat) // Discard mismatched storage
{ {
markAllImagesDirty(); markAllImagesDirty();
...@@ -3297,9 +3296,8 @@ void TextureD3D_2DArray::redefineImage(GLint level, GLenum internalformat, const ...@@ -3297,9 +3296,8 @@ void TextureD3D_2DArray::redefineImage(GLint level, GLenum internalformat, const
const GLenum storageFormat = getBaseLevelInternalFormat(); const GLenum storageFormat = getBaseLevelInternalFormat();
const int storageLevels = mTexStorage->getLevelCount(); const int storageLevels = mTexStorage->getLevelCount();
if (forceRelease || (level >= storageLevels && storageLevels != 0) || if ((level >= storageLevels && storageLevels != 0) || size.width != storageWidth ||
size.width != storageWidth || size.height != storageHeight || size.height != storageHeight || size.depth != storageDepth ||
size.depth != storageDepth ||
internalformat != storageFormat) // Discard mismatched storage internalformat != storageFormat) // Discard mismatched storage
{ {
markAllImagesDirty(); markAllImagesDirty();
......
...@@ -333,7 +333,8 @@ bool Image11::redefine(GLenum target, ...@@ -333,7 +333,8 @@ bool Image11::redefine(GLenum target,
mRenderable = (formatInfo.rtvFormat != DXGI_FORMAT_UNKNOWN); mRenderable = (formatInfo.rtvFormat != DXGI_FORMAT_UNKNOWN);
releaseStagingTexture(); releaseStagingTexture();
mDirty = (formatInfo.dataInitializerFunction != nullptr); mDirty = (formatInfo.dataInitializerFunction != nullptr) ||
mRenderer->isRobustResourceInitEnabled();
return true; return true;
} }
......
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