gallium: Add a cap bit for OpenCL-style extended integer functions
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 14 Nov 2019 22:12:30 +0000 (14:12 -0800)
committerMarge Bot <eric+marge@anholt.net>
Thu, 23 Jan 2020 00:18:57 +0000 (00:18 +0000)
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 <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/767>

src/gallium/auxiliary/util/u_screen.c
src/gallium/docs/source/screen.rst
src/gallium/include/pipe/p_defines.h

index 70eb4a27d748317ee5f0733a0f6388d97f7be1f6..5a7790b75dea5ee61cae0c793a29c7e50dd9e515 100644 (file)
@@ -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_*");
    }
index 7e6964282f59eeb360c616b1702b381718223f22..a0149cf6994f0021ea3366a988473a3c45591a8e 100644 (file)
@@ -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:
 
index 76afb5a311c549dedd6b2bdb45a01861c6328cd2..3599b7713471c55f5c450d5c9a58a8445d32853d 100644 (file)
@@ -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,
 };
 
 /**