mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 07:45:33 +01:00
Merge pull request #10341 from AdmiralCurtiss/dx12-shader-crash
D3D12: Fix nullptr dereference when creating a shader with a name.
This commit is contained in:
commit
a026ef30d2
@ -13,10 +13,6 @@ namespace DX12
|
|||||||
DXShader::DXShader(ShaderStage stage, BinaryData bytecode, std::string_view name)
|
DXShader::DXShader(ShaderStage stage, BinaryData bytecode, std::string_view name)
|
||||||
: D3DCommon::Shader(stage, std::move(bytecode)), m_name(UTF8ToWString(name))
|
: D3DCommon::Shader(stage, std::move(bytecode)), m_name(UTF8ToWString(name))
|
||||||
{
|
{
|
||||||
if (!m_name.empty())
|
|
||||||
{
|
|
||||||
m_compute_pipeline->SetName(m_name.c_str());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DXShader::~DXShader() = default;
|
DXShader::~DXShader() = default;
|
||||||
@ -56,6 +52,10 @@ bool DXShader::CreateComputePipeline()
|
|||||||
HRESULT hr = g_dx_context->GetDevice()->CreateComputePipelineState(
|
HRESULT hr = g_dx_context->GetDevice()->CreateComputePipelineState(
|
||||||
&desc, IID_PPV_ARGS(&m_compute_pipeline));
|
&desc, IID_PPV_ARGS(&m_compute_pipeline));
|
||||||
CHECK(SUCCEEDED(hr), "Creating compute pipeline failed");
|
CHECK(SUCCEEDED(hr), "Creating compute pipeline failed");
|
||||||
|
|
||||||
|
if (m_compute_pipeline && !m_name.empty())
|
||||||
|
m_compute_pipeline->SetName(m_name.c_str());
|
||||||
|
|
||||||
return SUCCEEDED(hr);
|
return SUCCEEDED(hr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user