mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 15:55:31 +01:00
Merge pull request #6031 from stenzek/d3d-crash
D3D: Fix shader compile error with logicop and alpha test enabled
This commit is contained in:
commit
5d6dac5410
@ -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;
|
||||||
|
@ -1232,7 +1232,7 @@ static void WriteAlphaTest(ShaderCode& out, const pixel_shader_uid_data* uid_dat
|
|||||||
out.Write(")) {\n");
|
out.Write(")) {\n");
|
||||||
|
|
||||||
out.Write("\t\tocol0 = float4(0.0, 0.0, 0.0, 0.0);\n");
|
out.Write("\t\tocol0 = float4(0.0, 0.0, 0.0, 0.0);\n");
|
||||||
if (use_dual_source)
|
if (use_dual_source && !(ApiType == APIType::D3D && uid_data->uint_output))
|
||||||
out.Write("\t\tocol1 = float4(0.0, 0.0, 0.0, 0.0);\n");
|
out.Write("\t\tocol1 = float4(0.0, 0.0, 0.0, 0.0);\n");
|
||||||
if (per_pixel_depth)
|
if (per_pixel_depth)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user