Mary Guillemard
2c455c2d81
libcl: Add more UINT_MAX variants
...
Needed by panvk's minmax CL code.
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35639 >
2025-06-20 10:11:52 +00:00
Konstantin Seurer
cb31b5a958
clc,libcl: Clean up CL includes
...
This patch does a couple of things to make CL integration with drivers
as seamless as possible:
- We pull in opencl-c.h and opencl-c-base.h to stop relying on system
headers.
- Parts of libcl.h are moved to new headers that are incomplete CL-safe
variants of libc headers.
- A couple of util headers are changed to remove now unnecessary
__OPENCL_VERSION__ guards and make more headers CL safe.
- Drivers now include src/compiler/libcl and use headers like
macros.h,u_math.h instead of libcl.h.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33576 >
2025-04-11 21:27:37 +00:00
Alyssa Rosenzweig
93b84d0d90
libcl: add u_foreach_bit
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33901 >
2025-03-10 20:16:03 +00:00
Alyssa Rosenzweig
c51a2e85d8
libcl/vk: add common query copy write routine
...
every VK driver ends up wanting this.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32721 >
2025-02-13 11:50:06 +00:00
Alyssa Rosenzweig
2a1524a089
libcl: add unreachable() macro
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33099 >
2025-01-31 16:17:59 +00:00
Alyssa Rosenzweig
6a958f6997
libcl: define GLSL-style compute built-ins
...
OpenCL C defines work-item functions to return a scalar for a particular
dimension. This is a really annoying papercut, and is not what you want for
either 1D or 3D dispatches. In both cases, it's nicer to get vectors. For
syntax, we opt to define uint3 "magic globals" for each work-item vector. This
matches the GLSL convention, although retaining OpenCL names. For example,
`gl_GlobalInvocationID.xy` is expressed here as `cl_global_id.xy`. That is much
nicer than standard OpenCL C's syntax `(uint2)(get_global_id(0),
get_global_id(1))`.
We define the obvious mappings for each relevant function in "Work-Item
Functions" in the OpenCL C specification.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33099 >
2025-01-31 16:17:59 +00:00
Alyssa Rosenzweig
5ab16b340e
libcl: add MIN3/MAX3 macros like on the host
...
useful for lvp
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33099 >
2025-01-31 16:17:59 +00:00
Lionel Landwerlin
b0a882b3dc
libcl_vk: add some vulkan enums/structures for DGC
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Tested-by: Matt Turner <mattst88@gmail.com >
Reviewed-by: Dylan Baker <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33014 >
2025-01-25 03:28:07 +00:00
Lionel Landwerlin
d3d771607d
libcl: add MIN2/MAX2 macros
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Tested-by: Matt Turner <mattst88@gmail.com >
Reviewed-by: Dylan Baker <None>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33014 >
2025-01-25 03:28:07 +00:00
Mary Guillemard
42f6bb0456
libcl: Add VkQueryType and VkQueryResultFlagBits definitions
...
Useful for query pool copy/clear meta shaders.
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32939 >
2025-01-08 11:37:27 +00:00
Mary Guillemard
2e38a15070
libcl: Respect NDEBUG for assert
...
In C, NDEBUG allows disabling the assert macro, let's follow this
behaviour.
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com >
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Eric R. Smith <eric.smith@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32939 >
2025-01-08 11:37:27 +00:00
Mary Guillemard
5f8addfd99
util/bitpack_helpers: Make fixed packs CL safe
...
We emulate roundf and llroundf for compatibility.
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com >
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Eric R. Smith <eric.smith@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32939 >
2025-01-08 11:37:27 +00:00
Alyssa Rosenzweig
d64caf4161
libcl: add VkDraw(Indexed)IndirectCommand definitions
...
this is helpful to indirect draw munging code, which applies to at least 3
stacks using driver CL stuff (current Intel, shortterm Asahi, mediumterm
Panfrost)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Reviewed-by: Karol Herbst <kherbst@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32529 >
2024-12-12 21:16:12 +00:00
Alyssa Rosenzweig
12e27497b3
libcl: add a common header for CPU/GPU stuff
...
In an attempt to make OpenCL shaders more "batteries included", start building
up a standard library. Based on libagx.h.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com >
Reviewed-by: Karol Herbst <kherbst@redhat.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32529 >
2024-12-12 21:16:12 +00:00