freedreno/ir3: fix assert with getinfo
authorRob Clark <robdclark@chromium.org>
Wed, 26 Feb 2020 16:21:32 +0000 (08:21 -0800)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Feb 2020 16:53:41 +0000 (16:53 +0000)
Fixes:
dEQP-VK.glsl.texture_functions.query.texturesamples.sampler2dms_fixed_vertex

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989>

src/freedreno/ir3/ir3.c

index f8cfc6b..0dbe9bb 100644 (file)
@@ -462,7 +462,8 @@ static int emit_cat5(struct ir3_instruction *instr, void *ptr,
        struct ir3_register *src2;
        instr_cat5_t *cat5 = ptr;
 
-       iassert((instr->regs_count == 2) ||
+       iassert((instr->regs_count == 1) ||
+                       (instr->regs_count == 2) ||
                        (instr->regs_count == 3) ||
                        (instr->regs_count == 4));
 
@@ -470,7 +471,7 @@ static int emit_cat5(struct ir3_instruction *instr, void *ptr,
                src1 = instr->regs[2];
                src2 = instr->regs_count > 3 ? instr->regs[3] : NULL;
        } else {
-               src1 = instr->regs[1];
+               src1 = instr->regs_count > 1 ? instr->regs[1] : NULL;
                src2 = instr->regs_count > 2 ? instr->regs[2] : NULL;
        }