Mesa (master): gallium: add flatshade lowering capability

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 17 09:26:21 UTC 2019


Module: Mesa
Branch: master
Commit: 731260de7ddb30638b194f1a52a62a5b94487398
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=731260de7ddb30638b194f1a52a62a5b94487398

Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Jan 24 13:11:22 2019 +1000

gallium: add flatshade lowering capability

This allows the driver to request flatshade lowering.
(NIR drivers only so far).

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/auxiliary/util/u_screen.c | 3 +++
 src/gallium/docs/source/screen.rst    | 1 +
 src/gallium/include/pipe/p_defines.h  | 1 +
 3 files changed, 5 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c
index 6faf6d75e76..3593e055590 100644
--- a/src/gallium/auxiliary/util/u_screen.c
+++ b/src/gallium/auxiliary/util/u_screen.c
@@ -394,6 +394,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
    case PIPE_CAP_TEXTURE_SHADOW_MAP: /* Enables ARB_shadow */
       return 1;
 
+   case PIPE_CAP_FLATSHADE:
+      return 1;
+
    default:
       unreachable("bad PIPE_CAP_*");
    }
diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
index 4bb805f39e2..8bb83aff77c 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -558,6 +558,7 @@ The integer capabilities:
 * ``PIPE_CAP_GL_SPIRV_VARIABLE_POINTERS``: True if the driver supports Variable Pointers in SPIR-V shaders.
 * ``PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION``: True if driver supports demote keyword in GLSL programs.
 * ``PIPE_CAP_TGSI_TG4_COMPONENT_IN_SWIZZLE``: True if driver wants the TG4 component encoded in sampler swizzle rather than as a separate source.
+* ``PIPE_CAP_FLATSHADE``: Driver supports pipe_rasterizer_state::flatshade.
 
 .. _pipe_capf:
 
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index bf6825a65d1..a9c5a466194 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -904,6 +904,7 @@ enum pipe_cap
    PIPE_CAP_GL_SPIRV_VARIABLE_POINTERS,
    PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION,
    PIPE_CAP_TGSI_TG4_COMPONENT_IN_SWIZZLE,
+   PIPE_CAP_FLATSHADE,
 };
 
 /**




More information about the mesa-commit mailing list