summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2020-10-09 14:00:28 +0200
committerBoris Brezillon <boris.brezillon@collabora.com>2020-10-15 08:05:23 +0200
commitd8326ceafbd8903b69e211ec6449ecdb83efc761 (patch)
treeb69b51b1fb31bb9026cf92d621392630238a8ad3
parent442f48f27b666cd2183d4ce27977da045ee34b0f (diff)
panfrost: Fix fixed-function blend on bifrost
The conversion from a 32b float to a 16b fixed-point number was wrong. Fixes: 8389976b7c09 ("panfrost: XML-ify the blend descriptors") 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/7151>
-rw-r--r--src/gallium/drivers/panfrost/pan_cmdstream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 52f3abc544d..e95e414ce92 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -311,7 +311,7 @@ panfrost_emit_bifrost_blend(struct panfrost_batch *batch,
cfg.bifrost.equation = blend[i].equation.equation;
/* Fixed point constant */
- u16 constant = blend[i].equation.constant / ((1 << chan_size) - 1);
+ u16 constant = blend[i].equation.constant * ((1 << chan_size) - 1);
constant <<= 16 - chan_size;
cfg.bifrost.constant = constant;