diff options
author | Tom Stellard <[email protected]> | 2011-01-30 15:29:29 -0800 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2011-04-30 11:00:15 -0700 |
commit | 4f4d1d06da5e151df39c60fe75ab686ffdd73659 (patch) | |
tree | 51eb047851b70ead043c8e46b379cbedb0761dcf | |
parent | bbcee3268a28410f677577868386419da32379bd (diff) |
r300/compiler: rc_reader_data: Add ExitOnAbort flag
5 files changed, 10 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c index b4837091d94..3c0ab10aa56 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c @@ -592,7 +592,7 @@ static void get_readers_pair_read_callback( if (d->ReadPairCB) d->ReadPairCB(d->ReaderData, inst, arg, src); - if (d->ReaderData->Abort) + if (d->ReaderData->ExitOnAbort && d->ReaderData->Abort) return; add_reader_pair(&d->C->Pool, d->ReaderData, inst, shared_mask, arg, src); @@ -620,7 +620,7 @@ static void get_readers_normal_read_callback( if (d->ReadNormalCB) d->ReadNormalCB(d->ReaderData, inst, src); - if (d->ReaderData->Abort) + if (d->ReaderData->ExitOnAbort && d->ReaderData->Abort) return; add_reader_normal(&d->C->Pool, d->ReaderData, inst, shared_mask, src); @@ -767,7 +767,7 @@ static void get_readers_for_single_write( } rc_for_all_writes_mask(tmp, get_readers_write_callback, d); - if (d->ReaderData->Abort) + if (d->ReaderData->ExitOnAbort && d->ReaderData->Abort) return; if (branch_depth == 0 && !d->AliveWriteMask) diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h index 77d5d74d859..1e30cc69695 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h @@ -94,6 +94,9 @@ struct rc_reader_data { unsigned int ReadersReserved; struct rc_reader * Readers; + /* If this flag is enabled, rc_get_readers will exit as soon possbile + * after the Abort flag is set.*/ + unsigned int ExitOnAbort; void * CbData; }; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c index 104f7bf6baf..447193ee817 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_optimize.c @@ -144,6 +144,7 @@ static void copy_propagate(struct radeon_compiler * c, struct rc_instruction * i return; /* Get a list of all the readers of this MOV instruction. */ + reader_data.ExitOnAbort = 1; rc_get_readers(c, inst_mov, &reader_data, copy_propagate_scan_read, NULL, is_src_clobbered_scan_write); @@ -453,6 +454,7 @@ static int presub_helper( rc_presubtract_op cb_op = presub_opcode; reader_data.CbData = &cb_op; + reader_data.ExitOnAbort = 1; rc_get_readers(c, inst_add, &reader_data, presub_scan_read, NULL, is_src_clobbered_scan_write); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c index dad8ef59355..3743b0239d4 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c @@ -952,6 +952,7 @@ static void schedule_block(struct r300_fragment_program_compiler * c, instruction_ready(&s, s.Current); /* Get global readers for possible RGB->Alpha conversion. */ + s.Current->GlobalReaders.ExitOnAbort = 1; rc_get_readers(s.C, inst, &s.Current->GlobalReaders, is_rgb_to_alpha_possible_normal, is_rgb_to_alpha_possible, NULL); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c index d4d96b4c0ca..cafa0579734 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c @@ -71,6 +71,7 @@ void rc_rename_regs(struct radeon_compiler *c, void *user) if (inst->U.I.DstReg.File != RC_FILE_TEMPORARY) continue; + reader_data.ExitOnAbort = 1; rc_get_readers(c, inst, &reader_data, NULL, NULL, NULL); if (reader_data.Abort || reader_data.ReaderCount == 0) |