From b71723ab4a27affaa659a1f166893a79303f1abc Mon Sep 17 00:00:00 2001 From: whoalin1 <207920491+whoalin1@users.noreply.github.com> Date: Wed, 25 Nov 2026 02:38:49 +0200 Subject: [PATCH] tests: skip honestly when push constants fall below the 144-byte contract d3d12_first_light_test builds translated PSOs that need 144 push-constant bytes; on a device with a smaller limit (e.g. a 128-byte iGPU) PSO creation would fail. d3d12_state_sweep_test was worse: every case's PSO fails the same way, each counts as a per-case skip, and the test could return success having compared nothing. Both now check rt::d3d12::device_push_constants_need_fallback right after the layer device exists and return 77, matching d3d12_pipeline_library_test, d3d12_msaa_draw_test and d3d12_fspx_compute_test. Co-Authored-By: Devin --- runtime/test/d3d12_first_light_test.cpp | 5 +++++ runtime/test/d3d12_state_sweep_test.cpp | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/runtime/test/d3d12_first_light_test.cpp b/runtime/test/d3d12_first_light_test.cpp index c5aea7fd59..7c6ca8e8b4 100644 --- a/runtime/test/d3d12_first_light_test.cpp +++ b/runtime/test/d3d12_first_light_test.cpp @@ -136,6 +136,11 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); + if (rt::d3d12::device_push_constants_need_fallback(inner)) { + std::printf("d3d12_first_light_test: skipped, the PSOs need 144 push-constant bytes and this GPU has %u\n", + rt::d3d12::device_max_push_constants_size(inner)); + return 77; + } // No root parameters: the VS applies no matrix and the PS has no bindings (vk_harness pushes zeros too). D3D12_VERSIONED_ROOT_SIGNATURE_DESC root_desc{}; diff --git a/runtime/test/d3d12_state_sweep_test.cpp b/runtime/test/d3d12_state_sweep_test.cpp index 2c237910bf..c78a05b714 100644 --- a/runtime/test/d3d12_state_sweep_test.cpp +++ b/runtime/test/d3d12_state_sweep_test.cpp @@ -574,6 +574,13 @@ int main() { Ref ours, host; std::string adapter; if (FAILED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&ours.p)))) return 1; + // Every case's PSO needs the 144 push-constant bytes the index declares; on a smaller limit they all fail and + // each would count as a per-case skip, leaving a silent pass that compared nothing. + if (rt::d3d12::device_push_constants_need_fallback(ours.p)) { + std::printf("d3d12_state_sweep_test: skipped, the PSOs need 144 push-constant bytes and this GPU has %u\n", + rt::d3d12::device_max_push_constants_size(ours.p)); + return 77; + } if (!host_device(vk, host, adapter)) { std::fprintf(stderr, "no host D3D12 device on the Vulkan device's adapter\n"); return 77;