tests: Improve feedback when enabling d3d12 debug layers.

This commit is contained in:
Giovanni Mascellani 2024-05-01 15:16:03 -07:00 committed by Henri Verbeet
parent 3dc43e8945
commit e3ddb76a3e
Notes: Henri Verbeet 2024-07-09 20:53:44 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Conor McCarthy (@cmccarthy)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/853

View File

@ -749,26 +749,35 @@ static void enable_d3d12_debug_layer(void)
{
ID3D12Debug1 *debug1;
ID3D12Debug *debug;
HRESULT hr;
if (test_options.enable_gpu_based_validation)
{
if (SUCCEEDED(D3D12GetDebugInterface(&IID_ID3D12Debug1, (void **)&debug1)))
if (SUCCEEDED(hr = D3D12GetDebugInterface(&IID_ID3D12Debug1, (void **)&debug1)))
{
ID3D12Debug1_SetEnableGPUBasedValidation(debug1, true);
ID3D12Debug1_Release(debug1);
test_options.enable_debug_layer = true;
trace("GPU-based validation was enabled.\n");
}
else
{
trace("Failed to enable GPU-based validation.\n");
trace("Failed to enable GPU-based validation, hr %#x.\n", hr);
}
}
if (test_options.enable_debug_layer
&& SUCCEEDED(D3D12GetDebugInterface(&IID_ID3D12Debug, (void **)&debug)))
if (test_options.enable_debug_layer)
{
ID3D12Debug_EnableDebugLayer(debug);
ID3D12Debug_Release(debug);
if (SUCCEEDED(hr = D3D12GetDebugInterface(&IID_ID3D12Debug, (void **)&debug)))
{
ID3D12Debug_EnableDebugLayer(debug);
ID3D12Debug_Release(debug);
trace("The debug layer was enabled.\n");
}
else
{
trace("Failed to enable the debug layer, hr %#x.\n", hr);
}
}
}