Commit 66c5e619 by Geoff Lang Committed by Commit Bot

TextureD3D: Mark images dirty after deleting the texture storage.

When a texture storage is deleted, it copies its mip levels back into images and marks them clean. Marking the images dirty before deleting the texture storage would have no effect. BUG=705865 Change-Id: Ib4c0fc9bea1236fc31963d1b7db814785bc54abc Reviewed-on: https://chromium-review.googlesource.com/486107 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent f81ce4a3
...@@ -1442,8 +1442,8 @@ void TextureD3D_2D::redefineImage(size_t level, ...@@ -1442,8 +1442,8 @@ void TextureD3D_2D::redefineImage(size_t level,
size.height != storageHeight || size.height != storageHeight ||
internalformat != storageFormat) // Discard mismatched storage internalformat != storageFormat) // Discard mismatched storage
{ {
markAllImagesDirty();
SafeDelete(mTexStorage); SafeDelete(mTexStorage);
markAllImagesDirty();
} }
} }
......
...@@ -1153,6 +1153,32 @@ TEST_P(MipmapTestES3, GenerateMipmapBaseLevelOutOfRangeImmutableTexture) ...@@ -1153,6 +1153,32 @@ TEST_P(MipmapTestES3, GenerateMipmapBaseLevelOutOfRangeImmutableTexture)
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 2, getWindowHeight() / 2, GLColor::green); EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 2, getWindowHeight() / 2, GLColor::green);
} }
// A native version of the WebGL2 test tex-base-level-bug.html
TEST_P(MipmapTestES3, BaseLevelTextureBug)
{
if (IsOpenGL() && IsWindows() && IsAMD())
{
std::cout << "Test skipped on Windows AMD OpenGL." << std::endl;
return;
}
glBindTexture(GL_TEXTURE_2D, mTexture);
glTexImage2D(GL_TEXTURE_2D, 2, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, &GLColor::red);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 2);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
ASSERT_GL_NO_ERROR();
drawQuad(m2DProgram, "position", 0.5f);
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::red);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
ASSERT_GL_NO_ERROR();
drawQuad(m2DProgram, "position", 0.5f);
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::red);
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. // Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
// Note: we run these tests against 9_3 on WARP due to hardware driver issues on Win7 // Note: we run these tests against 9_3 on WARP due to hardware driver issues on Win7
ANGLE_INSTANTIATE_TEST(MipmapTest, ANGLE_INSTANTIATE_TEST(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