radeonsi: fix texture loads from sampler > 0
authorChristian König <deathsimple@vodafone.de>
Wed, 1 Aug 2012 13:20:07 +0000 (15:20 +0200)
committerChristian König <deathsimple@vodafone.de>
Thu, 2 Aug 2012 09:22:52 +0000 (11:22 +0200)
The backend is multiplying the offset by the numbers of
elements anyway, so doing it twice just makes everything
crash.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/radeonsi_shader.c

index f90fd1dde303b272f190c0799be93348c7652f9f..81b44a772abda11e4b6f5102a300a8d1fccd5bcf 100644 (file)
@@ -529,14 +529,14 @@ static void tex_fetch_args(
        /* Resource */
        ptr = use_sgpr(bld_base->base.gallivm, SGPR_CONST_PTR_V8I32, 4);
        offset = lp_build_const_int32(bld_base->base.gallivm,
-                                 8 * emit_data->inst->Src[1].Register.Index);
+                                 emit_data->inst->Src[1].Register.Index);
        emit_data->args[2] = build_indexed_load(bld_base->base.gallivm,
                                                ptr, offset);
 
        /* Sampler */
        ptr = use_sgpr(bld_base->base.gallivm, SGPR_CONST_PTR_V4I32, 2);
        offset = lp_build_const_int32(bld_base->base.gallivm,
-                                 4 * emit_data->inst->Src[1].Register.Index);
+                                 emit_data->inst->Src[1].Register.Index);
        emit_data->args[3] = build_indexed_load(bld_base->base.gallivm,
                                                ptr, offset);