Remove syncing of extended dirty bits for TexImage calls.

All extended dirty bits were synced for glTexImage calls but many of
them required valid GL state or a complete framebuffer. This caused
errors in the Vulkan backend when we would read and write out of
bounds of the framebuffer due to an incorrect render area.

Bug: chromium:1410191
Change-Id: I17f156f71ded72761b631ef9842b048a9173c9b7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4374102
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
Geoff Lang
2023-03-27 11:32:30 -04:00
parent 14ddf56917
commit bb15ceefd9
2 changed files with 21 additions and 2 deletions

View File

@@ -698,8 +698,6 @@ void Context::initializeDefaultResources()
mTexImageDirtyBits.set(State::DIRTY_BIT_UNPACK_STATE);
mTexImageDirtyBits.set(State::DIRTY_BIT_UNPACK_BUFFER_BINDING);
mTexImageDirtyBits.set(State::DIRTY_BIT_EXTENDED);
mTexImageExtendedDirtyBits.set();
// No dirty objects.
// Readpixels uses the pack state and read FBO

View File

@@ -5856,6 +5856,27 @@ void main() {
EXPECT_PIXEL_COLOR_NEAR(0, 0, GLColor(42, 0, 0, 255), 1);
}
// Regression test for syncing internal state for TexImage calls while there is an incomplete
// framebuffer bound
TEST_P(WebGL2CompatibilityTest, TexImageSyncWithIncompleteFramebufferBug)
{
glColorMask(false, true, false, false);
glClear(GL_COLOR_BUFFER_BIT);
glViewport(100, 128, 65, 65537);
GLFramebuffer fb1;
glBindFramebuffer(GL_FRAMEBUFFER, fb1);
GLRenderbuffer rb;
glBindRenderbuffer(GL_RENDERBUFFER, rb);
glRenderbufferStorage(GL_RENDERBUFFER, GL_RG8UI, 1304, 2041);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rb);
GLTexture texture;
glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, 8, 8, 0, GL_RED_EXT, GL_UNSIGNED_BYTE, nullptr);
}
ANGLE_INSTANTIATE_TEST_ES2_AND_ES3(WebGLCompatibilityTest);
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WebGL2CompatibilityTest);