diff options
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_compiler.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_compiler.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_compiler.c b/src/gallium/drivers/freedreno/freedreno_compiler.c index a26f8cf562c..b9cac8f1228 100644 --- a/src/gallium/drivers/freedreno/freedreno_compiler.c +++ b/src/gallium/drivers/freedreno/freedreno_compiler.c @@ -810,6 +810,7 @@ translate_tex(struct fd_compile_context *ctx, instr = ir2_instr_create(next_exec_cf(ctx), IR2_FETCH); instr->fetch.opc = TEX_FETCH; + instr->fetch.is_cube = (inst->Texture.Texture == TGSI_TEXTURE_3D); assert(inst->Texture.NumOffsets <= 1); // TODO what to do in other cases? /* save off the tex fetch to be patched later with correct const_idx: */ @@ -820,6 +821,10 @@ translate_tex(struct fd_compile_context *ctx, add_dst_reg(ctx, instr, using_temp ? &tmp_dst : &inst->Dst[0].Register); reg = add_src_reg(ctx, instr, coord); + /* blob compiler always sets 3rd component to same as 1st for 2d: */ + if (inst->Texture.Texture == TGSI_TEXTURE_2D) + reg->swizzle[2] = reg->swizzle[0]; + /* dst register needs to be marked for sync: */ ctx->need_sync |= 1 << instr->regs[0]->num; |