From 6f2ce72b038b34e84819ddfc5d658166ed879eaa Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 27 Feb 2025 16:57:52 -0800 Subject: Map `SV_InstanceID` to `gl_InstanceIndex-gl_BaseInstance` (#6468) * Map `SV_InstanceID` to `gl_InstanceIndex-gl_BaseInstance` * Fix ci. --- tests/bugs/gh-3087-multi-entry-point.slang | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'tests/bugs') diff --git a/tests/bugs/gh-3087-multi-entry-point.slang b/tests/bugs/gh-3087-multi-entry-point.slang index d3aa574c7..edfda08af 100644 --- a/tests/bugs/gh-3087-multi-entry-point.slang +++ b/tests/bugs/gh-3087-multi-entry-point.slang @@ -3,14 +3,20 @@ // CHECK-DAG: OpEntryPoint Vertex // CHECK-DAG: OpEntryPoint Fragment -// we should only have 1 'BuiltIn InstanceIndex' since the `Output` and `Input` semantic -// for `InstanceIndex` should be converted to a non-builtin -// CHECK-DAG: OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex -// CHECK-NOT: OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex - // We require 1 `Flat` for the fragment input `uint` // CHECK-DAG: OpDecorate %{{[1-9][0-9]*}} Flat -// CHECK-NOT: OpDecorate %{{[1-9][0-9]*}} Flat + +// CHECK-DAG: OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex + +// The vertex shader should be using the builtin InstanceIndex var. +// CHECK: %vmain = OpFunction +// CHECK: InstanceIndex +// CHECK: OpFunctionEnd + +// The fragment shader should not be using the builtin InstanceIndex var. +// CHECK: %pmain = OpFunction +// CHECK-NOT: InstanceIndex +// CHECK: OpFunctionEnd struct VIn { -- cgit v1.2.3