mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 08:21:29 +12:00
vk: Fix mapping of output colors to render target ranges
This commit is contained in:
parent
8a0f6f1cbc
commit
3651e67a25
1 changed files with 5 additions and 11 deletions
|
@ -91,18 +91,12 @@ void VKFragmentDecompilerThread::insertOutputs(std::stringstream & OS)
|
||||||
{ "ocol3", m_ctrl & CELL_GCM_SHADER_CONTROL_32_BITS_EXPORTS ? "r4" : "h8" },
|
{ "ocol3", m_ctrl & CELL_GCM_SHADER_CONTROL_32_BITS_EXPORTS ? "r4" : "h8" },
|
||||||
};
|
};
|
||||||
|
|
||||||
//We always bind the first usable image to index 0, even if surface type is surface_type::b
|
//NOTE: We do not skip outputs, the only possible combinations are a(0), b(0), ab(0,1), abc(0,1,2), abcd(0,1,2,3)
|
||||||
//If only surface 1 is being written to, redirect to output 0
|
u8 output_index = 0;
|
||||||
|
for (int i = 0; i < sizeof(table) / sizeof(*table); ++i)
|
||||||
if (m_parr.HasParam(PF_PARAM_NONE, "vec4", table[1].second) && !m_parr.HasParam(PF_PARAM_NONE, "vec4", table[0].second))
|
|
||||||
OS << "layout(location=0) out vec4 " << table[1].first << ";" << std::endl;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
for (int i = 0; i < sizeof(table) / sizeof(*table); ++i)
|
if (m_parr.HasParam(PF_PARAM_NONE, "vec4", table[i].second))
|
||||||
{
|
OS << "layout(location=" << std::to_string(output_index++) << ") " << "out vec4 " << table[i].first << ";" << std::endl;
|
||||||
if (m_parr.HasParam(PF_PARAM_NONE, "vec4", table[i].second))
|
|
||||||
OS << "layout(location=" << i << ") " << "out vec4 " << table[i].first << ";" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue