freedreno: Enable mediump lowering
authorHyunjun Ko <zzoon@igalia.com>
Fri, 7 Jun 2019 08:48:34 +0000 (08:48 +0000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 24 Mar 2020 23:21:21 +0000 (23:21 +0000)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>

src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/freedreno/freedreno_util.h

index e6bfa49c4a8651b44110b6ead234870d7cc1bc6c..6c66d56dd78bf8f6ad59535f83c1d69f0506d66c 100644 (file)
@@ -92,6 +92,7 @@ static const struct debug_named_value debug_options[] = {
                {"nolrz",     FD_DBG_NOLRZ,  "Disable LRZ (a6xx)"},
                {"notile",    FD_DBG_NOTILE, "Disable tiling for all internal buffers"},
                {"layout",    FD_DBG_LAYOUT, "Dump resource layouts"},
+               {"nofp16",    FD_DBG_NOFP16, "Disable mediump precision lowering"},
                DEBUG_NAMED_VALUE_END
 };
 
@@ -564,7 +565,8 @@ fd_screen_get_shader_param(struct pipe_screen *pscreen,
        case PIPE_SHADER_CAP_INT64_ATOMICS:
                return 0;
        case PIPE_SHADER_CAP_FP16:
-               return 0;
+               return ((is_a5xx(screen) || is_a6xx(screen)) &&
+                               !(fd_mesa_debug & FD_DBG_NOFP16));
        case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
        case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
                return 16;
index a83056d89d0faf87a05a7b2a20fdba2c39da32f3..d6c80f2f29bddac80e0dd8d4b8bbec154ec3cb0b 100644 (file)
@@ -89,7 +89,7 @@ enum fd_debug_flag {
        FD_DBG_NOLRZ        = BITFIELD_BIT(24),
        FD_DBG_NOTILE       = BITFIELD_BIT(25),
        FD_DBG_LAYOUT       = BITFIELD_BIT(26),
-
+       FD_DBG_NOFP16       = BITFIELD_BIT(27),
 };
 
 extern int fd_mesa_debug;