From: Gert Wollny Date: Wed, 13 Apr 2022 09:59:20 +0000 (+0200) Subject: virgl: Fix relocating the re-writing the transformation code X-Git-Tag: upstream/22.3.5~10482 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a30ff9056147352e9537a97072232f942d502bb4;p=platform%2Fupstream%2Fmesa.git virgl: Fix relocating the re-writing the transformation code The transformation must come before the code emission. Fixes: 6a264e7024a29eb7 Signed-off-by: Gert Wollny Part-of: --- diff --git a/src/gallium/drivers/virgl/virgl_tgsi.c b/src/gallium/drivers/virgl/virgl_tgsi.c index 9e6158b1690..747ac0e043b 100644 --- a/src/gallium/drivers/virgl/virgl_tgsi.c +++ b/src/gallium/drivers/virgl/virgl_tgsi.c @@ -151,7 +151,7 @@ virgl_tgsi_transform_property(struct tgsi_transform_context *ctx, case TGSI_PROPERTY_NUM_CLIPDIST_ENABLED: case TGSI_PROPERTY_NUM_CULLDIST_ENABLED: if (vtctx->cull_enabled) - ctx->emit_property(ctx, prop); + ctx->emit_property(ctx, prop); break; case TGSI_PROPERTY_NEXT_SHADER: break; @@ -260,7 +260,7 @@ virgl_tgsi_rewrite_src_for_input_temp(struct virgl_input_temp *temp, struct tgsi static void virgl_tgsi_transform_instruction(struct tgsi_transform_context *ctx, - struct tgsi_full_instruction *inst) + struct tgsi_full_instruction *inst) { struct virgl_transform_context *vtctx = (struct virgl_transform_context *)ctx; if (vtctx->fake_fp64 && @@ -382,7 +382,6 @@ virgl_tgsi_transform_instruction(struct tgsi_transform_context *ctx, inst->Src[i].Register.SwizzleW = TGSI_SWIZZLE_W; } } - ctx->emit_instruction(ctx, inst); /* virglrenderer doesn't resolve non-float output write properly, * so we have to first write to a temporary */ @@ -408,6 +407,8 @@ virgl_tgsi_transform_instruction(struct tgsi_transform_context *ctx, inst->Src[0].Register.SwizzleW = 3; } + ctx->emit_instruction(ctx, inst); + for (unsigned i = 0; i < inst->Instruction.NumDstRegs; i++) { if (vtctx->num_writemask_fixups && inst->Dst[i].Register.File == TGSI_FILE_TEMPORARY &&