Skip to content

Commit e02eecf

Browse files
tests: Add rayquery variant of hit object test
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
1 parent 1a5f6e8 commit e02eecf

4 files changed

Lines changed: 394 additions & 6 deletions

File tree

tests/d3d12_raytracing.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5435,11 +5435,12 @@ void test_shader_execution_reordering_basic(void)
54355435
destroy_raytracing_test_context(&context);
54365436
}
54375437

5438-
void test_shader_execution_reordering_trace(void)
5438+
static void test_shader_execution_reordering_trace_inner(bool ray_query)
54395439
{
54405440
#undef NUM_RAYS
54415441
#define NUM_RAYS 64
54425442
#include "shaders/rt/headers/hit_object_trace.h"
5443+
#include "shaders/rt/headers/hit_object_query.h"
54435444
struct raytracing_test_context context;
54445445
uint32_t handles[6][64 / 4] = {{0}};
54455446
D3D12_FEATURE_DATA_SHADER_MODEL sm;
@@ -5456,7 +5457,7 @@ void test_shader_execution_reordering_trace(void)
54565457
D3D12_HIT_GROUP_DESC hit_desc[2];
54575458
unsigned int i, j;
54585459

5459-
if (!init_raytracing_test_context(&context, D3D12_RAYTRACING_TIER_1_0))
5460+
if (!init_raytracing_test_context(&context, D3D12_RAYTRACING_TIER_1_1))
54605461
return;
54615462

54625463
sm.HighestShaderModel = D3D_SHADER_MODEL_6_9;
@@ -5500,7 +5501,7 @@ void test_shader_execution_reordering_trace(void)
55005501
hit_desc[1].HitGroupExport = u"Hit1";
55015502
rt_pso_factory_add_hit_group(&factory, &hit_desc[1]);
55025503

5503-
rt_pso_factory_add_dxil_library(&factory, hit_object_trace_dxil, 0, NULL);
5504+
rt_pso_factory_add_dxil_library(&factory, ray_query ? hit_object_query_dxil : hit_object_trace_dxil, 0, NULL);
55045505
rtpso = rt_pso_factory_compile(&context, &factory, D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE);
55055506

55065507
if (rtpso && SUCCEEDED(ID3D12StateObject_QueryInterface(rtpso, &IID_ID3D12StateObjectProperties, (void **)&props)))
@@ -5648,8 +5649,9 @@ void test_shader_execution_reordering_trace(void)
56485649
{
56495650
bool is_bug;
56505651

5651-
/* NVIDIA fails to ignore the must-ignore bits on SetShaderTableIndex(). */
5652-
is_bug = is_nvidia_windows_device(context.context.device) && (i == 26 || i == 27);
5652+
/* NVIDIA fails to ignore the must-ignore bits on SetShaderTableIndex().
5653+
* The rayquery test does not test the buggy behavior. */
5654+
is_bug = !ray_query && is_nvidia_windows_device(context.context.device) && (i == 26 || i == 27);
56535655

56545656
bug_if(is_bug)
56555657
ok(value.u32 == expected.u32, "Ray %u, data %u: expected %u/%.3f/#%x, got %u/%.3f/#%x\n", j, i,
@@ -5665,4 +5667,14 @@ void test_shader_execution_reordering_trace(void)
56655667
ID3D12Resource_Release(sbt);
56665668
ID3D12StateObject_Release(rtpso);
56675669
destroy_raytracing_test_context(&context);
5668-
}
5670+
}
5671+
5672+
void test_shader_execution_reordering_trace(void)
5673+
{
5674+
test_shader_execution_reordering_trace_inner(false);
5675+
}
5676+
5677+
void test_shader_execution_reordering_ray_query(void)
5678+
{
5679+
test_shader_execution_reordering_trace_inner(true);
5680+
}

tests/d3d12_tests.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,3 +590,4 @@ decl_test(test_sm69_long_vector_load_store_heap_desc);
590590
decl_test(test_sm69_long_vector_load_store_root_desc);
591591
decl_test(test_shader_execution_reordering_basic);
592592
decl_test(test_shader_execution_reordering_trace);
593+
decl_test(test_shader_execution_reordering_ray_query);

0 commit comments

Comments
 (0)