From 00272aa4a1bc190b0b8ede6a241f2bd74a856a8e Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 25 Jun 2021 10:44:25 -0400 Subject: [PATCH] util/vbuf: always claim support for PATCHES in restart modes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this avoids forcing rewrites for patch mode which break tessellation Reviewed-by: Marek Olšák Part-of: --- docs/gallium/screen.rst | 2 +- src/gallium/auxiliary/util/u_vbuf.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/gallium/screen.rst b/docs/gallium/screen.rst index 96914e5fcc7..879714fd403 100644 --- a/docs/gallium/screen.rst +++ b/docs/gallium/screen.rst @@ -617,7 +617,7 @@ The integer capabilities: * ``PIPE_CAP_SAMPLER_REDUCTION_MINMAX_ARB``: Driver supports ARB min/max sampler reduction with format queries. * ``PIPE_CAP_EMULATE_NONFIXED_PRIMITIVE_RESTART``: Driver requests all draws using a non-fixed restart index to be rewritten to use a fixed restart index. * ``PIPE_CAP_SUPPORTED_PRIM_MODES``: A bitmask of the ``pipe_prim_type`` enum values that the driver can natively support. -* ``PIPE_CAP_SUPPORTED_PRIM_MODES_WITH_RESTART``: A bitmask of the ``pipe_prim_type`` enum values that the driver can natively support for primitive restart. Only useful if ``PIPE_CAP_PRIMITIVE_RESTART`` is also exported. ``PIPE_PRIM_PATCHES`` must be supported to prevent incorrect lowering of primitive restart. +* ``PIPE_CAP_SUPPORTED_PRIM_MODES_WITH_RESTART``: A bitmask of the ``pipe_prim_type`` enum values that the driver can natively support for primitive restart. Only useful if ``PIPE_CAP_PRIMITIVE_RESTART`` is also exported. .. _pipe_capf: diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c index 513b79ba38f..b1307f6db8f 100644 --- a/src/gallium/auxiliary/util/u_vbuf.c +++ b/src/gallium/auxiliary/util/u_vbuf.c @@ -309,6 +309,7 @@ void u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps, screen->get_param(screen, PIPE_CAP_PRIMITIVE_RESTART_FIXED_INDEX)) { caps->rewrite_restart_index = screen->get_param(screen, PIPE_CAP_EMULATE_NONFIXED_PRIMITIVE_RESTART); caps->supported_restart_modes = screen->get_param(screen, PIPE_CAP_SUPPORTED_PRIM_MODES_WITH_RESTART); + caps->supported_restart_modes |= BITFIELD_BIT(PIPE_PRIM_PATCHES); caps->fallback_always |= caps->rewrite_restart_index; } caps->supported_prim_modes = screen->get_param(screen, PIPE_CAP_SUPPORTED_PRIM_MODES);