summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2019-03-28 01:47:10 -0700
committerCaio Marcelo de Oliveira Filho <[email protected]>2019-04-08 19:29:33 -0700
commitf9b29c4a5862d7caeab89e8a3bd23f3275dbd9a6 (patch)
tree6ad210b9d5693f28e72c76a893fb3eecd7ab28db
parentc9d1569689b5dc636daba941dc44f8a573e37309 (diff)
gallium: Add PIPE_CAP_COMPUTE_SHADER_DERIVATIVES
To enable NV_compute_shader_derivatives, which allows derivatives (and texture lookups with implicit derivatives) in compute shaders. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
-rw-r--r--src/gallium/auxiliary/util/u_screen.c3
-rw-r--r--src/gallium/docs/source/screen.rst1
-rw-r--r--src/gallium/include/pipe/p_defines.h1
-rw-r--r--src/mesa/state_tracker/st_extensions.c1
4 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c
index 9f0be8060ee..43310f3e879 100644
--- a/src/gallium/auxiliary/util/u_screen.c
+++ b/src/gallium/auxiliary/util/u_screen.c
@@ -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_*");
}
diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
index a4d6a9557c0..7d3b262d240 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -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:
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 3dbdea035e4..695bb2b3f18 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -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,
};
/**
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 405fc21b3ad..7c0d1a72dc7 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -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 },