diff options
| author | Yong He <yonghe@outlook.com> | 2025-02-27 16:57:52 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-27 16:57:52 -0800 |
| commit | 6f2ce72b038b34e84819ddfc5d658166ed879eaa (patch) | |
| tree | 486a85523114a428ccf4deee05bcbab0d4b9528b /tests/spirv/sv_instance.slang | |
| parent | 90b3817498d9cf664346f04dcea71f48ce81993e (diff) | |
Map `SV_InstanceID` to `gl_InstanceIndex-gl_BaseInstance` (#6468)
* Map `SV_InstanceID` to `gl_InstanceIndex-gl_BaseInstance`
* Fix ci.
Diffstat (limited to 'tests/spirv/sv_instance.slang')
| -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 |
