Commit 436b43a6 by Shahbaz Youssefi Committed by Commit Bot

Add comprehensive memory barrier tests

Optimizing glMemoryBarrier can get very tricky. This change adds tests for every glMemoryBarrier bit in different scenarios for a total of about 1500 tests. With the current implementation, there are no syncval errors running these tests. Bug: angleproject:5070 Change-Id: I5358bfeed84f586a67c90ba5ab0fe624db6820b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2698288Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent ee5d098a
...@@ -84,6 +84,7 @@ angle_end2end_tests_sources = [ ...@@ -84,6 +84,7 @@ angle_end2end_tests_sources = [
"gl_tests/LinkAndRelinkTest.cpp", "gl_tests/LinkAndRelinkTest.cpp",
"gl_tests/MatrixTest.cpp", "gl_tests/MatrixTest.cpp",
"gl_tests/MaxTextureSizeTest.cpp", "gl_tests/MaxTextureSizeTest.cpp",
"gl_tests/MemoryBarrierTest.cpp",
"gl_tests/MemoryObjectTest.cpp", "gl_tests/MemoryObjectTest.cpp",
"gl_tests/MemorySizeTest.cpp", "gl_tests/MemorySizeTest.cpp",
"gl_tests/MipmapTest.cpp", "gl_tests/MipmapTest.cpp",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2539,6 +2539,7 @@ void main() ...@@ -2539,6 +2539,7 @@ void main()
// Verify the contents of the buffer. It should have blue as the first index and green as the // Verify the contents of the buffer. It should have blue as the first index and green as the
// second. // second.
glMemoryBarrier(GL_BUFFER_UPDATE_BARRIER_BIT);
GLColor *bufferContents = static_cast<GLColor *>( GLColor *bufferContents = static_cast<GLColor *>(
glMapBufferRange(GL_SHADER_STORAGE_BUFFER, 0, kBufferSize, GL_MAP_READ_BIT)); glMapBufferRange(GL_SHADER_STORAGE_BUFFER, 0, kBufferSize, GL_MAP_READ_BIT));
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
...@@ -2647,6 +2648,7 @@ void main() ...@@ -2647,6 +2648,7 @@ void main()
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::blue); EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::blue);
// Verify the contents of the buffer. // Verify the contents of the buffer.
glMemoryBarrier(GL_BUFFER_UPDATE_BARRIER_BIT);
uint32_t *bufferContents = static_cast<uint32_t *>( uint32_t *bufferContents = static_cast<uint32_t *>(
glMapBufferRange(GL_SHADER_STORAGE_BUFFER, 0, kBufferSize, GL_MAP_READ_BIT)); glMapBufferRange(GL_SHADER_STORAGE_BUFFER, 0, kBufferSize, GL_MAP_READ_BIT));
EXPECT_GL_NO_ERROR(); EXPECT_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