ir3/legalize: Handle inserting (ei) with preamble
Make sure that shaders with a preamble are still considered early-release so that we don't regress them. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13148>
This commit is contained in:
@@ -661,6 +661,19 @@ ir3_start_block(struct ir3 *ir)
|
|||||||
return list_first_entry(&ir->block_list, struct ir3_block, node);
|
return list_first_entry(&ir->block_list, struct ir3_block, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline struct ir3_block *
|
||||||
|
ir3_after_preamble(struct ir3 *ir)
|
||||||
|
{
|
||||||
|
struct ir3_block *block = ir3_start_block(ir);
|
||||||
|
/* The preamble will have a usually-empty else branch, and we want to skip
|
||||||
|
* that to get to the block after the preamble.
|
||||||
|
*/
|
||||||
|
if (block->brtype == IR3_BRANCH_SHPS)
|
||||||
|
return block->successors[1]->successors[0];
|
||||||
|
else
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
void ir3_block_add_predecessor(struct ir3_block *block, struct ir3_block *pred);
|
void ir3_block_add_predecessor(struct ir3_block *block, struct ir3_block *pred);
|
||||||
void ir3_block_add_physical_predecessor(struct ir3_block *block,
|
void ir3_block_add_physical_predecessor(struct ir3_block *block,
|
||||||
struct ir3_block *pred);
|
struct ir3_block *pred);
|
||||||
|
@@ -136,7 +136,7 @@ legalize_block(struct ir3_legalize_ctx *ctx, struct ir3_block *block)
|
|||||||
* with the end of the program.
|
* with the end of the program.
|
||||||
*/
|
*/
|
||||||
assert(input_count == 0 || !ctx->early_input_release ||
|
assert(input_count == 0 || !ctx->early_input_release ||
|
||||||
block == ir3_start_block(block->shader));
|
block == ir3_after_preamble(block->shader));
|
||||||
|
|
||||||
/* remove all the instructions from the list, we'll be adding
|
/* remove all the instructions from the list, we'll be adding
|
||||||
* them back in as we go
|
* them back in as we go
|
||||||
@@ -953,7 +953,7 @@ ir3_legalize(struct ir3 *ir, struct ir3_shader_variant *so, int *max_bary)
|
|||||||
* a5xx and a6xx do automatically release varying storage at the end.
|
* a5xx and a6xx do automatically release varying storage at the end.
|
||||||
*/
|
*/
|
||||||
ctx->early_input_release = true;
|
ctx->early_input_release = true;
|
||||||
struct ir3_block *start_block = ir3_start_block(ir);
|
struct ir3_block *start_block = ir3_after_preamble(ir);
|
||||||
foreach_block (block, &ir->block_list) {
|
foreach_block (block, &ir->block_list) {
|
||||||
foreach_instr (instr, &block->instr_list) {
|
foreach_instr (instr, &block->instr_list) {
|
||||||
if (is_input(instr) && block != start_block) {
|
if (is_input(instr) && block != start_block) {
|
||||||
|
Reference in New Issue
Block a user