From: Liam Middlebrook Date: Wed, 17 Jan 2018 05:17:38 +0000 (-0800) Subject: Fix ClearOpsBufferStorageTestCase on ppc64le X-Git-Tag: upstream/1.3.5~852^2~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e8e09fb71613ae70e5df70e3ae9fc188584c8b4;p=platform%2Fupstream%2FVK-GL-CTS.git Fix ClearOpsBufferStorageTestCase on ppc64le The check for the modified ClearOpsBufferStorageTestCase output currently checks if the value present in the mapped buffer from GL is equivalent to the calculated value under the following scheme: (data_rgba8 & (0xFF << (n_current_byte * 8))) >> (n_current_byte * 8) The C++ Working Draft Standard N4140 [1] Section 5.8 states the following: The behavior is undefined if the right operand is negative or greater than or equal to the length in bits of the promoted left operand. Similar language is also stated in the C Working Draft Standard N1256 [2] If the value of the right operand is negative or is greater than or equal to the width of the promoted left operand, the behavior is undefined. This change removes the undefined behavior that is being used to set `expected_value`. Additionally this change makes the literal 0xFF into 0xFFu since all of the other components surrounding it are unsigned. References: [1] https://timsong-cpp.github.io/cppwp/n4140/draft.pdf [2] http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf Components: OpenGL VK-GL-CTS issue: 955 Change-Id: I8f1a25b184379c966355e6d0dec81b1416049279 Reviewed-By: pdaniell --- diff --git a/external/openglcts/modules/gl/gl4cSparseBufferTests.cpp b/external/openglcts/modules/gl/gl4cSparseBufferTests.cpp index e67f508..8859d75 100644 --- a/external/openglcts/modules/gl/gl4cSparseBufferTests.cpp +++ b/external/openglcts/modules/gl/gl4cSparseBufferTests.cpp @@ -1775,8 +1775,9 @@ bool ClearOpsBufferStorageTestCase::execute(glw::GLuint sparse_bo_storage_flags) (n_current_byte < modified_region_start_offset + modified_region_size) && result_local; ++n_current_byte) { + const unsigned char component_offset = n_current_byte % 4; const unsigned char expected_value = - static_cast((data_rgba8 & (0xFF << (n_current_byte * 8))) >> (n_current_byte * 8)); + static_cast((data_rgba8 & (0xFFu << (component_offset * 8))) >> (component_offset * 8)); const unsigned char found_value = result_data[n_current_byte]; if (expected_value != found_value)