VideoBackends/D3D11: Include HRESULT in error messages

This commit is contained in:
Pokechu22
2021-12-12 12:50:13 -08:00
parent 140c8217f6
commit 23cdb5c576
9 changed files with 73 additions and 38 deletions

View File

@ -349,7 +349,7 @@ ID3D11SamplerState* StateCache::Get(SamplerState state)
ComPtr<ID3D11SamplerState> res;
HRESULT hr = D3D::device->CreateSamplerState(&sampdc, res.GetAddressOf());
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating D3D sampler state failed");
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating D3D sampler state failed: {}", DX11HRWrap(hr));
return m_sampler.emplace(state, std::move(res)).first->second.Get();
}
@ -387,7 +387,7 @@ ID3D11BlendState* StateCache::Get(BlendingState state)
{
return m_blend.emplace(state.hex, std::move(res)).first->second.Get();
}
WARN_LOG_FMT(VIDEO, "Creating D3D blend state failed with an error: {:08X}", hr);
WARN_LOG_FMT(VIDEO, "Creating D3D blend state failed with an error: {}", DX11HRWrap(hr));
}
D3D11_BLEND_DESC desc = {};
@ -426,7 +426,7 @@ ID3D11BlendState* StateCache::Get(BlendingState state)
ComPtr<ID3D11BlendState> res;
HRESULT hr = D3D::device->CreateBlendState(&desc, res.GetAddressOf());
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating D3D blend state failed");
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating D3D blend state failed: {}", DX11HRWrap(hr));
return m_blend.emplace(state.hex, std::move(res)).first->second.Get();
}
@ -447,7 +447,7 @@ ID3D11RasterizerState* StateCache::Get(RasterizationState state)
ComPtr<ID3D11RasterizerState> res;
HRESULT hr = D3D::device->CreateRasterizerState(&desc, res.GetAddressOf());
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating D3D rasterizer state failed");
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating D3D rasterizer state failed: {}", DX11HRWrap(hr));
return m_raster.emplace(state.hex, std::move(res)).first->second.Get();
}
@ -489,7 +489,7 @@ ID3D11DepthStencilState* StateCache::Get(DepthState state)
ComPtr<ID3D11DepthStencilState> res;
HRESULT hr = D3D::device->CreateDepthStencilState(&depthdc, res.GetAddressOf());
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating D3D depth stencil state failed");
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating D3D depth stencil state failed: {}", DX11HRWrap(hr));
return m_depth.emplace(state.hex, std::move(res)).first->second.Get();
}