mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-02 00:10:33 +01:00
r300/compiler: Use zero as the register index for unused sources
This fixes an invalid "Too many hardware temporaries used" error in the
case where a source reads from a temporary register with an index greater
than max_temp_regs and then the source is marked as unused before the
register allocation pass.
NOTE: This is a candidate for the 7.9 branch.
(cherry picked from commit d668659003)
This commit is contained in:
parent
7c8715ef0a
commit
80ff25b628
2 changed files with 6 additions and 0 deletions
|
|
@ -76,6 +76,9 @@ static void use_temporary(struct r300_fragment_program_code *code, unsigned int
|
|||
|
||||
static unsigned int use_source(struct r300_fragment_program_code* code, struct radeon_pair_instruction_source src)
|
||||
{
|
||||
if (!src.Used)
|
||||
return 0;
|
||||
|
||||
if (src.File == RC_FILE_CONSTANT) {
|
||||
return src.Index | (1 << 5);
|
||||
} else if (src.File == RC_FILE_TEMPORARY) {
|
||||
|
|
|
|||
|
|
@ -200,6 +200,9 @@ static void use_temporary(struct r500_fragment_program_code* code, unsigned int
|
|||
|
||||
static unsigned int use_source(struct r500_fragment_program_code* code, struct radeon_pair_instruction_source src)
|
||||
{
|
||||
if (!src.Used)
|
||||
return 0;
|
||||
|
||||
if (src.File == RC_FILE_CONSTANT) {
|
||||
return src.Index | 0x100;
|
||||
} else if (src.File == RC_FILE_TEMPORARY) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue