enable debug layer separately from independent-device logic

This commit is contained in:
jacob 2026-02-27 00:00:07 -06:00
parent 58543ac517
commit 21553804a2

View File

@ -92,20 +92,35 @@ void G_Bootstrap(void)
{
Panic(StringF(scratch.arena, "Failed to create ID3D12DeviceFactory: Error code 0x%F", FmtHex(hr)));
}
}
}
//////////////////////////////
//- Enable D3D12 debug layer
// Enable debug layer
if (G_D12.debug_layer_enabled)
{
ID3D12Debug1 *debug = 0;
ID3D12DeviceFactory_GetConfigurationInterface(G_D12.independent.device_factory, &CLSID_D3D12Debug, &IID_ID3D12Debug1, (void **)&debug);
HRESULT hr = 0;
if (G_D12.independent_devices_enabled)
{
hr = ID3D12DeviceFactory_GetConfigurationInterface(G_D12.independent.device_factory, &CLSID_D3D12Debug, &IID_ID3D12Debug1, (void **)&debug);
}
else
{
hr = D3D12GetDebugInterface(&IID_ID3D12Debug1, (void **)&debug);
}
if (FAILED(hr))
{
Panic(Lit("Failed to retrieve D3D12 Debug interface"));
}
ID3D12Debug1_EnableDebugLayer(debug);
if (G_D12.validation_layer_enabled)
{
ID3D12Debug1_SetEnableGPUBasedValidation(debug, 1);
}
}
}
}
//////////////////////////////
//- Initialize device