Skip to content

Commit 8f1e83f

Browse files
committed
add implicit ast / ast dump tests
1 parent 909339f commit 8f1e83f

2 files changed

Lines changed: 26 additions & 14 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// RUN: %dxilver 1.9 | %dxc -T lib_6_9 -validator-version 1.9 %s | %D3DReflect %s | FileCheck %s
2+
3+
// CHECK: MinShaderTarget: 0x10069
4+
RaytracingPipelineConfig1 rpc = { 32, RAYTRACING_PIPELINE_FLAG_SKIP_TRIANGLES | RAYTRACING_PIPELINE_FLAG_ALLOW_OPACITY_MICROMAPS };
Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
// RUN: %dxilver 1.9 | %dxc -T lib_6_9 -validator-version 1.9 %s | FileCheck -check-prefix=NOD3D %s
2-
// RUN: %dxilver 1.9 | %dxc -T lib_6_9 -validator-version 1.9 %s | %D3DReflect %s | FileCheck -check-prefix=D3D %s
3-
4-
// NOD3D: ; RaytracingPipelineConfig1 rpc = { MaxTraceRecursionDepth = 32, Flags = RAYTRACING_PIPELINE_FLAG_SKIP_TRIANGLES | RAYTRACING_PIPELINE_FLAG_ALLOW_OPACITY_MICROMAPS };
5-
// D3D: MinShaderTarget: 0x10069
6-
RaytracingPipelineConfig1 rpc = { 32, RAYTRACING_PIPELINE_FLAG_SKIP_TRIANGLES | RAYTRACING_PIPELINE_FLAG_ALLOW_OPACITY_MICROMAPS };
7-
8-
RaytracingAccelerationStructure RTAS;
9-
// DXR entry point to ensure RDAT flags match during validation.
10-
[shader("vertex")]
11-
void main(RayDesc rayDesc : RAYDESC) {
12-
RayQuery<RAY_FLAG_FORCE_OMM_2_STATE, RAYQUERY_FLAG_ALLOW_OPACITY_MICROMAPS> rayQuery1;
13-
rayQuery1.TraceRayInline(RTAS, RAY_FLAG_FORCE_OMM_2_STATE, 2, rayDesc);
14-
}
1+
// RUN: %dxilver 1.9 | %dxc -T lib_6_9 -validator-version 1.9 %s | FileCheck %s
2+
// RUsN: %dxilver 1.8 | %dxc -T lib_6_8 -validator-version 1.8 %s | FileCheck -check-prefix=UNDER69 %s
3+
// RUN: %dxilver 1.9 | %dxc -T lib_6_9 -validator-version 1.9 -ast-dump %s | FileCheck -check-prefix=AST %s
4+
// RUN: %dxilver 1.9 | %dxc -T lib_6_9 -validator-version 1.9 -ast-dump-implicit %s | FileCheck -check-prefix=ASTIMPL %s
5+
6+
// CHECK: ; RaytracingPipelineConfig1 rpc = { MaxTraceRecursionDepth = 32, Flags = RAYTRACING_PIPELINE_FLAG_ALLOW_OPACITY_MICROMAPS };
7+
8+
9+
// AST: TranslationUnitDecl 0x{{.+}} <<invalid sloc>> <invalid sloc>
10+
// AST-NEXT: VarDecl 0x{{.+}} rpc 'RaytracingPipelineConfig1' static cinit
11+
// AST-NEXT: InitListExpr 0x{{.+}} 'RaytracingPipelineConfig1'
12+
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'unsigned int' <IntegralCast>
13+
// AST-NEXT: IntegerLiteral 0x{{.+}} 'literal int' 32
14+
// AST-NEXT: ImplicitCastExpr 0x{{.+}} 'unsigned int' <LValueToRValue>
15+
// AST-NEXT: DeclRefExpr 0x{{.+}} 'const unsigned int' lvalue Var 0x{{.+}} 'RAYTRACING_PIPELINE_FLAG_ALLOW_OPACITY_MICROMAPS' 'const unsigned int'
16+
// ASTIMPL: VarDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> implicit referenced RAYTRACING_PIPELINE_FLAG_ALLOW_OPACITY_MICROMAPS 'const unsigned int' static cinit
17+
// ASTIMPL-NEXT: IntegerLiteral 0x{{.+}} <<invalid sloc>> 'const unsigned int' 1024
18+
// ASTIMPL-NEXT: AvailabilityAttr 0x{{.+}} <<invalid sloc>> Implicit 6.9 0 0 ""
19+
RaytracingPipelineConfig1 rpc = { 32, RAYTRACING_PIPELINE_FLAG_ALLOW_OPACITY_MICROMAPS };
20+
21+
// UNDER69: Potential misuse
22+

0 commit comments

Comments
 (0)