freedreno/ir3: fix emit_tex_info split_dest
authorJonathan Marek <jonathan@marek.ca>
Tue, 14 Apr 2020 18:19:14 +0000 (14:19 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 14 Apr 2020 19:12:47 +0000 (19:12 +0000)
Fixes a "free(): invalid next size (fast)" error in:

dEQP-VK.glsl.texture_functions.query.texturequerylevels.*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4557>

src/freedreno/ir3/ir3_compiler_nir.c

index 307eded893afb858de646526d5611261419d907c..8c676b2f3ce03859ea408ba3bc27281bcf89c18c 100644 (file)
@@ -2515,8 +2515,7 @@ emit_tex_info(struct ir3_context *ctx, nir_tex_instr *tex, unsigned idx)
        /* even though there is only one component, since it ends
         * up in .y/.z/.w rather than .x, we need a split_dest()
         */
-       if (idx)
-               ir3_split_dest(b, dst, sam, 0, idx + 1);
+       ir3_split_dest(b, dst, sam, idx, 1);
 
        /* The # of levels comes from getinfo.z. We need to add 1 to it, since
         * the value in TEX_CONST_0 is zero-based.