John Kessenich | 5611c6d | 2018-04-05 11:25:02 -0600 | [diff] [blame] | 1 | #version 450
|
| 2 |
|
| 3 | #extension GL_EXT_nonuniform_qualifier : enable
|
| 4 |
|
| 5 | layout(location=0) nonuniformEXT in vec4 nu_inv4;
|
| 6 | nonuniformEXT float nu_gf;
|
| 7 | layout(location=1) in nonuniformEXT flat int nu_ii;
|
Greg Fischer | 8eb0bdc | 2020-09-09 15:44:52 -0600 | [diff] [blame] | 8 | layout(location = 2) in vec2 inTexcoord;
|
John Kessenich | 5611c6d | 2018-04-05 11:25:02 -0600 | [diff] [blame] | 9 |
|
| 10 | layout(binding=0, input_attachment_index = 0) uniform subpassInput inputAttachmentDyn[];
|
| 11 | layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[];
|
| 12 | layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[];
|
| 13 | layout(binding=3) uniform uname { float a; } uniformBuffer[];
|
| 14 | layout(binding=4) buffer bname { float b; } storageBuffer[];
|
| 15 | layout(binding=5) uniform sampler2D sampledImage[];
|
| 16 | layout(binding=6, r32f) uniform image2D storageImage[];
|
| 17 | layout(binding=7, input_attachment_index = 1) uniform subpassInput inputAttachment[];
|
| 18 | layout(binding=8) uniform samplerBuffer uniformTexelBuffer[];
|
| 19 | layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[];
|
Greg Fischer | 8eb0bdc | 2020-09-09 15:44:52 -0600 | [diff] [blame] | 20 | layout(binding = 10) uniform texture2D uniformTexArr[8];
|
| 21 | layout(binding = 11) uniform sampler uniformSampler;
|
John Kessenich | 5611c6d | 2018-04-05 11:25:02 -0600 | [diff] [blame] | 22 |
|
| 23 | nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f)
|
| 24 | {
|
| 25 | return nupi;
|
| 26 | }
|
| 27 |
|
| 28 | void main()
|
| 29 | {
|
| 30 | nonuniformEXT int nu_li;
|
greg-lunarg | 639f546 | 2020-11-12 11:10:07 -0700 | [diff] [blame] | 31 | nonuniformEXT int nu_li2;
|
John Kessenich | 5611c6d | 2018-04-05 11:25:02 -0600 | [diff] [blame] | 32 | int dyn_i;
|
| 33 |
|
| 34 | int a = foo(nu_li, nu_li);
|
| 35 | nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2);
|
greg-lunarg | 639f546 | 2020-11-12 11:10:07 -0700 | [diff] [blame] | 36 | nu_li2 = a + nonuniformEXT(a * 2);
|
John Kessenich | 5611c6d | 2018-04-05 11:25:02 -0600 | [diff] [blame] | 37 |
|
| 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 Fischer | 8eb0bdc | 2020-09-09 15:44:52 -0600 | [diff] [blame] | 50 | b += texture(sampler2D(uniformTexArr[nu_ii], uniformSampler), inTexcoord.xy).x;
|
greg-lunarg | 639f546 | 2020-11-12 11:10:07 -0700 | [diff] [blame] | 51 | b += texture(nonuniformEXT(sampler2D(uniformTexArr[nu_ii], uniformSampler)), inTexcoord.xy).x;
|
John Kessenich | 5611c6d | 2018-04-05 11:25:02 -0600 | [diff] [blame] | 52 |
|
| 53 | nonuniformEXT ivec4 v;
|
| 54 | nonuniformEXT mat4 m;
|
| 55 | nonuniformEXT struct S { int a; } s;
|
greg-lunarg | 639f546 | 2020-11-12 11:10:07 -0700 | [diff] [blame] | 56 | nonuniformEXT int arr[10];
|
John Kessenich | 5611c6d | 2018-04-05 11:25:02 -0600 | [diff] [blame] | 57 | ivec4 uv;
|
greg-lunarg | 639f546 | 2020-11-12 11:10:07 -0700 | [diff] [blame] | 58 | mat4 um;
|
| 59 | struct US { int a[10]; } us;
|
| 60 | int uarr[10];
|
John Kessenich | 5611c6d | 2018-04-05 11:25:02 -0600 | [diff] [blame] | 61 | 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-lunarg | 639f546 | 2020-11-12 11:10:07 -0700 | [diff] [blame] | 66 | 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 Fischer | 889ac20 | 2020-09-08 20:01:55 -0600 | [diff] [blame] | 70 |
|
| 71 | storageBuffer[nu_ii].b = b;
|
John Kessenich | 5611c6d | 2018-04-05 11:25:02 -0600 | [diff] [blame] | 72 | }
|