mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
r600: Take ALU_EXTENDED into account when evaluating jump offsets
ALU_EXTENDED needs 4 DWORDS instead of the usual 2, hence if the last ALU
clause within a IF-JUMP or ELSE branch is ALU_EXTENDED the target jump
offset needs to be adjusted accordingly.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104654
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Gert Wollny <gw.fossdev@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit c7cadcbda4)
This commit is contained in:
parent
30a63012b4
commit
45f4a85f99
1 changed files with 7 additions and 2 deletions
|
|
@ -9862,17 +9862,22 @@ static int tgsi_else(struct r600_shader_ctx *ctx)
|
|||
|
||||
static int tgsi_endif(struct r600_shader_ctx *ctx)
|
||||
{
|
||||
int offset = 2;
|
||||
pops(ctx, 1);
|
||||
if (ctx->bc->fc_stack[ctx->bc->fc_sp - 1].type != FC_IF) {
|
||||
R600_ERR("if/endif unbalanced in shader\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ALU_EXTENDED needs 4 DWords instead of two, adjust jump target offset accordingly */
|
||||
if (ctx->bc->cf_last->eg_alu_extended)
|
||||
offset += 2;
|
||||
|
||||
if (ctx->bc->fc_stack[ctx->bc->fc_sp - 1].mid == NULL) {
|
||||
ctx->bc->fc_stack[ctx->bc->fc_sp - 1].start->cf_addr = ctx->bc->cf_last->id + 2;
|
||||
ctx->bc->fc_stack[ctx->bc->fc_sp - 1].start->cf_addr = ctx->bc->cf_last->id + offset;
|
||||
ctx->bc->fc_stack[ctx->bc->fc_sp - 1].start->pop_count = 1;
|
||||
} else {
|
||||
ctx->bc->fc_stack[ctx->bc->fc_sp - 1].mid[0]->cf_addr = ctx->bc->cf_last->id + 2;
|
||||
ctx->bc->fc_stack[ctx->bc->fc_sp - 1].mid[0]->cf_addr = ctx->bc->cf_last->id + offset;
|
||||
}
|
||||
fc_poplevel(ctx);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue