mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-01 16:13:23 +00:00
d3d12: Fix m_ctrl not being properly passed to fragement decompiler
Fix Retro City Rampage
This commit is contained in:
parent
45b7da6666
commit
3cc3974466
@ -71,25 +71,16 @@ void D3D12FragmentDecompiler::insertOutputs(std::stringstream & OS)
|
||||
OS << "{" << std::endl;
|
||||
const std::pair<std::string, std::string> table[] =
|
||||
{
|
||||
{ "ocol0", "r0" },
|
||||
{ "ocol1", "r2" },
|
||||
{ "ocol2", "r3" },
|
||||
{ "ocol3", "r4" },
|
||||
{ "ocol0", m_ctrl & 0x40 ? "r0" : "h0" },
|
||||
{ "ocol1", m_ctrl & 0x40 ? "r2" : "h4" },
|
||||
{ "ocol2", m_ctrl & 0x40 ? "r3" : "h6" },
|
||||
{ "ocol3", m_ctrl & 0x40 ? "r4" : "h8" },
|
||||
};
|
||||
|
||||
const std::pair<std::string, std::string> table2[] =
|
||||
{
|
||||
{ "ocol0", "h0" },
|
||||
{ "ocol1", "h2" },
|
||||
{ "ocol2", "h3" },
|
||||
{ "ocol3", "h4" },
|
||||
};
|
||||
for (int i = 0; i < sizeof(table) / sizeof(*table); ++i)
|
||||
{
|
||||
if (m_parr.HasParam(PF_PARAM_NONE, "float4", table[i].second))
|
||||
OS << " " << "float4" << " " << table[i].first << " : SV_TARGET" << i << ";" << std::endl;
|
||||
else if (m_parr.HasParam(PF_PARAM_NONE, "float4", table2[i].second))
|
||||
OS << " " << "float4" << " " << table2[i].first << " : SV_TARGET" << i << ";" << std::endl;
|
||||
}
|
||||
OS << "};" << std::endl;
|
||||
}
|
||||
@ -141,18 +132,10 @@ void D3D12FragmentDecompiler::insertMainEnd(std::stringstream & OS)
|
||||
{
|
||||
const std::pair<std::string, std::string> table[] =
|
||||
{
|
||||
{ "ocol0", "r0" },
|
||||
{ "ocol1", "r2" },
|
||||
{ "ocol2", "r3" },
|
||||
{ "ocol3", "r4" },
|
||||
};
|
||||
|
||||
const std::pair<std::string, std::string> table2[] =
|
||||
{
|
||||
{ "ocol0", "h0" },
|
||||
{ "ocol1", "h2" },
|
||||
{ "ocol2", "h3" },
|
||||
{ "ocol3", "h4" },
|
||||
{ "ocol0", m_ctrl & 0x40 ? "r0" : "h0" },
|
||||
{ "ocol1", m_ctrl & 0x40 ? "r2" : "h4" },
|
||||
{ "ocol2", m_ctrl & 0x40 ? "r3" : "h6" },
|
||||
{ "ocol3", m_ctrl & 0x40 ? "r4" : "h8" },
|
||||
};
|
||||
|
||||
OS << " PixelOutput Out;" << std::endl;
|
||||
@ -160,8 +143,6 @@ void D3D12FragmentDecompiler::insertMainEnd(std::stringstream & OS)
|
||||
{
|
||||
if (m_parr.HasParam(PF_PARAM_NONE, "float4", table[i].second))
|
||||
OS << " Out." << table[i].first << " = " << table[i].second << ";" << std::endl;
|
||||
else if (m_parr.HasParam(PF_PARAM_NONE, "float4", table2[i].second))
|
||||
OS << " Out." << table2[i].first << " = " << table2[i].second << ";" << std::endl;
|
||||
}
|
||||
OS << " if (isAlphaTested && Out.ocol0.a <= alphaRef) discard;" << std::endl;
|
||||
OS << " return Out;" << std::endl;
|
||||
|
@ -91,7 +91,7 @@ struct D3D12Traits
|
||||
static
|
||||
void RecompileFragmentProgram(RSXFragmentProgram *RSXFP, FragmentProgramData& fragmentProgramData, size_t ID)
|
||||
{
|
||||
D3D12FragmentDecompiler FS(RSXFP->addr, RSXFP->size, RSXFP->offset);
|
||||
D3D12FragmentDecompiler FS(RSXFP->addr, RSXFP->size, RSXFP->ctrl);
|
||||
const std::string &shader = FS.Decompile();
|
||||
fragmentProgramData.Compile(shader, Shader::SHADER_TYPE::SHADER_TYPE_FRAGMENT);
|
||||
fragmentProgramData.m_textureCount = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user