pan/bi: LOD is a 8.8 fixed point
authorBoris Brezillon <boris.brezillon@collabora.com>
Tue, 17 Nov 2020 16:27:40 +0000 (17:27 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Wed, 25 Nov 2020 15:22:19 +0000 (16:22 +0100)
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>

src/panfrost/bifrost/bifrost_compile.c

index 7dc5b2c..5dbc921 100644 (file)
@@ -1603,18 +1603,26 @@ bi_emit_lod_88(bi_context *ctx, unsigned lod, bool fp16)
 static unsigned
 bi_emit_lod_cube(bi_context *ctx, unsigned lod)
 {
-        /* MKVEC.v2i16 out, lod.h0, #0 */
-        bi_instruction mkvec = {
-                .type = BI_SELECT,
+        bi_instruction or = {
+                .type = BI_BITWISE,
+                .op.bitwise = BI_BITWISE_OR,
                 .dest = bi_make_temp(ctx),
-                .dest_type = nir_type_int16,
-                .src = { lod ? : BIR_INDEX_ZERO, BIR_INDEX_ZERO },
-                .src_types = { nir_type_int16, nir_type_int16 },
+                .dest_type = nir_type_uint32,
+                .src = {
+                        lod ? : BIR_INDEX_ZERO,
+                        BIR_INDEX_ZERO,
+                        BIR_INDEX_CONSTANT | 0,
+                },
+                .src_types = {
+                       nir_type_uint32,
+                       nir_type_uint32,
+                       nir_type_uint8,
+                },
+                .constant.u8[0] = 8,
         };
 
-        bi_emit(ctx, mkvec);
-
-        return mkvec.dest;
+        bi_emit(ctx, or);
+        return or.dest;
 }
 
 /* The hardware specifies texel offsets and multisample indices together as a