mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 23:41:26 +12:00
d3d12: Use CHECK_HRESULT in D3D12Utils.cpp
This commit is contained in:
parent
669a3277ff
commit
08622a41b4
1 changed files with 6 additions and 33 deletions
|
@ -28,12 +28,7 @@ std::pair<ID3DBlob *, ID3DBlob *> compileF32toU8CS()
|
||||||
|
|
||||||
ID3DBlob *bytecode;
|
ID3DBlob *bytecode;
|
||||||
Microsoft::WRL::ComPtr<ID3DBlob> errorBlob;
|
Microsoft::WRL::ComPtr<ID3DBlob> errorBlob;
|
||||||
HRESULT hr = wrapD3DCompile(shaderCode, strlen(shaderCode), "test", nullptr, nullptr, "main", "cs_5_0", 0, 0, &bytecode, errorBlob.GetAddressOf());
|
CHECK_HRESULT(wrapD3DCompile(shaderCode, strlen(shaderCode), "test", nullptr, nullptr, "main", "cs_5_0", 0, 0, &bytecode, errorBlob.GetAddressOf()));
|
||||||
if (hr != S_OK)
|
|
||||||
{
|
|
||||||
const char *tmp = (const char*)errorBlob->GetBufferPointer();
|
|
||||||
LOG_ERROR(RSX, tmp);
|
|
||||||
}
|
|
||||||
CD3DX12_DESCRIPTOR_RANGE descriptorRange[] =
|
CD3DX12_DESCRIPTOR_RANGE descriptorRange[] =
|
||||||
{
|
{
|
||||||
// Textures
|
// Textures
|
||||||
|
@ -47,13 +42,7 @@ std::pair<ID3DBlob *, ID3DBlob *> compileF32toU8CS()
|
||||||
|
|
||||||
ID3DBlob *rootSignatureBlob;
|
ID3DBlob *rootSignatureBlob;
|
||||||
|
|
||||||
hr = wrapD3D12SerializeRootSignature(&CD3DX12_ROOT_SIGNATURE_DESC(1, &RP), D3D_ROOT_SIGNATURE_VERSION_1, &rootSignatureBlob, &errorBlob);
|
CHECK_HRESULT(wrapD3D12SerializeRootSignature(&CD3DX12_ROOT_SIGNATURE_DESC(1, &RP), D3D_ROOT_SIGNATURE_VERSION_1, &rootSignatureBlob, &errorBlob));
|
||||||
if (hr != S_OK)
|
|
||||||
{
|
|
||||||
const char *tmp = (const char*)errorBlob->GetBufferPointer();
|
|
||||||
LOG_ERROR(RSX, tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
return std::make_pair(bytecode, rootSignatureBlob);
|
return std::make_pair(bytecode, rootSignatureBlob);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,12 +67,7 @@ void D3D12GSRender::Shader::Init(ID3D12Device *device, ID3D12CommandQueue *gfxco
|
||||||
|
|
||||||
Microsoft::WRL::ComPtr<ID3DBlob> fsBytecode;
|
Microsoft::WRL::ComPtr<ID3DBlob> fsBytecode;
|
||||||
Microsoft::WRL::ComPtr<ID3DBlob> errorBlob;
|
Microsoft::WRL::ComPtr<ID3DBlob> errorBlob;
|
||||||
HRESULT hr = wrapD3DCompile(fsCode, strlen(fsCode), "test", nullptr, nullptr, "main", "ps_5_0", 0, 0, &fsBytecode, errorBlob.GetAddressOf());
|
CHECK_HRESULT(wrapD3DCompile(fsCode, strlen(fsCode), "test", nullptr, nullptr, "main", "ps_5_0", 0, 0, &fsBytecode, errorBlob.GetAddressOf()));
|
||||||
if (hr != S_OK)
|
|
||||||
{
|
|
||||||
const char *tmp = (const char*)errorBlob->GetBufferPointer();
|
|
||||||
LOG_ERROR(RSX, tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *vsCode = STRINGIFY(
|
const char *vsCode = STRINGIFY(
|
||||||
struct VertexInput \n
|
struct VertexInput \n
|
||||||
|
@ -108,12 +92,7 @@ void D3D12GSRender::Shader::Init(ID3D12Device *device, ID3D12CommandQueue *gfxco
|
||||||
);
|
);
|
||||||
|
|
||||||
Microsoft::WRL::ComPtr<ID3DBlob> vsBytecode;
|
Microsoft::WRL::ComPtr<ID3DBlob> vsBytecode;
|
||||||
hr = wrapD3DCompile(vsCode, strlen(vsCode), "test", nullptr, nullptr, "main", "vs_5_0", 0, 0, &vsBytecode, errorBlob.GetAddressOf());
|
CHECK_HRESULT(wrapD3DCompile(vsCode, strlen(vsCode), "test", nullptr, nullptr, "main", "vs_5_0", 0, 0, &vsBytecode, errorBlob.GetAddressOf()));
|
||||||
if (hr != S_OK)
|
|
||||||
{
|
|
||||||
const char *tmp = (const char*)errorBlob->GetBufferPointer();
|
|
||||||
LOG_ERROR(RSX, tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
D3D12_GRAPHICS_PIPELINE_STATE_DESC psoDesc = {};
|
D3D12_GRAPHICS_PIPELINE_STATE_DESC psoDesc = {};
|
||||||
psoDesc.PS.BytecodeLength = fsBytecode->GetBufferSize();
|
psoDesc.PS.BytecodeLength = fsBytecode->GetBufferSize();
|
||||||
|
@ -163,14 +142,8 @@ void D3D12GSRender::Shader::Init(ID3D12Device *device, ID3D12CommandQueue *gfxco
|
||||||
|
|
||||||
Microsoft::WRL::ComPtr<ID3DBlob> rootSignatureBlob;
|
Microsoft::WRL::ComPtr<ID3DBlob> rootSignatureBlob;
|
||||||
|
|
||||||
hr = wrapD3D12SerializeRootSignature(&rootSignatureDesc, D3D_ROOT_SIGNATURE_VERSION_1, &rootSignatureBlob, &errorBlob);
|
CHECK_HRESULT(wrapD3D12SerializeRootSignature(&rootSignatureDesc, D3D_ROOT_SIGNATURE_VERSION_1, &rootSignatureBlob, &errorBlob));
|
||||||
if (hr != S_OK)
|
CHECK_HRESULT(device->CreateRootSignature(0, rootSignatureBlob->GetBufferPointer(), rootSignatureBlob->GetBufferSize(), IID_PPV_ARGS(&m_rootSignature)));
|
||||||
{
|
|
||||||
const char *tmp = (const char*)errorBlob->GetBufferPointer();
|
|
||||||
LOG_ERROR(RSX, tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = device->CreateRootSignature(0, rootSignatureBlob->GetBufferPointer(), rootSignatureBlob->GetBufferSize(), IID_PPV_ARGS(&m_rootSignature));
|
|
||||||
|
|
||||||
psoDesc.pRootSignature = m_rootSignature;
|
psoDesc.pRootSignature = m_rootSignature;
|
||||||
psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
|
psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue