Skip to content

Commit e9f223d

Browse files
committed
Fix tests.
1 parent dc43323 commit e9f223d

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

tests/bugs/gh-3087-multi-entry-point.slang

+12-6
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@
33
// CHECK-DAG: OpEntryPoint Vertex
44
// CHECK-DAG: OpEntryPoint Fragment
55

6-
// we should only have 1 'BuiltIn InstanceIndex' since the `Output` and `Input` semantic
7-
// for `InstanceIndex` should be converted to a non-builtin
8-
// CHECK-DAG: OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
9-
// CHECK-NOT: OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
10-
116
// We require 1 `Flat` for the fragment input `uint`
127
// CHECK-DAG: OpDecorate %{{[1-9][0-9]*}} Flat
13-
// CHECK-NOT: OpDecorate %{{[1-9][0-9]*}} Flat
8+
9+
// CHECK-DAG: OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
10+
11+
// The vertex shader should be using the builtin InstanceIndex var.
12+
// CHECK: %vmain = OpFunction
13+
// CHECK: InstanceIndex
14+
// CHECK: OpFunctionEnd
15+
16+
// The fragment shader should not be using the builtin InstanceIndex var.
17+
// CHECK: %pmain = OpFunction
18+
// CHECK-NOT: InstanceIndex
19+
// CHECK: OpFunctionEnd
1420

1521
struct VIn
1622
{

tests/hlsl-intrinsic/system-values-draw-parameters.slang

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ VSOutput main(VSInput input,
3232
// CHECK_HLSL: SV_StartVertexLocation
3333
// CHECK_METAL: base_vertex
3434

35-
// CHECK_SPIRV: BuiltIn BaseInstance
35+
// CHECK_SPIRV: BuiltIn InstanceIndex
3636
// CHECK_GLSL: gl_BaseInstance
3737
// CHECK_HLSL: SV_StartInstanceLocation
3838
// CHECK_METAL: base_instance

tests/spirv/sv_instance.slang

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//TEST:SIMPLE(filecheck=GLSL): -target glsl -entry vertMain -stage vertex
22
//TEST:SIMPLE(filecheck=CHECK): -target spirv
33

4-
// CHECK: %[[REG1:[0-9a-zA-Z_]+]] = OpLoad %int %gl_BaseInstance
5-
// CHECK: %[[REG2:[0-9a-zA-Z_]+]] = OpLoad %int %gl_InstanceIndex
6-
// CHECK: OpISub %int %[[REG2]] %[[REG1]]
4+
// CHECK-DAG: %[[REG1:[0-9a-zA-Z_]+]] = OpLoad %int %gl_BaseInstance
5+
// CHECK-DAG: %[[REG2:[0-9a-zA-Z_]+]] = OpLoad %int %gl_InstanceIndex
6+
// CHECK-DAG: OpISub %int %[[REG2]] %[[REG1]]
77

88
// GLSL: gl_InstanceIndex - gl_BaseInstance
99

0 commit comments

Comments
 (0)