[sksl] Apply duplicate binding check only to interface blocks
Initial work on compute shaders introduced a check for duplicate
binding indices assigned via the `set` and `binding` layout modifiers.
This check only applies to global variable declarations since compute
shaders currently do not support blocks. In preparation for buffer backed
block support in compute shaders, this check needs to also applies to
interface blocks.
The original intention of this CL was to extend the check to all
global-scope resource declarations where a binding index is allowed.
This is currently difficult because it is possible for binding indices to
overlap across textures/samplers and blocks in SkSL generated by graphite.
Making the check universal causes several tests and graphite
functionality to fail.
This CL changes the duplicate check to apply only to interface blocks.
This enables the usage of block syntax in compute shaders without having
to remove the checks altogether until there is a unified story for
handling duplicate binding indices across all backends.
Bug: skia:13664
Change-Id: I5ff247bb7c1748eb2a3e17ffe1de7c1468773bd0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/570138
Commit-Queue: Arman Uguray <armansito@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
6 files changed