d3d12: Make depth test optionnal and use (0,0,0,0) when texture unit is disabled

This commit is contained in:
vlj 2015-06-11 19:26:52 +02:00 committed by Vincent Lejeune
parent 482a371bb0
commit 2f54482592
4 changed files with 11 additions and 3 deletions

View file

@ -37,6 +37,7 @@ void D3D12FragmentDecompiler::insertHeader(std::stringstream & OS)
OS << "cbuffer SCALE_OFFSET : register(b0)" << std::endl;
OS << "{" << std::endl;
OS << " float4x4 scaleOffsetMat;" << std::endl;
OS << " int isAlphaTested;" << std::endl;
OS << " float alphaRef;" << std::endl;
OS << "};" << std::endl;
}
@ -162,7 +163,7 @@ void D3D12FragmentDecompiler::insertMainEnd(std::stringstream & OS)
else if (m_parr.HasParam(PF_PARAM_NONE, "float4", table2[i].second))
OS << " Out." << table2[i].first << " = " << table2[i].second << ";" << std::endl;
}
OS << " if (Out.ocol0.a <= alphaRef) discard;" << std::endl;
OS << " if (isAlphaTested && Out.ocol0.a <= alphaRef) discard;" << std::endl;
OS << " return Out;" << std::endl;
OS << "}" << std::endl;
}