Commit Graph

2866 Commits

Author SHA1 Message Date
Marek Olšák 25d4943481 nir: make use_interpolated_input_intrinsics a nir_lower_io parameter
This will need to be set to true when the GLSL linker lowers IO, which
can later be unlowered by st/mesa, and then drivers can lower it again
without load_interpolated_input. Therefore, it can't be a global
immutable option.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32229>
2024-11-20 02:45:37 +00:00
LingMan 190fbbe1d6 nak/hw_test: Use std::mem::offset_of!()
It got stabilized with Rust 1.77.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31510>
2024-11-18 22:29:13 +00:00
Rhys Perry 45c1280d2c nir_lower_mem_access_bit_sizes: pass access to callback
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31904>
2024-11-13 12:59:26 +00:00
Rhys Perry 61752152f7 nir_lower_mem_access_bit_sizes: add nir_mem_access_shift_method
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31904>
2024-11-13 12:59:26 +00:00
Eric Engestrom 234b9c72f9 nvk/ci: document flakes seen recently
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32080>
2024-11-13 12:26:50 +00:00
M Henning 68cdcf5bbc nvk: Fix two typos in comments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32086>
2024-11-12 23:26:49 +00:00
M Henning 05770374a3 nvk: Remove params for dirty_cbufs_for_descriptors
dyn_start/dyn_end are unused now.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32086>
2024-11-12 23:26:49 +00:00
M Henning dc12c78235 nvk: Fix invalidation of NVK_CBUF_TYPE_DYNAMIC_UBO
Because dyn_start and dyn_end are indices into
nvk_root_descriptor_table->dynamic_buffers, we would need to offset
cbuf->dynamic_idx by
nvk_root_descriptor_table->set_dynamic_buffer_start[cbuf->desc_set]
in order to do those comparisons correctly.

We could do that, but it's simpler and no less precise to sinply
re-use the same comparison that we do in the other cases here.

This fixes a rendering artifact in Baldur's Gate 3 (Vulkan), which
regressed with the commit listed below.

Fixes: 091a945b57 ("nvk: Be much more conservative about rebinding cbufs")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32086>
2024-11-12 23:26:49 +00:00
M Henning 64f17c1391 nvk/cmd_buffer: Pass count to set_root_array
Previously, we were passing the end index which was incorrect.
Also, improve the macros so that they can take an expression for
the count.

Fixes: b2d85ca36f ("nvk: Use helper macros for accessing root descriptors")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32086>
2024-11-12 23:26:49 +00:00
Karol Herbst 47a1565c3d nv/codegen: Do not use a zero immediate for tex instructions
They aren't always legal for tex instructions, specifically for TXQ when
an actual source is needed.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11999
Fixes: 85a31fa1fc ("nv50/ir/nir: fix txq emission on MS textures")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32043>
2024-11-08 09:18:54 +00:00
Eric Engestrom 73db4d350a nvk/ci: document flakes seen lately
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32007>
2024-11-06 14:14:38 +00:00
Eric Engestrom 831eab2375 nvk/ci: add flakes seen recently
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31825>
2024-10-24 16:50:44 +00:00
Eric Engestrom 654683143b nvk/ci: add back a crash that was mistakenly removed from the expectations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31825>
2024-10-24 16:50:44 +00:00
Daniel Schürmann 8d1abd4996 treewide: use nir_src_is_divergent() rather than checking the divergence of the SSA
Without LCSSA, divergence between src and def might differ.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30787>
2024-10-24 10:06:17 +00:00
Daniel Schürmann c25c63ebc0 nir/divergence: separately indicate whether loops have divergent continues or breaks
bool nir_loop_is_divergent(nir_loop *)
 replaces the previous loop->divergent indicator.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30787>
2024-10-24 10:06:17 +00:00
Samuel Pitoiset 9fda96db5b ci: uprev vkd3d-proton to 59d6d4b5ed23766e69fe252408a3401d2fd52ce8
It contains few fixes for recent DGC tests.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31796>
2024-10-23 15:47:54 +00:00
Samuel Pitoiset 7cd7631554 ci: uprev vkd3d-proton to 65b81403435576d882d9141ae3eb4a29373fba0e
For EXT DGC implementation.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31754>
2024-10-22 14:12:32 +00:00
Christian Gmeiner 5fa4c1a191 compiler/rust: Copy NirInstrPrinter from NAK
Switch NAK to it.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31706>
2024-10-18 12:43:52 +00:00
Faith Ekstrand d52a9d832e nvk: Put a sample map in the descriptor for MSAA storage images
This tells us exactly where each sample instead of assuming they're laid
out row-major. NIL_SAMPLE_LAYOUT_4X2_D3D is not row-major.

Fixes: 8f1697b12d ("nil: Use D3D sample modes by default")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31727>
2024-10-18 04:56:26 +00:00
Faith Ekstrand 9724028c15 nil: Add a nil_sample_offset() helper
Fixes: 8f1697b12d ("nil: Use D3D sample modes by default")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31727>
2024-10-18 04:56:26 +00:00
Faith Ekstrand 6e30ab8b16 nvk: Fix host copies for array images
Our offset handling was hitting asserts inside of NIL because we're
passing in offsets and extents with non-trivial array dimensions.

Fixes: 6c5420cd30 ("nvk: Add host copy functions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31727>
2024-10-18 04:56:26 +00:00
Faith Ekstrand aee0ce980b nak/bindings: Use an enum for IOCTL numbers
This should be more robust against weird bindgen shenanigans because it
forces LLVM to constant-fold and give us an actual thing we can generate
bindings for.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12008
Fixes: cd7128c2e3 ("nak: Add a bare HW shader runner")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31727>
2024-10-18 04:56:26 +00:00
Faith Ekstrand f49a3e0a68 nvk: Use nvk_queue_submit_simple() for nvk_queue_state_update()
This change has two main advantages.  First is that the previous code
had a subtle bug where state updates would drop the previous state
pushbuf without first guaranteeing that the queue was idle, potentially
leading to a fault.  This worked when I first wrote the code because we
were using the old nouveau UAPI which took a list of BOs on each submit
and the kernel would interanlly reference count them.  With the modern
UAPI, there is no such safety net.

The second effect of this commit is that we're now only submitting the
pushbuf when one of the pointers or ranges actually changes.  This
should hopefully reduce GPU stalling as setting those pointers is a
pretty heavy-weight operation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30596>
2024-10-18 02:58:00 +00:00
Faith Ekstrand 5fa5c5a300 nvk: move nvk_queue_state_update to nvk_queue_submit_exec
The only reason we had it pulled out was because that made more sense
back when we had drm/nouveau baked into our queue code.  With the new
NVKMD interface, there's no point.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30596>
2024-10-18 02:58:00 +00:00
Faith Ekstrand 86a6b894a8 nvk: Only submit the state pushbuf if there are commands
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30596>
2024-10-18 02:58:00 +00:00
Faith Ekstrand 296746d4b9 nvk: Only wait on the upload queue if there are commands
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30596>
2024-10-18 02:58:00 +00:00
Sid Pranjale 21beb7a6bd nvk: implement VK_EXT_depth_clamp_zero_one
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31488>
2024-10-18 00:56:15 +00:00
Thomas H.P. Andersen ade4512803 nvk: handle driconf for zeroing vram
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29892>
2024-10-17 22:19:33 +00:00
Georg Lehmann cba575f4df nir: always emit ddx intrinsics
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31014>
2024-10-17 09:50:19 +00:00
Daniel Almeida 279f38918f nak: memstream: move into common code
Move the memstream code into common code. Other Rust code interfacing
with FILE pointers will find the memstream abstraction useful.

Most notably, pinning is actually enforced this time with PhantomPinned.

Add a .clang-format from a sibling dir (i.e.: compiler/nir) while we're
at it to keep things tidy.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30594>
2024-10-17 02:50:21 +00:00
Eric Engestrom 9f58d0b0e7 nvk/ci: document more flakes seen
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31691>
2024-10-16 20:40:18 +00:00
Valentine Burley a33538cb9f nvk: Remap 10 and 12 bit formats to 16 bit formats
Preserves the previous behavior while handling the new formats.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30821>
2024-10-16 14:30:15 +00:00
M Henning 537ada2308 nak: Phi coalescing via biased register coloring
Reduces code size by -29.08% on shaderdb + nvk-fossils-foss

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31498>
2024-10-15 22:29:11 +00:00
Faith Ekstrand 03a393d6ca nak: Handle annotations in legalization
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31665>
2024-10-15 17:13:27 +00:00
Faith Ekstrand 36d9d11882 nak: Remove annotations before calc_instr_deps()
Otherwise the annotations might throw off latency information which
needs exact instruction counts.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31665>
2024-10-15 17:13:27 +00:00
Marek Olšák 02923e237d nir: add hole_size parameter into the vectorize callback
It will be used to allow merging loads with a hole between them.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29398>
2024-10-15 05:50:24 +00:00
Faith Ekstrand c2684968de nvk: Advertise 64-bit atomics on buffer views
We also add an nvk_format_supports_atomics() helper.  This helper lives
in NVK for now because it's not just about the format and hardware but
also about whether or not we have compiler support in NAK.

Fixes: 1d10de539c ("nvk: Implement VK_EXT_shader_image_atomic_int64")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31633>
2024-10-15 05:21:03 +00:00
Faith Ekstrand d3d8271620 nvk: Re-sort the features table
There were a couple of KHR extensions that got mixed in with the EXTs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31633>
2024-10-15 05:21:03 +00:00
Faith Ekstrand 681f807747 nvk: Only set texture/sampler tables and SLM for enabled engines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31633>
2024-10-15 05:21:02 +00:00
Faith Ekstrand 7ae2cc7f0a nvk: Add an nvkmd_engines bitfield to nvk_queue
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31633>
2024-10-15 05:21:02 +00:00
Faith Ekstrand 2fb4aed9d8 nvk: Advertise VK_KHR_fragment_shading_rate
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31585>
2024-10-10 23:16:57 +00:00
Faith Ekstrand e45effe555 nvk: Set VARIABLE_PIXEL_RATE_SHADING_TABLE_SELECT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31585>
2024-10-10 23:16:57 +00:00
Faith Ekstrand 99107ef8d4 nak: Add support for gl_PrimitiveShadingRateEXT
This aliases gl_ViewportIndex in the NVIDIA attribute space.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31585>
2024-10-10 23:16:57 +00:00
Faith Ekstrand ab8e6bf4c3 nak: Pass a nak_compiler into sysval and attrib helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31585>
2024-10-10 23:16:57 +00:00
Faith Ekstrand 58252622f1 nak: Add support for gl_ShadingRateEXT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31585>
2024-10-10 23:16:57 +00:00
Faith Ekstrand 957a1add26 nak: Rename SV_VERTEX_COUNT to PRIM_TYPE
This is what nvdisasm calls it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31585>
2024-10-10 23:16:57 +00:00
Faith Ekstrand 1e7c3ddc33 nak: Get rid of some dead code warnings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31585>
2024-10-10 23:16:57 +00:00
Faith Ekstrand 75bcb656d9 nvk: Add support for binding fragment shading rate images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31585>
2024-10-10 23:16:57 +00:00
Faith Ekstrand 16bd3f0f50 nvk: Emit FSR state
This is mostly a matter of filling out the
VARIABLE_PIXEL_SHADING_INDEX_TO_RATE tables.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31585>
2024-10-10 23:16:57 +00:00
Faith Ekstrand 55854de584 nvk: Rework setting of min_sample_shading
Instead of just storing a pre-computed min_sample_shading, store both
sample_shading_enable and min_sample_shading and then compute the final
min_sample_shading value when we emit state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31585>
2024-10-10 23:16:57 +00:00