ac/nir: fix txf_ms with an offset
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 19 Jul 2019 14:20:44 +0000 (15:20 +0100)
committerRhys Perry <pendingchaos02@gmail.com>
Mon, 29 Jul 2019 10:50:13 +0000 (11:50 +0100)
Seems to fix some hair artifacts in Max Payne 3:
https://github.com/daniel-schuermann/mesa/issues/76

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: f4e499ec791 ('radv: add initial non-conformant radv vulkan driver')
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/common/ac_nir_to_llvm.c

index 91865bd95ee22dd9c732a6895ae4425ef72c25d5..780712979713adea472ccf5f59c7f51de81e282b 100644 (file)
@@ -3793,7 +3793,7 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
                goto write_result;
        }
 
-       if (args.offset && instr->op != nir_texop_txf) {
+       if (args.offset && instr->op != nir_texop_txf && instr->op != nir_texop_txf_ms) {
                LLVMValueRef offset[3], pack;
                for (unsigned chan = 0; chan < 3; ++chan)
                        offset[chan] = ctx->ac.i32_0;
@@ -3932,7 +3932,7 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
                        args.coords[sample_chan], fmask_ptr);
        }
 
-       if (args.offset && instr->op == nir_texop_txf) {
+       if (args.offset && (instr->op == nir_texop_txf || instr->op == nir_texop_txf_ms)) {
                int num_offsets = instr->src[offset_src].src.ssa->num_components;
                num_offsets = MIN2(num_offsets, instr->coord_components);
                for (unsigned i = 0; i < num_offsets; ++i) {