From 2949b786a7f04ad31c113b622039fb5b72bc8622 Mon Sep 17 00:00:00 2001 From: Anders Leino Date: Sat, 1 Feb 2025 07:14:17 +0200 Subject: Update Slang-RHI and enable any debug layers up-front (#6226) * Update Slang-RHI and enable any debug layers up-front As [1] shows, creating a D3D12 device and then enabling debug layers causes future device creation to fail. That means enabling debug layers is a process-wide decision that should be done at startup, and not just before creating an individual device. Previously, Slang-RHI enabled debug layers as part of device creation. The new Slang-RHI revision doesn't do that anymore, but instead allows the user to enable debug layers earlier, with a separate API. This change calls the mentioned API before creating any device. This closes #6172. * Compile fixes needed after updating slang-rhi --------- Co-authored-by: Yong He --- tools/render-test/render-test-main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools/render-test/render-test-main.cpp') diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp index 648e5a4bd..a8bd00bd4 100644 --- a/tools/render-test/render-test-main.cpp +++ b/tools/render-test/render-test-main.cpp @@ -1404,10 +1404,11 @@ static SlangResult _innerMain( } } - desc.nvapiExtnSlot = int(nvapiExtnSlot); + desc.nvapiExtUavSlot = uint32_t(nvapiExtnSlot); desc.slang.slangGlobalSession = session; desc.slang.targetProfile = options.profileName.getBuffer(); { + getRHI()->enableDebugLayers(); SlangResult res = getRHI()->createDevice(desc, device.writeRef()); if (SLANG_FAILED(res)) { -- cgit v1.2.3