If a shader doesn't use any register and only ssa values we might
end up with zero minimum registers, and because a unsigned is
returned that goes wrong.
Fixes:
565816dfa15214abbeef9a9d94e44f30507ca4d7
r600/sfn: Set minimum required registers based on array allocation
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8008
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20516>
{
if (value_factory().allocate_registers(registers))
m_indirect_files |= 1 << TGSI_FILE_TEMPORARY;
- m_required_registers = value_factory().next_register_index() - 1;
+ m_required_registers = value_factory().next_register_index() ?
+ value_factory().next_register_index() - 1 : 0;
}
bool