blob: cf7ebedc1bbe4aedd0a847bb513c6d1dc2b3c809 [file] [log] [blame]
John Kessenich5611c6d2018-04-05 11:25:02 -06001#version 450
2
3#extension GL_EXT_nonuniform_qualifier : enable
4
5layout(location=0) nonuniformEXT in vec4 nu_inv4;
6nonuniformEXT float nu_gf;
7layout(location=1) in nonuniformEXT flat int nu_ii;
Greg Fischer8eb0bdc2020-09-09 15:44:52 -06008layout(location = 2) in vec2 inTexcoord;
John Kessenich5611c6d2018-04-05 11:25:02 -06009
10layout(binding=0, input_attachment_index = 0) uniform subpassInput inputAttachmentDyn[];
11layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[];
12layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[];
13layout(binding=3) uniform uname { float a; } uniformBuffer[];
14layout(binding=4) buffer bname { float b; } storageBuffer[];
15layout(binding=5) uniform sampler2D sampledImage[];
16layout(binding=6, r32f) uniform image2D storageImage[];
17layout(binding=7, input_attachment_index = 1) uniform subpassInput inputAttachment[];
18layout(binding=8) uniform samplerBuffer uniformTexelBuffer[];
19layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[];
Greg Fischer8eb0bdc2020-09-09 15:44:52 -060020layout(binding = 10) uniform texture2D uniformTexArr[8];
21layout(binding = 11) uniform sampler uniformSampler;
John Kessenich5611c6d2018-04-05 11:25:02 -060022
23nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f)
24{
25 return nupi;
26}
27
28void main()
29{
30 nonuniformEXT int nu_li;
greg-lunarg639f5462020-11-12 11:10:07 -070031 nonuniformEXT int nu_li2;
John Kessenich5611c6d2018-04-05 11:25:02 -060032 int dyn_i;
33
34 int a = foo(nu_li, nu_li);
35 nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2);
greg-lunarg639f5462020-11-12 11:10:07 -070036 nu_li2 = a + nonuniformEXT(a * 2);
John Kessenich5611c6d2018-04-05 11:25:02 -060037
38 float b;
39 b = nu_inv4.x * nu_gf;
40 b += subpassLoad(inputAttachmentDyn[dyn_i]).x;
41 b += texelFetch(uniformTexelBufferDyn[dyn_i], 1).x;
42 b += imageLoad(storageTexelBufferDyn[dyn_i], 1).x;
43 b += uniformBuffer[nu_ii].a;
44 b += storageBuffer[nu_ii].b;
45 b += texture(sampledImage[nu_ii], vec2(0.5)).x;
46 b += imageLoad(storageImage[nu_ii], ivec2(1)).x;
47 b += subpassLoad(inputAttachment[nu_ii]).x;
48 b += texelFetch(uniformTexelBuffer[nu_ii], 1).x;
49 b += imageLoad(storageTexelBuffer[nu_ii], 1).x;
Greg Fischer8eb0bdc2020-09-09 15:44:52 -060050 b += texture(sampler2D(uniformTexArr[nu_ii], uniformSampler), inTexcoord.xy).x;
greg-lunarg639f5462020-11-12 11:10:07 -070051 b += texture(nonuniformEXT(sampler2D(uniformTexArr[nu_ii], uniformSampler)), inTexcoord.xy).x;
John Kessenich5611c6d2018-04-05 11:25:02 -060052
53 nonuniformEXT ivec4 v;
54 nonuniformEXT mat4 m;
55 nonuniformEXT struct S { int a; } s;
greg-lunarg639f5462020-11-12 11:10:07 -070056 nonuniformEXT int arr[10];
John Kessenich5611c6d2018-04-05 11:25:02 -060057 ivec4 uv;
greg-lunarg639f5462020-11-12 11:10:07 -070058 mat4 um;
59 struct US { int a[10]; } us;
60 int uarr[10];
John Kessenich5611c6d2018-04-05 11:25:02 -060061 b += uniformBuffer[v.y].a;
62 b += uniformBuffer[v[2]].a;
63 b += uniformBuffer[uv[nu_ii]].a;
64 b += uniformBuffer[int(m[2].z)].a;
65 b += uniformBuffer[s.a].a;
greg-lunarg639f5462020-11-12 11:10:07 -070066 b += uniformBuffer[arr[2]].a;
67 b += uniformBuffer[int(um[nu_ii].z)].a;
68 b += uniformBuffer[us.a[nu_ii]].a;
69 b += uniformBuffer[uarr[nu_ii]].a;
Greg Fischer889ac202020-09-08 20:01:55 -060070
71 storageBuffer[nu_ii].b = b;
John Kessenich5611c6d2018-04-05 11:25:02 -060072}