enable debug layer separately from independent-device logic
This commit is contained in:
parent
58543ac517
commit
21553804a2
@ -92,18 +92,33 @@ void G_Bootstrap(void)
|
||||
{
|
||||
Panic(StringF(scratch.arena, "Failed to create ID3D12DeviceFactory: Error code 0x%F", FmtHex(hr)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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);
|
||||
ID3D12Debug1_EnableDebugLayer(debug);
|
||||
if (G_D12.validation_layer_enabled)
|
||||
{
|
||||
ID3D12Debug1_SetEnableGPUBasedValidation(debug, 1);
|
||||
}
|
||||
}
|
||||
//////////////////////////////
|
||||
//- Enable D3D12 debug layer
|
||||
|
||||
// Enable debug layer
|
||||
if (G_D12.debug_layer_enabled)
|
||||
{
|
||||
ID3D12Debug1 *debug = 0;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user