Mesa (master): gallium: Add PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Sep 30 20:23:27 UTC 2019


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

Author: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Date:   Fri Sep 20 09:21:02 2019 -0700

gallium: Add PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION

To enable EXT_demote_to_helper_invocation:

    This extension adds a "demote" keyword that is similar to "discard" but
    only suppresses subsequent writes and outputs to the framebuffer, and
    does not terminate the execution of the invocation. For the remainder
    of the execution, the invocation is "demoted" to act like a helper
    invocation.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

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

diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c
index a5711e5595c..ba99ec0615d 100644
--- a/src/gallium/auxiliary/util/u_screen.c
+++ b/src/gallium/auxiliary/util/u_screen.c
@@ -380,6 +380,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
    case PIPE_CAP_GL_SPIRV_VARIABLE_POINTERS:
       return 0;
 
+   case PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION:
+      return 0;
+
    case PIPE_CAP_DMABUF:
 #if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD)
       return 1;
diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
index d853edf92d0..961f0a9c3cc 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -557,6 +557,7 @@ The integer capabilities:
   efficient manner.
 * ``PIPE_CAP_GL_SPIRV``: True if the driver supports ARB_gl_spirv extension.
 * ``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_capf:
 
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 0d4adcf6f4b..1dc880bfc72 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -901,6 +901,7 @@ enum pipe_cap
    PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF,
    PIPE_CAP_GL_SPIRV,
    PIPE_CAP_GL_SPIRV_VARIABLE_POINTERS,
+   PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION,
 };
 
 /**
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index d111b6cf10b..3f8230a22fb 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -749,6 +749,7 @@ void st_init_extensions(struct pipe_screen *screen,
       { o(ARB_fragment_shader_interlock),    PIPE_CAP_FRAGMENT_SHADER_INTERLOCK        },
 
       { o(EXT_blend_equation_separate),      PIPE_CAP_BLEND_EQUATION_SEPARATE          },
+      { o(EXT_demote_to_helper_invocation),  PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION      },
       { o(EXT_depth_bounds_test),            PIPE_CAP_DEPTH_BOUNDS_TEST                },
       { o(EXT_disjoint_timer_query),         PIPE_CAP_QUERY_TIMESTAMP                  },
       { o(EXT_draw_buffers2),                PIPE_CAP_INDEP_BLEND_ENABLE               },




More information about the mesa-commit mailing list