Commit 26973584 by Jamie Madill Committed by Angle LUCI CQ

D3D11: Fix respecifying 3D textures.

The missing check for the "Depth" dimension could lead to a bug where we would not recreate a texture when the dimension changed. Bug: chromium:1210414 Change-Id: Id59097ad14ae77ff80d27081f61786dad17a77ea Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2911032Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 89ac8a44
...@@ -225,8 +225,8 @@ bool Image11::redefine(gl::TextureType type, ...@@ -225,8 +225,8 @@ bool Image11::redefine(gl::TextureType type,
const gl::Extents &size, const gl::Extents &size,
bool forceRelease) bool forceRelease)
{ {
if (mWidth != size.width || mHeight != size.height || mInternalFormat != internalformat || if (mWidth != size.width || mHeight != size.height || mDepth != size.depth ||
forceRelease) mInternalFormat != internalformat || forceRelease)
{ {
// End the association with the TextureStorage, since that data will be out of date. // End the association with the TextureStorage, since that data will be out of date.
// Also reset mRecoveredFromStorageCount since this Image is getting completely redefined. // Also reset mRecoveredFromStorageCount since this Image is getting completely redefined.
......
...@@ -2070,6 +2070,22 @@ void main() ...@@ -2070,6 +2070,22 @@ void main()
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 8, getWindowHeight() / 8, GLColor::green); EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 8, getWindowHeight() / 8, GLColor::green);
} }
// Tests respecifying 3D mipmaps.
TEST_P(MipmapTestES3, Generate3DMipmapRespecification)
{
std::vector<GLColor> pixels(256 * 256 * 100, GLColor::black);
GLTexture texture;
glBindTexture(GL_TEXTURE_3D, texture);
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, 256, 256, 100, 0, GL_RGBA, GL_UNSIGNED_BYTE,
pixels.data());
glTexImage3D(GL_TEXTURE_3D, 1, GL_RGBA, 128, 128, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
pixels.data());
glGenerateMipmap(GL_TEXTURE_3D);
ASSERT_GL_NO_ERROR();
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these // Use this to select which configurations (e.g. which renderer, which GLES major version) these
// tests should be run against. // tests should be run against.
ANGLE_INSTANTIATE_TEST_ES2_AND_ES3(MipmapTest); ANGLE_INSTANTIATE_TEST_ES2_AND_ES3(MipmapTest);
......
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