src/tests/gl_tests/PackUnpackTest.cpp


Log

Author Commit Date CI Message
Yuxin Hu c1cdc2b5 2025-08-22T15:23:58 Transform SPIRV to use 16-bit float for lower precision uniforms This change adds a ShCompileOption flag transformFloatUniformTo16Bits. The flag is turned on in vulkan backends where VK_KHR_16bit_storage extension is supported, and uniformAndStorageBuffer16BitAccess feature is supported. When the compiler flag is turned on, in the generated SPIRV, float data types in mediump and lowp uniforms are transformed from 32-bit to 16-bit. The 16-bit float uniform data is converted to 32-bit with OpFConvert instruction upon loading in SPIRV, this is to minimize the changes in OutputSPIRV.cpp. The converted variable is decorated with RelaxedPrecision, so that SPIRV compiler should be able to treat the converted variable as 16 bits, and the hardware can still benefit from reduced precision floats. The frontend is also notified such SPIRV shader changes by setting the isFloat16 bit in CollectVariables() step, and the frontend will transform float uniform data from 32-bit to 16-bit before storing the data into memory. That way, the uniform data that SPIRV shader reads matches with the uniform data type transformed in the SPIRV shader. This change also updates some test code to allow relative 2^-10 precision wiggle room for mediump uniform floats. This is valid according to spec: https://developer.arm.com/documentation/102502/0101/Shader-precision Bug: angleproject:405795981 Bug: angleproject:440941211 Change-Id: I05db7f5ef744df513fbad87cfed8aa173890ec26 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6851560 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Alexey Knyazev 9e8b104e 2024-10-14T00:00:00 Do not test OpenGL backend on iOS Added Metal platform to tests that require instantiation. Bug: angleproject:40050022 Bug: angleproject:42264029 Bug: angleproject:42266119 Bug: angleproject:42266226 Bug: angleproject:42266239 Bug: angleproject:42266249 Bug: angleproject:359136169 Fixed: angleproject:373478551 Change-Id: I915f09c7f24acce27bf0d489932645338ac3fbe8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5932659 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Shahbaz Youssefi d193d51b 2024-06-17T22:46:08 Replace issue ids post migration to new issue tracker This change replaces anglebug.com/NNNN links. Bug: None Change-Id: I8ac3aec8d2a8a844b3d7b99fc0a6b2be8da31761 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5637912 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev bc301691 2023-12-07T00:00:00 Run PackUnpackTest on all backends Fixed negative zero serialization for capture/replay. Bug: angleproject:4092 Change-Id: Ic12a556f56e40064da8bf3a8ce7d01af92c7086a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5106509 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Eddie Hatfield 89e38b57 2022-06-22T15:04:08 Refactor to use ANGLETest vs ANGLETestWithParam Bug: angleproject:6747 Change-Id: I72ad52d0268eae0e1a401f12f3e94cc5efa402f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3719002 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi f9d261f5 2021-08-25T10:23:48 Translator: Don't promote precision from initializer Take the following GLSL code: precision mediump float; uniform highp float u; float x = u; When `x` is declared, its precision is mediump due to `precision mediump float`. Its initializer (`u`) however is highp. Previously, ANGLE generated the following code to ensure the precision of the initializer is applied to the variable: highp float x = u; Compiling the same code with glslang and looking at the SPIR-V (both SPIR-V for OpenGL and SPIR-V for Vulkan), such a promotion is not done. The generated SPIR-V is equivalent to: mediump float x = u; This change aligns ANGLE's output with glslang's by outputting the precision of the variable itself instead of the precision of the assignment (which is highp due to promotion from the two operands). Bug: angleproject:4889 Bug: angleproject:6132 Change-Id: I6f338a865c0a7710329fc13bc171fd245dd30b31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3118965 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov 5b82fa2e 2021-02-28T11:11:34 Suppress UNINSTANTIATED_PARAMETERIZED_TEST failures on Win AMD GTest complains that we don't run some tests on D3D/Vulkan backends. They only run on GL backend, which is disabled on Win AMD per http://anglebug.com/5123 Bug: chromium:1183147 Change-Id: I95fdd9a24aff69aa60e2f60613d8300ae1019a27 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2726576 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
James Darpinian ebf00703 2020-12-29T16:25:54 angle_end2end_tests passes on iOS! Miscellaneous test skips and fixes for iOS. Bug: angleproject:5417 Bug: angleproject:5491 Change-Id: Id0785e6243949fc756e4d7923dbbe77a411052f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2606656 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Tobin Ehlis 5fd73782 2019-08-09T11:46:46 Vulkan: Use volk to load vk* func ptrs Thanks to Jamie Madill for some fixes to get all CI test passing w/ volk. This change updates all ANGLE targets that use Vulkan to dyanmically link all of the VK entrypoints using the volk OSS library from https://github.com/zeux/volk. It's only two source files so baking them directly into ANGLE repo. Also it's used in both the tests and libANGLE trees so added to src/common/third_party/volk dir. Updated volk and the renderer to track latest instance and device that were loaded and renderer will refresh vk* function pointers if the current and previous device and/or instance don't match. This prevents errors in the test framework as we transition between backends, especially between VK HW & SwiftShader ICDs. This change rolls the Vulkan Loader forward to use the latest loader version which no longer allows static linking but requires dynamic linking. Bug: angleproject:3740 Bug: angleproject:4092 Bug: angleproject:4162 Bug: angleproject:4210 Bug: angleproject:4225 Change-Id: I8a0b7d24c9545bbfdfaa4b9357a9bfe6793e0140 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1965640 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis c1776c61 2019-11-13T11:36:35 Vulkan:Add Swiftshader configs Add Swiftshader configs to existing test instantiation macros for all ESX variants. This causes Swiftshader to be used to run end2end tests. Added detection code to know when tests are running on Swiftshader and skipping a number of fails initially. Note that when running ANGLE end2end tests within Chromium build on Win32 bots there were crashes with Swiftshader config for tests that should have been skipped. Due to this, just skipping Swiftshader configs on Win32 for now. Bug: angleproject:4081 Bug: angleproject:4092 Change-Id: I32527a62304c5fad90f645b372edf9411ca2b212 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1914126 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Tobin Ehlis 1a01b4b3 2019-11-11T16:41:07 Refactor end2end test macros This is a foundational CL to enabling the end2end tests on swiftshader. Refactored infrastructure with new ANGLE_INSTANTIATE_TEST_ES* macros that will run tests over all various combinations of all platforms for different ES versions. Just skipping failing tests initially to get the refactor landed. Bug: angleproject:4081 Bug: angleproject:4092 Change-Id: I017f6c3267179e49b6ae08cc7488096b423dcdb5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1904635 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill 5cbaa3f8 2019-05-07T15:49:22 Don't inherit ANGLETest SetUp and TearDown. Instead of inheriting from testing::Test's SetUp and TearDown we add new methods 'testSetUp' and 'testTearDown'. This helps prevent a common error of forgetting to call the base class method. Also add a check in the ANGLETest destructor that SetUp and TearDown have been called. Bug: angleproject:3393 Change-Id: Iab211305cc06ffea9ca649e864ddc9b180f2cba0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1593960 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill ddc4d33a 2019-05-01T15:11:46 Remove several underused platform configs. * Removes D3D11 Warp and Reference configs from tests. * Removes several permutations of OpenGL back-end specific configs. * Removes FL 9_3 since it is no longer supported. * Removes present path "Copy" since it's redundant with normal D3D11. Reduces number of configs from over 60 to 25. Bug: angleproject:3393 Change-Id: Ia5a23de3c4865b17ee50673a4066757b901a4b5a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1574675 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 35cd7332 2018-12-02T12:03:33 Refactor test shader style. This change enforces a lot more consistency. We pass const char * to the Compile functions instead of std::string. Also fixes the indentation of C++11 block comments to be more consistent. Bug: angleproject:2995 Change-Id: Id6e5ea94055d8cbd420df4ea2e81b2d96cb5ce78 Reviewed-on: https://chromium-review.googlesource.com/c/1357103 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Olli Etuaho 5804dc8e 2018-04-13T14:11:46 Refactor GL tests to use a shader library Instead of having the same simple shaders repeated over and over in the test code, reuse a single shader library. BUG=angleproject:2474 TEST=angle_end2end_tests Change-Id: I13f8ca8c0125e6d30f1761639bf8c3f69e0e77d2 Reviewed-on: https://chromium-review.googlesource.com/1012078 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Yunchao He 2f23f35a 2018-02-11T22:11:37 Clean up end2end tests for Intel OSX. BUG=angleproject:2205 BUG=angleproject:2041 BUG=angleproject:2155 Change-Id: I26bcbb63e147787cd342ec80a86d60cf230be4c9 Reviewed-on: https://chromium-review.googlesource.com/913108 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho a20af6d7 2017-09-18T13:32:29 Use C++11 raw string literals instead of SHADER_SOURCE macro This is better in many ways: 1. It doesn't confuse clang format 2. \n doesn't need to be included after preprocessor directives like the version directive. 3. It's using built-in functionality instead of something custom. Raw string literals should be the preferred way to include shader source in C++ files going forward. BUG=angleproject:2157 TEST=angle_end2end_tests Change-Id: I8b236a6e2d5c25d920297e5bc5b5b143eddeba1f Reviewed-on: https://chromium-review.googlesource.com/671046 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Geoff Lang 91d56945 2015-07-21T18:56:48 Emulate the pack/unpack functions for unorms. BUG=angleproject:1044 Change-Id: I2cfb792de43d3a6fddd750100c74f948948dc1f6 Reviewed-on: https://chromium-review.googlesource.com/287290 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 518b9fab 2016-03-02T11:26:02 Suppress some failing end2end_tests on Intel. BUG=589851 Change-Id: Ia580cee30e6842aaddb4683025f425166f0f6120 Reviewed-on: https://chromium-review.googlesource.com/329735 Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill f09bf669 2016-03-02T11:26:01 Revert "Suppress some failing end2end_tests on Intel." This reverts commit 7208f6994cf7d810c2226965362aad43d2a66f53. Still some failures on Intel, requires a slightly different solution. BUG=589851 Change-Id: I6ac6599249e9e0f6319c917e04734cd48ca9274d Reviewed-on: https://chromium-review.googlesource.com/329734 Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7208f699 2016-02-29T10:47:35 Suppress some failing end2end_tests on Intel. BUG=589851 Change-Id: I91588014784a8a9b75389aeb596923458c30d80a Reviewed-on: https://chromium-review.googlesource.com/329427 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang e0cc2a4a 2016-01-20T10:58:17 Enable all angle_end2end_tests targeting OpenGL and OpenGL ES backends. Added failure supressions and filed bugs for failing tests. BUG=angleproject:1145 BUG=angleproject:1289 BUG=angleproject:1291 BUG=angleproject:1292 BUG=angleproject:1293 BUG=angleproject:1296 Change-Id: Ida78ba855500fe8a6ce6154d43ee01520330e3b1 Reviewed-on: https://chromium-review.googlesource.com/322695 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 36b73909 2015-10-05T11:58:50 Fix standalone ninja build on Linux Preprocessor conditions referring to undefined macros failed standalone build which uses the -Werror=undef setting. This same error has been in multiple patches, and reverting them would cause test breakage, so fixing the issue is simpler than reverting. Change-Id: I4a079ef5d823eed76ebdefa8be413f63d29a5f6a Reviewed-on: https://chromium-review.googlesource.com/304020 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Corentin Wallez 7b43c9b0 2015-09-30T10:47:30 Add suppressions for failing end2end tests on Mac Intel BUG=angleproject:891 Change-Id: I88a8bcc4a6911c92bdb981aca34a0557ad451df7 Reviewed-on: https://chromium-review.googlesource.com/303390 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 01c796ac 2015-07-21T18:53:58 Revert "Emulate the pack/unpack functions for unorms." Causing MSAN failures on Linux. This reverts commit 1915652ee82109d7756dc8349562c3c11ea39b77. Change-Id: Ib23bec16eab22288930be0b41186e54cd8d1f921 Reviewed-on: https://chromium-review.googlesource.com/287127 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 1915652e 2015-06-18T09:40:14 Emulate the pack/unpack functions for unorms. BUG=angleproject:1044 Change-Id: I0e7bee366398159ae6b87a820f36cb51c05cb064 Reviewed-on: https://chromium-review.googlesource.com/280362 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 2a46b4e8 2015-06-29T15:06:49 Remove the PackUnpackHalfOverflow test. Different drivers handle overflow differently. The overflow case is not defined in the spec. BUG=angleproject:1044 Change-Id: I9e3883af147c6c1a4fcdcddea3ff70c62f859c56 Reviewed-on: https://chromium-review.googlesource.com/282540 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 8273e006 2015-06-15T13:40:19 Add new GLSL target versions. Test the emulated GLSL functions against multiple GL versions. BUG=angleproject:1044 Change-Id: I1e12523301042f0d541ab2f4e73f02319d1584ef Reviewed-on: https://chromium-review.googlesource.com/277702 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 83ab236f 2015-06-23T13:18:03 Improve the test precision in PackUnpackTest. * Output to floating point framebuffers so that results are not truncated to 8 bit normalized values. * Tighten the epsilon from 1/255 to 0.0005. May need further tweaking as more GPUs are tested. * Explicitly check for -inf and inf values when they were previously rounded to 0 and 255. * Explicitly check for clamping of overflowed normalized floats by providing the expectations instead of computing them. BUG=angleproject:1044 Change-Id: I8410cf61fe79a9919fb0db7e415bf97b2d0abd9e Reviewed-on: https://chromium-review.googlesource.com/281191 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qingqing Deng 03f3caec 2015-03-16T02:01:21 Emulate Missing pack_unpack functions from OpenGL 4.1 BUG=angleproject:947 TEST=angle_unittests, angle_end2end_tests Change-Id: Id1afd7630d9720b6701225b7abf1ce4a3bf528b6 Reviewed-on: https://chromium-review.googlesource.com/260232 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com>