summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-03-27 14:39:39 -0400
committerMarge Bot <[email protected]>2020-03-31 01:12:26 +0000
commitc2a8ef907b528b125ff0827e8ea2588a85022fd6 (patch)
tree6b49cc8b293657ae670f150b089837da77346816 /src
parent77e04eb2e2e0170343ab424f51ace3fbc175cb77 (diff)
panfrost: Enable PIPE_SHADER_CAP_FP16 on Bifrost
We don't have fp16 implemented on Midgard yet but on Bifrost we can flip it on now. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4382>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/pan_screen.c5
-rw-r--r--src/panfrost/include/panfrost-quirks.h7
2 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index 46f33d584a0..0c40ff67c73 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -286,6 +286,7 @@ panfrost_get_shader_param(struct pipe_screen *screen,
enum pipe_shader_cap param)
{
bool is_deqp = pan_debug & PAN_DBG_DEQP;
+ struct panfrost_device *dev = pan_device(screen);
if (shader != PIPE_SHADER_VERTEX &&
shader != PIPE_SHADER_FRAGMENT &&
@@ -341,8 +342,10 @@ panfrost_get_shader_param(struct pipe_screen *screen,
case PIPE_SHADER_CAP_INTEGERS:
return 1;
- case PIPE_SHADER_CAP_INT64_ATOMICS:
case PIPE_SHADER_CAP_FP16:
+ return !(dev->quirks & MIDGARD_BROKEN_FP16);
+
+ case PIPE_SHADER_CAP_INT64_ATOMICS:
case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:
case PIPE_SHADER_CAP_TGSI_LDEXP_SUPPORTED:
diff --git a/src/panfrost/include/panfrost-quirks.h b/src/panfrost/include/panfrost-quirks.h
index 8b8aa0812cd..afac6d82d2b 100644
--- a/src/panfrost/include/panfrost-quirks.h
+++ b/src/panfrost/include/panfrost-quirks.h
@@ -39,9 +39,14 @@
#define MIDGARD_SFBD (1 << 1)
+/* Whether fp16 is broken in the compiler. Hopefully this quirk will go away
+ * over time */
+
+#define MIDGARD_BROKEN_FP16 (1 << 2)
+
/* Quirk collections common to particular uarchs */
-#define MIDGARD_QUIRKS (0)
+#define MIDGARD_QUIRKS (MIDGARD_BROKEN_FP16)
#define BIFROST_QUIRKS (0)