Commit 57f4b73e by Dzmitry Malyshau Committed by Commit Bot

Fix the format check in TextureD3D_2DArray::redefineImage

Note: by the time the old code used to call `getBaseLevelInternalFormat`, the base level image has already been updated with `redefine()` call above, thus the check `internalformat != storageFormat` wasn't correct. Change-Id: I3da6df54490d6e72e5094388ed7e39a4c7d920d2 Reviewed-on: https://chromium-review.googlesource.com/862256Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarDzmitry Malyshau <dmalyshau@mozilla.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 1ea85a13
...@@ -3429,6 +3429,8 @@ gl::Error TextureD3D_2DArray::redefineImage(const gl::Context *context, ...@@ -3429,6 +3429,8 @@ gl::Error TextureD3D_2DArray::redefineImage(const gl::Context *context,
const int storageWidth = std::max(1, getLevelZeroWidth() >> level); const int storageWidth = std::max(1, getLevelZeroWidth() >> level);
const int storageHeight = std::max(1, getLevelZeroHeight() >> level); const int storageHeight = std::max(1, getLevelZeroHeight() >> level);
const GLuint baseLevel = getBaseLevel(); const GLuint baseLevel = getBaseLevel();
const GLenum storageFormat = getBaseLevelInternalFormat();
int storageDepth = 0; int storageDepth = 0;
if (baseLevel < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS) if (baseLevel < gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS)
{ {
...@@ -3468,7 +3470,6 @@ gl::Error TextureD3D_2DArray::redefineImage(const gl::Context *context, ...@@ -3468,7 +3470,6 @@ gl::Error TextureD3D_2DArray::redefineImage(const gl::Context *context,
if (mTexStorage) if (mTexStorage)
{ {
const GLenum storageFormat = getBaseLevelInternalFormat();
const int storageLevels = mTexStorage->getLevelCount(); const int storageLevels = mTexStorage->getLevelCount();
if ((level >= storageLevels && storageLevels != 0) || size.width != storageWidth || if ((level >= storageLevels && storageLevels != 0) || size.width != storageWidth ||
......
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