Commit Graph

188335 Commits

Author SHA1 Message Date
David Heidelberg
fd3d125343 r600: add license information to the sfn_shader_gs.h
Fixes: 79ca456b48 ("r600/sfn: rewrite NIR backend")
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28395>
2024-04-09 08:56:08 +00:00
David Heidelberg
722e5bf46f r600: add license info to the r600_opcodes.h
Fixes: a3a94554f5 ("r600g: split opcodes out and add wrapper around usage.")
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28395>
2024-04-09 08:56:08 +00:00
David Heidelberg
0020dd85ee r600: add license header to r600_formats.h
The header was missing after the definitions were moved.

Fixes: 82114ac02a ("r600g: switch to a common formats.h file since they are in different regs")

Acked-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28395>
2024-04-09 08:56:08 +00:00
David Heidelberg
fb8cf56b75 r600: update licensing to SPDX header
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28395>
2024-04-09 08:56:08 +00:00
David Heidelberg
c423f48204 frontend/nine: fix typos
Signed-off-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28232>
2024-04-09 10:30:40 +02:00
Axel Davy
c6468f6547 frontend/nine: Reset should EndScene
This was reported by some users.

Cc: mesa-stable
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28232>
2024-04-09 10:30:40 +02:00
Axel Davy
d6044cf857 frontend/nine: Fix destruction race
As we were checking the bind count after decreasing the ref count,
we could hit a situation where the worker thread decreases the bind count
just after the ref count is decreased, but before the bind count is checked
which would lead to both threads calling the resource dtor.

Cc: mesa-stable
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28232>
2024-04-09 10:30:40 +02:00
Axel Davy
b4a14c7ebf frontend/nine: Fix missing light flag check
The constants for ff lights use the VIEW matrix,
thus we must update them if the matrix is dirty.

Cc: mesa-stable

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28232>
2024-04-09 10:30:40 +02:00
Axel Davy
d3cec6cdf1 frontend/nine: Fix programmable vs check
Checking if context->vs is set is not
equivalent to checking programmable vs

Cc: mesa-stable
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28232>
2024-04-09 10:30:39 +02:00
Axel Davy
9063d554f3 frontend/nine: Fix ff ps key
The stage index, rather than the
texture coord index was used.

Cc: mesa-stable
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28232>
2024-04-09 10:30:39 +02:00
Konstantin Seurer
750b2af4d9 lavapipe: Implement VK_KHR_ray_tracing_position_fetch
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:02 +00:00
Konstantin Seurer
cede129119 lavapipe: Implement VK_EXT_pipeline_library_group_handles
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:02 +00:00
Konstantin Seurer
1f729d9e2d lavapipe: Implement KHR_ray_tracing_maintenance1
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:02 +00:00
Konstantin Seurer
d99e95e033 lavapipe: Implement VK_KHR_ray_tracing_pipeline
Uses the existing ray traversal helpers and function calls handled by
gallivm.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:02 +00:00
Konstantin Seurer
8b71c6d0d1 lavapipe: Fix a memory leak in lvp_push_internal_buffer
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:02 +00:00
Konstantin Seurer
73259c9ec4 lavapipe: Add an api_stage parameter to update_pcbuf
llvmpipe does not support ray tracing stages, so update_pcbuf needs to
be aware of the Vulkan and the llvmpipe stage.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:02 +00:00
Konstantin Seurer
fd8fd2d791 lavapipe: Inline fill_ubo0
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:02 +00:00
Konstantin Seurer
9482d8cc61 lavapipe: Use the pipeline type in get_pcbuf_size
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Konstantin Seurer
5e0b8334ec lavapipe: Pass lvp_ray_flags into lvp_aabb_intersection_cb
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Konstantin Seurer
bdab90d120 lavapipe: Add more ray tracing helpers
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Konstantin Seurer
35ad2e37d9 lavapipe: Remove unused ray tracing variables
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Konstantin Seurer
5423a47954 lavapipe: Defer binding compute state
Ray tracing uses compute state as well and therefore will need to dirty
it.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Konstantin Seurer
a738ae4838 lavapipe: Lower mem_constant variables
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Konstantin Seurer
8ff444b595 lavapipe: Make lvp_create_pipeline_nir non-static
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Konstantin Seurer
1a718e0adf lavapipe: Make lvp_shader_init non-static
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Konstantin Seurer
5d43b8c46e lavapipe: Add lvp_spirv_to_nir
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Konstantin Seurer
04af9b3ac2 llvmpipe: Fix function call handling
Fixes using images and samplers inside functions and allows for
function calls outside of kernels.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Konstantin Seurer
85e840786c nir: Add lavapipe ray tracing intrinsics
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Konstantin Seurer
edc8e011eb nir/serialize: Encode data for temporaries
the location has to be preserved when lowering them to scratch using
nir_lower_vars_to_explicit_types and nir_lower_explicit_io.

cc: mesa-stable

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Konstantin Seurer
1ff8659f41 nir/print: Fix printing booleans with bit_size>1
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
2024-04-09 07:13:01 +00:00
Paul Gofman
27dba224d3 driconf: add a workaround for Joe Danger
CC: mesa-stable
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28439>
2024-04-09 01:29:24 +00:00
Paul Gofman
2abb72f512 driconf: add a workaround for Joe Danger 2
CC: mesa-stable
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28439>
2024-04-09 01:29:23 +00:00
Paul Gofman
bd189dbd77 glsl: allow out arrays in #110 with allow_glsl_120_subset_in_110
CC: mesa-stable
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28439>
2024-04-09 01:29:23 +00:00
Faith Ekstrand
6b383ca810 nil: Enforce units via Rust types
We add a units generic parameter to Extent4D and Offset4D and then make
every helper take and return the right type.  The mul and div_* helpers
only half-enforce types but it's better than nothing.  We leave them
non-public so no one outside extent.rs uses them.

Reviewed-by: Lina Versace <linyaa@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28639>
2024-04-09 00:13:01 +00:00
Faith Ekstrand
c3b33de33c nil: Take a format in el_to_B()
Reviewed-by: Lina Versace <linyaa@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28639>
2024-04-09 00:13:01 +00:00
Faith Ekstrand
5a075785ac nil: Drop the nil_extent/offset4d() helpers
They're only used one place each in NVK and we can just use a struct
initializer instead.

Reviewed-by: Lina Versace <linyaa@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28639>
2024-04-09 00:13:01 +00:00
Faith Ekstrand
bc0de7a2cf nil: Add Extent/Offset4D::new() helpers
We're about to add a PhantomData to Extent/Offset4D and that'll make it
harder to construct.  Adding a helper lets us more easily construct them
elsewhere in the code.

Reviewed-by: Lina Versace <linyaa@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28639>
2024-04-09 00:13:01 +00:00
Connor Abbott
8f65ecac21 ir3: Use divergence analysis for (jp) and physical CFG
This will be important for checking whether we can use scalar registers
for phis.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28573>
2024-04-08 23:20:08 +00:00
Connor Abbott
b349dc5c74 ir3: Remove loop shared copy check
This is now handled by inserting LCSSA phis similar to how it's handled
in ACO.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28573>
2024-04-08 23:20:08 +00:00
Connor Abbott
5ed567fea1 ir3: Run divergence analysis at the end
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28573>
2024-04-08 23:20:08 +00:00
Connor Abbott
266adc3e11 ir3: Allow single-predecessor phis
These will be used to block propagating shared -> non shared moves out
of loops instead of the current check in ir3_cp.c, similar to what ACO
does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28573>
2024-04-08 23:20:08 +00:00
Connor Abbott
42ddbf4ebe nir/divergence_analysis: Fix load_view_index divergence in VS
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28573>
2024-04-08 23:20:08 +00:00
Connor Abbott
223e3727d5 nir/divergence_analysis: Add uniform_load_tears option
This "tear" is similar to the original concept of loads/stores tearing,
but across invocations in a wave instead of bytes. Qualcomm seems to
have this problem, at least for some GPUs. This fixes
spec@arb_shader_storage_buffer_object@execution@ssbo-atomiccompswap-int
on a630 once we start relying on divergence analysis for computing
reconvergence properties. For backends that have readFirstInvocation(),
it should be possible to fix the problem by inserting
readFirstInvocation() instead, but a5xx doesn't have it so we can't rely
on it in freedreno.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28573>
2024-04-08 23:20:08 +00:00
Connor Abbott
291e6d2940 nir/divergence_analysis: Add ir3-specific intrinsics
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28573>
2024-04-08 23:20:08 +00:00
Paulo Zanoni
cf7e1f3817 anv, iris: add missing CS_STALL bit for GPGPU texture invalidation
The BSpec page "Flush Types" (46213) says the following about the Tex
Invalidate bit:

  "Requires stall bit ([20] of DW) set for all GPGPU Workloads."

For newer platforms, this is documented in the description of the
texture invalidation bit in the PIPE_CONTROL page (56551):

  "CS Stall bit in PIPE_CONTROL command must be always set for GPGPU
   workloads when Texture Cache Invalidation Enable bit is set"

Iris had it only for GFX_VER 9 and 11, while Anv had it missing for
everything.

Please notice that this patch includes a revert of 397e728ef4.

Fixes: 397e728ef4 ("iris: Drop GPGPU Tex Invalidate restriction for TGL+")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28608>
2024-04-08 22:57:22 +00:00
Zack Rusin
955444e068 svga: Fix instanced draw detection
The new GTK+ GL renderer is extensively using instanced rendering. SVGA
driver was incorrectly detecting the instanced draws by only checking
whether the instance count was greater than 1. Base instance has to
be also checked to make sure that the draw correctly offsets the vertex
buffer.

Fix instanced draw detection by checking both the instance count and
the base instance. Fixes the new GTK+ 4 GL renderer.

Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Fixes: ccb4ea5a43 ("svga: Add GL4.1(compatibility profile) support in svga driver")
Reviewed-by: Neha Bhende <neha.bhende@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28616>
2024-04-08 22:35:48 +00:00
Pavel Ondračka
96479794a5 nir/lower_vec_to_regs: always set cursor before inserting decl_reg
Otherwise we can end with invalid curson in some cases, specifically,
if we encounter an identity vector and thus neither register
declaration nor swizzle is inserted, it can lead to invalid cursor and a
crash later.

Suggested by: Alyssa Rosenzweig <alyssa@rosenzweig.io>

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10905
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28581>
2024-04-08 21:03:46 +00:00
Faith Ekstrand
fc90d4eed9 nil: Make the Rust library the primary build target
This just shuffles around the meson to make it so that the Rust library
is the final build target, not a C library.  We're still building
fundamentally the same amount of stuff because nil_format_table.c is
still C (C is really good at tables that go in the .data section) and we
still need a wrapper rlib for bindgen.  Howver, the Rust library is now
the main thing.  When the time comes to start using NIL from other Rust
code, this will mean that we can just build an rlib and it will have
everything.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27397>
2024-04-08 20:28:44 +00:00
Faith Ekstrand
571b77fee7 nil: Delete unused USAGE bits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27397>
2024-04-08 20:28:44 +00:00
Daniel Almeida
5577128c83 nil: Rewrite the TIC code in Rust
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27397>
2024-04-08 20:28:44 +00:00