pan/mdg: Fix perspective combination
[mesa.git] / 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_from != ins->src[0]) continue;
                 if (frcp_component != COMPONENT_W && frcp_component != COMPONENT_Z) continue;
                 if (!mir_single_use(ctx, frcp)) continue;