gallium: Add PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTED
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Mon, 10 Jun 2019 03:56:09 +0000 (20:56 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 11 Jun 2019 22:12:17 +0000 (15:12 -0700)
Tells whether or not the driver can handle gl_LocalInvocationIndex and
gl_GlobalInvocationID.  If not supported (the default), state tracker
will lower those on behalf of the driver.

v2: Add case to u_screen.c.  (Anholt)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/auxiliary/util/u_screen.c
src/gallium/docs/source/screen.rst
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index 6457bcffda125d55f3caa05deac5a76e72290ca1..e46485946144227c188dcc0b26ed33e6fcb8bc34 100644 (file)
@@ -328,6 +328,7 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
    case PIPE_CAP_IMAGE_LOAD_FORMATTED:
    case PIPE_CAP_PREFER_COMPUTE_BLIT_FOR_MULTIMEDIA:
    case PIPE_CAP_FRAGMENT_SHADER_INTERLOCK:
+   case PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTED:
       return 0;
 
    case PIPE_CAP_MAX_GS_INVOCATIONS:
index 70810418f8a8690a22a0afd4917bcb6a1b49f0e6..fd8b7a9f68ce4c056427987e071bebac7422def0 100644 (file)
@@ -528,6 +528,9 @@ The integer capabilities:
   OpenMAX should use a compute-based blit instead of pipe_context::blit.
 * ``PIPE_CAP_FRAGMENT_SHADER_INTERLOCK``: True if fragment shader interlock
   functionality is supported.
+* ``PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTED``: True if driver handles
+  gl_LocalInvocationIndex and gl_GlobalInvocationID.  Otherwise, state tracker will
+  lower those system values.
 
 .. _pipe_capf:
 
index d3c951279d9bd2835f1ecfd2fd51a3dc57fe4fe2..261f6c51ec15186b36055d29a60c72667c2d5782 100644 (file)
@@ -885,6 +885,7 @@ enum pipe_cap
    PIPE_CAP_PREFER_COMPUTE_BLIT_FOR_MULTIMEDIA,
    PIPE_CAP_FRAGMENT_SHADER_INTERLOCK,
    PIPE_CAP_FBFETCH_COHERENT,
+   PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTED,
 };
 
 /**
index f930d3caff9d01d6dde5c1e62735ef0d63c0efd7..cb340b3edc9ba308b6ce73a4c8514676f90ff588 100644 (file)
@@ -348,7 +348,8 @@ void st_init_limits(struct pipe_screen *screen,
       screen->get_param(screen, PIPE_CAP_GLSL_TESS_LEVELS_AS_INPUTS);
    c->LowerTessLevel =
       !screen->get_param(screen, PIPE_CAP_NIR_COMPACT_ARRAYS);
-   c->LowerCsDerivedVariables = true;
+   c->LowerCsDerivedVariables =
+      !screen->get_param(screen, PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTED);
    c->PrimitiveRestartForPatches =
       screen->get_param(screen, PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES);