ac/nir: force unnormalized coordinates for RECT
authorMarek Olšák <marek.olsak@amd.com>
Wed, 18 Sep 2019 23:41:18 +0000 (19:41 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 23 Sep 2019 19:34:54 +0000 (15:34 -0400)
This fixes VAAPI.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/amd/common/ac_nir_to_llvm.c

index b4b4e42..0745842 100644 (file)
@@ -4266,8 +4266,10 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
                        args.dmask = 1 << instr->component;
        }
 
-       if (instr->sampler_dim != GLSL_SAMPLER_DIM_BUF)
+       if (instr->sampler_dim != GLSL_SAMPLER_DIM_BUF) {
                args.dim = get_ac_sampler_dim(&ctx->ac, instr->sampler_dim, instr->is_array);
+               args.unorm = instr->sampler_dim == GLSL_SAMPLER_DIM_RECT;
+       }
        result = build_tex_intrinsic(ctx, instr, &args);
 
        if (instr->op == nir_texop_query_levels)