#include "r500_fragprog.h"
-#include "../r300_reg.h"
+#include "r300_reg.h"
#include "radeon_program_pair.h"
} else if (src.File == RC_FILE_TEMPORARY || src.File == RC_FILE_INPUT) {
use_temporary(code, src.Index);
return src.Index;
+ } else if (src.File == RC_FILE_INLINE) {
+ return src.Index | (1 << 7);
}
return 0;
} else {
code->inst[ip].inst0 = R500_INST_TYPE_ALU;
}
- code->inst[ip].inst0 |= R500_INST_TEX_SEM_WAIT;
+ code->inst[ip].inst0 |= (inst->SemWait << R500_INST_TEX_SEM_WAIT_SHIFT);
code->inst[ip].inst0 |= (inst->RGB.WriteMask << 11);
code->inst[ip].inst0 |= inst->Alpha.WriteMask ? 1 << 14 : 0;
break;
}
+ /* Set the output modifier */
+ code->inst[ip].inst3 |= inst->RGB.Omod << R500_ALU_RGB_OMOD_SHIFT;
+ code->inst[ip].inst4 |= inst->Alpha.Omod << R500_ALPHA_OMOD_SHIFT;
+
code->inst[ip].inst1 |= R500_RGB_ADDR0(use_source(code, inst->RGB.Src[0]));
code->inst[ip].inst1 |= R500_RGB_ADDR1(use_source(code, inst->RGB.Src[1]));
code->inst[ip].inst1 |= R500_RGB_ADDR2(use_source(code, inst->RGB.Src[2]));
code->inst[ip].inst0 = R500_INST_TYPE_TEX
| (inst->DstReg.WriteMask << 11)
- | R500_INST_TEX_SEM_WAIT;
+ | (inst->TexSemWait << R500_INST_TEX_SEM_WAIT_SHIFT);
code->inst[ip].inst1 = R500_TEX_ID(inst->TexSrcUnit)
- | R500_TEX_SEM_ACQUIRE;
+ | (inst->TexSemAcquire << R500_TEX_SEM_ACQUIRE_SHIFT);
if (inst->TexSrcTarget == RC_TEXTURE_RECT)
code->inst[ip].inst1 |= R500_TEX_UNSCALED;
code->inst[ip].inst0 = R500_INST_TYPE_OUT | R500_INST_TEX_SEM_WAIT;
}
+ /* Make sure TEX_SEM_WAIT is set on the last instruction */
+ code->inst[code->inst_end].inst0 |= R500_INST_TEX_SEM_WAIT;
+
/* Enable full flow control mode if we are using loops or have if
* statements nested at least four deep. */
if (s.MaxBranchDepth >= 4 || s.LoopsReserved > 0) {