Issue 13092 in skia: WGSL support for SkSL

7 views
Skip to first unread message

arman… via monorail

unread,
Mar 23, 2022, 6:59:13 PM3/23/22
to bu...@skia.org
Status: Accepted
Owner: arma...@google.com
CC: brian...@google.com, kjlu...@google.com
Area: GPU SkSL
Priority: Medium
Type: Defect

New issue 13092 by arma...@google.com: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092

This issue tracks the short-term goals to enable WGSL (the WebGPU Shading Language) as a codegen target for the SkSL compiler. The initial goals of this effort:

1. Support WGSL code generation.
2. Integrate Tint's WGSL reader front-end for (optional) validation of WGSL output.
3. Use the generated WGSL instead of SPIR-V when Skia targets Dawn/WebGPU.

This effort will not only enable us to use the standard shading language when targeting WebGPU but also unlock experiments to use Tint for MSL, SPIR-V, and HLSL code generation.

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

arman… via monorail

unread,
Mar 23, 2022, 6:59:24 PM3/23/22
to bu...@skia.org
Updates:
Status: Started

Comment #1 on issue 13092 by arma...@google.com: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c1

(No comment was entered for this change.)

Git Watcher via monorail

unread,
Apr 5, 2022, 5:55:04 PM4/5/22
to bu...@skia.org

Comment #2 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c2

The following revision refers to this bug:
https://skia.googlesource.com/skia/+/be405a8b382a4b501ae46222583b8625db0905a0

commit be405a8b382a4b501ae46222583b8625db0905a0
Author: Arman Uguray <arma...@google.com>
Date: Mon Mar 28 23:34:52 2022

[sksl][wgsl] Introduce SkSLWGSLCodeGenerator

Introduce a new WGSL codegen backend. It currently only supports
fragment/vertex stage input and output variable declarations.

Bug: skia:13092
Change-Id: If9e4e432794eb95fd33719be5c0141dfc2cb5680
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526757
Reviewed-by: Brian Osman <brian...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[add] https://crrev.com/be405a8b382a4b501ae46222583b8625db0905a0/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[modify] https://crrev.com/be405a8b382a4b501ae46222583b8625db0905a0/src/sksl/codegen/BUILD.bazel
[modify] https://crrev.com/be405a8b382a4b501ae46222583b8625db0905a0/gn/sksl.gni
[add] https://crrev.com/be405a8b382a4b501ae46222583b8625db0905a0/src/sksl/codegen/SkSLWGSLCodeGenerator.h

Git Watcher via monorail

unread,
Apr 6, 2022, 6:12:06 PM4/6/22
to bu...@skia.org

Comment #3 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c3


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/f379b259a55e61e4ca173bf392c43ec20ca9e0e4

commit f379b259a55e61e4ca173bf392c43ec20ca9e0e4
Author: Arman Uguray <arma...@google.com>
Date: Thu Mar 31 00:13:23 2022

[sksl][wgsl] Implement codegen for simplest complete program

- Implemented much of the statement/expression/program-element
parsing/dispatch boilerplate with support for only those expressions
that are necessary to successfully compile shared/HelloWorld.sksl

- Implemented functions and fragment/vertex program entry points

Most of the code for HelloWorld.sksl is now generated, however the
output program is still missing a correct propagation of varying stage
inputs and output parameters to subroutines.

Bug: skia:13092
Change-Id: Ic51af5a041761f58234d45e3746206ed080e0910
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526758
Reviewed-by: John Stiles <johns...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/f379b259a55e61e4ca173bf392c43ec20ca9e0e4/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[modify] https://crrev.com/f379b259a55e61e4ca173bf392c43ec20ca9e0e4/src/sksl/codegen/BUILD.bazel
[modify] https://crrev.com/f379b259a55e61e4ca173bf392c43ec20ca9e0e4/src/sksl/codegen/SkSLWGSLCodeGenerator.h

Git Watcher via monorail

unread,
Apr 7, 2022, 9:09:06 AM4/7/22
to bu...@skia.org

Comment #4 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c4


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/9f3c6bce488365ec198d9f7d9857ab6739031cf4

commit 9f3c6bce488365ec198d9f7d9857ab6739031cf4
Author: Derek Sollenberger <djso...@google.com>
Date: Thu Apr 07 13:07:56 2022

Revert "[sksl][wgsl] Implement codegen for simplest complete program"

This reverts commit f379b259a55e61e4ca173bf392c43ec20ca9e0e4.

Reason for revert: breaking the linux GCC x86 and x86_64 builders

Original change's description:

> [sksl][wgsl] Implement codegen for simplest complete program
>
> - Implemented much of the statement/expression/program-element
> parsing/dispatch boilerplate with support for only those expressions
> that are necessary to successfully compile shared/HelloWorld.sksl
>
> - Implemented functions and fragment/vertex program entry points
>
> Most of the code for HelloWorld.sksl is now generated, however the
> output program is still missing a correct propagation of varying stage
> inputs and output parameters to subroutines.
>
> Bug: skia:13092
> Change-Id: Ic51af5a041761f58234d45e3746206ed080e0910
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526758
> Reviewed-by: John Stiles <johns...@google.com>
> Commit-Queue: Arman Uguray <arma...@google.com>

Git Watcher via monorail

unread,
Apr 7, 2022, 12:47:08 PM4/7/22
to bu...@skia.org

Comment #5 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c5


The following revision refers to this bug:

Author: Arman Uguray <arma...@google.com>
Date: Thu Mar 31 00:13:23 2022

This is a reland of commit f379b259a55e61e4ca173bf392c43ec20ca9e0e4

GCC warnings caused by missing integer cast from enum class in format
specifier have been fixed.


Original change's description:
> [sksl][wgsl] Implement codegen for simplest complete program
>
> - Implemented much of the statement/expression/program-element
> parsing/dispatch boilerplate with support for only those expressions
> that are necessary to successfully compile shared/HelloWorld.sksl
>
> - Implemented functions and fragment/vertex program entry points
>
> Most of the code for HelloWorld.sksl is now generated, however the
> output program is still missing a correct propagation of varying stage
> inputs and output parameters to subroutines.
>
> Bug: skia:13092
> Change-Id: Ic51af5a041761f58234d45e3746206ed080e0910
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526758
> Reviewed-by: John Stiles <johns...@google.com>
> Commit-Queue: Arman Uguray <arma...@google.com>

Bug: skia:13092

Git Watcher via monorail

unread,
Apr 8, 2022, 5:06:08 PM4/8/22
to bu...@skia.org

Comment #6 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c6


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/6b6015ff79b09f3b0ddcdf26574ce91f2d817717

commit 6b6015ff79b09f3b0ddcdf26574ce91f2d817717
Author: Arman Uguray <arma...@google.com>
Date: Sat Apr 02 02:53:28 2022

[sksl][wgsl] Function pipeline input/output injection

Pipeline stage inputs and outputs are not declared in global-scope but
rather as a parameter/return of the program entry point function. Thus
that references any one of these parameters must obtain them via a
function argument.

* All references to pipeline input/output variables are resolved as the
first codegen step. All functions that either reference or call a
function that directly or indirectly references such a variable gets
synthesized input/output parameters.

* Pipeline stage outputs are passed via pointer to allow mutation by
subroutines.

* If the main function requires the SK_MAINCOORDS_BUILTIN, we now make
sure that sk_FragCoords is declared, even if not directly referenced by
code.

Bug: skia:13092
Change-Id: Ie538566a074e8cc9ce8594946a56d311ac5e7270
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526759

Reviewed-by: John Stiles <johns...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

Git Watcher via monorail

unread,
Apr 11, 2022, 2:33:13 PM4/11/22
to bu...@skia.org

Comment #7 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c7


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/5d594e4af458c30283bfabebe3e405c8da9979c7

commit 5d594e4af458c30283bfabebe3e405c8da9979c7
Author: Arman Uguray <arma...@google.com>
Date: Sat Apr 02 03:04:51 2022

[sksl][wgsl] Enable WGSL codegen in skslc

* Wire up the WGSLCodeGenerator to SkSLCompiler.
* Wire up build rules to generate WGSL from unit tests.
* Include HelloWorld.sksl as the first complete program.

Bug: skia:13092
Change-Id: I283cf5971b6856126b9fc23340afacff5cc54697
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526760
Reviewed-by: Ethan Nicholas <ethann...@google.com>

Reviewed-by: John Stiles <johns...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/5d594e4af458c30283bfabebe3e405c8da9979c7/gn/sksl_tests.gni
[modify] https://crrev.com/5d594e4af458c30283bfabebe3e405c8da9979c7/src/sksl/SkSLCompiler.h
[modify] https://crrev.com/5d594e4af458c30283bfabebe3e405c8da9979c7/src/sksl/BUILD.bazel
[modify] https://crrev.com/5d594e4af458c30283bfabebe3e405c8da9979c7/tools/skslc/Main.cpp
[modify] https://crrev.com/5d594e4af458c30283bfabebe3e405c8da9979c7/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[modify] https://crrev.com/5d594e4af458c30283bfabebe3e405c8da9979c7/src/sksl/SkSLCompiler.cpp
[modify] https://crrev.com/5d594e4af458c30283bfabebe3e405c8da9979c7/src/sksl/codegen/BUILD.bazel
[modify] https://crrev.com/5d594e4af458c30283bfabebe3e405c8da9979c7/BUILD.gn
[modify] https://crrev.com/5d594e4af458c30283bfabebe3e405c8da9979c7/src/sksl/codegen/SkSLWGSLCodeGenerator.h
[modify] https://crrev.com/5d594e4af458c30283bfabebe3e405c8da9979c7/gn/compile_sksl_tests.py
[add] https://crrev.com/5d594e4af458c30283bfabebe3e405c8da9979c7/tests/sksl/shared/HelloWorld.wgsl

Git Watcher via monorail

unread,
May 17, 2022, 2:26:05 PM5/17/22
to bu...@skia.org

Comment #9 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c9


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/c1504658a7c5d53a72360fab3184648cebb66e24

commit c1504658a7c5d53a72360fab3184648cebb66e24
Author: Arman Uguray <arma...@google.com>
Date: Thu May 05 23:35:55 2022

[sksl][wgsl] Enable WGSL validation using Tint

- Introduced the SK_ENABLE_WGSL_VALIDATION macro which is currently only
enabled when skslc gets compiled when using the `skia_compile_sksl_tests`
setting.
- SkSLCompiler::toWGSL now validates its output using Tint's WGSL reader
structures based on conditionally compiled code depending on the
SK_ENABLE_WGSL_VALIDATION flag.
- Fixed `warning: use of deprecated language feature: struct members should be separated with commas"
warnings that were generated for HelloWorld.wgsl.

Bug: skia:13092
Change-Id: Ib894457030004966221faf82f61360e390b95e22
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/537802
Commit-Queue: Arman Uguray <arma...@google.com>
Reviewed-by: Kevin Lubick <kjlu...@google.com>
Reviewed-by: Brian Osman <brian...@google.com>

[modify] https://crrev.com/c1504658a7c5d53a72360fab3184648cebb66e24/third_party/file_map_for_bazel.json
[modify] https://crrev.com/c1504658a7c5d53a72360fab3184648cebb66e24/src/sksl/BUILD.bazel
[modify] https://crrev.com/c1504658a7c5d53a72360fab3184648cebb66e24/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[modify] https://crrev.com/c1504658a7c5d53a72360fab3184648cebb66e24/bazel/BUILD.bazel
[modify] https://crrev.com/c1504658a7c5d53a72360fab3184648cebb66e24/src/sksl/SkSLCompiler.cpp
[modify] https://crrev.com/c1504658a7c5d53a72360fab3184648cebb66e24/BUILD.gn
[modify] https://crrev.com/c1504658a7c5d53a72360fab3184648cebb66e24/bazel/external/dawn/BUILD.bazel
[modify] https://crrev.com/c1504658a7c5d53a72360fab3184648cebb66e24/src/sksl/codegen/SkSLWGSLCodeGenerator.h
[modify] https://crrev.com/c1504658a7c5d53a72360fab3184648cebb66e24/tests/sksl/shared/HelloWorld.wgsl

Git Watcher via monorail

unread,
May 17, 2022, 3:24:10 PM5/17/22
to bu...@skia.org

Comment #10 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c10


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/b2b1d6553e3eb82555e83565cc716ae56a64535b

commit b2b1d6553e3eb82555e83565cc716ae56a64535b
Author: Arman Uguray <arma...@google.com>
Date: Fri May 06 22:46:28 2022

[sksl][wgsl] Prevent empty pipeline stage structs

1. It is illegal to declare an empty struct in WGSL. The codegen no longer
declares an empty struct for pipeline stage inputs and outputs if the
program does not reference them.

2. WGSL requires that every vertex program declare a @builtin(position) output.
The codegen now emits this pipeline stage output even for an empty
program that doesn't assign to sk_Position. This allows unit tests for
vertex programs to be authored without unnecessary boilerplate.

Bug: skia:13092

Change-Id: Ib023200e2ba13acf96859817249686d7f815cb00
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538418
Reviewed-by: Brian Osman <brian...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/b2b1d6553e3eb82555e83565cc716ae56a64535b/gn/sksl_tests.gni
[modify] https://crrev.com/b2b1d6553e3eb82555e83565cc716ae56a64535b/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[add] https://crrev.com/b2b1d6553e3eb82555e83565cc716ae56a64535b/tests/sksl/wgsl/VertexPositionOutputIsAlwaysDeclared.wgsl
[add] https://crrev.com/b2b1d6553e3eb82555e83565cc716ae56a64535b/resources/sksl/wgsl/VertexPositionOutputIsAlwaysDeclared.vert
[modify] https://crrev.com/b2b1d6553e3eb82555e83565cc716ae56a64535b/src/sksl/codegen/SkSLWGSLCodeGenerator.h

Git Watcher via monorail

unread,
May 17, 2022, 5:44:05 PM5/17/22
to bu...@skia.org

Comment #11 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c11


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/5235b3df4237970985967dcb6e973d00d19e4bd6

commit 5235b3df4237970985967dcb6e973d00d19e4bd6
Author: Arman Uguray <arma...@google.com>
Date: Fri May 06 23:01:37 2022

[sksl][wgsl] Add @interpolate(flat) annotation to integer IO

WGSL requires that pipeline stage IO parameters that are scalar or
vector integers be annotated with the "flat" interpolation attribute.

Bug: skia:13092
Change-Id: I2930da6cf468ac8cd9ccaca0004e5849065411dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538419
Commit-Queue: Arman Uguray <arma...@google.com>
Reviewed-by: Brian Osman <brian...@google.com>

[modify] https://crrev.com/5235b3df4237970985967dcb6e973d00d19e4bd6/gn/sksl_tests.gni
[modify] https://crrev.com/5235b3df4237970985967dcb6e973d00d19e4bd6/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[add] https://crrev.com/5235b3df4237970985967dcb6e973d00d19e4bd6/resources/sksl/wgsl/UserDefinedPipelineIO.sksl
[add] https://crrev.com/5235b3df4237970985967dcb6e973d00d19e4bd6/tests/sksl/wgsl/UserDefinedPipelineIO.wgsl

Git Watcher via monorail

unread,
May 17, 2022, 10:26:08 PM5/17/22
to bu...@skia.org

Comment #12 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c12


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/02888a6f0aabfb528884ef90276d686735112d09

commit 02888a6f0aabfb528884ef90276d686735112d09
Author: Arman Uguray <arma...@google.com>
Date: Fri May 06 23:07:01 2022

[sksl][wgsl] Support simple assignment

- Add support for simple assignment expressions, as well as swizzle,
variable references, and type conversion constructors to support
simple assignment test cases that reference built-ins and local variables.

- Handle a case where the type of a SkSL built-in differs from its WGSL
counterpart and emit a type cast when such a variable gets referenced.

- Add additional test cases for supported WGSL features that could not
be tested without simple assignment support.

Bug: skia:13092
Change-Id: Ib1ff3bcef60e436c9be5c08236c9fe4de02dd005
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538420

Reviewed-by: Brian Osman <brian...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[add] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/resources/sksl/wgsl/BuiltinFragmentStageIO.sksl
[add] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/tests/sksl/wgsl/MainHasVoidReturn.wgsl
[add] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/tests/sksl/wgsl/BuiltinFragmentStageIO.wgsl
[modify] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/gn/sksl_tests.gni
[add] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/resources/sksl/wgsl/MainHasVoidReturn.sksl
[add] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/tests/sksl/shared/VertexID.wgsl
[modify] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[modify] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/src/sksl/codegen/BUILD.bazel
[add] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/tests/sksl/shared/InstanceID.wgsl
[modify] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/src/sksl/codegen/SkSLWGSLCodeGenerator.h
[add] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/tests/sksl/wgsl/MainDoesNotHaveFragCoordParameter.wgsl
[add] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/tests/sksl/wgsl/MainHasFragCoordParameter.wgsl
[add] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/resources/sksl/wgsl/MainDoesNotHaveFragCoordParameter.sksl
[add] https://crrev.com/02888a6f0aabfb528884ef90276d686735112d09/resources/sksl/wgsl/MainHasFragCoordParameter.sksl

Git Watcher via monorail

unread,
May 18, 2022, 11:02:08 AM5/18/22
to bu...@skia.org

Comment #13 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c13


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/839a0b64fadb142e64a120571a8a33bae478235c

commit 839a0b64fadb142e64a120571a8a33bae478235c
Author: Arman Uguray <arma...@google.com>
Date: Wed May 11 16:59:26 2022

[sksl][wgsl] Field access and test for vertex stage builtins

* Added support for field access expressions, excluding user-defined
interface blocks.
* Added a test case for vertex stage builtin declarations.
* Added a NOP workaround for sk_PointSize which does not have a
WGSL/WebGPU equivalent.

Bug: skia:13092
Change-Id: I46fd7bb0a9fe55d2e3ed2b3b72f63376c1ed4f31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539082
Commit-Queue: Arman Uguray <arma...@google.com>
Reviewed-by: John Stiles <johns...@google.com>

[modify] https://crrev.com/839a0b64fadb142e64a120571a8a33bae478235c/gn/sksl_tests.gni
[modify] https://crrev.com/839a0b64fadb142e64a120571a8a33bae478235c/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[modify] https://crrev.com/839a0b64fadb142e64a120571a8a33bae478235c/src/sksl/codegen/BUILD.bazel
[add] https://crrev.com/839a0b64fadb142e64a120571a8a33bae478235c/resources/sksl/wgsl/BuiltinVertexStageIO.vert
[modify] https://crrev.com/839a0b64fadb142e64a120571a8a33bae478235c/src/sksl/codegen/SkSLWGSLCodeGenerator.h
[add] https://crrev.com/839a0b64fadb142e64a120571a8a33bae478235c/tests/sksl/wgsl/BuiltinVertexStageIO.wgsl

Git Watcher via monorail

unread,
Jun 2, 2022, 8:41:10 PM6/2/22
to bu...@skia.org

Comment #14 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c14


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/02031e67d014c6170839f95f217d408225a0c40a

commit 02031e67d014c6170839f95f217d408225a0c40a
Author: Arman Uguray <arma...@google.com>
Date: Wed Jun 01 03:56:16 2022

[sksl][wgsl] Support WGSL in SkSLMemoryLayout

- SkSLMemoryLayout now handles WGSL uniform and storage address space
memory alignment and size calculations.
- MemoryLayout::IsSupported is now an instance method that checks for
type support based on the specified language standard.
- Unit tests have been added for WGSL memory layout types.

Bug: skia:13092
Change-Id: I2fe161998a0b551ca7c3c1d118b6a8cc1ae95a5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/545398
Reviewed-by: John Stiles <johns...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/02031e67d014c6170839f95f217d408225a0c40a/src/sksl/SkSLMemoryLayout.h
[modify] https://crrev.com/02031e67d014c6170839f95f217d408225a0c40a/src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp
[modify] https://crrev.com/02031e67d014c6170839f95f217d408225a0c40a/src/sksl/codegen/SkSLSPIRVCodeGenerator.h
[modify] https://crrev.com/02031e67d014c6170839f95f217d408225a0c40a/tests/SkSLMemoryLayoutTest.cpp
[modify] https://crrev.com/02031e67d014c6170839f95f217d408225a0c40a/src/sksl/codegen/SkSLMetalCodeGenerator.cpp

arman… via monorail

unread,
Jan 3, 2023, 4:43:31 PM1/3/23
to bu...@skia.org
Updates:
Labels: Type-Feature

Comment #16 on issue 13092 by arma...@google.com: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c16


(No comment was entered for this change.)

arman… via monorail

unread,
Jan 3, 2023, 4:43:55 PM1/3/23
to bu...@skia.org
Updates:
Labels: Priority-High

Comment #17 on issue 13092 by arma...@google.com: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c17

Git Watcher via monorail

unread,
Jan 23, 2023, 10:50:12 AM1/23/23
to bu...@skia.org

Comment #18 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c18


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/9f09b754e15e33b7b01ff3feafae83f45899f1ab

commit 9f09b754e15e33b7b01ff3feafae83f45899f1ab
Author: Arman Uguray <arma...@google.com>
Date: Wed Jan 11 06:40:14 2023

[sksl][wgsl] Struct type and global variable declarations

Initial support for struct types and global module-private variable
declarations.

Also added code for array declarations to enable the Structs.sksl test
file. More array declaration tests will be added in a follow up.

Bug: skia:13092
Change-Id: If9d2127fc9150df031bb039accfd9803ed4875bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/628850

Reviewed-by: John Stiles <johns...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

Git Watcher via monorail

unread,
Jan 23, 2023, 10:19:09 PM1/23/23
to bu...@skia.org

Comment #19 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c19


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/028bc38fdcb23d536fb7e3122593b13f85015e19

commit 028bc38fdcb23d536fb7e3122593b13f85015e19
Author: Arman Uguray <arma...@google.com>
Date: Wed Jan 11 22:43:34 2023

[sksl][wgsl] Global GL-style uniforms

Add support for global GL-style uniforms. These only occur in
RuntimeEffect programs that are compiled as fragment programs via skslc
for gold-file tests. WGSL codegen now places all of these into a single
synthesized block at the default bind group and binding index. The
WGSL backend assumes that these won't coexist with a legitimate buffer
block or opaque resource uniform declaration that uses the same index,
which would lead to a bind-slot conflict and would not pass tint's
validation.

Bug: skia:13092
Change-Id: Iba198eb3ad56d3a60c2d980b9f2b450b22fc4255
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/628851

Commit-Queue: Arman Uguray <arma...@google.com>
Reviewed-by: John Stiles <johns...@google.com>

Git Watcher via monorail

unread,
Jan 24, 2023, 6:52:06 PM1/24/23
to bu...@skia.org

Comment #20 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c20


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/8ffd5c20d634df8b5050a08e30fa7d1ca8d27ef1

commit 8ffd5c20d634df8b5050a08e30fa7d1ca8d27ef1
Author: Arman Uguray <arma...@google.com>
Date: Thu Jan 12 03:11:00 2023

[sksl][wgsl] Support for trivial ternary expressions

WGSL does not have ternary expressions. The most trivial cases, which
have no side-effects (and can safely be evaluated without
short-circuiting) and evaluate to a scalar or vector can be translated
to a call to the "select" intrinsic, which is what this CL implements.

All other situations need more sophisticated handling in which any
ternary expressions need to be hoisted out as an if-else statement in
the immediately surrounding block, which will be implemented later.

Bug: skia:13092
Change-Id: I0101e4d3199a9f2bb72038d9ba153ef33f551ac8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/628852

Reviewed-by: John Stiles <johns...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

Git Watcher via monorail

unread,
Jan 26, 2023, 3:04:11 PM1/26/23
to bu...@skia.org

Comment #21 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c21


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/5726b4686378c8bfa8269ddb520aac3ac80e1ed4

commit 5726b4686378c8bfa8269ddb520aac3ac80e1ed4
Author: Arman Uguray <arma...@google.com>
Date: Thu Jan 12 06:48:29 2023

[sksl][wgsl] Function call expressions with no out-params

Add support for function call expressions. References to pipeline stage
input and output variables via argument injection is supported.
Semantically correct out-parameter support is not yet implemented.

Bug: skia:13092
Change-Id: Ide17c508debfcc3e940f9b3a18588d99012a0a93
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/628853

Reviewed-by: John Stiles <johns...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

Git Watcher via monorail

unread,
Jan 26, 2023, 9:00:12 PM1/26/23
to bu...@skia.org

Git Watcher via monorail

unread,
Feb 17, 2023, 5:57:10 PM2/17/23
to bu...@skia.org

Comment #23 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c23


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/deb1cf8d127986fee464946a12b248d6f17fb629

commit deb1cf8d127986fee464946a12b248d6f17fb629
Author: Arman Uguray <arma...@google.com>
Date: Thu Jan 12 22:04:49 2023

[sksl][wgsl] Implement GLSL out-parameter semantics

Implemented out-parameter indirection to support GLSL semantics. The
code here is very similar to the Metal codegen implementation with some
differences. The main distinction is that WGSL out-parameters are
emulated using pointers as opposed to MSL's C++-style reference types.
This requires careful handling of certain cases as WGSL pointers have
several restrictions.

Notably, the following situations are currently not supported and will
be addressed in follow-up CLs:

1. Passing a pipeline I/O parameter (e.g. sk_FragColor) as an
out-parameter. The code currently does not handle synthesized
parameter struct indirection and an expression such as
`&(*_stageOut).sk_FragColor` is not supported in WGSL as it is in
Metal. This is because WGSL does not support taking the address of a
struct component.
2. Passing a module-private or workgroup variable as an out-parameter
is not yet implemented (this requires pointer declarations with the
private and workgroup address space decoration).
3. Passing a swizzle as an out-parameter is not yet supported. While the
code has some handling for this, it won't generate correct code since
WGSL does not permit assignments (or taking the address of) swizzles
(see discussion on https://github.com/gpuweb/gpuweb/issues/737). This
will be implemented as part of general lhs swizzle assignment.

Bug: skia:13092

Change-Id: I26e107241bd4b511b4321011da3bf103992fc091
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/628855

Commit-Queue: Arman Uguray <arma...@google.com>
Reviewed-by: John Stiles <johns...@google.com>

[add] https://crrev.com/deb1cf8d127986fee464946a12b248d6f17fb629/resources/sksl/wgsl/OutParams.sksl
[modify] https://crrev.com/deb1cf8d127986fee464946a12b248d6f17fb629/gn/sksl_tests.gni
[modify] https://crrev.com/deb1cf8d127986fee464946a12b248d6f17fb629/resources/sksl/BUILD.bazel
[modify] https://crrev.com/deb1cf8d127986fee464946a12b248d6f17fb629/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[add] https://crrev.com/deb1cf8d127986fee464946a12b248d6f17fb629/tests/sksl/shared/InoutParamsAreDistinct.wgsl
[add] https://crrev.com/deb1cf8d127986fee464946a12b248d6f17fb629/tests/sksl/shared/InoutParameters.wgsl
[add] https://crrev.com/deb1cf8d127986fee464946a12b248d6f17fb629/tests/sksl/shared/OutParamsAreDistinct.wgsl
[modify] https://crrev.com/deb1cf8d127986fee464946a12b248d6f17fb629/src/sksl/codegen/SkSLWGSLCodeGenerator.h
[add] https://crrev.com/deb1cf8d127986fee464946a12b248d6f17fb629/tests/sksl/wgsl/OutParams.wgsl

Git Watcher via monorail

unread,
Feb 17, 2023, 6:15:06 PM2/17/23
to bu...@skia.org

Git Watcher via monorail

unread,
Feb 17, 2023, 6:51:10 PM2/17/23
to bu...@skia.org

Comment #25 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c25


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/733a19f6a625420d8797eafd773f4e293641166e

commit 733a19f6a625420d8797eafd773f4e293641166e
Author: Arman Uguray <arma...@google.com>
Date: Thu Jan 26 00:48:33 2023

[sksl][wgsl] Correctly handle vector equality operator

In WGSL, the equality and inequality operators (==, !=) are
component-wise and result in a vector when applied to vector arguments.
In SkSL the result needs to be converted to a boolean when the
expression needs to evaluate to a boolean.

This is now done for vectors using the all() and any() intrinsics.

Bug: skia:13092
Change-Id: I3377e06ad0703cad38fb11447001a500ebe5ed54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/631168

Reviewed-by: John Stiles <johns...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[add] https://crrev.com/733a19f6a625420d8797eafd773f4e293641166e/resources/sksl/wgsl/Equality.sksl
[modify] https://crrev.com/733a19f6a625420d8797eafd773f4e293641166e/tests/sksl/shared/TernaryExpression.glsl
[modify] https://crrev.com/733a19f6a625420d8797eafd773f4e293641166e/tests/sksl/shared/TernaryExpression.hlsl
[modify] https://crrev.com/733a19f6a625420d8797eafd773f4e293641166e/tests/sksl/shared/TernaryExpression.asm.frag
[modify] https://crrev.com/733a19f6a625420d8797eafd773f4e293641166e/tests/sksl/shared/TernaryExpression.skrp
[modify] https://crrev.com/733a19f6a625420d8797eafd773f4e293641166e/gn/sksl_tests.gni
[modify] https://crrev.com/733a19f6a625420d8797eafd773f4e293641166e/resources/sksl/shared/TernaryExpression.sksl
[modify] https://crrev.com/733a19f6a625420d8797eafd773f4e293641166e/resources/sksl/BUILD.bazel
[modify] https://crrev.com/733a19f6a625420d8797eafd773f4e293641166e/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[add] https://crrev.com/733a19f6a625420d8797eafd773f4e293641166e/tests/sksl/wgsl/Equality.wgsl
[modify] https://crrev.com/733a19f6a625420d8797eafd773f4e293641166e/tests/sksl/shared/TernaryExpression.metal
[modify] https://crrev.com/733a19f6a625420d8797eafd773f4e293641166e/tests/sksl/shared/TernaryExpression.wgsl

Git Watcher via monorail

unread,
Feb 17, 2023, 8:23:11 PM2/17/23
to bu...@skia.org

Comment #26 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c26


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/4e938aedf1f296c18dece1276dc54ba882fa72c2

commit 4e938aedf1f296c18dece1276dc54ba882fa72c2
Author: Arman Uguray <arma...@google.com>
Date: Thu Jan 26 05:54:32 2023

[sksl][wgsl] Matrix type and index expressions

* Support matrix type declarations
* Support array index expressions.
* Enable the shared/OutParamsFunctionCallInArgument.sksl for WGSL now
that index expressions are supported.

Bug: skia:13092
Change-Id: I4a17c199ad4584941d9e7ae0d5d3d198b55e9cf3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/631169

Reviewed-by: John Stiles <johns...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/4e938aedf1f296c18dece1276dc54ba882fa72c2/gn/sksl_tests.gni
[modify] https://crrev.com/4e938aedf1f296c18dece1276dc54ba882fa72c2/resources/sksl/BUILD.bazel
[modify] https://crrev.com/4e938aedf1f296c18dece1276dc54ba882fa72c2/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[add] https://crrev.com/4e938aedf1f296c18dece1276dc54ba882fa72c2/resources/sksl/wgsl/IndexExpression.sksl
[modify] https://crrev.com/4e938aedf1f296c18dece1276dc54ba882fa72c2/tests/sksl/wgsl/Equality.wgsl
[modify] https://crrev.com/4e938aedf1f296c18dece1276dc54ba882fa72c2/resources/sksl/wgsl/Equality.sksl
[add] https://crrev.com/4e938aedf1f296c18dece1276dc54ba882fa72c2/tests/sksl/wgsl/IndexExpression.wgsl
[add] https://crrev.com/4e938aedf1f296c18dece1276dc54ba882fa72c2/tests/sksl/shared/OutParamsFunctionCallInArgument.wgsl
[modify] https://crrev.com/4e938aedf1f296c18dece1276dc54ba882fa72c2/src/sksl/codegen/SkSLWGSLCodeGenerator.h
[modify] https://crrev.com/4e938aedf1f296c18dece1276dc54ba882fa72c2/resources/sksl/shared/OutParamsFunctionCallInArgument.sksl

Git Watcher via monorail

unread,
Feb 18, 2023, 2:57:10 AM2/18/23
to bu...@skia.org

Comment #27 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c27


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/165ec70ddb7f9d1a5a925efb62585971caa43c6a

commit 165ec70ddb7f9d1a5a925efb62585971caa43c6a
Author: Arman Uguray <arma...@google.com>
Date: Thu Jan 26 07:08:45 2023

[sksl][wgsl] Support diagonal matrix constructor

The one-arg diagonal matrix constructor is now implemented as a
synthesized helper function using construction-by-elements.

Bug: skia:13092
Change-Id: I3409dda9d4bfa0a7c7afca958eb5b3b03d4d75d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/631171

Reviewed-by: John Stiles <johns...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

Git Watcher via monorail

unread,
Feb 18, 2023, 2:58:09 AM2/18/23
to bu...@skia.org

Comment #28 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c28


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/935e20f3d1a53b7e390e9aaf513b702b92a9fc22

commit 935e20f3d1a53b7e390e9aaf513b702b92a9fc22
Author: Arman Uguray <arma...@google.com>
Date: Thu Jan 26 07:33:17 2023

[sksl][wgsl] Support float4(mat2x2) cast

SkSL allows a vec4 to be constructed from a 2x2 matrix but WGSL does
not. Implement this vector compound constructor as a synthesized helper
function.

Bug: skia:13092
Change-Id: I617824f0ca34e48dff5bfa00205a5bb2c5438d10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/631172

Reviewed-by: John Stiles <johns...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

etien… via monorail

unread,
Mar 13, 2023, 12:21:14 PM3/13/23
to bu...@skia.org

Comment #30 on issue 13092 by etien...@gmail.com: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c30

When will we get full support for WGSL?

I modified Skia's dawn implementation to compile to WGSL instead of SPIRV, it does run but the generated WGSL is full of errors which prevents Skia from running properly.

Any chance to get this running soon?

johns… via monorail

unread,
Mar 13, 2023, 1:19:26 PM3/13/23
to bu...@skia.org

Comment #31 on issue 13092 by johns...@google.com: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c31

"I modified Skia's dawn implementation to compile to WGSL instead of SPIRV" -- what specifically did you try?

"it does run but the generated WGSL is full of errors" -- if you used our WGSL code generator, it is still a work in progress and missing a lot of basic features. e.g. true ternary expressions don't exist in WGSL; we will need to simulate them, and that code isn't written yet. So it's not expected to be functional for even basic shaders yet.

If you did something else, what did you try?

etien… via monorail

unread,
Mar 13, 2023, 3:09:08 PM3/13/23
to bu...@skia.org

Comment #32 on issue 13092 by etien...@gmail.com: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c32


>> "what specifically did you try?"

In GrDawnGpu.cpp I created the following method:

std::string GrDawnGpu::SkSLToWGSL(const char* shaderString,
SkSL::ProgramKind kind,
uint32_t rtFlipOffset,
SkSL::Program::Inputs* inputs)

which calls "this->shaderCompiler()->toWGSL" instead of ".toSPIRV()"

The toWGSL() from the SkSLCompiler takes an OutputStream reference so I also created a new method that takes a string reference output like for the toSPIRV():


bool toWGSL(Program& program, std::string* out);





I modify GrDawnProgramBuilder.cpp to

wgpu::ShaderModule GrDawnProgramBuilder::createShaderModule


Finally in GrDawnProgramBuilder.cpp, in the createShaderModule function (wgpu::ShaderModule GrDawnProgramBuilder::createShaderModule), I changed:

std::string spirvSource = fGpu->SkSLToSPIRV(source.c_str(),
kind,
fUniformHandler.getRTFlipOffset(),
inputs);

to


std::string wgslSource = fGpu->SkSLToWGSL(source.c_str(),
kind,
fUniformHandler.getRTFlipOffset(),
inputs);

Recompiling skia allows me to run dawn with skia and wgsl shader modules but I get a bunch of WGSL shader syntax errors.
After seeing this thread I realized that the support was still in progress.
However since SPIRV is not part of the official WebGPU specs (and disabled in the latest Chromium build from v113) I would like to use WGSL.

>> "So it's not expected to be functional for even basic shaders yet."

Do you have a roadmap for WGSL + Skia? Do you believe that this will happen in H1 of 2023?

Any way to get a basic working version of Skia without advanced shader features even if the outputted WGSL shaders are not pretty nor optimized?

arman… via monorail

unread,
Mar 13, 2023, 5:32:22 PM3/13/23
to bu...@skia.org

Comment #33 on issue 13092 by arma...@google.com: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c33

IIUC you need WGSL support to target WebGPU via WASM, correct? WGSL support is on our roadmap to finish this year but we do not have a hard-set date for completion.

Git Watcher via monorail

unread,
Mar 14, 2023, 8:06:11 PM3/14/23
to bu...@skia.org

Comment #34 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c34


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/4d90ba479527e1bcbb629eeef82207ee4e051201

commit 4d90ba479527e1bcbb629eeef82207ee4e051201
Author: Arman Uguray <arma...@google.com>
Date: Thu Jan 26 08:01:15 2023

[sksl][wgsl] Implement matrix constructors

Implemented all matrix constructor variants and overloads in terms of
WGSL matrix constructors via synthesized helper functions.

Much of this logic was borrowed from the Metal code generator which
has to deal with a very similar argument shuffling scheme.

Bug: skia:13092
Change-Id: Ic070c968dd97148d09cf13e412ae2b2ecd6590a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/631173

Reviewed-by: John Stiles <johns...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/tests/sksl/wgsl/CastMat2x2ToMat3x3.wgsl
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/tests/sksl/wgsl/CastVec4ToMat2x2.wgsl
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/tests/sksl/shared/UniformMatrixResize.wgsl
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/tests/sksl/wgsl/CastMat4x4ToMat4x3.wgsl
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/tests/sksl/wgsl/CastMat4x4ToMat3x4.wgsl
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/tests/sksl/wgsl/CastMat2x3ToMat4x4.wgsl
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/tests/sksl/shared/MatrixConstructorsES2.wgsl
[modify] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/gn/sksl_tests.gni
[modify] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/resources/sksl/BUILD.bazel
[modify] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/resources/sksl/wgsl/CastMat2x2ToMat3x3.sksl
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/resources/sksl/wgsl/CastMat4x4ToMat3x4.sksl
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/resources/sksl/wgsl/CastMat2x3ToMat4x4.sksl
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/resources/sksl/wgsl/CastVec4ToMat2x2.sksl
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/resources/sksl/wgsl/Matrices.sksl
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/resources/sksl/wgsl/CastMat4x4ToMat4x3.sksl
[modify] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/src/sksl/codegen/SkSLWGSLCodeGenerator.h
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/tests/sksl/shared/MatrixConstructorsES3.wgsl
[add] https://crrev.com/4d90ba479527e1bcbb629eeef82207ee4e051201/tests/sksl/wgsl/Matrices.wgsl

etien… via monorail

unread,
Apr 3, 2023, 11:41:05 PM4/3/23
to bu...@skia.org

Comment #35 on issue 13092 by etien...@gmail.com: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c35


> you need WGSL support to target WebGPU via WASM

Yes that’s correct, it runs great using emscripten and through spirv but broken since chromium 113, probably spirv got disabled for the official release of webGPU.

Thanks for the update

Git Watcher via monorail

unread,
May 2, 2023, 11:16:15 PM5/2/23
to bu...@skia.org

Comment #36 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c36


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9

commit 8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9
Author: Arman Uguray <arma...@google.com>
Date: Thu Jan 26 20:32:08 2023

[sksl][wgsl] Prefix expressions and matrix equality test

Support for prefix expression allowed by WGSL (unary ! and -). This
also allows the shared/MatrixEquality.sksl test to be enabled.

Bug: skia:13092
Change-Id: I5e1002bb4643d24042f10d8422797feda8e225e4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/634676

Commit-Queue: Arman Uguray <arma...@google.com>
Reviewed-by: John Stiles <johns...@google.com>

[add] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/tests/sksl/shared/PrefixExpressions.skrp
[add] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/tests/sksl/shared/MatrixEquality.wgsl
[add] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/tests/sksl/shared/PrefixExpressions.glsl
[add] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/tests/sksl/shared/UnaryPositiveNegative.wgsl
[add] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/tests/sksl/shared/PrefixExpressions.asm.frag
[add] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/tests/sksl/shared/PrefixExpressions.hlsl
[add] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/resources/sksl/shared/PrefixExpressions.sksl
[modify] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/gn/sksl_tests.gni
[add] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/tests/sksl/shared/PrefixExpressions.wgsl
[modify] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/resources/sksl/BUILD.bazel
[modify] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[modify] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/src/sksl/codegen/SkSLWGSLCodeGenerator.h
[add] https://crrev.com/8bb2d7b6f9989ccb75fd5947c69262a3bc9147d9/tests/sksl/shared/PrefixExpressions.metal

johns… via monorail

unread,
May 18, 2023, 12:40:14 PM5/18/23
to bu...@skia.org
Updates:
Owner: johns...@google.com

Comment #37 on issue 13092 by johns...@google.com: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c37


(No comment was entered for this change.)

Git Watcher via monorail

unread,
Jun 3, 2023, 1:40:12 PM6/3/23
to bu...@skia.org

Git Watcher via monorail

unread,
Jun 6, 2023, 6:35:17 PM6/6/23
to bu...@skia.org

Comment #39 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c39


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/2f2e4a228723392f2b5fadb23b2fa06b5436e014

commit 2f2e4a228723392f2b5fadb23b2fa06b5436e014
Author: John Stiles <johns...@google.com>
Date: Tue Jun 06 20:08:03 2023

Add WGSL support for do-while loops.

These can be implemented pretty naturally as a WGSL loop {}
construct. Most do-while tests now pass, but a few do not, because
WGSL is unable to detect unconditional returns within a loop body.
This causes some valid SkSL tests to fail in WGSL with a "missing
return at end of function" error. This will be fixed in a followup.

Example test breakages:
https://paste.googleplex.com/5519253959606272
https://paste.googleplex.com/6640317599055872

Bug: skia:13092
Change-Id: I72eec654e9a03e506dce1b4419590bba2290e4bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/708376

Auto-Submit: John Stiles <johns...@google.com>
Reviewed-by: Arman Uguray <arma...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/2f2e4a228723392f2b5fadb23b2fa06b5436e014/gn/sksl_tests.gni
[add] https://crrev.com/2f2e4a228723392f2b5fadb23b2fa06b5436e014/tests/sksl/shared/DoWhileControlFlow.wgsl
[modify] https://crrev.com/2f2e4a228723392f2b5fadb23b2fa06b5436e014/resources/sksl/BUILD.bazel
[modify] https://crrev.com/2f2e4a228723392f2b5fadb23b2fa06b5436e014/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[add] https://crrev.com/2f2e4a228723392f2b5fadb23b2fa06b5436e014/tests/sksl/shared/EmptyBlocksES2.wgsl
[add] https://crrev.com/2f2e4a228723392f2b5fadb23b2fa06b5436e014/tests/sksl/shared/DeadDoWhileLoop.wgsl
[add] https://crrev.com/2f2e4a228723392f2b5fadb23b2fa06b5436e014/tests/sksl/inliner/DoWhileTestCannotBeInlined.wgsl
[modify] https://crrev.com/2f2e4a228723392f2b5fadb23b2fa06b5436e014/src/sksl/codegen/SkSLWGSLCodeGenerator.h
[add] https://crrev.com/2f2e4a228723392f2b5fadb23b2fa06b5436e014/tests/sksl/shared/DeadReturn.wgsl
[add] https://crrev.com/2f2e4a228723392f2b5fadb23b2fa06b5436e014/tests/sksl/shared/EmptyBlocksES3.wgsl

johns… via monorail

unread,
Jun 8, 2023, 3:53:29 PM6/8/23
to bu...@skia.org

Comment #40 on issue 13092 by johns...@google.com: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c40

Issue 13805 has been merged into this issue.

Git Watcher via monorail

unread,
Jun 14, 2023, 4:09:06 PM6/14/23
to bu...@skia.org

Comment #41 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c41


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/f26e786d4944a81c9f2367396dafe455dae77f84

commit f26e786d4944a81c9f2367396dafe455dae77f84
Author: John Stiles <johns...@google.com>
Date: Wed Jun 14 18:30:38 2023

Add WGSL support for switches that have fallthrough cases.

When groups of case-blocks can fall through, we use chained if-else
blocks to emulate the behavior of SkSL's switch. This generates a
few extra comparisons, but allows us to preserve full SkSL semantics
without adding very much extra complexity to the final shader.

Bug: skia:13092
Change-Id: Ie56045d6c92f45ee546d135b4ea40060856894af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/710816
Commit-Queue: John Stiles <johns...@google.com>

Auto-Submit: John Stiles <johns...@google.com>
Reviewed-by: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/f26e786d4944a81c9f2367396dafe455dae77f84/tests/sksl/shared/SwitchWithEarlyReturn.wgsl
[modify] https://crrev.com/f26e786d4944a81c9f2367396dafe455dae77f84/tests/sksl/shared/SwitchWithLoopsES3.wgsl
[modify] https://crrev.com/f26e786d4944a81c9f2367396dafe455dae77f84/tests/sksl/shared/SwitchWithFallthrough.asm.frag
[modify] https://crrev.com/f26e786d4944a81c9f2367396dafe455dae77f84/tests/sksl/shared/SwitchWithFallthrough.glsl
[modify] https://crrev.com/f26e786d4944a81c9f2367396dafe455dae77f84/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[modify] https://crrev.com/f26e786d4944a81c9f2367396dafe455dae77f84/tests/sksl/shared/SwitchWithFallthroughAndVarDecls.wgsl
[modify] https://crrev.com/f26e786d4944a81c9f2367396dafe455dae77f84/tests/sksl/shared/SwitchWithLoops.wgsl
[modify] https://crrev.com/f26e786d4944a81c9f2367396dafe455dae77f84/src/sksl/codegen/SkSLWGSLCodeGenerator.h
[modify] https://crrev.com/f26e786d4944a81c9f2367396dafe455dae77f84/tests/sksl/shared/SwitchWithFallthroughStandaloneSettings.glsl
[modify] https://crrev.com/f26e786d4944a81c9f2367396dafe455dae77f84/tests/sksl/shared/SwitchWithFallthrough.wgsl
[modify] https://crrev.com/f26e786d4944a81c9f2367396dafe455dae77f84/resources/sksl/shared/SwitchWithFallthrough.sksl

Git Watcher via monorail

unread,
Jun 14, 2023, 4:09:09 PM6/14/23
to bu...@skia.org

Comment #42 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c42


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/1774610ff247679226ca4286593e847224023a9c

commit 1774610ff247679226ca4286593e847224023a9c
Author: John Stiles <johns...@google.com>
Date: Wed Jun 14 18:28:58 2023

Add WGSL support for switches that do not have fallthrough cases.

The WGSL code generator now supports switch statements as long as
no cases fall through. We mirror WGSL's native abilities and
emit a comma-separated list of switch-case values when multiple
`case X:` statements are placed back-to-back. We currently tack on
a comment indicating the cases that were not handled due to
fallthrough.

In a followup CL, the non-native cases will be emulated via
if-else statements. This will mimic the rewrite-switches mode
in the GLSL code generator, but we will only rewrite the cases
that actually violate the WGSL switch rules (either by falling
through, or by being fallen-into).

Bug: skia:13092
Change-Id: I9c61399a9573a2bc57510fd4bee994f4312894f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/710257
Reviewed-by: Brian Osman <brian...@google.com>
Reviewed-by: Arman Uguray <arma...@google.com>

[add] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/tests/sksl/shared/SwitchWithFallthroughAndVarDecls.wgsl
[add] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/tests/sksl/shared/SwitchDefaultOnly.wgsl
[add] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/tests/sksl/shared/SwitchWithLoops.wgsl
[modify] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/gn/sksl_tests.gni
[modify] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/resources/sksl/BUILD.bazel
[modify] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/src/sksl/analysis/SkSLSwitchCaseContainsExit.cpp
[add] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/tests/sksl/shared/SwitchWithEarlyReturn.wgsl
[add] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/tests/sksl/shared/SwitchWithLoopsES3.wgsl
[modify] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[modify] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/src/sksl/SkSLAnalysis.h
[modify] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/src/sksl/codegen/SkSLWGSLCodeGenerator.h
[add] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/tests/sksl/shared/Switch.wgsl
[add] https://crrev.com/1774610ff247679226ca4286593e847224023a9c/tests/sksl/shared/SwitchWithFallthrough.wgsl

Git Watcher via monorail

unread,
Jun 27, 2023, 11:21:07 AM6/27/23
to bu...@skia.org

Comment #43 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c43


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/412993390e78a1f4aa09b54120a69877326c69ba

commit 412993390e78a1f4aa09b54120a69877326c69ba
Author: John Stiles <johns...@google.com>
Date: Tue Jun 27 14:00:35 2023

Enable all shared tests in WGSL.

We can now compile all of the shared and intrinsic tests in WGSL.
Some of the tests generate incorrect code, because e.g. they rely on
features which we don't support in WGSL yet (like ES3+ intrinsics),
but the majority appear to be correct.

Change-Id: Ib13e2c1566d951bdadbf676605e81a8e4574ee65
Bug: skia:13092
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/716999
Reviewed-by: Chris Mumford <cmum...@google.com>

Commit-Queue: John Stiles <johns...@google.com>
Auto-Submit: John Stiles <johns...@google.com>

[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Sinh.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/FunctionReturnTypeMatch.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz36852.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/IntBitsToFloat.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Atanh.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/TernaryAsLValueFoldableTest.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/DeadStripFunctions.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/TernarySideEffects.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/realistic/GaussianBlur.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/InterfaceBlockNamedArray.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz37677.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Clockwise.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/SampleLod.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Cosh.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/DependentInitializers.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/FloatBitsToUint.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/RoundEven.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Determinant.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/DFdyNoRTFlip.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ReturnBadTypeFromMain.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Hex.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StaticSwitchWithBreak.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/OperatorsES3.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz58483.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz26167.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Texture2D.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/MatrixScalarMath.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz37900.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/VectorScalarMath.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/FragCoords.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz50636.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/UintBitsToFloat.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/PackSnorm2x16.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/UniformArray.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/FloatBitsToInt.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/GeometricIntrinsics.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz28794.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz37466.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ForLoopControlFlow.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/FunctionPrototype.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/HexUnsigned.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/NoFragCoordsPosRT.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/FindLSB.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/FindMSB.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz29085.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Tanh.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Ldexp.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StructMaxDepth.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ScopedSymbol.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/IsInf.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/OperatorsES2.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Pack.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ReturnsValueOnEveryPathES3.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/DeadIfStatement.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz28904.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/FunctionParametersOfTextureAndSamplerType.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StackingVectorCasts.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/MatrixOpEqualsES3.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/DFdx.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/DerivativesUnused.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/CrossNoInline.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/MultipleAssignments.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Round.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/UniformBuffers.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/NumberConversions.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/CastsRoundTowardZero.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/FragCoordsNoRTFlip.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StaticSwitchWithConditionalBreak.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ConstVariableComparison.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StaticSwitchWithFallthroughB.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ResizeMatrix.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ConstantCompositeAccessViaConstantIndex.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz36770.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/RectangleTexture.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Frexp.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StaticSwitch.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ResizeMatrixNonsquare.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/MatrixSwizzleStore.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ArrayNarrowingConversions.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Saturate.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ScalarConversionConstructorsES3.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/SampleLocations.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Inverse.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/InterfaceBlockNamed.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Octal.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/MatrixOpEqualsES2.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz60077.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/NumberCasts.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Trunc.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Offset.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/TextureSharpen.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz29494.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/OuterProduct.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ReturnColorFromMain.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Sample.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StorageBuffer.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz26759.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/PackUnorm2x16.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StaticSwitchWithStaticConditionalBreak.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/PackHalf2x16.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Ossfuzz41000.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StaticSwitchWithBreakInsideBlock.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/NoFragCoordsPos.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/BitCount.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ScalarConversionConstructorsES2.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/FunctionArgTypeMatch.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Functions.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/MatricesNonsquare.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/DFdy.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/DeadGlobals.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Caps.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/DoubleNegation.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StaticSwitchWithConditionalBreakInsideBlock.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Transpose.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/TemporaryIndexLookup.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StaticSwitchWithFallthroughA.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ClockwiseNoRTFlip.wgsl
[modify] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/resources/sksl/BUILD.bazel
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/DeadLoopVariable.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/SampleGrad.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/InterfaceBlockBuffer.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Modf.wgsl
[modify] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/bazel/exporter/gni_exporter.go
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ConstantCompositeAccessViaDynamicIndex.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/CompileTimeConstantVariables.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StaticSwitchWithStaticConditionalBreakInsideBlock.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/TernaryAsLValueEntirelyFoldable.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/Overflow.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Unpack.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Fma.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Acosh.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/VectorToMatrixCast.wgsl
[modify] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/gn/sksl_tests.gni
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/MatrixToVectorCast.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/NormalizationVert.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/IsNan.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/ComplexDelete.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Fwidth.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/intrinsics/Asinh.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/StorageBufferVertex.wgsl
[add] https://crrev.com/412993390e78a1f4aa09b54120a69877326c69ba/tests/sksl/shared/InterfaceBlockMultipleAnonymous.wgsl

Git Watcher via monorail

unread,
Jun 27, 2023, 2:53:05 PM6/27/23
to bu...@skia.org

Comment #44 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c44


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/8259f235fc2f96c5c49b22faf586201413bcffc2

commit 8259f235fc2f96c5c49b22faf586201413bcffc2
Author: John Stiles <johns...@google.com>
Date: Tue Jun 27 17:16:54 2023

Remove DUMP_SRC_IR macro from WGSL code generator.

The WGSL code generator now supports all the standard IR objects and
doesn't need an IR dumping gadget.

Bug: skia:13092
Change-Id: Ie2995c3e6352680ad033574c77458bf9f3661505
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/717157
Commit-Queue: John Stiles <johns...@google.com>
Reviewed-by: Nicolette Prevost <nicol...@google.com>
Auto-Submit: John Stiles <johns...@google.com>

[modify] https://crrev.com/8259f235fc2f96c5c49b22faf586201413bcffc2/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp

Git Watcher via monorail

unread,
Jul 20, 2023, 5:28:08 PM7/20/23
to bu...@skia.org

Comment #45 on issue 13092 by Git Watcher: WGSL support for SkSL
https://bugs.chromium.org/p/skia/issues/detail?id=13092#c45


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/6e84fed6d46756739c4cc6b18f29cf6e447289ce

commit 6e84fed6d46756739c4cc6b18f29cf6e447289ce
Author: John Stiles <johns...@google.com>
Date: Thu Jul 20 20:44:38 2023

Add WGSL support for uniforms inside interface blocks.

Previously, we only supported uniforms at global scope (like in a
golden test) and uniforms inside of interface blocks were ignored.

Bug: skia:13092
Change-Id: I279ae3b3a48d63d84c237cbd1017014af2817d58
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/725558
Auto-Submit: John Stiles <johns...@google.com>
Commit-Queue: John Stiles <johns...@google.com>
Reviewed-by: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/6e84fed6d46756739c4cc6b18f29cf6e447289ce/gn/sksl_tests.gni
[modify] https://crrev.com/6e84fed6d46756739c4cc6b18f29cf6e447289ce/tests/sksl/shared/UniformBuffers.wgsl
[modify] https://crrev.com/6e84fed6d46756739c4cc6b18f29cf6e447289ce/resources/sksl/BUILD.bazel
[add] https://crrev.com/6e84fed6d46756739c4cc6b18f29cf6e447289ce/resources/sksl/wgsl/InterfaceBlockUniforms.sksl
[modify] https://crrev.com/6e84fed6d46756739c4cc6b18f29cf6e447289ce/tests/sksl/shared/InterfaceBlockNamed.wgsl
[modify] https://crrev.com/6e84fed6d46756739c4cc6b18f29cf6e447289ce/src/sksl/codegen/SkSLWGSLCodeGenerator.cpp
[modify] https://crrev.com/6e84fed6d46756739c4cc6b18f29cf6e447289ce/tests/sksl/realistic/GaussianBlur.wgsl
[modify] https://crrev.com/6e84fed6d46756739c4cc6b18f29cf6e447289ce/src/sksl/codegen/SkSLWGSLCodeGenerator.h
[modify] https://crrev.com/6e84fed6d46756739c4cc6b18f29cf6e447289ce/tests/sksl/shared/InterfaceBlockMultipleAnonymous.wgsl
[modify] https://crrev.com/6e84fed6d46756739c4cc6b18f29cf6e447289ce/tests/sksl/shared/InterfaceBlockNamedArray.wgsl
[add] https://crrev.com/6e84fed6d46756739c4cc6b18f29cf6e447289ce/tests/sksl/wgsl/InterfaceBlockUniforms.wgsl
Reply all
Reply to author
Forward
0 new messages