diff options
Diffstat (limited to 'tests/spirv')
| -rw-r--r-- | tests/spirv/sv_instance.slang | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/spirv/sv_instance.slang b/tests/spirv/sv_instance.slang new file mode 100644 index 000000000..e71c6c7fa --- /dev/null +++ b/tests/spirv/sv_instance.slang @@ -0,0 +1,14 @@ +//TEST:SIMPLE(filecheck=GLSL): -target glsl -entry vertMain -stage vertex +//TEST:SIMPLE(filecheck=CHECK): -target spirv + +// CHECK-DAG: %[[REG1:[0-9a-zA-Z_]+]] = OpLoad %int %gl_BaseInstance +// CHECK-DAG: %[[REG2:[0-9a-zA-Z_]+]] = OpLoad %int %gl_InstanceIndex +// CHECK-DAG: OpISub %int %[[REG2]] %[[REG1]] + +// GLSL: gl_InstanceIndex - gl_BaseInstance + +[shader("vertex")] +float4 vertMain(int i : SV_InstanceID) : SV_Position +{ + return i; +}
\ No newline at end of file |
