Fix sparse buffer test for atomics
authorJames Helferty <jhelferty@nvidia.com>
Wed, 26 Jul 2017 17:16:07 +0000 (13:16 -0400)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 22 Aug 2017 07:42:02 +0000 (03:42 -0400)
When binding a buffer for an array of atomics, the buffer size needs
to be large enough to cover the entire array, or else you will get
undefined behavior. For the atomic buffer case where using
glBindBufferRange to bind only part of the sparse buffer, we were
only providing a size argument large enough for half of the array.

VK-GL-CTS issue 595
Components: OpenGL

Affects:
KHR-GL43.sparse_buffer_tests.BufferStorageTest
KHR-GL44.sparse_buffer_tests.BufferStorageTest
KHR-GL45.sparse_buffer_tests.BufferStorageTest

Change-Id: I8e0a67619801a6071cf53374ae9f06672782dfa0

external/openglcts/modules/gl/gl4cSparseBufferTests.cpp

index c18cb48..ab56c3d 100644 (file)
@@ -945,7 +945,7 @@ bool AtomicCounterBufferStorageTestCase::execute(glw::GLuint sparse_bo_storage_f
                else
                {
                        m_gl.bindBufferRange(GL_ATOMIC_COUNTER_BUFFER, 0, /* index */
-                                                                m_sparse_bo, m_sparse_bo_data_start_offset, m_sparse_bo_data_size);
+                                                                m_sparse_bo, m_sparse_bo_data_start_offset, m_helper_bo_size);
 
                        GLU_EXPECT_NO_ERROR(m_gl.getError(), "glBindBufferRange() call failed.");
                }