pan/midgard: Fix old style shadows
authorIcecream95 <ixn@keemail.me>
Mon, 11 May 2020 22:16:31 +0000 (10:16 +1200)
committerIcecream95 <ixn@keemail.me>
Mon, 11 May 2020 22:36:30 +0000 (10:36 +1200)
This fixes the sky being red in OpenMW, as well as some of the Mesa
demos using shadows (shadowtex, shadow_sampler).

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4997>

src/panfrost/midgard/midgard_compile.c

index 58f0160b5645ee190450f14035048ad3b82db998..8ec29cf6bbe27990e81b105b25877e8009e2a307 100644 (file)
@@ -1759,6 +1759,10 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
                 }
         };
 
+        if (instr->is_shadow && !instr->is_new_style_shadow)
+           for (int i = 0; i < 4; ++i)
+              ins.swizzle[0][i] = COMPONENT_X;
+
         /* We may need a temporary for the coordinate */
 
         bool needs_temp_coord =