gallium: Add PIPE_CAP_COMPUTE_SHADER_DERIVATIVES
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Thu, 28 Mar 2019 08:47:10 +0000 (01:47 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 9 Apr 2019 02:29:33 +0000 (19:29 -0700)
To enable NV_compute_shader_derivatives, which allows derivatives (and
texture lookups with implicit derivatives) in compute shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
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 9f0be8060ee12d1d18e21dd9334ff64d0bda628d..43310f3e87909cf6a599b973cda31fb4aea93b36 100644 (file)
@@ -348,6 +348,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
    case PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK:
       return 0;
 
+   case PIPE_CAP_COMPUTE_SHADER_DERIVATIVES:
+      return 0;
+
    default:
       unreachable("bad PIPE_CAP_*");
    }
index a4d6a9557c0a1b3f8945fc3699491af8c19333cd..7d3b262d240938b25b22cbd7a4eb0029182c9128 100644 (file)
@@ -503,6 +503,7 @@ The integer capabilities:
   cases may be a smaller number.
 * ``PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK``: Whether pipe_grid_info::last_block
   is implemented by the driver. See struct pipe_grid_info for more details.
+* ``PIPE_CAP_COMPUTE_SHADER_DERIVATIVE``: True if the driver supports derivatives (and texture lookups with implicit derivatives) in compute shaders.
 
 .. _pipe_capf:
 
index 3dbdea035e4956d3b1f2c665229446d0afc25689..695bb2b3f18b5498f4fd39f33d7b119c0571fe60 100644 (file)
@@ -865,6 +865,7 @@ enum pipe_cap
    PIPE_CAP_NIR_COMPACT_ARRAYS,
    PIPE_CAP_MAX_VARYINGS,
    PIPE_CAP_COMPUTE_GRID_INFO_LAST_BLOCK,
+   PIPE_CAP_COMPUTE_SHADER_DERIVATIVES,
 };
 
 /**
index 405fc21b3ad3a91ed63b55ad9848e1eb9f822ede..7c0d1a72dc7cc03c381d792e06a2b2655fbf0401 100644 (file)
@@ -772,6 +772,7 @@ void st_init_extensions(struct pipe_screen *screen,
       { o(AMD_seamless_cubemap_per_texture), PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE    },
       { o(ATI_texture_mirror_once),          PIPE_CAP_TEXTURE_MIRROR_CLAMP             },
       { o(MESA_tile_raster_order),           PIPE_CAP_TILE_RASTER_ORDER                },
+      { o(NV_compute_shader_derivatives),    PIPE_CAP_COMPUTE_SHADER_DERIVATIVES       },
       { o(NV_conditional_render),            PIPE_CAP_CONDITIONAL_RENDER               },
       { o(NV_fill_rectangle),                PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE      },
       { o(NV_primitive_restart),             PIPE_CAP_PRIMITIVE_RESTART                },