src/tests/compiler_tests/APPLE_clip_distance_test.cpp


Log

Author Commit Date CI Message
Shahbaz Youssefi 02ae054c 2025-04-07T13:48:29 Translator: Fix init of inactive output variables Bug: chromium:398401939 Change-Id: I0df494b945b8d0e805a62cf7645d06bf233f36ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6438495 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 9b63700b 2023-07-11T10:25:40 Translator: Reorganize files This change makes the translator files more organized by: - Grouping files that are specific to a certain output under their own directory, - Moving transformations under tree_ops - Removing Direct from metal translation now that that SPIR-V Cross path is removed Bug: angleproject:6394 Change-Id: Iaf5bb8d5604b84748dece029821b1f77b2813967 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678780 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen 16841d62 2023-01-31T11:51:41 Reland "Remove SPIRV_METAL references from .gn and tests" The backend was removed but the references were not. Update ShaderBinaryTest to properly skip tests if shader binaries are unsupported in the current ANGLE backend. Forcibly re-enable building of the Vulkan backend on macOS to keep ANGLE's SwiftShader backend working. Fixed: angleproject:6081 Change-Id: I5e6e47d5fe05b0dd6ec150b6db9fe5d75e580173 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4594582 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov c37d74a5 2023-06-06T17:07:15 Revert "Remove SPIRV_METAL references from .gn and tests" This reverts commit f7badd3faa8b1b04538ac7b6db833e1398b13498. Reason for revert: disables SwiftShader fallback on Mac Original change's description: > Remove SPIRV_METAL references from .gn and tests > > The backend was removed but the references were not. > > Update ShaderBinaryTest to properly skip tests if shader binaries are > unsupported in the current ANGLE backend. > > Fixed: angleproject:6081 > Change-Id: I54bb4080763fbc0dcc2515e71ccd5df5c536db5b > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4591046 > Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Change-Id: Id41035017830d8b36b29bc4497919c6b01fc3f35 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4595018 Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Kimmo Kinnunen f7badd3f 2023-01-31T11:51:41 Remove SPIRV_METAL references from .gn and tests The backend was removed but the references were not. Update ShaderBinaryTest to properly skip tests if shader binaries are unsupported in the current ANGLE backend. Fixed: angleproject:6081 Change-Id: I54bb4080763fbc0dcc2515e71ccd5df5c536db5b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4591046 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 02e7f967 2023-05-25T14:54:49 Translator: Remove the "variables" option Variable collection is invariably enabled by the front-end as well as other major users of ANGLE such as Firefox. All translator backends except GLSL force-enable variable collection either way. This change removes this compile option and enables variable collection unconditionally. The flag itself remains in ShCompileOptions until references to it are removed from Chromium. Bug: chromium:1447314 Change-Id: I4d3b30c1bfbd345c5ad269abc62c0a6a59de2f56 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4568524 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 7fefd230 2022-10-20T00:00:00 GL: Adjust APPLE_clip_distance exposure Partial revert of I458cad29c10b9d9193c5233e24bac53361ba104e APPLE_clip_distance cannot be implemented on top of EXT_clip_cull_distance because the former is defined both for ES 2.0 and ES 3.0 while the latter is defined only for ES 3.0. Although some ES 3.0+ drivers allow gl_ClipDistance built-in in ESSL 1.00 shaders, this behavior is not specified so ANGLE should not allow it. Added independent ESSL 3.00 gl_ClipDistance and gl_MaxClipDistances definitions. Adjusted translator unit tests. Bug: angleproject:4452 Change-Id: Ib582ce0ac7ccb65f0200ef1d17eaab0c83b228cf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963745 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 6f80f0f0 2022-08-06T02:29:19 Translator: Clean up the compile flag passing interface Historically, compile flags were sent to the translator as a bitmask. Recently, we were getting close to running out of bits. Additionally, direct-to-metal work had started to introduce constants to be passed to the translator, which were misplaced in ShBuiltInResources and Caps. Recent work on Pixel Local Storage adds even more constants, aggravating the situation. In this change, the interface to passing compile flags is reworked. A struct is passed (instead of a bitmask) that has one bit for each flag. This can be indefinitely extended. Additionally, the constants needed by metal and PLS are also placed in this struct. In turn, the backends can set these options directly, and don't have to hack them into Caps to further get hacked into ShBuiltInResources. Bug: angleproject:7559 Change-Id: If93f1e1b8818ad3a0ac708ab04ab93b4b397d114 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812562 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Brian Osman df163d71 2022-05-02T11:02:52 Test both MSL translators in APPLEClipDistanceTest This test failed with the SPIRV translator disabled (the ifdef being checked didn't match up with the requested compiler output). Bug: angleproject:7155 Change-Id: Ic89bf4035b0ada43ec249dbbca4626ae2eab2006 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3621314 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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>
Shahbaz Youssefi 9c271645 2021-08-27T13:07:06 Vulkan: SPIR-V Gen: Fix gl_PerVertex without clip/cull support When the clip/cull distance extension is not supported, the gl_ClipDistances and gl_CullDistances arrays were given a size of 0, which made them translate as OpRuntimeArray. This change makes sure that these arrays always have a non-zero size. Bug: angleproject:4889 Change-Id: I8d2ffe3a7c1df9316e91eebc2aa53bdc2c87ccc1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3123354 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 2f737c25 2021-02-25T16:55:14 Translator: Rename GLSL to SPIR-V in Vulkan and Metal output Preparation for actual SPIR-V output instead of GLSL. Bug: angleproject:4889 Change-Id: Ic279b23d3a817bd5dca66a844905378207afdbac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2721194 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
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>