From 4ac2861e2b93c6a1b6622eea78cadd3e002289ad Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Mon, 21 Jul 2025 18:23:26 +0100 Subject: [PATCH] DXIL Shader Debug Data test for struct inheritance struct TestGrand { int3 i3; int2 i2; }; struct TestParent : TestGrand { int4 i4; }; struct TestChild : TestParent { int i; }; --- .../d3d12/d3d12_shader_debugdata_zoo.cpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/util/test/demos/d3d12/d3d12_shader_debugdata_zoo.cpp b/util/test/demos/d3d12/d3d12_shader_debugdata_zoo.cpp index a7c76d27c..a0f2bb328 100644 --- a/util/test/demos/d3d12/d3d12_shader_debugdata_zoo.cpp +++ b/util/test/demos/d3d12/d3d12_shader_debugdata_zoo.cpp @@ -114,11 +114,28 @@ struct TestStruct } anon; }; +struct TestGrand +{ + int3 i3; + int2 i2; +}; + +struct TestParent : TestGrand +{ + int4 i4; +}; + +struct TestChild : TestParent +{ + int i; +}; + )EOSHADER"; std::string testsBody = R"EOSHADER( TestStruct testStruct; + TestChild testChild; TEST_DEBUG_VECTOR_TYPE(int); TEST_DEBUG_VECTOR_TYPE(float); @@ -131,6 +148,10 @@ struct TestStruct TEST_DEBUG_VAR_DECLARE(float1, bob, 3.0) TEST_DEBUG_VAR_SET(int4, testStruct.anon.a, 1) TEST_DEBUG_VAR_SET(int3, testStruct.anon.b, 2) + TEST_DEBUG_VAR_SET(int, testChild.i, 1) + TEST_DEBUG_VAR_SET(int2, testChild.i2, 2) + TEST_DEBUG_VAR_SET(int3, testChild.i3, 3) + TEST_DEBUG_VAR_SET(int4, testChild.i4, 4) // TEST_DEBUG_VAR_END if(testIndex == 0) @@ -157,6 +178,13 @@ struct TestStruct SET_DATA(testIndex, testResult); EARLY_RETURN; } + else if(testIndex == 5) + { + testResult.x = testChild.i; + testResult.y = testChild.i2.x; + testResult.z = testChild.i3.y; + testResult.w = testChild.i4.z; + } else { testResult = 0.4f;