Commit graph

180998 commits

Author SHA1 Message Date
Faith Ekstrand
d8551cd328 nak: Add a writes_layer bit to nak_shader_info::vtg
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
a232050204 nak: Move clip, cull, and XFB into a nak_shader_info.vtg
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
440adf7970 nak: Properly prefix nak_xfb_info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
4e6e814f5e nak: Rename TLS to SLM
Shader Local Memory is what NVIDIA calls it in the shader header docs as
well as the command stream headers.  Better to be consistent even if it
gets my Intel brain confused.  (Intel uses SLM for shared memory.)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
a946071546 nvk: Use nak_fs_key instead of rolling our own
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
0f086401e3 nvk: Move even more lowering into nvk_codegen.c
At this point, we're fully trusting NAK to do its own lowering and we
only lower stuff in nvk_shader.c if it's relevant for Vulkan.  This also
assumes that NAK is already doing the right thing everywhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
67bb8e8165 nvk: Move the guts of nvk_compile_nir() to nvk_codegen.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
0405f494e8 nvk: Move the optimization loop to the nvk_codegen.c
We also call it from nak_preprocess_nir and lower var copies there.  NAK
should already be doing this for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
7f8fbacb8a nvk: Move a bunch of codegen-specific lowering to helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
c3a44f6264 nvk: Add a codegen helper for nir_shader_compiler_options
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
845e7d2911 nvk: Only lower outputs to temporaries
Also, move it up to right after we parse the SPIR-V and remove some now
unnecessary clean-up passes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
26bb5f4972 nak/nir: Lower indirect FS inputs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
e507d70333 nvk: Handle load_first_vertex in nvk_nir_lower_descriptors()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
Faith Ekstrand
82061b1b9d nvk: Only advertise VK_KHR_shader_terminate_invocation if using NAK
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
2023-11-15 02:24:12 +00:00
David Rosca
fcfa68a632 Revert "frontends/va: Alloc interlaced surface for interlaced pics"
This reverts commit 578e10e157.

The only reason for reallocating surfaces as interlaced (on drivers
that supports both progressive and interlaced) was deinterlacing
with postproc filter, but that now also supports interleaved surfaces.

With this change interlaced surfaces are no longer used on radeonsi.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26174>
2023-11-15 01:44:29 +00:00
David Rosca
eafeff6302 gallium/auxiliary/vl: Support interleaved input in deinterlace filter
This adds support for deinterlacing interleaved surfaces (both fields
interleaved together instead of as separate layers).

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26174>
2023-11-15 01:44:29 +00:00
David Rosca
35b0ccd855 gallium/auxiliary/vl: Scale dst_rect x0/y0 when rendering chroma plane
This fixes incorrect chroma plane position when x0/y0 is not zero.

Fixes: 001358a97c ("vl/compositor: add a new function for YUV deint")

Acked-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26123>
2023-11-15 01:12:01 +00:00
David Rosca
e9091b1f5c gallium/auxiliary: Fix coordinates clamp in util_compute_blit
Fixes: 7c8e1596d6 ("gallium/auxiliary: Fix util_compute_blit half texel offset with scaling")

Acked-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26123>
2023-11-15 01:12:01 +00:00
David Rosca
ef0546152f gallium/auxiliary/vl: Fix coordinates clamp in compute shaders
Fixes: a6a43963ed ("gallium/auxiliary/vl: Clamp coordinates in compute shaders")

Acked-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26123>
2023-11-15 01:12:01 +00:00
Jesse Natalie
cd0cff951a nir_lower_mem_access_bit_sizes: Fix write-mask-constrained 3-byte stores as atomics
The code here handled stores of actual 3-byte values (8-bit, 3-component), but didn't
correctly handle stores of larger 8-bit vectors that were constrained by write mask to
just 3 bytes. In that case, the pad-to-vec4 step was unnecessary and problematic.

Seen in CL CTS test_basic vector_swizzle test group for char3 with CLOn12.

Fixes: c70d94a8 ("nir_lower_mem_access_bit_sizes: Support unaligned stores via a pair of atomics")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26034>
2023-11-14 21:10:30 +00:00
Helen Koike
bff7e4b69d ci/zink: add spec@ext_timer_query@time-elapsed to flakes
Add the following flake to zink-anv-tgl-flakes.txt

spec@ext_timer_query@time-elapsed

See https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25861#note_2140498

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25885>
2023-11-14 17:29:30 +00:00
Faith Ekstrand
618bdb8571 nak: Rework FS input interpolation
This gives FS I/O the same treatment as we did for vertex attributes in
that we now have a NIR intrinsic which pretty closely matches the
hardware and we lower to that before going into NAK.  This gives us a
bit more control in the NIR.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:03 +00:00
Faith Ekstrand
d3c5688cf5 nak: Plumb the nak_compiler through to lower_fs_input_intrin
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:02 +00:00
Faith Ekstrand
f5ba0751e2 nak: Make encode_sm75 a method of Shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:02 +00:00
Faith Ekstrand
a6376705e4 nak: Make ALD/AST.PHYS a boolean
The generic flags field was originally copied from codegen but a boolean
makes way more sense.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:02 +00:00
Faith Ekstrand
8e00ee6fe8 nak: Drop OpAtomCas in favor of OpAtom with atom_op == CmpExch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:02 +00:00
Faith Ekstrand
ea453b373d nak: Fix copy-prop for OpPLop3 sources
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:02 +00:00
Faith Ekstrand
a65518b625 nvk: Free NAK shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26181>
2023-11-14 16:38:02 +00:00
Rhys Perry
c4ee639ca0 docs: fix RADV_THREAD_TRACE_CACHE_COUNTERS default
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: dbab98d9d6 ("radv: enable RADV_THREAD_TRACE_CACHE_COUNTERS by default")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26193>
2023-11-14 16:24:11 +00:00
Jesse Natalie
2f1cb79968 d3d12: GL4.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26180>
2023-11-14 16:04:58 +00:00
Jesse Natalie
5a5178d5a4 d3d12: Fix MSAA-disabling pass; sample mask should be 0 for helper lanes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26180>
2023-11-14 16:04:58 +00:00
Jesse Natalie
ba06542c7b d3d12: Handle cull distance as an XFB target
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26180>
2023-11-14 16:04:58 +00:00
Jesse Natalie
263b56051d d3d12: PRIMITIVES_GENERATED for stream > 0 should only be an SO query
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26180>
2023-11-14 16:04:58 +00:00
Tatsuyuki Ishi
538ca7801a radv: Use shader part caching helpers for VS prolog and PS/TCS epilog.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26028>
2023-11-14 13:45:22 +00:00
Tatsuyuki Ishi
611545fbfe radv: Implement helpers for shader part caching.
Currently, shader part caching logic is duplicated between VS prolog and
PS/TCS epilogs. This commit introduces a common abstraction to
deduplicate the code.

Additionally, there are a few design decisions that diverts from the
current implementation:
1. A simple mutex is used instead of reader-writer lock. Prolog/epilog
   constructions are serialized, removing the need to free duplicate
   objects in case of a race.
2. A CS-local cache is used to quickly lookup an entry without holding a
   lock. This eliminates locking in over 99% of cases.
3. A set is used to reduce number of allocations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26028>
2023-11-14 13:45:22 +00:00
Danylo Piliaiev
3cd6bb3e5d tu: Add a725 workaround dispatch at the start of each cmdbuf
Blob executes a special compute dispatch at the start of each
command buffers. We copy this dispatch as is. At this point
we don't know what this workaround is for.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25888>
2023-11-14 13:14:11 +00:00
Danylo Piliaiev
37f11ff1d4 freedreno/devices: Support Adreno 725
For 0x07030002 chip id different names are returned on different
phones: Adreno730v3 or Adreno725v1. Settle on 725 to disambiguate
them.

The only difference from base 730 is that it has conditional
execution of compute shader at the start of every command buffer.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25888>
2023-11-14 13:14:11 +00:00
Danylo Piliaiev
28f187b9a7 tu: Return error when GPU is unsupported
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25888>
2023-11-14 13:14:11 +00:00
Danylo Piliaiev
a669147689 tu: Always print startup failure messages
If we encounter an error during the startup we always want to have
it in the logs to quickly diagnose an issue from user attached logs.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25888>
2023-11-14 13:14:11 +00:00
LingMan
76996e2a94 rusticl: Use the from_raw_parts wrappers
Deduplicates some safety checks and ensures we didn't forget one.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26157>
2023-11-14 12:31:31 +00:00
LingMan
471d89c4fd rusticl/api: Add checking wrappers around slice::from_raw_parts{_mut}
They check for null, alignment, excessive size, and address space wrapping. If any of the checks
fails, `Err(CL_INVALID_VALUE)` is returned.

The caller still has to uphold the other requirements of the `from_raw_parts` fns.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26157>
2023-11-14 12:31:31 +00:00
LingMan
572a96aa59 rusticl: Turn pointers in enqueue_svm_memcpy_impl into slices
Allows the closure to implement `Send` and `Sync`, which we want for `EventSig`.
Includes detailed documentation on the casts and unsafe operations.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26157>
2023-11-14 12:31:31 +00:00
LingMan
7dd5a22735 rusticl: Turn pointers in enqueue_svm_mem_fill_impl into proper Rust types
Raw pointers have bad ergonomics and by using them we opt out of a lot of Rust safety guarantees.
The closure we create modifies the memory behind `svm_ptr`. Make that clear to the compiler by
representing it as slice. `pattern` could also be represented by a slice but then we'd create
overly generic code not exploiting the guarantees given to us be the OpenCL spec.
Namely that there's only a few possible sizes - all of them a power of two - and that `svm_ptr` is
aligned to that size.

Thus, represent `pattern` as one struct per possible size and have the compiler generate optimized
code paths for filling the buffer with each of them. There's one unsafe operation less and the
remaining ones as well as the casts have been documented in detail.

Based on that additional checks of the provided `size` have been added. While it's unlikely that
any application will ever run into them, the old pointer arithmetic already silently relied on
these properties.

Furthermore, since raw pointers are neither `Send` or `Sync` but the Rust types we now use are the
closure can now implement `Send` and `Sync`. That's one step toward marking `EventSig` `Send`.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26157>
2023-11-14 12:31:31 +00:00
Eric Engestrom
fdbb5d5898 ci/valve-infra: ensure the correct farm picks up the job
Until now, any farm that has a DUT that matches could have picked up the
job.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25821>
2023-11-14 10:25:24 +00:00
Pierre-Eric Pelloux-Prayer
898ccf7711 radeonsi/ci: update failures
Remove GTF-GL46.gtf21.GLCoverage.CoverageGL21 from failing tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25956>
2023-11-14 09:28:00 +00:00
Pierre-Eric Pelloux-Prayer
64352ae8e4 mesa: restore call to _mesa_set_varying_vp_inputs from set_vertex_processing_mode
Otherwise ctx->VertexProgram._VaryingInputs might not be up to date.

We can't do this in update_program because this breaks vbo_save_playback_vertex_list_gallium:

  const GLbitfield enabled = node->enabled_attribs[mode];
  _mesa_set_varying_vp_inputs(ctx, enabled);              <-- update _VaryingInputs

  if (ctx->NewState)
     _mesa_update_state(ctx);                             <-- calls update_program, reverting the
                                                              change made above

Fixes: c97961a855 ("mesa: fix 38% decrease in display list performance of Viewperf2020/NX8_StudioAA")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9441
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25956>
2023-11-14 09:28:00 +00:00
Samuel Pitoiset
dfc125d423 radv: fix VRS subpass attachment when HTILE can't be enabled on GFX10.3
On GFX10.3, VRS rates need to be copied to the HTILE buffer but in some
situations, like for mips, it's not always possible to enable HTILE.
In this case, we can fallback to our internal HTILE buffer and tweak
the depth/stencil registers to use this HTILE buffer.

This fixes a bunch of VRS crashes on GFX10.3.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26025>
2023-11-14 09:02:46 +00:00
Sagar Ghuge
648c0c159d anv: Flush data cache while clearing depth using HIZ_CCS_WT
Patch fxes ESO shadow pass ground corruption on Arc A750. In the colour
pass where the rendering corruption first appears, the depth resource
was used as a "PS - Texture".  Immediately afterwards there's a Barrier
where it goes from

	VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL =>
	VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL

immediately following that there's a Clear from vkCmdBeginRendering
which appears to be a HiZ clear.  Things work when using AUX_USAGE_HIZ
but AUX_USAGE_HIZ_CCS_WT (XXX: and AUX_USAGE_HIZ_CCS?) doesn't work.

current thinking is this is related to 14015264727 where we had to add
HDC and DC flushes to CCS and MCS fast clears.  Maybe HiZ clears with
CCS also have similar problems?  The docs don't appear to indicate that
but the docs were also wrong for color clears until recently...

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9277
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9444
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22717>
2023-11-14 08:30:59 +00:00
Tapani Pälli
e4db19afa7 iris: add data cache flush for pre hiz op
This fixes various failing Piglit tests on DG2.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22717>
2023-11-14 08:30:59 +00:00
Maíra Canal
4d95b4861e v3dv: implement VK_EXT_multi_draw
Implement the Vulkan extension VK_EXT_multi_draw. It was tested with
deqp-vk -n dEQP-VK.draw.*multi_draw*.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26138>
2023-11-14 06:20:21 +00:00