Skip to content

Commit 934a1d0

Browse files
Copilotzangold-nv
andcommitted
Use [[# @line+1]] magic in test for better maintainability
Co-authored-by: zangold-nv <[email protected]>
1 parent 738c7e3 commit 934a1d0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/spirv/debug-struct-member-line-numbers.slang

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
// Structure for shader parameters
44
struct ShaderParameters
55
{
6+
// CHECK-DAG: DebugTypeMember %{{.*}} %{{.*}} %{{.*}} %uint_[[# @LINE+1 ]]
67
float4 fillColor;
8+
// CHECK-DAG: DebugTypeMember %{{.*}} %{{.*}} %{{.*}} %uint_[[# @LINE+1 ]]
79
float edgeThickness;
10+
// CHECK-DAG: DebugTypeMember %{{.*}} %{{.*}} %{{.*}} %uint_[[# @LINE+1 ]]
811
float4 edgeColor;
912
};
1013

@@ -36,7 +39,7 @@ PSOutput main(VSOutput input)
3639
float distance = length(uv);
3740

3841
// Create circular shape with edge
39-
float circle = 1.0 - step(0.4, distance); // Circle with radius 0.4
42+
float circle =1.0 - step(0.4, distance); // Circle with radius 0.4
4043
float edge = step(0.4 - params.edgeThickness, distance) * circle; // Edge of the circle
4144

4245
// Combine fill and edge colors
@@ -51,9 +54,6 @@ PSOutput main(VSOutput input)
5154
}
5255

5356
// Check that DebugTypeMember instructions for ShaderParameters_std140 have correct line numbers
54-
// CHECK: OpString "fillColor"
55-
// CHECK: OpString "edgeThickness"
56-
// CHECK: OpString "edgeColor"
57-
// CHECK: DebugTypeMember %{{.*}} %{{.*}} %{{.*}} %uint_6
58-
// CHECK: DebugTypeMember %{{.*}} %{{.*}} %{{.*}} %uint_7
59-
// CHECK: DebugTypeMember %{{.*}} %{{.*}} %{{.*}} %uint_8
57+
// CHECK-DAG: OpString "fillColor"
58+
// CHECK-DAG: OpString "edgeThickness"
59+
// CHECK-DAG: OpString "edgeColor"

0 commit comments

Comments
 (0)