yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Tim FoleyRemove support for the -no-checking flag (#392)0360f81b9

master
542 B35 linesraw
1#version 450
2//DISABLED_TEST:COMPARE_GLSL:
3
4// Confirm implementation of GitHub issue #84
5
6#if defined(__SLANG__)
7#define LAYOUT(X) /* empty */
8#else
9#define LAYOUT(X) layout(X)
10#endif
11
12// Array of resources: should only use up one binding
13LAYOUT(binding = 0)
14uniform texture2D t[8];
15
16// This should automatically get binding 1
17LAYOUT(binding = 1)
18uniform sampler s;
19
20LAYOUT(binding = 2)
21uniform U
22{
23	int i;
24};
25
26LAYOUT(location = 0)
27in vec2 uv;
28
29LAYOUT(location = 0)
30out vec4 color;
31
32void main()
33{
34	color = texture(sampler2D(t[i], s), uv);
35}