radeonsi: Fix cube texture coordinates.
authorMichel Dänzer <michel.daenzer@amd.com>
Mon, 3 Dec 2012 11:46:30 +0000 (12:46 +0100)
committerMichel Dänzer <michel@daenzer.net>
Thu, 6 Dec 2012 19:35:18 +0000 (20:35 +0100)
8 more piglits.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/radeonsi_shader.c

index d5d56c46a8422d3181ad5a0e5e7363d307dedb5d..a452d4bbe9bf4fc7229beff559afa42fec0a1915 100644 (file)
@@ -813,6 +813,13 @@ static void tex_fetch_args(
                emit_data->args[1] = lp_build_emit_fetch(bld_base, emit_data->inst,
                                                         0, LP_CHAN_ALL);
 
+       if ((inst->Texture.Texture == TGSI_TEXTURE_CUBE ||
+            inst->Texture.Texture == TGSI_TEXTURE_SHADOWCUBE) &&
+           inst->Instruction.Opcode != TGSI_OPCODE_TXQ) {
+               radeon_llvm_emit_prepare_cube_coords(bld_base, &emit_data->args[1],
+                                                    inst->Texture.Texture);
+       }
+
        /* Resource */
        ptr = use_sgpr(bld_base->base.gallivm, SGPR_CONST_PTR_V8I32, SI_SGPR_RESOURCE);
        offset = lp_build_const_int32(bld_base->base.gallivm,