From e3de44d12779526164f0035a5021473cf0267c54 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 5 Jan 2021 17:19:05 +1000 Subject: [PATCH] D3D11/Texture: Log attributes when creation fails --- src/common/d3d11/texture.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/d3d11/texture.cpp b/src/common/d3d11/texture.cpp index 1b307654a..22f4c617e 100644 --- a/src/common/d3d11/texture.cpp +++ b/src/common/d3d11/texture.cpp @@ -45,7 +45,9 @@ bool Texture::Create(ID3D11Device* device, u32 width, u32 height, u16 levels, u1 const HRESULT tex_hr = device->CreateTexture2D(&desc, initial_data ? &srd : nullptr, texture.GetAddressOf()); if (FAILED(tex_hr)) { - Log_ErrorPrintf("Create texture failed: 0x%08X", tex_hr); + Log_ErrorPrintf( + "Create texture failed: 0x%08X (%ux%u levels:%u samples:%u format:%u bind_flags:%X initial_data:%p)", tex_hr, + width, height, levels, samples, static_cast(format), bind_flags, initial_data); return false; } @@ -58,7 +60,7 @@ bool Texture::Create(ID3D11Device* device, u32 width, u32 height, u16 levels, u1 const HRESULT hr = device->CreateShaderResourceView(texture.Get(), &srv_desc, srv.GetAddressOf()); if (FAILED(hr)) { - Log_ErrorPrintf("Create SRV for adopted texture failed: 0x%08X", hr); + Log_ErrorPrintf("Create SRV for texture failed: 0x%08X", hr); return false; } } @@ -72,7 +74,7 @@ bool Texture::Create(ID3D11Device* device, u32 width, u32 height, u16 levels, u1 const HRESULT hr = device->CreateRenderTargetView(texture.Get(), &rtv_desc, rtv.GetAddressOf()); if (FAILED(hr)) { - Log_ErrorPrintf("Create RTV for adopted texture failed: 0x%08X", hr); + Log_ErrorPrintf("Create RTV for texture failed: 0x%08X", hr); return false; } }