src/compiler


Log

Author Commit Date CI Message
Matthew Denton 6a3ff5a1 2025-07-17T12:41:13 WGSL: extra debug logging for failure cases Bug: angleproject:42267100 Change-Id: I8938526b60af71d15d4327bc10fa172117afef60 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6777200 Reviewed-by: Geoff Lang <geofflang@chromium.org>
Matthew Denton 343e3bdc 2025-07-17T12:38:31 ScalarizeVecAndMatConstructors: also handle scalar constructors In WGSL you cannot "construct" a scalar from a non-scalar (vec or mat). This modifies ScalarizeVecAndMatConstructors to handle scalar constructors as well, indexing and swizzling the argument to select the first element of the nonscalar. This makes dEQP-GLES2.functional.shaders.conversions.vector_to_scalar.* pass (except those that use bool uniforms which are still unsupported). Bug: angleproject:42267100, angleproject:395659799 Change-Id: Ibaa3dc14f36fecb384bfb6e7f226c6d5f377dd5f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6777199 Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang b7582680 2025-02-24T18:04:32 Reland: GL: Allow untranslated shaders to pass through on GLES Add an EGL extension EGL_ANGLE_create_context_passthrough_shaders which uses the NULL translator and passes the original shader to the driver. The parser is still used for shader reflection. Always enable the null compiler backend. It has almost no binary size cost and is now potentially used when the null ANGLE backend is not enabled. Bug: angleproject:398857482 Change-Id: Id528189ccbbacb1c444eacb151baadfda9fcc04b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6488609 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Matthew Denton cbff5658 2025-07-16T14:10:47 ScalarizeVecAndMatConstructorArgs: cast for mat constructors In WGSL, matrix constructors also can't handle arguments of differing basic type than the constructor's basic type, so cast when necessary. Makes dEQP-GLES2.functional.shaders.conversions.scalar_to_matrix.* pass for WGSL. dEQP-GLES2.functional.shaders.conversions.matrix_to_matrix.* does not yet pass because WGSL can't handle matrix shader inputs/outputs. Bug: angleproject:42267100, angleproject:395659799 Change-Id: Ia4761190c78ccfe7d748275642361ada93314529 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6777198 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Matthew Denton 2c1a55b3 2025-07-16T13:44:49 WGSL: implement == for vectors by wrapping in all() WGSL's vec comparisons are component-wise, so wrapping the result in a call to all() returns true if all components compare equal, matching the behavior of GLSL's vec comparisons (== and !=). Bug: angleproject:42267100 Change-Id: Icfbfacf72e53096e2567fa89bcd4bf573e457ec1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6777197 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Shahbaz Youssefi e98dec82 2025-07-20T22:16:00 Translator: Remove Sampler2DRectShadow This is a desktop GLSL type. Bug: angleproject:370937467 Change-Id: Ife8b50e57f6e054ccd35df10c2157f8e4a218d37 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6774081 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Panfeng Hou 251ffe62 2025-07-15T17:37:30 Vulkan: Add support for built-in gl_ShadingRateEXT Add support for built-in gl_ShadingRateEXT of GL_EXT_fragment_shading_rate Bug: angleproject:420310117 Change-Id: Ie11b139a0371b5995f1533a85e02c590cd36109c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6733750 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 7cbb77a8 2025-07-14T11:32:04 Fix the uniform reorder bug When sorting uniforms, we should first check if both uniforms are structs, and make sure to place the uniforms with specifier in front of the uniforms without specifier. Bug: chromium:431318231 Change-Id: I8be9501f34073983b7f3d040780b749a7366e3d2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6733547 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Kimmo Kinnunen 93b659f9 2025-07-04T12:35:29 Remove PoolAllocator push/pop feature PoolAllocator would manage a stack of memory pools upon client calling push() and pop(). This made the code unnecessarily complicated. The feature was only used with nesting of one, to mark the memory unused after a shader compile. Fix by removing the push/pop feature. Instantiate PoolAllocator in places the previous push() was and uninstantiating instead of previous pop(). This removes the feature where the PoolAllocator would hold on to the allocated memory in order to reuse it. This is seen as a progression: the allocator is held by the compiler, the compiler is held by the shader and each shader typically see only one compile. Thus the free pages were just leaking unused until the shader was destroyed. Instead, destructing the PoolAllocator instead of pop() will donate the memory back to platform/OS, where it is likely more useful. To preserve existing Vulkan behavior, add PoolAllocator::reset() which would mark the memory unused but leave them reserved for the PoolAllocator. Removes UB where PageHeader::nextPage would be accessed after ~PageHeader. Bug: angleproject:429513168 Change-Id: I21e58b46e0887380db3a2cab5ce22f0042cfae9e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6701153 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 1443a451 2025-07-04T16:18:30 Regenerate the parsers with current cl format The format tool has changed since last parser generation. This causes overly many changes when downstream regenerates the parsers. The diff formatting fails for flex and bison generated content. Format them in full always. Bug: angleproject:429588208 Change-Id: I7a4b8e966e9502920fc25f5c1c5bf80246f5cf0b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6705451 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Corentin Wallez 5d51bd19 2025-07-01T15:40:10 Translator: Handle arrays of samplers in FlagSamplersWithTexelFetch This was found while running tests for Dawn's "sized binding arrays" (including arrays of textures) with ANGLE + Swiftshader. Adds a test that ASSERTs without the change. Bug: chromium:411573957 Change-Id: Ib7fad0f5c0b4f3aa70e6af5bf5977b82956e1986 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6695013 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Alexey Knyazev 56e9bfff 2025-06-19T00:00:00 GL: Remove obsolete macOS workarounds Bug: angleproject:427600175 Change-Id: I8bfc062b71f1a34de09cbf76b504293ccd081fe0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6676022 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev beae1b4a 2025-06-19T00:00:00 Metal: Remove obsolete workarounds Removed Intel-specific Metal workarounds that are not used on macOS 12 and later. Removed a redundant version check. Bug: angleproject:427600175 Change-Id: I34c7e53108f7e030512c9436ab2b9ae38ad17946 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6672312 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi f48fcb46 2025-06-19T07:11:48 Revert "Metal: Wraparound int arithmetic for add, sub" This reverts commit 2f6f0514563d81e439e04ba09eee9e8a1d6ca8d1. Reason for revert: Leads to MSL compiler errors: > error: non-const reference cannot bind to vector element Bug: angleproject:382215759 Original change's description: > Metal: Wraparound int arithmetic for add, sub > > Implement wraparound int arithmetic for > int, ivec +, -, +=, -=, ++, --. > > All of the added tests pass also without the changes. > > Bug: angleproject:382215759 > Change-Id: I7605582ab2931e63010c34fba474797f7edd19f9 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6578729 > Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Bug: angleproject:382215759 Bug: chromium:425746892 Change-Id: I831d96c6ee7b8bcdeaa08fbf32d430def87a3c30 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6656001 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Martin Arjovsky a2b84cc0 2025-06-17T09:47:58 Fix bug in translator fuzzer. We were incorrectly checking a type against a spec. bug: angleproject:425580663 Change-Id: I7a57852b143ea26a41414015414d43720e2e53b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6650788 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen 94ee620d 2025-05-22T10:07:05 Metal: Allow optimization of simple loops Reimplement the feature to avoid undefined behavior of infinite loops. Add EnsureLoopForwardProgress rewrite pass that inserts a volatile variable access to all loops that it cannot analyze as being finite. Detect loops of form `for (; i <op> x; ++i)` as being finite. The <op> can be any of <,<=,>,>=,==, != operator. The i can be int or uint. The ++i can be -- or ++, -=1, +=1. This assumes that backends using the feature emit signed int arithmetic with defined wraparound semantics. Uses volatile write instead of asm("") due to asm not forcing the behavior in some compiler versions. The volatile variable access is defined in C++ as forward progress, and by inheritance this works in MSL. Later commits may remove injectAsmStatementIntoLoopBodies if ensureLoopForwardProgress is appropriate for all use-cases. Bug: angleproject:418918522 Change-Id: Ic9c29f57044b792195386483208632354d24c854 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6575051 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Matthew Denton 005336e4 2025-06-11T17:17:16 WGPU: Basic texture cubes Allows uploading to texture cube faces and sampling from them in shaders using samplerCube. Bug: angleproject:420782526 Change-Id: I45d4370fcc418f39afb225114d13632a78c7c200 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6593999 Reviewed-by: Liza Burakova <liza@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Yuxin Hu 1e613fec 2025-05-27T16:59:26 Compiler: sort uniforms by precision This change reoreders the AST sequences so that uniform declarations with lower precisions are places in front of uniform declarations with higher precisions. This is to prepare for the upcoming change that converts uniforms declared with mediump or lowp to 16-bit and pack them to 32-bit integeter using packHalf2x16(). Bug: b/405795981 Change-Id: I5e1e293399dc8b51b9a6e83115f95beb0c4a7b1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6594255 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Roberto Rodriguez af6313f5 2025-06-02T10:31:27 Check redundant statements for comma op in MSL translator. Bug: angleproject:421891565 Change-Id: I0475476f360f103a3da4df263dae9c604a8bfef5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6610091 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Shahbaz Youssefi bc2c85a6 2025-05-27T11:40:33 Translator: Set correct qualifiers on user-declared gl_PerVertex Bug: angleproject:409439499 Change-Id: Ia4bc1335d977f2b138af877e5d698914b182ff52 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6592612 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Kimmo Kinnunen 2f6f0514 2025-05-22T15:59:19 Metal: Wraparound int arithmetic for add, sub Implement wraparound int arithmetic for int, ivec +, -, +=, -=, ++, --. All of the added tests pass also without the changes. Bug: angleproject:382215759 Change-Id: I7605582ab2931e63010c34fba474797f7edd19f9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6578729 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Roberto Rodriguez 157a99aa 2025-05-20T23:59:29 Update logic for redeclaring gl_FragDepth. Update ParseContext logic to handle redeclaration of gl_FragDepth. Bug: angleproject:419066563 Change-Id: I774d036922ec75ca151f1c871afc243ca09a3061 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6573532 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Matthew Denton 96c9f065 2025-05-15T19:22:29 WGPU: Flip y for the default framebuffer Bug: angleproject:389145696 Change-Id: I0d527ad3dc24dbca7e9d914b03edacdc257a568f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6477137 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Shahbaz Youssefi 671f55d8 2025-04-03T22:54:44 Vulkan: Fix texelFetch(externalSampler) behavior GLES expects YUV decoding to happen with texelFetch when an external sampler is used, but texelFetch's translation (OpImageFetch) does not do such a thing. A transformation is added to replace that with a texture call at the right coordinate. Bug: angleproject:405149439 Change-Id: I3a8d07a6399705ec07718b38085ee4bc1ad2af6c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6431570 Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Matthew Denton cac1e824 2025-04-29T18:27:36 WGSL: Output driver uniform and UBO structs This is the WGSL half of the change to implement driver uniforms. Driver uniforms are implemented as a UBO and reuse the default set of driver uniforms. User-provided UBOs don't yet have variables outputted for them. This requires moving MSL's ReduceInterfaceBlocks to the tree_ops dir in order to change interface block definitions into struct definitions. Bug: angleproject:389145696 Change-Id: I27f3837b3d115f2ffac66cc545f3b60ca9f01cb6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6477564 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Matthew Denton 4b69ba93 2025-04-28T16:45:56 WGPU: upload texture bind groups and configured samplers GLSL samplers are split into separate sampler/texture variables in WGSL. Before this CL, the WGSL translator generated shaders that look like: @group(1) @binding(@@@@@@) var ANGLE_sampler_samp2D : sampler; @group(1) @binding(@@@@@@) var ANGLE_texture_samp2D : texture_2d<f32>; @group(1) @binding(@@@@@@) var ANGLE_sampler_sampCube : sampler; @group(1) @binding(@@@@@@) var ANGLE_texture_sampCube : texture_cube<f32>; This CL replaces those with actual binding numbers @group(1) @binding(0) var ANGLE_sampler_samp2D : sampler; @group(1) @binding(1) var ANGLE_texture_samp2D : texture_2d<f32>; ... Such that @binding(n*2) is the WGSL sampler variable corresponding to the n-th GLSL sampler and @binding(n*2+1) is the WGSL texture variable corresponding to the n-th GLSL sampler. This CL then generates binding group layouts matching the above, and uploads textures and configured samplers in bind groups. This makes some of the deqp_gles2 tests 2d texture tests pass, though some fail because they need a flipped y coordinate. Not yet supported: 1. arrays of samplers 2. shadow samplers 3. cube textures Bug: angleproject:389145696 Change-Id: I2ab18ae5ebb4d1289101266bd9451576aa04ce2a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6382272 Reviewed-by: Liza Burakova <liza@chromium.org> Auto-Submit: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 828bec45 2025-04-26T16:12:56 Vulkan: Fix SPIR-V gen for constant constructors ... inside non-constant constructors of different basic type. The SPIR-V generator proactively casts the elements of the inner constructor to the type of the outer constructor, but it was mistakenly using the original inner constructor's type id for the constant instead of the cast type id. Bug: chromium:413775106 Change-Id: I95e8b1dcc1ba36777eb4475042f0d106a6abe109 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6489041 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi 555038b8 2025-04-23T12:47:02 Translator Fuzzer: Enable required options Bug: chromium:409603851 Change-Id: I73067fcd3855f6cdcb6eea05b06bafa45d23fb19 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6482917 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi f355e2b3 2025-04-15T18:58:25 Vulkan: Remove preferDriverUniformOverSpecConst This was practically true for every vendor on Android (where rotation matters). For Qualcomm, it was also true due to a bug in version checking and didn't seem to be causing any concerns. Where pre-rotation is supported, it is better to enable this feature to avoid excessive pipeline creation. This change removes the feature and makes sure ANGLE always uses uniforms for rotation instead of spec consts. While technically this may have an adverse effect on platforms that never need pre-rotation, the ability is retained for all vendors since pre-rotation is finding its way into more platforms and would likely eventually be needed everywhere anyway. Bug: angleproject:42265878 Bug: angleproject:42262166 Change-Id: I4b64c04da46db08cfdd44b60789b66d93d8e8b17 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6459025 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: mohan maiya <m.maiya@samsung.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Yuly Novikov 5dd05578 2025-04-14T07:34:57 Revert "GL: Allow untranslated shaders to pass through on GLES" This reverts commit 4e77552b86a89b449ada6d6c18f84285f5812b1d. Reason for revert: breaks ChromeOS and fuzzers Bug: angleproject:398857482 Original change's description: > GL: Allow untranslated shaders to pass through on GLES > > Add an EGL extension EGL_ANGLE_create_context_passthrough_shaders which > uses the NULL translator and passes the original shader to the driver. > The parser is still used for shader reflection. > > Bug: angleproject:398857482 > Change-Id: I7c5fcc318c7e11931f78c08dcbf4764bf77d397d > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6297527 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Bug: angleproject:398857482, angleproject:410423936 Bug: chromium:410114655, chromium:410100607, chromium:410121218 Bug: chromium:410052365, chromium:410290507, chromium:410178288 No-Presubmit: true Change-Id: I45b01960637a1cda05d21a7df6d07465f6a8f5e9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6448984 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 4e77552b 2025-02-24T18:04:32 GL: Allow untranslated shaders to pass through on GLES Add an EGL extension EGL_ANGLE_create_context_passthrough_shaders which uses the NULL translator and passes the original shader to the driver. The parser is still used for shader reflection. Bug: angleproject:398857482 Change-Id: I7c5fcc318c7e11931f78c08dcbf4764bf77d397d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6297527 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
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>
Cody Northrop d27a1fd0 2025-04-03T19:59:20 Compiler: Allow denorm float values in the lexer This adds an option to preserve denorm values in the lexer, skipping the explicit zero conversions for below range floats. There are applications in the wild that expect to be able to use denorm float values. They are typically immediately converted to integer values, not used in floating point operations. The option is only enabled for Vulkan backends. Test: FloatLexTest, DenormFloatsToIntValues, app traces Bug: b/406827038 Change-Id: Iab5a1a69a540b78ccbce8ea90b532d2d4976e29e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6432237 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Geoff Lang 0e28c030 2025-04-02T17:26:28 ScalarizeVecAndMatConstructorArgs on WGSL shaders. WGSL does not support mixing types in the constructors of vectors and matrices. Use the ScalarizeVecAndMatConstructorArgs traverser to scalarize these constructors and update it to cast to the destination type if the inputs are not in that type already. Bug: angleproject:395659799 Change-Id: I4c270f2b18e79393e3c187916f33ad719bc88a63 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6427067 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Kenneth Russell fd722f9a 2025-03-31T23:23:26 Avoid emitting SampleCmp in discontinuous loops. Apply fix by Mikkel Simonsen from Unity to use texture level 0 when using textureLod with a shadow sampler inside a discontinuous loop. Bug: angleproject:406190894 Change-Id: If02b687f15ec4c3e8bd1b8eece72098d498e2ce1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6421496 Auto-Submit: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Neil Zhang 0d1478f3 2025-03-27T18:40:05 Fix dFdx() dFdy() in frag shader not work as expected When render to FBO0, Y axis will flipping, Angle's compile module will handle this, but only when glsl version > 300, that's a mistake as glsl 100 also have dFdx/dFdy when have GL_OES_standard_derivatives. Bug: angleproject:406819301 Change-Id: I656cfcfdeff1e80db374cfa083578adda6064e69 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6407233 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Neil Zhang <Neil.Zhang@arm.com> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 362161fa 2025-03-28T11:22:46 Translator: Use unsized int for swizzle components Bug: angleproject:349994211 Change-Id: Ibee2c664f159960cf9bf860496038bbb32ae355a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6408391 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi dba77589 2025-03-21T14:02:29 Translator: Fix output-variable-init vs after-main declarations Bug: chromium:400504716 Change-Id: I105180cd10dda5238c228d16c9f4e15f1bf49e77 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6383079 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d314868d 2025-03-21T16:13:45 Translator: prune `side_effect,noop` to `side_effect` ... if the result is unused. If `noop` includes a reference to a struct that's entirely made of samplers, the transformation that removes samplers from structs doesn't know what to do with the empty expressions. Bug: chromium:390467743 Change-Id: I62ccce6031e1bb4a0c875d0f7dce9adefb7e208d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6383081 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Matthew Denton 00d99277 2025-03-19T17:22:24 [WGSL] Emit sampler types and texture lookup builtins The split texture/sampler WGSL variables will now have the correct types corresponding to their GLSL types. Texture builtins are translated as faithfully as possible. There are some issues with the translation: 1. Texture builtins using an implicit level-of-detail in a vertex shader are supposed to sample from the base mip level. Right now these are translated into WGSL functions that cannot be used in a vertex shader at all. 2. Some texture builtins that take integer samplers do not have corresponding WGSL versions, e.g. the sampling GLSL function texture() takes integer samplers but the mostly equivalent WGSL builtin, textureSample(), will only take float samplers. 3. A number of GLSL texture builtins are not supported in WGSL when uses on shadow samplers, e.g. anything with a bias parameter, an explicit LOD parameter, or explicit gradients, Bug: angleproject:389145696 Change-Id: Idfd75721f88181db9643235b954629ac477163e4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6372082 Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org>
Shahbaz Youssefi 0b98cf97 2025-03-14T16:42:32 Translator: Fix a bug with struct-with-sampler rewrite Bug: chromium:388884060 Change-Id: I8843e0ab9698224020628bedc7a528865d91d2bf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6354207 Commit-Queue: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 00e0b31a 2025-03-10T15:17:50 Vulkan: Don't generate OpTypeSampledImage for sampler buffers That is banned in SPIR-V 1.6. Bug: angleproject:402056128 Change-Id: Ie30880628228b6949632dbe99b85b2abc9e991d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6340667 Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Matthew Denton 0cdbc781 2025-03-06T11:22:18 WGSL: Output samplers, including samplers from structs This output two WGSL variables for each GLSL sampler, including samplers in structs. This does not output the correct types for the WGSL variables, yet, nor does it generate texture access function calls. It also can't deal with arrays of samplers, which are not allowed in WGSL. Note that WGSL does not allow structs containing samplers to be arguments to a function, like Vulkan, nor does it allowed arrays of samplers at all, unlike Vulkan. This deals with the former problem the same way as Vulkan and Metal, by monomorphizing functions that take unsupported arguments. Bug: angleproject:389145696 Change-Id: I346688783dd2771c8fe6848b6783d948ed111783 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6253672 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Shahbaz Youssefi 3d806ba6 2025-03-02T00:15:36 Translator: Split textureGather* ops ... based on whether the comp or refz arguments are present. Bug: angleproject:349994211 Change-Id: I19e638f6cb27cdb890c5e30c0662aad30888d2da Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6313582 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 8dd4a6e8 2025-02-28T16:50:51 Translator: Remove rect and 2DMS* images from atomic ops They are a relic of desktop GLSL support. Bug: angleproject:349994211 Change-Id: I111467fea111d22e2d12003d639bec268e418b44 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6313639 Commit-Queue: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d39cabbd 2025-02-27T15:15:46 Translator: textureGather* always takes refZ with shadow sampler Bug: angleproject:349994211 Change-Id: I8337b80bf1d9ecae6943c6f1432b710040081273 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6309579 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 03de46ef 2025-02-20T00:00:00 Metal: Remove divMatrixScalar polyfills MSL 2.3+ natively supports matrix by scalar division. Bug: angleproject:372169468 Change-Id: I2055ab8cfff01d8a52ddc0de4d5c3bc115271aed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6289047 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Aurora Zhang 3972cfa1 2025-02-18T19:52:06 YUV should support on all the shader stages * The spec requires all shader stages should support YUV. Therefore, move YUV related functions out of the switch. * Add a new end2end test that sampling YUV in the vertex shader. Bug: angleproject:391919465 Change-Id: I7811d419d5f1461c2499c522a902c3b2149289a1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6263325 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov c4caed5f 2025-02-10T06:17:01 Revert "UNREACHABLE -> __builtin_unreachable() in release clang builds" This reverts commit 7370bb573dd8b37006d409fc8917ff49912dd75a. Reason for revert: issue identified by fuzzer crbug.com/394980074 Original change's description: > UNREACHABLE -> __builtin_unreachable() in release clang builds > > This enables compiler optimizations such as reducing the amount of > branching, see anglebug.com/394129077#comment1 > > Reduces .so size in an Android perf build by 0.4%. I spot checked a few > differences and saw less branches (this will be causing a different > behavior in UNREACHABLE branches) as well as more functions getting > inlined (likely due to compiler heuristics due to less branches) > > Bug: angleproject:394129077 > Change-Id: I23411ca7a49d3daf2a0621bfcc0b2523d4db4f5a > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6231111 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Charlie Lao <cclao@google.com> > Commit-Queue: Roman Lavrov <romanl@google.com> Bug: angleproject:394129077 Bug: chromium:394980074 Change-Id: I7398d86c692e5c50ac1185c30e2053eb87f9bd70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6248417 Auto-Submit: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov 7370bb57 2025-02-04T13:19:37 UNREACHABLE -> __builtin_unreachable() in release clang builds This enables compiler optimizations such as reducing the amount of branching, see anglebug.com/394129077#comment1 Reduces .so size in an Android perf build by 0.4%. I spot checked a few differences and saw less branches (this will be causing a different behavior in UNREACHABLE branches) as well as more functions getting inlined (likely due to compiler heuristics due to less branches) Bug: angleproject:394129077 Change-Id: I23411ca7a49d3daf2a0621bfcc0b2523d4db4f5a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6231111 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Geoff Lang 1161ac8e 2025-01-23T13:25:01 WebGPU: Implement no-op gl_PointSize Support writing to the gl_PointSize builtin but do not pass it to the next shader stages. Bug: angleproject:392604862 Change-Id: I845a3edeb0ce8e7ea41a5e96e5f3b443100f2cbf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6194555 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Matthew Denton 8ee72cc7 2025-01-13T13:44:31 WGSL: support matCx2 in uniforms matCx2 in WGSL does not match std140 layout and so it needs to be translated as array<ANGLE_wrapped_vec2, C> when in a uniform. On use it needs to be converted to a WGSL-native matCx2. This also includes the optimization of an array<matCx2> in a uniform--when indexing into it, only the indexed element will be converted to a native matCx2, instead of converting the entire array and then indexing. Bug: angleproject:376553328 Change-Id: I1d84471234b3d3cf4cf361ae89cb61675d5bf9a8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6157788 Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 0cfea380 2025-01-15T10:46:54 Rename sh::TSpan as general purpose angle::Span Span abstraction is useful for making buffer manipulation more consistent. The commit makes the Span available to all code until std::span can be used. Bug: angleproject:389951202 Change-Id: Id0c6b54bb6e75d3cc4e85af854d9e61b66906752 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6170997 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 65513240 2025-01-03T17:26:55 Fix initializing output variables ... by compiling a list of TVariables instead of names that are later looked up. The latter results in wrong symbols being initialized when the output variables are shadowed. Bug: chromium:376738756 Bug: chromium:377553431 Change-Id: I76b9688c035476c547ac73cff380629161210406 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6143374 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Matthew Denton b1a0d60f 2025-01-08T15:10:41 WGSL: Fix accidentally overloaded functions Small-stride arrays in uniforms with the same element type, but different array sizes, would cause the WGSL generator to produce conversion functions with the same name but different array sizes. This CL puts the array size in the name of the function to avoid overloading, which is unsupported in WGSL. Bug: angleproject:376553328 Change-Id: I446e91ccb9da2872c88f1a4e05283aacc9d6f8b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6160334 Commit-Queue: Matt Denton <mpdenton@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Matt Denton <mpdenton@google.com> Reviewed-by: Liza Burakova <liza@chromium.org>
Matthew Denton 363f6264 2025-01-07T10:35:09 WGSL: unwrap single array element from uniform ...instead of unwrapping the entire array when only one element is being accessed. The is step #4 from the implementation plan in https://docs.google.com/document/d/17Qku1QEbLDhvJS-JJ9lPQAbnuZtLxWhG-ha5eCUhtEY/edit?tab=t.0#bookmark=id.dt9vmixnpdvo Bug: angleproject:376553328 Change-Id: I6c559f44b75cd1d3c4a478141c11f65a33d76bdf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6102117 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Matt Denton <mpdenton@google.com> Reviewed-by: Matt Denton <mpdenton@google.com> Reviewed-by: Liza Burakova <liza@chromium.org>
Shahbaz Youssefi 6f32ed6c 2025-01-03T23:54:22 Fix struct sampler rewrite vs comma Bug: chromium:377614665 Change-Id: I2c0e8230e31405c9e7fd165a9fca68b7e9f31a76 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6142516 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d1496a22 2025-01-03T22:54:27 Produce same compile errors for op= as op Bug: chromium:376787367 Change-Id: Ic2c1415c184c603b86876e5eb70eee602639abbf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6142515 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Matthew Denton 53ec86ab 2024-12-17T14:40:31 WGSL: support small stride arrays in uniforms WGSL requires arrays in the uniform address space to have a stride a multiple of 16. This CL makes WGSL translator emit wrapper structs for array element types used in the uniform address space, when the array stride is not a multiple of 16. The exception is for structs that aren't an aligned size of 16n, and for any types matCx2, since they are (or will be) handled in different ways that ensure alignment to 16. This should leave only f32, i32, u32, and vec2. See https://www.w3.org/TR/WGSL/#example-67da5de6 for an example of using a wrapper struct. This requires converting arrays with a wrapper struct element type to arrays with an unwrapped element type when they are first used; this can be "optimized" later for the common case of accessing a single array element, which can then be unwrapped immediately. This CL generates WGSL conversion functions when necessary. After this, the only types that can't yet be used in a uniform are matCx2 and bools. This is #2 in https://docs.google.com/document/d/17Qku1QEbLDhvJS-JJ9lPQAbnuZtLxWhG-ha5eCUhtEY/edit?tab=t.0#bookmark=id.rt3slgehd4te Bug: angleproject:376553328 Change-Id: I1edfa7f481a6cbf5b595643aae8728e67bc4b770 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6092038 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Reviewed-by: Matt Denton <mpdenton@google.com> Commit-Queue: Matt Denton <mpdenton@google.com>
Shahbaz Youssefi f80d15ad 2025-01-03T16:19:13 Vulkan: Fix crash with array of array of samplers vs comma Bug: chromium:385256122 Change-Id: I9b356401e7c007060e95bb95ca8269411178ce66 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6143373 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi e72cc71b 2024-12-13T11:59:29 Vulkan: Remove framebuffer fetch from shader if unused Some application shaders may use `inout` variables to simplify shader generation (presumably), but in the end don't actually ever read from those variables. This change tries to detect some very simple but common cases where it's clear that the shader completely overwrites the variable without reading from it and turns `inout` into `out`. When coherent framebuffer fetch emulation kicks in, these shaders would no longer cause unnecessary barriers. Bug: angleproject:377923479 Change-Id: I0970b72f551b24409337a375cf97aa63bb511fb5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6094425 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Roman Lavrov <romanl@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>
Alexey Knyazev e82a2eab 2024-11-28T00:00:00 Support multisample 2D array textures on ES 3.0 contexts Supported via OES_texture_storage_multisample_2d_array enabled together with ANGLE_texture_multisample. Drive-by: Fixed exposure conditions in the OpenGL backend to match the implementation. Fixed: angleproject:382298321 Change-Id: I21b037aac7bebc35df267e9dd468088ebce35e71 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6075241 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Matthew Denton 473798bf 2024-11-28T00:38:36 WGSL: @align appropriate struct members in uniforms. Structs used in the uniform address space need to have certain members aligned according to the uniform address space layout constraints (substantially similar to std140). This CL adds @align annotations where necessary, in structs used in the uniform address space. Strictly speaking, it's okay to apply @align annotations to all structs used in the WGSL program, but this CL uses a pre-pass AST traverser to records all the structs used in the uniform address space. This is to avoid more unreadable generated code, and when more transformations are applied to these structs in future CLs, less generated code overall. After this, the only types that can't yet be used in a uniform are matCx2, arrays with stride not divisble by 16 (except when the array element type is a struct), and bools. This is #1 in struct translation in https://docs.google.com/document/d/17Qku1QEbLDhvJS-JJ9lPQAbnuZtLxWhG-ha5eCUhtEY/edit?tab=t.0#bookmark=id.rudfrn2o6jv1 Bug: angleproject:376553328 Change-Id: Ibff3414043a6ecb4a01ef8e3e71dad9c1066ddfd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6056951 Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 5288ed36 2024-11-26T00:00:00 GL: Enable ANGLE_texture_multisample on OpenGL ES Trivially enabled on supported device contexts. Improved readablility of conditions for implicit GLSL version upgrades. Fixed: angleproject:381113379 Change-Id: I843f7119da2a3cffb255af97f654d714add9f482 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6055117 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 239ef680 2024-11-21T00:00:00 Metal: Support ANGLE_texture_multisample * Added explicit multisample texture creation support * Added support for SAMPLE_MASK frontend state * Adjusted Metal backend caps Fixed: angleproject:380475003 Change-Id: I90250e14da52869cb954b5a61d9c670e958a526c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6048958 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Kimmo Kinnunen bfa03a84 2024-11-19T13:32:31 Metal: Fix vec swizzles to bvecs on AMD Constructing bvecs explicitly from swizzles would produce double swizzles, and this would fail validation at validateNoSwizzleOfSwizzle. Fix by folding the expression passed to coersion bvec constructor. Cannot test more in isolation for now, since AddExplicitTypeCasts uses Metal specific SymbolEnv. Bug: angleproject:379758210 Change-Id: I175941747ef1c7acb8c88683c1188843a154aa8a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6034935 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 8e9dc1a6 2024-11-19T11:08:31 Validate anonymous struct names with namespace Consider GLSL: struct { vec4 e; } g; struct sbbf { vec4 f; }; The struct name validation would fail if user chosen struct name would clash with a symbol name that ANGLE internally gave to an anonymous struct. Fix by importing Name abstraction from MSL backend. A symbol name is a pair (namespace, string). Move operator<<(std::ostream &os, const ImmutableString &str) to sh namespace because that is more natural for operator overloading name resolution. MSVC works with this. Bug: angleproject:379758201 Change-Id: Icc9b02aa8cb532e1d925e2fba4c45468f01b9144 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6035029 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 8409b41e 2024-11-20T14:38:30 Report error on unsized interface block array GLSL of forms: uniform S{...} a[]; in R{...} b[]; out Q{...} c[]; Should produce error unless the shader is tesselation or geometry shader. Fix the errors for VS and FS. GS and TS likely need more work. Bug: angleproject:379996129 Change-Id: Ib31c9a81717a8cd1c984eb4ce2e993d563bb3c4f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6038333 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen ec773865 2024-11-19T14:46:29 Qualifier in const for sampler2D fails validation The commit 039660a0757e8e5b661c1850747b688b6642f56d failed to special cased "const in". Fix by special casing also on EvqParamConst. Bug: angleproject:379762012 Change-Id: Ife6966ea536972874645ae22b504712249817638 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6035505 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 770242db 2024-11-20T17:03:07 Translator: Remove the `gimage1D` base type This is a desktop GL type, whose removal was left out of b16d105fc6. Bug: angleproject:370937467 Change-Id: I0bda5453b95ddf924ba0583de346902b333603a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6037776 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 1f0ac74a 2024-11-20T16:43:50 Translator: Remove SubpassInputMS ANGLE never generates multisampled input attachments, because it cannot know if the shader will be used with a single-sampled or multisampled framebuffer. The SPIR-V transformer takes care of changing the type and ops to be multisampled if needed. Bug: angleproject:37093746 Change-Id: Ic9c3057536c0a5d543512dbd3c347033453a29f4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6039437 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi c4533e0a 2024-11-20T16:21:40 Translator: Remove the `double` base type This is a desktop GL type, whose removal was left out of b16d105fc6. Bug: angleproject:37093746 Change-Id: I185beef71099aafc3e350efc3dad019e2a72c0e6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6039436 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Kimmo Kinnunen 7ba69645 2024-11-14T10:07:31 Fix unnamed outs w/ initializeUninitializedLocals Fix translator initializeUninitializedLocals pass for anonymous out parameters. The parameters should be initialized to zero, similar to named but unassigned parameters. Initialization would be skipped on GLSL output, assert on Metal. Functions need to be replaced if their parameter names change. In case the function had a prototype declaration, that has to be replaced too. All calls to old functions must be replaced with calls to new function. Bug: angleproject:378584780 Change-Id: I9a990fa3840f6e26cd30f35bf6c99d9a8816f272 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6020245 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 03c75d35 2024-11-14T14:24:44 Remove SeparateStructFromFunctionDeclarations Move SeparateStructFromFunctionDeclarations to SeparateDeclarations It is logical part of the separate declarations step. Bug: angleproject:378966971 Change-Id: Ie102a1d936f7b444f5f9f2ac2fe8dc6c10027782 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6022857 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen df61fc7f 2024-11-14T13:31:24 Avoid reordering structs when separating from func Avoid reordering structs when separating struct declarations and function declarations. Consider: struct S1 { ... }; struct S2 { S1 a; } f(); SeparateStructFromFunctionDeclarations would insert the S2 to the beginning of the containg block, so before S1 definition. Fix by not inserting the structs to the parent block. Instead, return the nodes from multi-replacement, so that the struct definition is inserted at the site of the replaced function. Bug: angleproject:378966971 Change-Id: I47582660610c1fcb28a9b5bd592ac020b5c48e34 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6022856 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Matthew Denton 4a835cf2 2024-11-01T13:31:00 WebGPU: send uniforms to GPU for use in shader Basic uniforms should now be accessible in the shader during a draw call, rather than just via glGetUniform*(). This is unoptimized and creates a new GPU-side copy of all the uniforms, every time any uniform changes. This sets up the bind group layout for a pipeline and sets the bind groups in the renderer pass. Right now these bind groups only contain the default uniform blocks, but in the future will need to contain textures, samplers, and non-default uniform blocks (UBOs). Bug: angleproject:376553328 Change-Id: I50891b81ab2ee374d674213257f76319c0222120 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5980972 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Kimmo Kinnunen c46e6bac 2024-11-12T13:55:01 Make intermediate output symbol names consistent Make intermediate output symbol names consistent across uses in parameter names, struct names, variable names: - built-in without quotes - '' empty - #satb ANGLE internal - 'a' user-defined Previously empty parameters would output the symbol id-generated name ("sabb"), which was surprising when this is used only when the symbol is in AngleInternal namespace, and not in Empty namespace. Bug: angleproject:378584780 Change-Id: I87b13cf964a1ae3ee54b8f4ef7a00eddcd474760 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6011018 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen b8b962d2 2024-11-08T14:53:00 Parse function parameters into TPublicType Parse function parameters into TPublicType instead of TType. TType holds the type info, TPublicType holds the type specification info. This helps in moving the TType::isStructSpecifier into the AST nodes, away from the type system which it is not part of. Removes duplicated code where unnamed unsized arrays would cause different error message than named unsized arrays. Bug: angleproject:377330017 Change-Id: I102b9e87823a545f7e64f971aafbdcd313a542fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6000009 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 4f4062ae 2024-11-08T10:18:02 Add support for running the parser generation on Mac For cloud storage, uses new bucket angle-flex-bison-mac for clarity, the names Linux and Mac clash. The lexer diffs seem to be due to formatter changes after the last generation of tjhe lexer. The diffs repro on Linux too. Lexer produces too hard to format source or diffs, and one hunk is left unformatted the first time. Add a workaround. Bug: angleproject:377941128 Change-Id: Id9d8f9a5c4a169955ccd8cd9cb3d632fbb339d28 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6000005 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen efcb94ab 2024-11-06T15:55:02 Output the type of constant union Output the type of the constant union node in OutputTree output. This makes it easier to understand typing bugs related to the constant union. Adds a node nesting level for constant unions. This makes it easier to understand consecutive constant unions. Bug: angleproject:377330017 Change-Id: Ia83072b78c4d1713f839fd136692b254f6d2c517 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6000532 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Shahbaz Youssefi e3011d96 2024-11-08T16:17:07 Translator: Optimize size calculation for variable arrays Bug: angleproject:373924024 Change-Id: Id3a8b844b8274c19c0c2c833842fb8b501f50174 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6004338 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen eccfec93 2024-11-01T11:49:11 Metal: gl_ClipDistance fails validation Failure is "Found child with two parents". Result from reusing gl_ClipDistance in: float gl_ClipDistance[8]; ClipDistance_0 = gl_ClipDistance[0]; ... Fix by creating new node for each symbol access. Bug: angleproject:376718272 Change-Id: I7a866a10e389cc25d0cff4e6f18ae9c70ab376e0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5979781 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Chris Dalton a05a0e15 2024-09-25T22:33:36 Validate PLS shaders against context state Add shader introspection for PLS uniforms and validate that they match context state during draw calls. Bug: angleproject:40096838 Change-Id: I76cdf8add03de8f8b0b3e772c15c0087c1d97e98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5893962 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen b03f0148 2024-11-01T10:26:04 Metal: interpolateAtOffset fails validation Fix validation error Found function prototype with an invalid qualifier. The offset parameter was created with "global" qualifier. Bug: angleproject:376718268 Change-Id: I6f314a42fe1d35d54bb673cfa7d58eba526c9ea5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5979778 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen bf29a047 2024-10-28T11:07:57 Metal: Remove uniform struct decl separation code Remove uniform specific struct declaration separation and anonymous struct naming code. This is already done by SeparateDeclarations. Removes code for NameEmbeddedUniformStructsMetal. Does not remove SeparateStructFromUniformDeclarations code as it is used for SPIRV. Bug: angleproject:375937551 Change-Id: I943d96897d97b23fd0f54155dc215a4490f63937 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5972994 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 2156cd6e 2024-10-31T14:22:31 Metal: Fix rewritten array variables clashes It was possible to generate MSL name clashes by declaring arrays, such as in: mat3 a[1] mat2 a_0; Complex GLSL outputs need to be linearized into primitive MSL types. This would happen for struct outputs, arrays and matrices. For these new MSL variables, the translator needs to invent new names that match, generated from both VS and FS. The clashes were due to the encoding scheme: For arrays, the MSL vertex output variable was named with _0 suffix for the array and _0 for the matrix row 0. In the example above, this would create a clash since also non-array mat would be linearized row-wise. For structs, field `a.b` would be encoded as `a_b`. By selecting different a and b, clashes could be generated trivially. It is redundant to encode named semantics in the out variable names. The only needed element is the discriminator which associates VS variables to FS variables. Currently this is done by using the user-provided root field name. Fix by encoding only the root variable name to the MSL variable name. The rest of the field discriminators are just a running number. Each GLSL name `a` is unique. MSL names get fixed suffix form `a_X`, and thus all of them are unique too. This is a continuation of following fixes that turned out to be incomplete: 6fe8a399dd Metal: Fix rewritten out variables with underscores 27423bffff Metal: Generate names for rewritten inputs Bug: angleproject:376417347 Change-Id: I407db373d201b3e321c6d8414bafdbecfd82cf19 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5979774 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 0624b4fb 2024-10-31T20:59:20 Metal: Make ToposortStructs compile on c++17 Use .find() != .end() instead of .contains() for std::unordered_map. Bug: angleproject:375352601 Change-Id: I2e550354e1df3b390b74fdea29427fd3a0326fe8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5979775 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 8d12b278 2024-03-15T15:39:39 Make separated anonymous in/out structs work better Fixes failing case for other backends than GLSL output: VS: out struct { .. } a, b; FS: in struct { .. } a, b Make the ANGLE VS-FS interface matching work by using the anonymous name as the variable structOrBlock name. Bug: angleproject:42267047 Change-Id: If8107387c02b5520134857fb210a27a8f92a2db0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5372727 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen b8d546b2 2024-10-30T15:40:58 Fix immutable string concats with ints `BuildConcatenatedImmutableString("a", 10, "b")` would construct "a\nb" because the implementation lacked int overloads and ints would be promoted to chars implicitly. Fix by implementing simpler way to calculate digits for numbers and then add useful overloads. Remove ImmutableStringBuilder::appendDecimal() since the code is already expecting << for all other types, and the bug was due to this expectation. Bug: angleproject:376417347 Change-Id: Iea5e14a6e2fede068b704754b9203db794dd5bf0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5972641 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 4397ff2f 2024-10-25T16:55:30 Metal: SeparateCompoundStructDeclarations fails validation Consider GLSL: struct S { int i; } s; s=s; SeparateCompoundStructDeclarations would rewrite this to: struct S { int i; }; S s'; s=s; The interm rewrite would rewrite the specification and declaration of s, but not the use sites. The use sites would use the old type, and thus something that was not in the tree anymore. This would fail the validation. This kind of bug was previously fixed for SeparateDeclarations in commit 18fa02bebf901dd8501de3176f6052ae4ce984be. Fix by adding the logic to SeparateDeclarations, as it is already doing almost the exact task, separating `struct S { ..} a, b`. The separation is tested in GLSLTests.StructInShader and various other draw tests. These pass with MSL, but these would also fail validation if that was enabled. Bug: angleproject:375523825 Change-Id: I1697103d0ba47616dbd3159f36f9e71cb2831c4b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5964899 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kimmo Kinnunen 4a5b0284 2024-10-24T11:46:54 Disallow discarded uniform block references Uniform block instances cannot be used by themselves, as there is no way to refer to their type. Disallow the only typeless access pattern, discarding via expression statement: uniform MyBlock { int x; } b; void main() { b; 0, b; } Explained as disallowed in newer GLSL 300: https://github.com/KhronosGroup/WebGL/issues/3644 The comma expression form would ASSERT in CollectVariables. Bug: angleproject:42267026 Change-Id: I6c8b835482fd551bd97576c1bd24f005874da6af Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5961498 Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 898a1c12 2024-10-24T13:09:36 Metal: Fix ToposortStructs validation == failures ToposortStructs would convert mat, vec, struct == to ANGLE_equals() calls. However, the functions called were not in AST. This would cause "Found node calling previously undeclared function <validateFunctionCall>" validation error and ASSERT. Mat, vec equality calls would use prelude ANGLE_equals implementations. The MSL emit already does the conversion from == to ANGLE_equals for these builtins. For user-defined structs the logic would be: - collect struct decls, structs, create equality functions - toposort - for each sorted struct: - insert struct decl - insert equality function Move the equality function creation after the toposort: - collect struct decls, structs - toposort - for each sorted struct: - insert struct decl - create equality function - insert equality function This way the sort ensures that nested struct equality functions can refer to previously introduced equality functions. Bug: angleproject:375352601 Change-Id: I59efed98bca6d99b198abc2b5c7577cf5d1d5d83 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5961281 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Shahbaz Youssefi 08c1724f 2024-10-11T14:29:00 Vulkan: Support GL_ARM_shader_framebuffer_fetch_depth_stencil Bug: angleproject:352364582 Change-Id: I63fd78314fa7ebccbf366c252e309a9c0f09c8c1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5938150 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 12584049 2024-10-21T14:04:55 Make SimplifyLoopConditions testable Add ShCompileOptions::simplifyLoopConditions, so that tests can turn it on. Later edits to simplify loop condition logic are simpler to review when the testing related edits are landed separately. Test the feature by having ESSL as the input and ESSL as the natural output, to reflect how AST changes. To make the test expectations more deterministic across code changes, change SymbolTable::kLastBuiltInId to SymbolTable::kFirstUserDefinedSymbolId. This is simpler as no code needs to know exact last built in id, so we can just ensure that the user defined symbol ids do not clash with the builtin ids. Bug: angleproject:374585769 Change-Id: Iea0efb8ac2878691d0fd5ff5cfe9a49ac754515d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5946724 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Shahbaz Youssefi 47c66901 2024-10-21T12:47:22 Vulkan: Set gl_Layer to 0 if the framebuffer is not layered Bug: angleproject:372390039 Change-Id: I29067c9488e06f6dd2e90f207fecb843267fb77c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5949263 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi bbe68963 2024-10-21T15:11:27 Vulkan: Fix `precise` vs `mat4(...)[index]` Bug: angleproject:374801303 Change-Id: I45550abe406aaaf4d2c5eb5d7d694b2b30ab8e4e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5949528 Reviewed-by: mohan maiya <m.maiya@samsung.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 5c2a2fd5 2024-10-21T16:00:25 Vulkan: Fix `vec4(...).zxwy[index]` The code was actually correct, but included an unnecessary assertion. The code incorrectly assumed `.zxwy[index]` is pre-processed with a lookup table and turned into `[index']`, but it wasn't if the LHS is a constructor. The change just removes the assertion because it was correctly handling that already. Bug: angleproject:40096715 Change-Id: Ib1365f95a255ce3654831af55429361d35c026c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5949527 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 4aa12e9e 2024-10-07T00:00:00 Metal: Remove macOS 11.0 availability checks Chromium now requires at least macOS 11.0. This also implies MSL 2.3 support. Bug: angleproject:371829506 Change-Id: I6aaf4d9775bfe58747df28173d3931aa11fa8d25 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5912903 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Stephen White 4b1e58d9 2024-10-17T09:33:53 Fix for float constant precision in the GLSL backend. Increase the precision of floating point values written out via std::ostringstream. 8 digits is not sufficient to represent all floating point values. Note: the reason the locale test was modified is because it was using a value of 1.9, which has no exact fp32 representation. Increasing the precision causes it to print as 1.8999998 instead of 1.9, failing the test. I've adjusted the value to 1.5, since this does have an exact fp32 representation. (However, note that I couldn't get the test to fail when I removed the locale setting, with either 1.9 or 1.5. Perhaps the locale is being handled at a different level.) Bug: angleproject:374013421 Change-Id: Icb79eb9acd562c83d079f2cc2cdba253220e581e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5938473 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 2f644ed8 2024-10-16T00:00:00 Implement NULL translator output Fixed: angleproject:373818287 Change-Id: If862e8e66a043ef968daea91d95717af97e3a0de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5937827 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>