summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-04-05 02:44:03 +0200
committerMarek Olšák <[email protected]>2011-04-05 06:36:56 +0200
commitc97234507ad7de36e57868ade22a11ea8de773a6 (patch)
tree2dcd68de95ecf650a6df73c08c139946469443b8
parent5d92596c5619eee4bac0fdc7733bafcd578309de (diff)
r300/compiler: set the MSB of ADDR for inline constants
The docs say so.
-rw-r--r--src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
index 2f8d6e4d04b..9b5c7c6e489 100644
--- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
+++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
@@ -197,11 +197,14 @@ static void use_temporary(struct r500_fragment_program_code* code, unsigned int
static unsigned int use_source(struct r500_fragment_program_code* code, struct rc_pair_instruction_source src)
{
+ /* From docs:
+ * Note that inline constants set the MSB of ADDR0 and clear ADDR0_CONST.
+ * MSB = 1 << 7 */
if (!src.Used)
- return 0;
+ return 1 << 7;
if (src.File == RC_FILE_CONSTANT) {
- return src.Index | 0x100;
+ return src.Index | R500_RGB_ADDR0_CONST;
} else if (src.File == RC_FILE_TEMPORARY) {
use_temporary(code, src.Index);
return src.Index;