From: Ian Romanick Date: Thu, 14 Nov 2019 22:12:30 +0000 (-0800) Subject: gallium: Add a cap bit for OpenCL-style extended integer functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9db20748fd1af930920424a95321ee11b6eae16e;p=mesa.git gallium: Add a cap bit for OpenCL-style extended integer functions Iris will eventually enable this. Looking at the header files, it looks like Midgard could also enable it. Basically, any GPU that fully supports OpenCL can. v2: Add default value to u_screen.c. Suggested by Caio. Reviewed-by: Caio Marcelo de Oliveira Filho Reviewed-by: Kenneth Graunke Part-of: --- diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c index 70eb4a27d74..5a7790b75de 100644 --- a/src/gallium/auxiliary/util/u_screen.c +++ b/src/gallium/auxiliary/util/u_screen.c @@ -404,6 +404,9 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen, case PIPE_CAP_MAX_VERTEX_BUFFERS: return 16; + case PIPE_CAP_OPENCL_INTEGER_FUNCTIONS: + return 0; + default: unreachable("bad PIPE_CAP_*"); } diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index 7e6964282f5..a0149cf6994 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -565,6 +565,7 @@ The integer capabilities: * ``PIPE_CAP_TWO_SIDED_COLOR``: Driver supports two-sided coloring. * ``PIPE_CAP_CLIP_PLANES``: Driver supports user-defined clip-planes. * ``PIPE_CAP_MAX_VERTEX_BUFFERS``: Number of supported vertex buffers. +* ``PIPE_CAP_OPENCL_INTEGER_FUNCTIONS``: Driver supports extended OpenCL-style integer functions. This includes averge, saturating additiong, saturating subtraction, absolute difference, count leading zeros, and count trailing zeros. .. _pipe_capf: diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 76afb5a311c..3599b771347 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -910,6 +910,7 @@ enum pipe_cap PIPE_CAP_TWO_SIDED_COLOR, PIPE_CAP_CLIP_PLANES, PIPE_CAP_MAX_VERTEX_BUFFERS, + PIPE_CAP_OPENCL_INTEGER_FUNCTIONS, }; /**