radeonsi: get the sampler view type from inst->Texture for TG4
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 17 May 2017 08:55:51 +0000 (10:55 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 18 May 2017 19:48:16 +0000 (21:48 +0200)
This will also magically fix this special lowering for
bindless samplers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c

index 13b46949d010bde537e8dc2d0a5b5ffc002ecfaf..a47d5bbae3beb2516afd5027e41256ffa4c90bb0 100644 (file)
@@ -1772,17 +1772,13 @@ static void build_tex_intrinsic(const struct lp_build_tgsi_action *action,
        /* The hardware needs special lowering for Gather4 with integer formats. */
        if (ctx->screen->b.chip_class <= VI &&
            opcode == TGSI_OPCODE_TG4) {
-               struct tgsi_shader_info *info = &ctx->shader->selector->info;
-               /* This will also work with non-constant indexing because of how
-                * glsl_to_tgsi works and we intent to preserve that behavior.
-                */
                const unsigned src_idx = 2;
-               unsigned sampler = inst->Src[src_idx].Register.Index;
 
                assert(inst->Src[src_idx].Register.File == TGSI_FILE_SAMPLER);
+               assert(inst->Texture.ReturnType != TGSI_RETURN_TYPE_UNKNOWN);
 
-               if (info->sampler_type[sampler] == TGSI_RETURN_TYPE_SINT ||
-                   info->sampler_type[sampler] == TGSI_RETURN_TYPE_UINT)
+               if (inst->Texture.ReturnType == TGSI_RETURN_TYPE_SINT ||
+                   inst->Texture.ReturnType == TGSI_RETURN_TYPE_UINT)
                        si_lower_gather4_integer(ctx, &args, target);
        }