dawn-cmake/test/intrinsics/gen
Stephen White f9b8b6104d GLSL: implement CombineSamplers transform (string version).
This transform converts all separate texture/sampler references
in a program into combined texture/samplers. This is required for GLSL,
which does not support separate texture/samplers.

As input, the transform requires a map from the unique sampler/texture
pairs previously gathered by the Resolver to strings, which will be
used as the names of the newly-generated combined samplers. Note that
binding points are unused by GLSL, and so are set to (0, 0) with
collision detection disabled.

All function signatures containing textures or samplers are rewritten,
as well as function calls and texture intrinsic calls. For texture
intrinsic calls, a placeholder sampler is used to satisfy the subsequent
Resolver pass (GLSL texture intrinsics do not require a separate sampler,
but WGSL intrinsics do). The placeholder is also used if the shader
contains only texture references (e.g., textureLoad).

Bug: tint:1366

Change-Id: Iff8407d28fdc2a8adac5cb655707a08c8553c389
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/77080
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-01-24 17:17:22 +00:00
..
abs wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
acos wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
all wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
any wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
arrayLength wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
asin wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atan wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atan2 wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atomicAdd wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atomicAnd wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atomicCompareExchangeWeak wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atomicExchange wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atomicLoad wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atomicMax wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atomicMin wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atomicOr wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atomicStore wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atomicSub wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
atomicXor wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
ceil wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
clamp wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
cos wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
cosh wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
countOneBits wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
cross wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
degrees wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
determinant wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
distance wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
dot wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
dpdx wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
dpdxCoarse wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
dpdxFine wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
dpdy wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
dpdyCoarse wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
dpdyFine wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
exp wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
exp2 wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
faceForward wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
floor wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
fma wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
fract wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
frexp wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
fwidth wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
fwidthCoarse wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
fwidthFine wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
ignore GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
inverseSqrt wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
isFinite wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
isInf wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
isNan wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
isNormal wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
ldexp wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
length wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
log wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
log2 wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
max wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
min wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
mix wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
modf wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
normalize wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
pack2x16float wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
pack2x16snorm wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
pack2x16unorm wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
pack4x8snorm wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
pack4x8unorm wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
pow wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
radians wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
reflect wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
refract wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
reverseBits wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
round wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
select wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
sign wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
sin wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
sinh wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
smoothStep wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
sqrt wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
step wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
storageBarrier wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
tan wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
tanh wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
textureDimensions GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureGather GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureGatherCompare GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureLoad GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureNumLayers GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureNumLevels GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureNumSamples GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureSample GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureSampleBias GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureSampleCompare GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureSampleCompareLevel GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureSampleGrad GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureSampleLevel GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
textureStore GLSL: implement CombineSamplers transform (string version). 2022-01-24 17:17:22 +00:00
transpose wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
trunc wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
unpack2x16float wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
unpack2x16snorm wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
unpack2x16unorm wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
unpack4x8snorm wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
unpack4x8unorm wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
workgroupBarrier wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00