dawn-cmake/test/builtins/gen
Stephen White d9b32c3178 GLSL: fix textureLoad() and textureStore(), depth textures, and more.
The CombineSamplers transform was incorrectly flagging StorageTexture
(which in GLSL ends up as image2D) as needing to be combined with a
sampler, or at least renamed. This is incorrect: StorageTexture never
has an associated sampler, so don't try to pair it up and just output
it as image* in GLSL.

In GLSL, textureLoad (aka texelFetch) of depth textures is not allowed.
The fix is to bind the depth texture as the corresponding f32 texture
instead (e.g., texture_depth_2d -> texture_2d<f32>,
texture_depth_cube -> texture_cube<f32>, etc). This requires changing
both the uniform globals and function parameter types. We're now going
to receive a vec4 instead of a float from texelFetch, so add a ".x"
member accessor to retrieve the first component. (Note that we don't
do this inside a CallStatement since this gives the CloneContext
indigestion, and CallStatement is going to ignore the result of the
call anyway.)

We were failing to find the dummy samplers that Dawn creates for the
calls that actually do require a dummy sampler, since the old Inspector
implementation of GetSamplerTextureUses() does not find them. The fix
is to implement a new Inspector call to return the texture/sampler
pairs the Resolver found during resolution. This will include the
dummy sampler as a null variable pointer.

In order to identify the placeholder sampler, we pass in a BindingPair
to represent it. When we discover a null sampler in the variable pair,
we return the passed-in placeholder binding point to the caller (Dawn).
(Dawn will use a group of kMaxBindGroups, to ensure that it never
collides with an existing sampler.)

Bug: tint:1298
Change-Id: I82e142c2b4318608c27a9fa9521c27f15a6214cd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78820
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-03 22:39:13 +00:00
..
abs Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
acos Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
all Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
any Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
arrayLength Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
asin Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atan Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atan2 Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atomicAdd Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atomicAnd Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atomicCompareExchangeWeak Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atomicExchange Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atomicLoad Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atomicMax Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atomicMin Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atomicOr Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atomicStore Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atomicSub Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
atomicXor Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
ceil Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
clamp Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
cos Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
cosh Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
countOneBits Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
cross Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
degrees Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
determinant Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
distance Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
dot Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
dpdx Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
dpdxCoarse Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
dpdxFine Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
dpdy Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
dpdyCoarse Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
dpdyFine Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
exp Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
exp2 Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
faceForward Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
floor Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
fma Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
fract Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
frexp Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
fwidth Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
fwidthCoarse Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
fwidthFine Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
inverseSqrt Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
isFinite Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
isInf Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
isNan Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
isNormal Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
ldexp Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
length Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
log Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
log2 Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
max Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
min Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
mix Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
modf Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
normalize Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
pack2x16float Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
pack2x16snorm Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
pack2x16unorm Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
pack4x8snorm Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
pack4x8unorm Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
pow Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
radians Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
reflect Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
refract Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
reverseBits Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
round Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
select Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
sign Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
sin Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
sinh Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
smoothStep Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
sqrt Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
step Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
storageBarrier Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
tan Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
tanh Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
textureDimensions GLSL: fix textureLoad() and textureStore(), depth textures, and more. 2022-02-03 22:39:13 +00:00
textureGather Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
textureGatherCompare Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
textureLoad GLSL: fix textureLoad() and textureStore(), depth textures, and more. 2022-02-03 22:39:13 +00:00
textureNumLayers GLSL: fix textureLoad() and textureStore(), depth textures, and more. 2022-02-03 22:39:13 +00:00
textureNumLevels GLSL: fix textureLoad() and textureStore(), depth textures, and more. 2022-02-03 22:39:13 +00:00
textureNumSamples Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
textureSample Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
textureSampleBias Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
textureSampleCompare Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
textureSampleCompareLevel Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
textureSampleGrad Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
textureSampleLevel Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
textureStore GLSL: fix textureLoad() and textureStore(), depth textures, and more. 2022-02-03 22:39:13 +00:00
transpose Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
trunc Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
unpack2x16float Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
unpack2x16snorm Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
unpack2x16unorm Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
unpack4x8snorm Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
unpack4x8unorm Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00
workgroupBarrier Rename 'intrinsic' to 'builtin' 2022-02-02 23:07:11 +00:00