Mesa (master): panfrost: Explicitly convert to 32-bit for logic-ops
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jun 3 22:57:54 UTC 2020
Module: Mesa
Branch: master
Commit: 3e4a0c2bca32fcf9f13363fa0c54b6a9b70c086b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3e4a0c2bca32fcf9f13363fa0c54b6a9b70c086b
Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date: Mon Jun 1 20:34:34 2020 -0400
panfrost: Explicitly convert to 32-bit for logic-ops
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reported-by: Icecream95 <ixn at keemail.me>
Fixes: 19b4e586f62 ("panfrost: Switch to pan_lower_framebuffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5289>
---
src/gallium/drivers/panfrost/nir/nir_lower_blend.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/panfrost/nir/nir_lower_blend.c b/src/gallium/drivers/panfrost/nir/nir_lower_blend.c
index f46f635da48..13cef5d6e14 100644
--- a/src/gallium/drivers/panfrost/nir/nir_lower_blend.c
+++ b/src/gallium/drivers/panfrost/nir/nir_lower_blend.c
@@ -215,6 +215,11 @@ nir_blend_logicop(
const struct util_format_description *format_desc =
util_format_description(options.format);
+ if (options.half) {
+ src = nir_f2f32(b, src);
+ dst = nir_f2f32(b, dst);
+ }
+
assert(src->num_components <= 4);
assert(dst->num_components <= 4);
@@ -235,7 +240,12 @@ nir_blend_logicop(
out = nir_iand(b, out, nir_build_imm(b, 4, 32, mask));
}
- return nir_format_unorm_to_float(b, out, bits);
+ out = nir_format_unorm_to_float(b, out, bits);
+
+ if (options.half)
+ out = nir_f2f16(b, out);
+
+ return out;
}
/* Given a blend state, the source color, and the destination color,
More information about the mesa-commit
mailing list