Commit graph

168601 commits

Author SHA1 Message Date
Karol Herbst
c674db05e8 clc: use addMacroDef/Undef instead of -D/-U flags
It always felt weird having the extension management in two different
places. Later once we require LLVM-14 we might even be able to clean it up
a little more.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26641>
2023-12-12 14:24:48 +00:00
Iago Toral Quiroga
6b89c71c90 broadcom: fix scheduling dependencies for SETMSF instruction
We use SETMSF to implement discard, so we need to ensure that any
TMU writes after a SETMSF don't actually execute. We emit a TMU flush
before a discard but we also need to ensure that the QPU scheduler
honors this.

Fixes some tests in dEQP-VK.spirv_assembly.instruction.terminate_invocation.*
when we expose the extension that would otherwise fail because the
QPU scheduler would incorrectly move some image writes emitted after a SETMSF
before the SETMSF instruction.

Also fixes spec@arb_shader_atomic_counters@fragment-discard

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26631>
2023-12-12 12:58:42 +00:00
Frank Binns
4add1273f5 pvr: alloc WSI memory via GPU when there isn't a valid display FD
This isn't currently causing any issues as the driver only supports the
VK_KHR_display extension for now, so there will always be a valid display FD
when a WSI allocation is requested. However, checking that we have a valid
display FD when attempting to allocate via the display driver is more correct
and, when we come to support VK_KHR_wayland_surface, will avoid
vkAllocateMemory() unnecessarily failing.

This addresses a comment made here:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15507#note_2188052

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26516>
2023-12-12 12:41:13 +00:00
Lionel Landwerlin
aa8c88f96c anv: fix incorrect queue_family access on command buffer
The queue_family field is not an array, but a pointer.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9866c4e32b ("anv: Skip layout transition on the compute queue")
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26645>
2023-12-12 12:11:29 +00:00
Lionel Landwerlin
f53748c481 nir: fixup nir_printf intrinsic description
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Lionel Landwerlin
dc3e69af1a nir/serialize: untangle printf serialization from a particular stage
This allows any stage to carry printf instructions.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Lionel Landwerlin
4e4a3820ab nir/divergence: handle printf intrinsic
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Lionel Landwerlin
f7ae92b868 nir: include printfs from linked shaders
Once lowered low enough, it's not always possible to tell what strings
are used. So include them all when linking another shader.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Lionel Landwerlin
81b3dea993 nir/clone: fix missing printf_info clone
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Lionel Landwerlin
603f039708 nir: make printf_info (de)serializer available
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Lionel Landwerlin
751e919c33 util/u_printf: add a u_printf_ptr() variant
Taking an array of pointer to u_printf_info.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26505>
2023-12-12 11:11:10 +00:00
Thomas Devoogdt
3ef5149824 util: os_same_file_description: fix unknown linux < 3.5 syscall SYS_kcmp
https://man7.org/linux/man-pages/man2/kcmp.2.html

The kcmp() system call first appeared in Linux 3.5.

But was probably also not supported by all major platforms
at that time. So fallback to the check that is done for windows.

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18517>
2023-12-12 10:28:17 +00:00
Yonggang Luo
8fa16452ba broadcom/compiler: remove include of gallium headers from meson.build
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26579>
2023-12-12 10:03:11 +00:00
Yonggang Luo
238a9ef5ff broadcom/(compiler,common): avoid include of gallium headers in header files
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26579>
2023-12-12 10:03:10 +00:00
Pavel Asyutchenko
a921a69010 mesa/main: allow S3TC for 3D textures
This is allowed by D3D, RADV, ANV and Nvidia GL drivers
at least, so it should work on any hardware with S3TC.

Confirmed to work in OpenXRay on radeonsi.

Signed-off-by: Pavel Asyutchenko <svenpavel@gmail.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26389>
2023-12-12 06:53:00 +00:00
Yogesh Mohan Marimuthu
a9064837f8 winsys/radeon: remove unused gpu_address variable from struct radeon_cmdbuf
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
9a258bd5b3 winsys/amdgpu: rename big_ib_buffer,ib_mapped variables in struct amdgpu_ib
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
65cd94c8f0 winsys/amdgpu: rename ptr_ib_size_inside_ib to is_chained_ib
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
50ad5845cb winsys/amdgpu: rename requested_size_dw to projected_size_dw
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
e240cda128 winsys/amdgpu: move 125% comment to correct line of code
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
c7d004d029 winsys/amdgpu: remove rcs variable from struct amdgpu_ib
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
52aca8542f winsys/amdgpu: rename ib variable name to chunk_ib
rename struct drm_amdgpu_cs_chunk_ib ib variable name to chunk_ib for
improving code readability.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:23 +00:00
Yogesh Mohan Marimuthu
34fba64cf6 winsys/amdgpu: rename struct amdgpu_ib main variable as main_ib everywhere
In amdgpu_cs.c, struct amdgpu_ib variable is named as ib which creates
confusion since struct drm_amdgpu_cs_chunk_ib is also called as ib in
some places.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:22 +00:00
Yogesh Mohan Marimuthu
4d6089bfd1 winsys/amdgpu: remove ib_type variable from struct amdgpu_ib
preamble ib is created using amdgpu_cs_setup_preemption()
function. only IB_MAIN memory is allocated from struct amdgpu_ib.
Hence remove ib_type variable from struct amdgpu_ib.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:22 +00:00
Yogesh Mohan Marimuthu
0f117efe39 winsys/amdgpu: add _dw to max_ib_size variable for code readability
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26612>
2023-12-12 06:14:22 +00:00
Timothy Arceri
5147e9a26e glsl: combine shader stage loops in linker
The gs validation that was run between these loops can be run after
merging them without any issue.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26628>
2023-12-12 02:28:33 +00:00
Timothy Arceri
5d98592e04 mesa/st: drop additional validate_ir_tree() call
This is not needed. validate_ir_tree() is called at the end of the
glsl ir linker and the IR is not modified again after so we can
drop this.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26628>
2023-12-12 02:28:33 +00:00
Timothy Arceri
fe44414662 glsl/st: move remaining glsl ir lowering to linker
This is a tidy up but also allows us to drop an additional
validate_ir_tree() call.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26628>
2023-12-12 02:28:33 +00:00
Timothy Arceri
f4a8aa653d glsl/st: move has_half_float_packing flag to consts struct
Moving this out of the state tracker will allow us to move its user
directly to the glsl linker in the folowing patch.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26628>
2023-12-12 02:28:33 +00:00
Karol Herbst
8af15359e3 rusticl: use rust.proc_macro for proc macros
Should fix a few issues in regards to cross compilation and maybe other
things. This requires meson-1.3.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26636>
2023-12-12 00:21:40 +00:00
Rob Clark
1188b218c6 freedreno: Implement PIPE_CAP_TIMER_RESOLUTION
Perhaps it should use div_round_up() unlike normal timestamp conversion,
but this is close enough and it makes the connection to the 19.2MHz RBBM
counter more obvious.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26640>
2023-12-11 23:46:26 +00:00
Rob Clark
659e557676 freedreno: Fix timestamp conversion
The kernel returns the 19.2MHz RBBM counter, same as what is used for
timestamp queries.  So it needs to be converted the same way.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26640>
2023-12-11 23:46:26 +00:00
Rob Clark
2284d1c42f freedreno: De-duplicate 19.2MHz RBBM tick conversion
The 19.2MHz always-on counter is universal across generations, so
de-duplicate.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26640>
2023-12-11 23:46:26 +00:00
Karol Herbst
e6249f97f1 rusticl: implement cl_khr_subgroup_shuffle and shuffle_relative
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26504>
2023-12-11 23:08:51 +00:00
Karol Herbst
7e78802028 clc: add support for cl_khr_subgroup_shuffle and shuffle_relative
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26504>
2023-12-11 23:08:51 +00:00
Karol Herbst
a217eb111c radeonsi: lower 64bit subgroup shuffle to 32 bit
This option only affects 64 bit values and is needed by OpenCL.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26504>
2023-12-11 23:08:51 +00:00
Karol Herbst
9fbcc7987f radeonsi: lower relative shuffle subgroup ops
This will be needed by rusticl to support the relevant CL extensions.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26504>
2023-12-11 23:08:51 +00:00
Sil Vilerino
83624659c5 meson: Only build WGL for Windows platform when opengl option is active
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26638>
2023-12-11 22:32:08 +00:00
Eric Engestrom
c51e40dd8b spirv: add missing build dependency
Fixes: 59a72570b6 ("compiler: Move spirv into a module of its own")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10277
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26624>
2023-12-11 21:47:37 +00:00
Yiwei Zhang
88c5affacf driconfig: add a workaround for Hades (Vulkan backend)
Vulkan backend of Hades can only handle at most 3 swapchain images.

It affects all drivers after below commit:
04d654a5d0

and then only affects specific driver backend which enables
extra_xwayland_image in wsi device options after below commit:
c1a62476ac

Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Renato Pereyra <renatopereyra@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26607>
2023-12-11 19:40:09 +00:00
Ian Romanick
7fce0a5598 nir: Handle divergence for decl_reg
Once decl_reg is handled, src[0].ssa->divergent will be properly set, so
load_reg and load_reg_indirect do not need special treatment.

shader-db can run to completion on HSW, IVB, and SNB now. No other
testing was done.

v2: Refactor nir_intrinsic_load_reg and nir_intrinsic_load_reg_indirect
handling. Suggested by Daniel Schürmann.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 4fd257d20f ("nir: Properly handle divergence for load_reg")
Fixes: 6dbb5f1e07 ("intel/fs: rerun divergence analysis prior to convert_from_ssa")
Closes: #10233
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26436>
2023-12-11 17:10:51 +00:00
Jesse Natalie
7cd0553572 microsoft/clc: Flip on capabilities to prevent warning spew
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26582>
2023-12-11 16:28:29 +00:00
Jesse Natalie
37c0e8beda compiler/clc: Don't fail to parse SPIR-V if there's no kernels
It's valid to have library SPIR-V being parsed that has no entrypoints.
We still want to get spec constant info for them.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26582>
2023-12-11 16:28:28 +00:00
Faith Ekstrand
3955e596df nak: Implement fmulz and ffmaz
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10261
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26569>
2023-12-11 15:29:17 +00:00
Faith Ekstrand
ce8d966085 nak: Set .ftz on f32 ops by default
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26569>
2023-12-11 15:29:17 +00:00
Faith Ekstrand
aac1e3f595 nir: Add a new has_fmulz_no_denorms flag
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26569>
2023-12-11 15:29:17 +00:00
Erik Faye-Lund
a8b68badd5 mesa/st: use _mesa_is_zero_size_texture-helper
No need to repeat the logic.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26418>
2023-12-11 12:23:19 +00:00
Erik Faye-Lund
3123e4ffeb mesa/main: remove unused function
Let's just remove it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26418>
2023-12-11 12:23:19 +00:00
Erik Faye-Lund
b84117b272 mesa/main: use _mesa_is_zero_size_texture-helper
No need to repeat this logic.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26418>
2023-12-11 12:23:19 +00:00
Erik Faye-Lund
9e69dfbfed mesa/main: remove unused ClassID
This was probably useful in the past when we had DRI drivers, but it's
only ever written now. Let's get rid of it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26418>
2023-12-11 12:23:19 +00:00