Debian Codegraph @

third_party/spirv-cross/shaders-msl-no-opt/frag/texture-access-int.swizzle.frag

raw
1 #version 450
2
3 layout(binding = 0) uniform isampler1D tex1d;
4 layout(binding = 1) uniform isampler2D tex2d;
5 layout(binding = 2) uniform isampler3D tex3d;
6 layout(binding = 3) uniform isamplerCube texCube;
7 layout(binding = 4) uniform isampler2DArray tex2dArray;
8 layout(binding = 5) uniform isamplerCubeArray texCubeArray;
9 layout(binding = 6) uniform isamplerBuffer texBuffer;
10
11 void main()
12 {
13 // OpImageSampleImplicitLod
14 vec4 c = texture(tex1d, 0.0);
15 c = texture(tex2d, vec2(0.0, 0.0));
16 c = texture(tex3d, vec3(0.0, 0.0, 0.0));
17 c = texture(texCube, vec3(0.0, 0.0, 0.0));
18 c = texture(tex2dArray, vec3(0.0, 0.0, 0.0));
19 c = texture(texCubeArray, vec4(0.0, 0.0, 0.0, 0.0));
20
21 // OpImageSampleProjImplicitLod
22 c = textureProj(tex1d, vec2(0.0, 1.0));
23 c = textureProj(tex2d, vec3(0.0, 0.0, 1.0));
24 c = textureProj(tex3d, vec4(0.0, 0.0, 0.0, 1.0));
25
26 // OpImageSampleExplicitLod
27 c = textureLod(tex1d, 0.0, 0.0);
28 c = textureLod(tex2d, vec2(0.0, 0.0), 0.0);
29 c = textureLod(tex3d, vec3(0.0, 0.0, 0.0), 0.0);
30 c = textureLod(texCube, vec3(0.0, 0.0, 0.0), 0.0);
31 c = textureLod(tex2dArray, vec3(0.0, 0.0, 0.0), 0.0);
32 c = textureLod(texCubeArray, vec4(0.0, 0.0, 0.0, 0.0), 0.0);
33
34 // OpImageSampleProjExplicitLod
35 c = textureProjLod(tex1d, vec2(0.0, 1.0), 0.0);
36 c = textureProjLod(tex2d, vec3(0.0, 0.0, 1.0), 0.0);
37 c = textureProjLod(tex3d, vec4(0.0, 0.0, 0.0, 1.0), 0.0);
38
39 // OpImageFetch
40 c = texelFetch(tex1d, 0, 0);
41 c = texelFetch(tex2d, ivec2(0, 0), 0);
42 c = texelFetch(tex3d, ivec3(0, 0, 0), 0);
43 c = texelFetch(tex2dArray, ivec3(0, 0, 0), 0);
44
45 // Show that this transformation doesn't apply to Buffer images.
46 c = texelFetch(texBuffer, 0);
47
48 // OpImageGather
49 c = textureGather(tex2d, vec2(0.0, 0.0), 0);
50 c = textureGather(texCube, vec3(0.0, 0.0, 0.0), 1);
51 c = textureGather(tex2dArray, vec3(0.0, 0.0, 0.0), 2);
52 c = textureGather(texCubeArray, vec4(0.0, 0.0, 0.0, 0.0), 3);
53 }