src/tests/gl_tests/ClipDistanceTest.cpp


Log

Author Commit Date CI Message
Devon Loehr 1fe50b44 2024-07-16T20:12:06 Make implicit `this` capture explicit When declaring a lambda with a value-capture default [=, ...], the this pointer is implicitly captured by value as well. This results in potentially-unintuitive behavior and has been deprecated in C++20. It produces a warning in newer versions of clang (https://reviews.llvm.org/D142639). This CL prevents the warning by explicitly `this` for each lambda. To maintain compatibility with previous C++ standards, it also removes the = capture default and captures each variable explicitly. It does not change the compiled code at all, since it's just removing some syntactic sugar. Bug: chromium:351004963, angleproject:42266730 Change-Id: I0f17a442262e2da22a1951d590291806554e66ff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5714410 Auto-Submit: Devon Loehr <dloehr@google.com> Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Roman Lavrov <romanl@google.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 490ff869 2024-03-14T00:00:00 Always redeclare clip/cull distance built-ins When clip or cull distance built-in arrays are implicitly sized, various pruning passes may produce an inconsistent AST state thus causing translation or linking failures. Adjusted the dedicated validation pass to inject an explicit declaration thus bypassing the issue. Additional updates: * Ensured that API clip distance state emulation is applied when a variable is declared but not assigned * Reverted previous clip/cull distance related changes to TIntermBinary::hasSideEffects as they are redundant now * Fixed failing AST validation for MSL varying emulation * Aligned linking error messages with the specifications * Updated tests and cleaned-up obsolete code Fixed: angleproject:8591 Change-Id: Ic8cfaf37778b8532bbab32ab998d5350b85d67ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372714 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 40dfb3a8 2024-02-12T00:00:00 Fix length() translation for clip/cull distance arrays * Fixed a failing assertion when the arrays are resized. * Added a compile error for length() when the arrays are unsized. Fixed: angleproject:8527 Change-Id: I6379336c546b008095f0875e5b5b4e8e0e5ba3e6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5293914 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev cb7d3cc2 2024-02-09T00:00:00 Treat clip/cull distance built-ins as having side effects The sizes of these built-in arrays may be affected by indexing them with constant integral expressions so such operations should not be optimized out. Fixed related failures during MSL and HLSL translation. Fixed: angleproject:8525 Change-Id: I8460aa03b997ebc4142ee2d9f81eeefe13661336 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5285436 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 8f1a7190 2022-12-23T00:00:00 Accept clip distance enums for simple queries State variables for which IsEnabled is listed as the query command can also be obtained using any of the simple queries. Bug: angleproject:4452 Change-Id: I075db600b772e5370c72c0f4de9b35e007259987 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4158331 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev d0c936cf 2022-12-23T00:00:00 Check clip and cull distance storage qualifiers When redeclared, these built-ins must be outputs in vertex shaders and inputs in fragment shaders. Bug: angleproject:4452 Change-Id: I811764009669ec358f05eb7a26297742baf2de63 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4120264 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 9d5d619c 2022-12-26T00:00:00 Adjust clip distance compiler state and validation The internal uniform, which is used for passing GL state on some platforms, could be removed by GL drivers when built-ins are not accessed; this may lead to failed frontend assertions. Refactored relevant compiler state and validation helpers to avoid ambiguous usage. Added ClipCullDistanceTest.Unused test. Bug: angleproject:4452 Change-Id: I06fdf9a69e01afb2ad11fa12e0510d8b0421e4bc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4143839 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 067ace47 2022-12-21T00:00:00 Add ANGLE_clip_cull_distance extension Added an extension spec. Trivially exposed it on GL, Vulkan, and D3D11. Adjusted tests and validation to allow no cull distance support for this extension string. Removed extra built-in variable definitions. Bug: angleproject:7904 Change-Id: Ic60772dfe28132c316eaa29aadc1afd66e3b0fa7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4114290 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 91a5635a 2022-12-16T00:00:00 Support arbitrary clip and cull distance array sizes Removed limitSimultaneousClipAndCullDistanceUsage cap. Enhanced HLSL translator to support all valid combinations of clip and cull distances. Validate that these arrays are sized explicitly or by using only constant indices; adjusted link program error message. Enhanced tests to cover all possible combinations of implicit and explicit array sizes for both built-ins. Bug: angleproject:4452 Change-Id: I704db6dc3c8951e5ba482a3e4dad09e5b0182f9c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4111645 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 805e00b8 2022-10-27T00:00:00 D3D11: Add clip and cull distance support Added gl_ClipDistance and gl_CullDistance support to HLSL translator. Added enabled clip distance GL state emulation. Added limitSimultaneousClipAndCullDistanceUsage limitation. Expanded and optimized related end2end tests. Bug: angleproject:4452 Change-Id: Id66312505254ceff43d5258d486ddcdb0462db47 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3990944 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev fec93f40 2022-10-14T00:00:00 GL: Support clip and cull distance extensions Use EXT_clip_cull_distance on OpenGL ES to expose APPLE_clip_distance; use ARB_cull_distance on OpenGL to expose EXT_clip_cull_distance. Added disableClipCullDistance OpenGL workaround. Bug: angleproject:4452 Change-Id: I458cad29c10b9d9193c5233e24bac53361ba104e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3956075 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: 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 f3d5dac3 2021-08-23T17:25:15 Vulkan: SPIR-V Gen: Drop dependency to glslang The SPIR-V gen path is now made default. Compilation through glslang is still supported for debugging, and is enabled on the GLSL* end2end tests for smoke testing. On release builds, glslang is not supported. To test with glslang, add the following gn arg (only necessary if dcheck is disabled): angle_enable_spirv_gen_through_glslang = true Then enable the generateSPIRVThroughGlslang feature. This can be done by setting an environment variable: ANGLE_FEATURE_OVERRIDES_ENABLED=generateSPIRVThroughGlslang ./angle_deqp_gles2_tests Binary size saving: - 1.3MB on Linux (SPIR-V gen itself: 240KB) - 730KB on Android (SPIR-V gen itself: 140KB) Perf tests: - LinkProgramBenchmark.Run/vulkan_compile_single_thread * Through glslang: truncated mean: 1287033.36 * Direct SPIR-V Gen: truncated mean: 244495.91 (~80% reduction) - LinkProgramBenchmark.Run/vulkan_compile_multi_thread * Through glslang: truncated mean: 4565894.83 * Direct SPIR-V Gen: truncated mean: 1158164.10 (~75% reduction) Bug: angleproject:4889 Bug: angleproject:6210 Change-Id: I486342702977c8114e90073b97183aba115a8b2d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3115140 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Peter Kasting 4f2b2995 2021-09-23T09:50:46 Fix -Wshadow. This still disables the warning for glmark2 instead of fixing it, to avoid needing to upstream a patch. Bug: chromium:794619 Change-Id: Ice602996041d6090c9b09ee81c8ed095c4fa6b2e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3179860 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi ebe943e2 2021-07-29T11:19:33 Vulkan: SPIR-V Gen: Fix gl_Clip/CullDistance These built-ins can be redeclared in the shader. The translator took these redeclarations (and gl_LastFragData) as UserDefined symbols. There were a number of hacks such as in name generation and CollectVariables, to special-case these redeclarations. This change instead makes sure that these variables continue to be considered built-ins with the appropriate qualifiers. A number of fixes are made accordingly: - Hacks are removed. - In fragment shaders, ANGLEClipDistance was initialized with gl_ClipDistance for further use by the shader. The code generation however mistakenly produced `gl_ClipDistance[0] = ANGLEClipDistance[0];`, which caused compilation failures by glslang, but passed the tests accidentally because they expected link failures (see next item). - CollectVariables is fixed to correctly collect gl_Clip/CullDistance in fragment shaders; previously they were collected as output varyings, and therefore the aforementioned link error was not produced in the tests after the compilation error was fixed. Additional fixes: - The transformation of gl_Clip/CullDistance was always ever done on one of them due to misplaced breaks in the loop that detected their presence. - The transformation of gl_CullDistance was skipped when it was not redeclared. Validation is added to make sure these built-ins always have the correct qualifier even when redeclared. SPIR-V gen support for these variables have been fixed as well. Bug: angleproject:4889 Change-Id: Ic8bf2c508357035cb937ef41a28ae22ffc533ebe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3059921 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov a6b16d29 2021-03-02T19:04:57 Suppress UNINSTANTIATED_PARAMETERIZED_TEST failures on Ozone We only support ES2 on Ozone, so tests that depend on ES3 or ES31 support are not instantiated there. Bug: chromium:1183147 Change-Id: Id58bcd9b44a5b9a70b5ae8115e27c44f5dc81226 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2726550 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Mohan Maiya 9229b805 2020-12-14T14:10:28 Vulkan: Add the tests for EXT_clip_cull_distance Before supporting EXT_clip_cull_distance extension, some tests are added to validate the implementation of EXT_clip_cull_distance extension. These tests are implemented based on the tests for APPLE_clip_distance Bug: angleproject:5458 Tests: angle_end2end_tests --gtest_filter=Clip*DistanceTest* angle_unittests --gtest_filter=*Clip*Distance* Change-Id: I018c72ae8f0aff616c9d2600e63246e9609cf3de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2585986 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Le Hoang Quyen dadd1986 2020-04-21T01:50:00 Implement GL_APPLE_clip_distance - Built-in variable gl_ClipDistance has been added to compiler. - Desktop GL: gl_ClipDistance is supported since GL 3.0. Enable/Disable each gl_ClipDistances[i] works out of the box via glEnable(). - Vulkan/Metal: Use uniform variable to control writing to each gl_ClipDistance. One bit flag controls one element in the gl_ClipDistance array. The writing to the disabled element in vertex shader will be ignored, and turned into zero assignment instead. - Direct3D/Mobile GL: Not implemented yet. - Added ClipDistanceTest to gl_tests and compiler unittests. - GL_APPLE_clip_distance is a subset of GL_EXT_clip_cull_distance, so GL_EXT_clip_cull_distance could be implemented in future if needed. Bug: angleproject:4452 Change-Id: I571ac8b56826989808a680226a04bec4cf59988e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2084324 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>