blob: d3b05a5ac92358e5c12158b601b901b00d50d41e [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;
8
9layout(binding=0, input_attachment_index = 0) uniform subpassInput inputAttachmentDyn[];
10layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[];
11layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[];
12layout(binding=3) uniform uname { float a; } uniformBuffer[];
13layout(binding=4) buffer bname { float b; } storageBuffer[];
14layout(binding=5) uniform sampler2D sampledImage[];
15layout(binding=6, r32f) uniform image2D storageImage[];
16layout(binding=7, input_attachment_index = 1) uniform subpassInput inputAttachment[];
17layout(binding=8) uniform samplerBuffer uniformTexelBuffer[];
18layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[];
19
20nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f)
21{
22 return nupi;
23}
24
25void main()
26{
27 nonuniformEXT int nu_li;
28 int dyn_i;
29
30 int a = foo(nu_li, nu_li);
31 nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2);
32
33 float b;
34 b = nu_inv4.x * nu_gf;
35 b += subpassLoad(inputAttachmentDyn[dyn_i]).x;
36 b += texelFetch(uniformTexelBufferDyn[dyn_i], 1).x;
37 b += imageLoad(storageTexelBufferDyn[dyn_i], 1).x;
38 b += uniformBuffer[nu_ii].a;
39 b += storageBuffer[nu_ii].b;
40 b += texture(sampledImage[nu_ii], vec2(0.5)).x;
41 b += imageLoad(storageImage[nu_ii], ivec2(1)).x;
42 b += subpassLoad(inputAttachment[nu_ii]).x;
43 b += texelFetch(uniformTexelBuffer[nu_ii], 1).x;
44 b += imageLoad(storageTexelBuffer[nu_ii], 1).x;
45
46 nonuniformEXT ivec4 v;
47 nonuniformEXT mat4 m;
48 nonuniformEXT struct S { int a; } s;
49 ivec4 uv;
50 b += uniformBuffer[v.y].a;
51 b += uniformBuffer[v[2]].a;
52 b += uniformBuffer[uv[nu_ii]].a;
53 b += uniformBuffer[int(m[2].z)].a;
54 b += uniformBuffer[s.a].a;
55}