Commit graph

194246 commits

Author SHA1 Message Date
David Heidelberg
43bff3b9eb etnaviv: rename enums_h appropriately
Needed for the follow-up change.

Cc: mesa-stable
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30829>
2024-08-26 08:09:14 +00:00
Qiang Yu
48a49c4e04 radeonsi: enable KHR_shader_subgroup
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:21 +08:00
Qiang Yu
1ee612e1ac radeonsi: use wave64 for KHR_shader_subgroup enabled shader
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:20 +08:00
Qiang Yu
a78d1d49e6 radeonsi: consider both stages to determine merged shader wave_size
Previously we determine wave_size of merged shader stages separately,
and ignore the condition which may cause them to be different.

Now we determine the wave_size of the TCS/GS part first, then use the
wave_size for VS/TES part. So that we can condider the previous shader
stage's information when determine the wave_size of TCS/GS, and two
stages in the merged shader can affect each other's wave_size.

This requires si_shader_selector to have two kinds of main part for
wave32 and wave64 when part mode, to be combined with other shader
part with various wave size.

This also enables merged shader stages with different
si_shader_info->has_divergent_loop to use wave32. We'll add another
condition for KHR_shader_subgroup latter.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:20 +08:00
Qiang Yu
196d91ed78 radeonsi: remove NULL check in si_determine_wave_size
This function is always called with non-NULL shader now.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:20 +08:00
Qiang Yu
40fdd97de3 glsl: set shader_info.subgroup_size for KHR_shader_subgroup
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:20 +08:00
Qiang Yu
ea33876fbe glsl: remove unused fields in gl_shader
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:20 +08:00
Qiang Yu
7538edf706 glsl: add KHR_shader_subgroup_quad builtin functions
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:19 +08:00
Qiang Yu
72517a8be9 glsl: add KHR_shader_subgroup_clustered builtin functions
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:19 +08:00
Qiang Yu
db41c09e17 glsl: add KHR_shader_subgroup_arithmetic builtin functions
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:19 +08:00
Qiang Yu
ac0bbb5b3f glsl: add KHR_shader_subgroup_shuffle_relative builtin functions
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:19 +08:00
Qiang Yu
eee3091e3e glsl: add KHR_shader_subgroup_shuffle builtin functions
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:19 +08:00
Qiang Yu
a496d84ac8 glsl: add KHR_shader_subgroup_ballot builtin functions
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:18 +08:00
Qiang Yu
7113d3c6ba glsl: prepare ballot function args for subgroup usage
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:18 +08:00
Qiang Yu
5f212a190b glsl: add KHR_shader_subgroup_vote builtin functions
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:18 +08:00
Qiang Yu
2d71467ec3 glsl: prepare vote function args for subgroup usage
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:18 +08:00
Qiang Yu
f0c8520a90 glsl: add KHR_shader_subgroup_basic builtin functions
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:18 +08:00
Qiang Yu
6ae013a032 glsl: use generic convertion code for some intrinsics
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:18 +08:00
Qiang Yu
c631116644 glsl: remove unused builtin function macros
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:17 +08:00
Qiang Yu
e2b07f9329 glsl: add builtin variables for KHR_shader_subgroup
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:17 +08:00
Qiang Yu
19e4549944 glsl: add KHR_shader_subgroup extensions
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:17 +08:00
Qiang Yu
72823354dd mesa: add spirv GroupNonUniform* capbilities support
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:17 +08:00
Qiang Yu
d5bc014493 mesa: implement KHR_shader_subgroup Get* values
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:17 +08:00
Qiang Yu
34f4b5e0ea mesa: add KHR_shader_subgroup extension
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:16 +08:00
Qiang Yu
661b9061d4 gallium: add caps for KHR_shader_subgroup
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:16 +08:00
Qiang Yu
58e412014a ac,radv,radeonsi: stop using quad vote any/all when llvm
ClustedAnd with bool argument and cluster_size==4 will be lowered
to quad_vote_all. So does ALU nir_iand/ior op with bool src.

OpenGL and Vulkan subgroup clustered_and tests with bool argument
fail when using LLVM. It seems LLVM has bug when quad vote bool
is in complex control flow. So stop using it for now.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:15 +08:00
Qiang Yu
a37933b721 ac/llvm: build wqm for quad intrinsics only when fragment shader
Otherwise we get wrong result when non-fragment shader.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:46:11 +08:00
Qiang Yu
0f937426cc radeonsi: lower subgroup ops after wave size is known
We use wave 32 sometime so should not use static subgroup
size of 64.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
2024-08-26 10:41:30 +08:00
Caio Oliveira
31dfb04fd3 intel/brw: Remove long register file names
The long names were originally meant to map to the HW encoding but
nowadays the actual encoding values depend on gfx version, whether
instruction is 3src, etc.

Suggested by Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
6bdf2de4d2 intel/brw: Remove unused ARF values and helpers
These were used by old Gfx versions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
72b687abb4 intel/brw: Make BAD_FILE the zero value for brw_reg_file
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
e8f921678a intel/brw: Explicitly map brw_reg_file into hardware values
For now this is a no-op, but will be useful when changing the enum
to values that don't match the hardware.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
e7179232c9 intel/brw: Move encoding of Gfx11 3-src inside the inst helpers
Create specific helper for register file encoding and handle it there.
Use ad-hoc structs to let the macro take optional named arguments.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
d31c8bfb6f intel/brw: Remove more uses of variable length arrays
In these cases there's a clear bound we can use.  In C++ this is a
compiler extension and not compatible with zero initializing a
regular struct -- which will happen in a later change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
86c20e2910 intel/brw: Use a helper for common VEC pattern
In the helper, instead of using the Variable Length Array, use a
fixed size array to NIR_MAX_VEC_COMPONENTS.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:14 +00:00
Caio Oliveira
abc535a3b4 intel/brw: Remove unused variable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30704>
2024-08-25 22:08:13 +00:00
Lepton Wu
72506ac8c7 egl/android: Fix wrong pipe format for RGB_565
We were actually using PIPE_FORMAT_B5G6R5_UNORM for HAL_PIXEL_FORMAT_RGB_565
since Android support was added to Mesa. This restores the original behavior.

Fixes: 273e54391a ("egl/android: Remove hard-coded color-channel data")

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Signed-off-by: Lepton Wu <lepton@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30827>
2024-08-25 21:01:15 +00:00
Karol Herbst
e9d908206b vtn: ignore volatile on functions for now
Not sure if we have to do something about it here, but maybe at some point
we do?

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30739>
2024-08-25 14:11:32 +00:00
Karol Herbst
eef1af8128 rusticl/device: limit CL_DEVICE_IMAGE_MAX_BUFFER_SIZE more aggressively
We can't exceed c_int::MAX, because the CTS casts to ints in a few places.

We also need to take into account max pixel size when restricting to
max_mem_alloc as this cap is pixel based, not byte based.

Cc: mesa-stable

Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30739>
2024-08-25 14:11:32 +00:00
Konstantin Seurer
81e3930ec0 nir/print: Add a helper for generating debug info
Prints the shader to a string and assigns source locations based on
that.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18903>
2024-08-25 10:26:33 +00:00
Konstantin Seurer
4423c50c1b spirv: Emit nir_debug_info_instr for OpLine
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18903>
2024-08-25 10:26:33 +00:00
Konstantin Seurer
ce24486ee4 nir: Introduce nir_debug_info_instr
Adds a new instruction type that stores metadata that might be useful
for debugging purposes. Passes must ignore these instructions when
making decisions.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18903>
2024-08-25 10:26:33 +00:00
David Heidelberg
a70968c62f freedreno: update night expectations
Acked-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30830>
2024-08-25 04:26:03 +00:00
Mauro Rossi
7b32df696e nvk: Fix regression observed on Kepler
vkcube, vkgears and vkmark are crashing with the following error/segfault:

$ NVK_I_WANT_A_BROKEN_VULKAN_DRIVER=1 vkcube
WARNING: NVK is not a conformant Vulkan implementation, testing use only.
Selected GPU 0: GeForce GT 640 (NVK GK107), type: DiscreteGpu
ERROR: couldn't get DataFile for op ldc_nv
Segmentation fault (core dumped)

Handling nir_intrinsic_ldc_nv as per nir_intrinsic_load_ubo in Converter::getFile()
allows to run vkcube, vkgears and vkmark on Nvidia GT640

Fixes: dc99d9b2 ("nvk,nak: Switch to nir_intrinsic_ldc_nv")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30832>
2024-08-24 22:15:45 +02:00
Karol Herbst
74dafa3c79 ac/llvm: fix umul_high
LLVM optimizes umul_hi with a constant to v_mul_hi_i32_i24_e32 which isn't
always what we need here. This causes miscalculations. To prevent LLVM to
apply this optimization, we insert a optimization barrier.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11761
Suggested-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30810>
2024-08-24 16:10:20 +00:00
Juan A. Suarez Romero
2162cf7476 v3d/ci: update expected results
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30823>
2024-08-24 14:54:23 +00:00
Valentine Burley
aeba937762 nvk: Advertise VK_EXT_legacy_vertex_attributes
Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30817>
2024-08-24 03:55:37 +00:00
Faith Ekstrand
fef77e1d4c nvk: Treat NULL vertex/index buffer pointers as null descriptors
Previously, we trusted the caller to set the size to zero for null
descriptors.  However, device-generated commands allows specifying a
zero device address with a non-zero size.  We may as well handle this
case directly in the MME and keep our command emit shader simple.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:57 +00:00
Faith Ekstrand
f83e573c1a nvk: Use the new dispatch helper for queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:57 +00:00
Faith Ekstrand
105bdf2e36 nvk: Add a helper for dispatching compute shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:56 +00:00