Debian Codegraph @

third_party/spirv-cross/shaders-msl-no-opt/vulkan/frag/texture-access-function.swizzle.vk.frag

raw
1 #version 450
2
3 layout(binding = 0) uniform sampler1D tex1d;
4 layout(binding = 1) uniform texture2D tex2d;
5 layout(binding = 2) uniform sampler3D tex3d;
6 layout(binding = 3) uniform textureCube texCube;
7 layout(binding = 4) uniform sampler2DArray tex2dArray;
8 layout(binding = 5) uniform samplerCubeArray texCubeArray;
9 layout(binding = 6) uniform samplerBuffer texBuffer;
10
11 layout(binding = 7) uniform sampler2DShadow depth2d;
12 layout(binding = 8) uniform samplerCubeShadow depthCube;
13 layout(binding = 9) uniform texture2DArray depth2dArray;
14 layout(binding = 10) uniform samplerCubeArrayShadow depthCubeArray;
15
16 layout(binding = 11) uniform sampler defaultSampler;
17 layout(binding = 12) uniform samplerShadow shadowSampler;
18
19 layout(location = 0) out vec4 fragColor;
20
21 vec4 do_samples(sampler1D t1, texture2D t2, sampler3D t3, textureCube tc, sampler2DArray t2a, samplerCubeArray tca, samplerBuffer tb, sampler2DShadow d2, samplerCubeShadow dc, texture2DArray d2a, samplerCubeArrayShadow dca)
22 {
23 // OpImageSampleImplicitLod
24 vec4 c = texture(t1, 0.0);
25 c = texture(sampler2D(t2, defaultSampler), vec2(0.0, 0.0));
26 c = texture(t3, vec3(0.0, 0.0, 0.0));
27 c = texture(samplerCube(tc, defaultSampler), vec3(0.0, 0.0, 0.0));
28 c = texture(t2a, vec3(0.0, 0.0, 0.0));
29 c = texture(tca, vec4(0.0, 0.0, 0.0, 0.0));
30
31 // OpImageSampleDrefImplicitLod
32 c.r = texture(d2, vec3(0.0, 0.0, 1.0));
33 c.r = texture(dc, vec4(0.0, 0.0, 0.0, 1.0));
34 c.r = texture(sampler2DArrayShadow(d2a, shadowSampler), vec4(0.0, 0.0, 0.0, 1.0));
35 c.r = texture(dca, vec4(0.0, 0.0, 0.0, 0.0), 1.0);
36
37 // OpImageSampleProjImplicitLod
38 c = textureProj(t1, vec2(0.0, 1.0));
39 c = textureProj(sampler2D(t2, defaultSampler), vec3(0.0, 0.0, 1.0));
40 c = textureProj(t3, vec4(0.0, 0.0, 0.0, 1.0));
41
42 // OpImageSampleProjDrefImplicitLod
43 c.r = textureProj(d2, vec4(0.0, 0.0, 1.0, 1.0));
44
45 // OpImageSampleExplicitLod
46 c = textureLod(t1, 0.0, 0.0);
47 c = textureLod(sampler2D(t2, defaultSampler), vec2(0.0, 0.0), 0.0);
48 c = textureLod(t3, vec3(0.0, 0.0, 0.0), 0.0);
49 c = textureLod(samplerCube(tc, defaultSampler), vec3(0.0, 0.0, 0.0), 0.0);
50 c = textureLod(t2a, vec3(0.0, 0.0, 0.0), 0.0);
51 c = textureLod(tca, vec4(0.0, 0.0, 0.0, 0.0), 0.0);
52
53 // OpImageSampleDrefExplicitLod
54 c.r = textureLod(d2, vec3(0.0, 0.0, 1.0), 0.0);
55
56 // OpImageSampleProjExplicitLod
57 c = textureProjLod(t1, vec2(0.0, 1.0), 0.0);
58 c = textureProjLod(sampler2D(t2, defaultSampler), vec3(0.0, 0.0, 1.0), 0.0);
59 c = textureProjLod(t3, vec4(0.0, 0.0, 0.0, 1.0), 0.0);
60
61 // OpImageSampleProjDrefExplicitLod
62 c.r = textureProjLod(d2, vec4(0.0, 0.0, 1.0, 1.0), 0.0);
63
64 // OpImageFetch
65 c = texelFetch(t1, 0, 0);
66 c = texelFetch(sampler2D(t2, defaultSampler), ivec2(0, 0), 0);
67 c = texelFetch(t3, ivec3(0, 0, 0), 0);
68 c = texelFetch(t2a, ivec3(0, 0, 0), 0);
69
70 // Show that this transformation doesn't apply to Buffer images.
71 c = texelFetch(tb, 0);
72
73 // OpImageGather
74 c = textureGather(sampler2D(t2, defaultSampler), vec2(0.0, 0.0), 0);
75 c = textureGather(samplerCube(tc, defaultSampler), vec3(0.0, 0.0, 0.0), 1);
76 c = textureGather(t2a, vec3(0.0, 0.0, 0.0), 2);
77 c = textureGather(tca, vec4(0.0, 0.0, 0.0, 0.0), 3);
78
79 // OpImageDrefGather
80 c = textureGather(d2, vec2(0.0, 0.0), 1.0);
81 c = textureGather(dc, vec3(0.0, 0.0, 0.0), 1.0);
82 c = textureGather(sampler2DArrayShadow(d2a, shadowSampler), vec3(0.0, 0.0, 0.0), 1.0);
83 c = textureGather(dca, vec4(0.0, 0.0, 0.0, 0.0), 1.0);
84 return c;
85 }
86
87 void main()
88 {
89 fragColor = do_samples(tex1d, tex2d, tex3d, texCube, tex2dArray, texCubeArray, texBuffer, depth2d, depthCube, depth2dArray, depthCubeArray);
90 }