vk/gl: Mark unused FP outputs as unused
This commit is contained in:
@@ -103,7 +103,18 @@ void GLFragmentDecompilerThread::insertOutputs(std::stringstream & OS)
|
|||||||
const auto reg_type = float_type ? "vec4" : getHalfTypeName(4);
|
const auto reg_type = float_type ? "vec4" : getHalfTypeName(4);
|
||||||
for (uint i = 0; i < std::size(table); ++i)
|
for (uint i = 0; i < std::size(table); ++i)
|
||||||
{
|
{
|
||||||
if (m_parr.HasParam(PF_PARAM_NONE, reg_type, table[i].second))
|
if (!m_parr.HasParam(PF_PARAM_NONE, reg_type, table[i].second))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i >= m_prog.mrt_buffers_count)
|
||||||
|
{
|
||||||
|
// Dead writes. Declare as temp variables for DCE to clean up.
|
||||||
|
OS << "vec4 " << table[i].first << "; // Unused\n";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
OS << "layout(location=" << i << ") out vec4 " << table[i].first << ";\n";
|
OS << "layout(location=" << i << ") out vec4 " << table[i].first << ";\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,13 +156,23 @@ void VKFragmentDecompilerThread::insertOutputs(std::stringstream & OS)
|
|||||||
const auto reg_type = float_type ? "vec4" : getHalfTypeName(4);
|
const auto reg_type = float_type ? "vec4" : getHalfTypeName(4);
|
||||||
for (uint i = 0; i < std::size(table); ++i)
|
for (uint i = 0; i < std::size(table); ++i)
|
||||||
{
|
{
|
||||||
if (m_parr.HasParam(PF_PARAM_NONE, reg_type, table[i].second))
|
if (!m_parr.HasParam(PF_PARAM_NONE, reg_type, table[i].second))
|
||||||
{
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i >= m_prog.mrt_buffers_count)
|
||||||
|
{
|
||||||
|
// Dead writes. Declare as temp variables for DCE to clean up.
|
||||||
|
OS << "vec4 " << table[i].first << "; // Unused\n";
|
||||||
|
vk_prog->output_color_masks[i] = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
OS << "layout(location=" << std::to_string(output_index++) << ") " << "out vec4 " << table[i].first << ";\n";
|
OS << "layout(location=" << std::to_string(output_index++) << ") " << "out vec4 " << table[i].first << ";\n";
|
||||||
vk_prog->output_color_masks[i] = -1;
|
vk_prog->output_color_masks[i] = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void VKFragmentDecompilerThread::insertConstants(std::stringstream & OS)
|
void VKFragmentDecompilerThread::insertConstants(std::stringstream & OS)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user