r300/compiler: set the MSB of ADDR for inline constants

The docs say so.
This commit is contained in:
Marek Olšák 2011-04-05 02:44:03 +02:00
parent 5d92596c56
commit c97234507a
1 changed files with 5 additions and 2 deletions

View File

@ -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;