D3D11/Texture: Log attributes when creation fails

This commit is contained in:
Connor McLaughlin 2021-01-05 17:19:05 +10:00
parent 8f5c20bdf5
commit e3de44d127
1 changed files with 5 additions and 3 deletions

View File

@ -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()); const HRESULT tex_hr = device->CreateTexture2D(&desc, initial_data ? &srd : nullptr, texture.GetAddressOf());
if (FAILED(tex_hr)) 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<unsigned>(format), bind_flags, initial_data);
return false; 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()); const HRESULT hr = device->CreateShaderResourceView(texture.Get(), &srv_desc, srv.GetAddressOf());
if (FAILED(hr)) 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; 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()); const HRESULT hr = device->CreateRenderTargetView(texture.Get(), &rtv_desc, rtv.GetAddressOf());
if (FAILED(hr)) 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; return false;
} }
} }