gallium: add flatshade lowering capability
authorDave Airlie <airlied@redhat.com>
Thu, 24 Jan 2019 03:11:22 +0000 (13:11 +1000)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 17 Oct 2019 08:41:36 +0000 (10:41 +0200)
This allows the driver to request flatshade lowering.
(NIR drivers only so far).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/util/u_screen.c
src/gallium/docs/source/screen.rst
src/gallium/include/pipe/p_defines.h

index 6faf6d75e76e11da219659d973eff5c0e9a90666..3593e055590476130161a877bbdf4328a3faca71 100644 (file)
@@ -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_*");
    }
index 4bb805f39e2336c801775823109ba8d84cdda83c..8bb83aff77cb4be3512a5f7400b9f461576f45e9 100644 (file)
@@ -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:
 
index bf6825a65d1574cbbdb55ba287c0c6deb0166a39..a9c5a4661945d2778c67c916550b655802c556d7 100644 (file)
@@ -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,
 };
 
 /**