pan/mdg: Fix perspective combination
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 31 Aug 2020 18:20:59 +0000 (14:20 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 31 Aug 2020 19:43:55 +0000 (19:43 +0000)
It's not enough to multiply by a .w reciprocal, we have to be taking the
reciprocal of the thing we're actually multiplying against.

Fixes incorrect rendering in Manhattan.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6525>

src/panfrost/midgard/midgard_opt_perspective.c

index 34afcfa6c93bf1fac661c9a2c515e40237692422..f2a83576bba6d35ae3326afd34bbcbd16d6c1c67 100644 (file)
@@ -88,6 +88,7 @@ midgard_opt_combine_projection(compiler_context *ctx, midgard_block *block)
                 }
 
                 if (!frcp_found) continue;
                 }
 
                 if (!frcp_found) continue;
+                if (frcp_from != ins->src[0]) continue;
                 if (frcp_component != COMPONENT_W && frcp_component != COMPONENT_Z) continue;
                 if (!mir_single_use(ctx, frcp)) continue;
 
                 if (frcp_component != COMPONENT_W && frcp_component != COMPONENT_Z) continue;
                 if (!mir_single_use(ctx, frcp)) continue;