Commit e995d7fb by Xinghua Cao Committed by Commit Bot

Use memoryBarrier to sync image load and store

Image load and store are incoherent memory access operations, so need to use memoryBarrier to ensure the visibility of incoherent memory access operations with other operations. Bug: angleproject:3044 Change-Id: I4d474d260a3199c026911de8d20878cd327d16c6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1677420 Commit-Queue: Xinghua Cao <xinghua.cao@intel.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 1dbbc7b3
......@@ -2986,9 +2986,6 @@ TEST_P(SimpleStateChangeTestES31, UpdateImageTextureInUse)
// Test that we can alternate between image textures between different dispatchs.
TEST_P(SimpleStateChangeTestES31, DispatchImageTextureAThenTextureBThenTextureA)
{
// TODO(syoussefi): Flaky, needs investigation. http://anglebug.com/3044
ANGLE_SKIP_TEST_IF(IsLinux() && IsIntel() && IsDesktopOpenGL());
std::array<GLColor, 4> colorsTexA = {
{GLColor::cyan, GLColor::cyan, GLColor::cyan, GLColor::cyan}};
......@@ -3009,12 +3006,15 @@ TEST_P(SimpleStateChangeTestES31, DispatchImageTextureAThenTextureBThenTextureA)
glBindImageTexture(0, texA, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA8);
glDispatchCompute(1, 1, 1);
glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
glBindImageTexture(0, texB, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA8);
glDispatchCompute(1, 1, 1);
glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
glBindImageTexture(0, texA, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA8);
glDispatchCompute(1, 1, 1);
glMemoryBarrier(GL_FRAMEBUFFER_BARRIER_BIT);
EXPECT_PIXEL_RECT_EQ(0, 0, 2, 2, GLColor::cyan);
ASSERT_GL_NO_ERROR();
}
......
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