Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tools/clang/test/SemaHLSL/rayquery-omm-DXR-entry-point.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// RUN: %dxc -T lib_6_3 -validator-version 1.8 -verify %s

// expected-warning@+1{{potential misuse of built-in constant 'RAYTRACING_PIPELINE_FLAG_ALLOW_OPACITY_MICROMAPS' in shader model lib_6_3; introduced in shader model 6.9}}
RaytracingPipelineConfig1 rpc = { 32, RAYTRACING_PIPELINE_FLAG_ALLOW_OPACITY_MICROMAPS };

RaytracingAccelerationStructure RTAS;
// DXR entry to test that restricted flags are diagnosed.
[shader("raygeneration")]
void main(void) {
RayDesc rayDesc;

// expected-warning@+2{{potential misuse of built-in constant 'RAY_FLAG_FORCE_OMM_2_STATE' in shader model lib_6_3; introduced in shader model 6.9}}
// expected-warning@+1{{potential misuse of built-in constant 'RAYQUERY_FLAG_ALLOW_OPACITY_MICROMAPS' in shader model lib_6_3; introduced in shader model 6.9}}
RayQuery<RAY_FLAG_FORCE_OMM_2_STATE, RAYQUERY_FLAG_ALLOW_OPACITY_MICROMAPS> rayQuery;
// expected-warning@+1{{potential misuse of built-in constant 'RAY_FLAG_FORCE_OMM_2_STATE' in shader model lib_6_3; introduced in shader model 6.9}}
rayQuery.TraceRayInline(RTAS, RAY_FLAG_FORCE_OMM_2_STATE, 2, rayDesc);
}
4 changes: 2 additions & 2 deletions tools/clang/test/SemaHLSL/rayquery-omm-type-diag.hlsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %dxc -T vs_6_9 -E RayQueryTests -verify %s
// RUN: %dxc -T vs_6_5 -E RayQueryTests2 -verify %s
// RUN: %dxc -T vs_6_9 -verify %s
// RUN: %dxc -T vs_6_5 -verify %s

// validate 2nd template argument flags
// expected-error@+1{{When using 'RAY_FLAG_FORCE_OMM_2_STATE' in RayFlags, RayQueryFlags must have RAYQUERY_FLAG_ALLOW_OPACITY_MICROMAPS set.}}
Expand Down
12 changes: 12 additions & 0 deletions tools/clang/test/SemaHLSL/raytracingpipelineconfig1-no-errors.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// RUN: %dxc -T ps_6_0 -verify %s

// expected-no-diagnostics
// No diagnostic is expected because this is a non-library target,
// and SubObjects are ignored on non-library targets.

RaytracingPipelineConfig1 rpc = { 32, RAYTRACING_PIPELINE_FLAG_ALLOW_OPACITY_MICROMAPS };

[shader("pixel")]
int main(int i : INDEX) : SV_Target {
return 1;
}
Loading