• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#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;
8layout(location = 2) in vec2 inTexcoord;
9
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[];
20layout(binding = 10)                          uniform texture2D           uniformTexArr[8];
21layout(binding = 11)                          uniform sampler             uniformSampler;
22
23nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f)
24{
25    return nupi;
26}
27
28void main()
29{
30    nonuniformEXT int nu_li;
31    nonuniformEXT int nu_li2;
32    int dyn_i;
33
34    int a = foo(nu_li, nu_li);
35    nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2);
36    nu_li2 = a + nonuniformEXT(a * 2);
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;
50    b += texture(sampler2D(uniformTexArr[nu_ii], uniformSampler), inTexcoord.xy).x;
51    b += texture(nonuniformEXT(sampler2D(uniformTexArr[nu_ii], uniformSampler)), inTexcoord.xy).x;
52
53    nonuniformEXT ivec4 v;
54    nonuniformEXT mat4 m;
55    nonuniformEXT struct S { int a; } s;
56    nonuniformEXT int arr[10];
57    ivec4 uv;
58    mat4 um;
59    struct US { int a[10]; } us;
60    int uarr[10];
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;
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;
70
71    storageBuffer[nu_ii].b = b;
72}
73