D3D: Fix crash if shaders fail to compile
This commit is contained in:
parent
c97a799c5f
commit
c15ea2f1ed
|
@ -251,7 +251,7 @@ bool GeometryShaderCache::CompileShader(const GeometryShaderUid& uid)
|
||||||
ShaderCode code =
|
ShaderCode code =
|
||||||
GenerateGeometryShaderCode(APIType::D3D, ShaderHostConfig::GetCurrent(), uid.GetUidData());
|
GenerateGeometryShaderCode(APIType::D3D, ShaderHostConfig::GetCurrent(), uid.GetUidData());
|
||||||
if (!D3D::CompileGeometryShader(code.GetBuffer(), &bytecode) ||
|
if (!D3D::CompileGeometryShader(code.GetBuffer(), &bytecode) ||
|
||||||
!InsertByteCode(uid, bytecode->Data(), bytecode->Size()))
|
!InsertByteCode(uid, bytecode ? bytecode->Data() : nullptr, bytecode ? bytecode->Size() : 0))
|
||||||
{
|
{
|
||||||
SAFE_RELEASE(bytecode);
|
SAFE_RELEASE(bytecode);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -644,7 +644,7 @@ bool PixelShaderCache::SetShader()
|
||||||
ShaderCode code =
|
ShaderCode code =
|
||||||
GeneratePixelShaderCode(APIType::D3D, ShaderHostConfig::GetCurrent(), uid.GetUidData());
|
GeneratePixelShaderCode(APIType::D3D, ShaderHostConfig::GetCurrent(), uid.GetUidData());
|
||||||
D3D::CompilePixelShader(code.GetBuffer(), &bytecode);
|
D3D::CompilePixelShader(code.GetBuffer(), &bytecode);
|
||||||
if (!InsertByteCode(uid, bytecode->Data(), bytecode->Size()))
|
if (!InsertByteCode(uid, bytecode ? bytecode->Data() : nullptr, bytecode ? bytecode->Size() : 0))
|
||||||
{
|
{
|
||||||
SAFE_RELEASE(bytecode);
|
SAFE_RELEASE(bytecode);
|
||||||
return false;
|
return false;
|
||||||
|
@ -687,7 +687,7 @@ bool PixelShaderCache::SetUberShader()
|
||||||
ShaderCode code =
|
ShaderCode code =
|
||||||
UberShader::GenPixelShader(APIType::D3D, ShaderHostConfig::GetCurrent(), uid.GetUidData());
|
UberShader::GenPixelShader(APIType::D3D, ShaderHostConfig::GetCurrent(), uid.GetUidData());
|
||||||
D3D::CompilePixelShader(code.GetBuffer(), &bytecode);
|
D3D::CompilePixelShader(code.GetBuffer(), &bytecode);
|
||||||
if (!InsertByteCode(uid, bytecode->Data(), bytecode->Size()))
|
if (!InsertByteCode(uid, bytecode ? bytecode->Data() : nullptr, bytecode ? bytecode->Size() : 0))
|
||||||
{
|
{
|
||||||
SAFE_RELEASE(bytecode);
|
SAFE_RELEASE(bytecode);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue