yum-mirror/slang

Making it easier to work with shaders

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

ArielG-NVRefactor memory qualifier decorators to be a bit-flag set, resolves #3841 (#3881)e0de98e9a

master
749 B23 linesraw
1//TEST:SIMPLE(filecheck=CHECK_GLSL): -stage compute -entry computeMain -allow-glsl -target glsl
2//TEST:SIMPLE(filecheck=CHECK_SPV): -stage compute -entry computeMain -allow-glsl -target spirv -emit-spirv-directly
3
4// This code should error since memory qualifiers are only allowed inside:
5// Shader storage blocks, variables declared within shader storage blocks 
6// and variables declared as image types. Named structs inside a Interface
7// block violates these rules
8// CHECK_GLSL: error
9// CHECK_SPV: error
10buffer Block4 {
11    struct StructTmp
12    {
13        readonly int val;
14    };
15    readonly structTmp myStruct;
16    coherent readonly vec4 member1;
17    coherent vec4 member2;
18}inputBuffer4;
19
20layout(local_size_x = 1) in;
21void computeMain()
22{
23}