panfrost: Guard experimental fp16 behind debug flag
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 6 May 2020 23:48:05 +0000 (19:48 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 21 May 2020 17:49:14 +0000 (17:49 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5151>

src/gallium/drivers/panfrost/pan_screen.c
src/panfrost/encoder/pan_util.h

index 28ce1c9a8b1cad825ec51fca090e58ca37f230d9..5024a19f2434efcb0a34ed74c63f40c61496ed23 100644 (file)
@@ -63,6 +63,7 @@ static const struct debug_named_value debug_options[] = {
         {"sync",      PAN_DBG_SYNC,     "Wait for each job's completion and check for any GPU fault"},
         {"precompile", PAN_DBG_PRECOMPILE, "Precompile shaders for shader-db"},
         {"gles3",     PAN_DBG_GLES3,    "Enable experimental GLES3 implementation"},
+        {"fp16",     PAN_DBG_FP16,     "Enable buggy experimental (don't use!) fp16"},
         DEBUG_NAMED_VALUE_END
 };
 
@@ -289,6 +290,7 @@ panfrost_get_shader_param(struct pipe_screen *screen,
                           enum pipe_shader_cap param)
 {
         bool is_deqp = pan_debug & PAN_DBG_DEQP;
+        bool is_fp16 = pan_debug & PAN_DBG_FP16;
         struct panfrost_device *dev = pan_device(screen);
 
         if (shader != PIPE_SHADER_VERTEX &&
@@ -346,7 +348,7 @@ panfrost_get_shader_param(struct pipe_screen *screen,
                 return 1;
 
         case PIPE_SHADER_CAP_FP16:
-                return !(dev->quirks & MIDGARD_BROKEN_FP16);
+                return !(dev->quirks & MIDGARD_BROKEN_FP16) || is_fp16;
 
         case PIPE_SHADER_CAP_INT64_ATOMICS:
         case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
index 06484ce383b76f57d7726eecfc9181714020d52d..320a608e36fb94e1e49f017f19973b8f4fe43da4 100644 (file)
@@ -35,6 +35,7 @@
 #define PAN_DBG_SYNC            0x0010
 #define PAN_DBG_PRECOMPILE      0x0020
 #define PAN_DBG_GLES3           0x0040
+#define PAN_DBG_FP16            0x0080
 
 extern int pan_debug;