diff options
author | Tom Stellard <tstellar@gmail.com> | 2010-11-08 18:49:44 -0800 |
---|---|---|
committer | Tom Stellard <tstellar@gmail.com> | 2010-11-21 18:48:31 -0800 |
commit | bbe49bc585c4fed46f55d184b463d13bddd97f1b (patch) | |
tree | 55597798857bcf9d1ed8f8d0c53fbb160d5fabd8 /src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c | |
parent | ddceededf850c942c1bb8185ec7dc0c203d3bad6 (diff) |
r300/compiler: Use presubtract operations as much as possible
Previously, presubtract operations where only being used by instructions
with less than three source source registers.
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c index 600be8b886..9df07edf2b 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c @@ -139,9 +139,17 @@ static void pair_sub_for_all_args( const struct rc_opcode_info * info = rc_get_opcode_info(sub->Opcode); for(i = 0; i < info->NumSrcRegs; i++) { - unsigned int src_type = rc_source_type_that_arg_reads( - sub->Arg[i].Source, sub->Arg[i].Swizzle); - if (src_type == RC_PAIR_SOURCE_NONE) + unsigned int src_type; + unsigned int channels = 0; + if (&fullinst->U.P.RGB == sub) + channels = 3; + else if (&fullinst->U.P.Alpha == sub) + channels = 1; + + assert(channels > 0); + src_type = rc_source_type_swz(sub->Arg[i].Swizzle, channels); + + if (src_type == RC_SOURCE_NONE) continue; if (sub->Arg[i].Source == RC_PAIR_PRESUB_SRC) { @@ -149,7 +157,7 @@ static void pair_sub_for_all_args( unsigned int presub_src_count; struct rc_pair_instruction_source * src_array; unsigned int j; - if (src_type & RC_PAIR_SOURCE_RGB) { + if (src_type & RC_SOURCE_RGB) { presub_type = fullinst-> U.P.RGB.Src[RC_PAIR_PRESUB_SRC].Index; src_array = fullinst->U.P.RGB.Src; |