yum-mirror/glslang

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

Saqib KhanHandle spirv_literal operands in spirv_instruction with a set (#4454)c97e126b

main
566 B21 linesraw
1#version 450 core
2
3#extension GL_EXT_spirv_intrinsics: enable
4
5layout(local_size_x = 1) in;
6
7// OpenCL.std vloadn: the last operand (n) is a literal
8spirv_instruction(set = "OpenCL.std", id = 171)
9vec2 vloadn(uint offset, spirv_by_reference float p, spirv_literal int n);
10
11// OpenCL.DebugInfo.100 DebugOperation: the only operand (OpCode) is a literal
12spirv_instruction(set = "OpenCL.DebugInfo.100", id = 30)
13void debugOperation(spirv_literal int opCode);
14
15shared float data[16];
16
17void main()
18{
19    vec2 v = vloadn(0u, data[0], 2);
20    debugOperation(/*Swap=*/5);
21}