summaryrefslogtreecommitdiffstats
path: root/tests/bindings/gh-84.frag
blob: 407ba5043dcde16e4c8353ad9ccee56d68b3bd99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#version 450
//DISABLED_TEST:COMPARE_GLSL:

// Confirm implementation of GitHub issue #84

#if defined(__SLANG__)
#define LAYOUT(X) /* empty */
#else
#define LAYOUT(X) layout(X)
#endif

// Array of resources: should only use up one binding
LAYOUT(binding = 0)
uniform texture2D t[8];

// This should automatically get binding 1
LAYOUT(binding = 1)
uniform sampler s;

LAYOUT(binding = 2)
uniform U
{
	int i;
};

LAYOUT(location = 0)
in vec2 uv;

LAYOUT(location = 0)
out vec4 color;

void main()
{
	color = texture(sampler2D(t[i], s), uv);
}