summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2020-08-31 14:20:59 -0400
committerEric Engestrom <eric@engestrom.ch>2020-09-02 21:50:46 +0200
commitf963c22f064b13372b3c986c2506025d14c6519b (patch)
tree9221382d06a83536986495e3d225b1378183dd03
parent259b7605931e13b927b0b90dad06e18c4f4b0fd2 (diff)
pan/mdg: Fix perspective combination
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> (cherry picked from commit 41d0a81c2a3f09701e8c694b520c8d900f6ac2f1)
-rw-r--r--.pick_status.json2
-rw-r--r--src/panfrost/midgard/midgard_opt_perspective.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index ec7977aa8ce..d12adca6fe4 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -985,7 +985,7 @@
"description": "pan/mdg: Fix perspective combination",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/src/panfrost/midgard/midgard_opt_perspective.c b/src/panfrost/midgard/midgard_opt_perspective.c
index 4af8c45356e..601fa259ca6 100644
--- a/src/panfrost/midgard/midgard_opt_perspective.c
+++ b/src/panfrost/midgard/midgard_opt_perspective.c
@@ -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;