Commit graph

3844 commits

Author SHA1 Message Date
Máté Pinczel
e6ea2bef6b nak: implement uror and urol using shf
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39409>
2026-01-29 20:57:08 +00:00
Mel Henning
99bc2d9775 nvk: Merge tese/tesc state in the MME
Recent versions of vulkan have relaxed the requirements for the way
applications specify tess parameters with shader objects. Track the
state separately for tess eval and tess control so we can merge the
states in the MME.

See either:
 * 60a4ad187c
 * https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/7694

Fixes dEQP-VK.shader_object.tessellation.hlsl.* on VK CTS 1.4.5

Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39571>
2026-01-28 18:17:39 +00:00
Mel Henning
ad6a5a88d1 nak: Handle unspecified tess spacing
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39571>
2026-01-28 18:17:39 +00:00
Mel Henning
f9831e356b nak: Split out TesselationCommonShaderInfo
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39571>
2026-01-28 18:17:39 +00:00
Mel Henning
6ad2b84cba nvk: Use some additional drf macros
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39571>
2026-01-28 18:17:39 +00:00
Mel Henning
d75de33158 nvk: Move tess flags between other fields
This keeps the whole state in the lower 8 bits.

Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39571>
2026-01-28 18:17:39 +00:00
Mel Henning
3723855646 nvk: Remove prims from tess state
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39571>
2026-01-28 18:17:39 +00:00
Mel Henning
cfa81a7460 nvk: Compute tess prims in the MME macro
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39571>
2026-01-28 18:17:39 +00:00
Mel Henning
96d9a2b421 nvk: Add CCW, POINT_MODE flags for set_tess_params
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39571>
2026-01-28 18:17:38 +00:00
Mel Henning
384cc81464 nvk: Use macros for nvk_mme_set_tess_params tests
By rewriting all of the manual integers with macros we make this a
little easier to read and refactor.

Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39571>
2026-01-28 18:17:38 +00:00
Mel Henning
0826d58109 nvk: Add a NVK_MME_VAL_MASK macro
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39571>
2026-01-28 18:17:38 +00:00
Faith Ekstrand
797198e7a6 nak: Use .xx swizzles for f2f.32.16
This is a no-op from a codegen PoV since both SrcSwizzle::Xx and
SrcSwizzle::None will result in .high not being set.  However, it allows
other parts of the compiler to more easily reason about the fact that it
only reads the bottom 16 bits.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39572>
2026-01-28 17:15:33 +00:00
Faith Ekstrand
15d6637282 nak: Make OpF2F take a F16v2 source
Instead of depending on a global "high" bit that affects both source and
destination, this models f2f.32.16 as an F16v2 op which ignores one of
the two components.  This makes encoding the op a tiny bit more complex
(though that's easy enough to shove in a helper) in exchange for letting
copy-prop propagate OpPrmt and swizzles into it.

Shader-db stats:

    Totals:
    CodeSize: 24304240 -> 24298928 (-0.02%)
    Static cycle count: 274812403 -> 274809320 (-0.00%)

    Totals from 39 (0.57% of 6891) affected shaders:
    CodeSize: 266672 -> 261360 (-1.99%)
    Static cycle count: 138321 -> 135238 (-2.23%)

    PERCENTAGE DELTAS                            Shaders  CodeSize Static cycle count
    google-meet-clvk/BgBlur                      49        -0.49%        -0.44%
    google-meet-clvk/Relight                     81        -0.55%        -0.18%
    q2rtx/q2rtx-rt-pipeline                      42        -0.31%        -0.10%

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39572>
2026-01-28 17:15:33 +00:00
Mel Henning
f3c53cf66b nvk: Disable large pages for now
Reviewed-by: Mary Guillemard <mary@mary.zone>
Fixes: cabfdb4404 ("nvk: Enable compression")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39364>
2026-01-27 17:58:40 +00:00
Hans-Kristian Arntzen
9ec097c837 nvk: Enable EXT_present_timing.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38770>
2026-01-27 11:09:51 +00:00
Mel Henning
e32bfc5efe nvk: Ignore meta ops in occlusion queries
Fixes: 052bbd65c9 ("nvk: Implement pipeline statistics and occlusion queries")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39510>
2026-01-26 18:41:54 +00:00
Faith Ekstrand
c081ab864f nvk: Enable ZPASS_PIXEL_COUNT in draw_state_init()
Fixes: 052bbd65c9 ("nvk: Implement pipeline statistics and occlusion queries")
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39510>
2026-01-26 18:41:54 +00:00
Mary Guillemard
457149a48e nvk/nvkmd: Do not limit exec_push count in nvkmd_nouveau_exec_ctx
Previously, we were allowing up to 1024 entries to be accumulated and
pushed. Nouveau kernel side always report 510 entries but we are going
to increase this at some point.

This makes it so that we now dynamically allocate
nvkmd_nouveau_exec_ctx::req_push.

Signed-off-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39239>
2026-01-22 20:35:03 +00:00
Mel Henning
c8e47ab40c nvk: Use pipeline_layout.dynamic_descriptor_offset
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Tested-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39411>
2026-01-22 17:04:18 +00:00
Mel Henning
25acd26a0f nvk: Use layout->vk.dynamic_descriptor_count
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Tested-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39411>
2026-01-22 17:04:18 +00:00
Aitor Camacho
80a076f5d0 nvk: Handle unbound sets that contain dynamic buffers
The offset for the dynamic buffers needs to be computed with the currently
bound pipeline layout. This change fixes incorrectly selecting the offset
for a dynamic buffer if a descriptor with a lower index than the currently
being bound contains a dynamic buffer but said descriptor hasn't being
bound yet. It also prevents the binding to override the dynamic buffers in
order to preserve the already bound dynamic descriptors.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39203>
2026-01-21 18:16:05 +00:00
Piotr Masłowski
9ae075f38f nvk: promote VK_EXT_robustness2 to VK_KHR_robustness2
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39340>
2026-01-16 22:39:11 +00:00
Mel Henning
78c8b8f131 nak/instr_sched_prepass: Fix RegOut special case
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This fixes the register count accounting to match the equivalent
special case in liveness.rs

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14614
Fixes: b55b8da012 ("nak: Add a prepass instruction scheduler")
Acked-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39220>
2026-01-09 23:31:45 +00:00
Mel Henning
9ff8ee49f4 nak: Copy-prop bindless cbuf handles
Totals:
CodeSize: 4503463376 -> 4502059168 (-0.03%); split: -0.03%, +0.00%
Number of GPRs: 11377380 -> 11377668 (+0.00%); split: -0.00%, +0.00%
Static cycle count: 2871017064 -> 2870884663 (-0.00%); split: -0.01%, +0.00%
Spills to reg: 210798 -> 210728 (-0.03%)
Fills from reg: 200514 -> 200489 (-0.01%)
Max warps/SM: 7361864 -> 7361904 (+0.00%)

Totals from 28087 (14.27% of 196789) affected shaders:
CodeSize: 870417856 -> 869013648 (-0.16%); split: -0.17%, +0.01%
Number of GPRs: 2273399 -> 2273687 (+0.01%); split: -0.00%, +0.02%
Static cycle count: 780733864 -> 780601463 (-0.02%); split: -0.04%, +0.02%
Spills to reg: 135380 -> 135310 (-0.05%)
Fills from reg: 131832 -> 131807 (-0.02%)
Max warps/SM: 891108 -> 891148 (+0.00%)

Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Lorenzo Rossi <git@rossilorenzo.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39122>
2026-01-09 23:08:29 +00:00
Mel Henning
e92ab5db56 nak/copy_prop: Split out prop_to_ssa_values helper
Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Lorenzo Rossi <git@rossilorenzo.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39122>
2026-01-09 23:08:29 +00:00
Mel Henning
6fc211335a nouveau/drm-shim: Implement new getparam values
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39217>
2026-01-09 16:41:23 +00:00
Georg Lehmann
a706769a0b nir: move exact bit to nir_fp_math_control
Unifies nir per instruction float control.

In the future this can be split into contract/reassoc/transform
like SPIR-V.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (except SPIR-V)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39103>
2026-01-07 09:40:57 +00:00
Marek Olšák
0b7ee3b981 ALL: use #define and a copy helper to check and copy build_id
preparation for changing SHA1_DIGEST_LENGTH to BLAKE3_KEY_LEN

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39110>
2026-01-07 08:32:33 +00:00
Marek Olšák
1912a00a91 ALL: use SHA1_DIGEST_LENGTH etc. instead of hardcoding the numbers
only build_id is switched to use literal 20 instead of SHA1_DIGEST_LENGTH
because we will increase SHA1_DIGEST_LENGTH to BLAKE3_KEY_LEN

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39110>
2026-01-07 08:32:33 +00:00
Frank Binns
b273a5c10c nvk: remove duplicate header include
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37686>
2026-01-06 11:24:29 +00:00
Faith Ekstrand
41d8e1ecde nvk: Add support for 64-bit vertex attributes
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Acked-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39135>
2026-01-05 20:11:56 +00:00
Faith Ekstrand
5ed98c8267 nak: Use nir_lower_io_lower_64bit_to_32
This is the one that has Vulkan semantics.  We could probably make
nir_lower_io_lower_64bit_to_32_new work but it assumes the weird GL
semantics which don't map to what Vulkan does.  Using it with a Vulkan
driver would require remapping all the attribute indices.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Acked-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39135>
2026-01-05 20:11:56 +00:00
Faith Ekstrand
230fb83d61 nil: Claim buffer support for R64_[US]INT
They're implemented as RG32 so it's fine to claim storage texel buffer
support.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Acked-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39135>
2026-01-05 20:11:56 +00:00
Faith Ekstrand
26c50cb7ff nvk: Check before claiming UNIFORM_TEXEL_BUFFER_BIT
This is a no-op right now because NIL never claims buffer support on
anything that can't support texturing.  That will change in the next
commit.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Acked-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39135>
2026-01-05 20:11:56 +00:00
Georg Lehmann
f3290219ab nir: use a seperate enum for per alu floating point math control
We don't need one bit per bitsize per instruction if only one actually
matters in the end.

First step towards moving NIR in the direction of full float_controls2
only.

Also rename this from fp_fast_math, because that name implied that 0 is
the no fast math mode, while the opposite was the case.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39026>
2025-12-29 10:57:05 +00:00
Lorenzo Rossi
eced9c8bb7 nak/sm120: Fix panic for CS2R during prepass
Currently the sm120 instruction latency code expects registers to be out
of SSA. This prerequisite is broken with the prepass scheduler.
This commit removes non-SSA-specific code.

Fixes: b55b8da012 ("nak: Add a prepass instruction scheduler")
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Signed-off-by: Lorenzo Rossi <git@rossilorenzo.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39072>
2025-12-23 18:50:30 +00:00
Mel Henning
93d0e062a1 nak: Use .file() helper in sm120_instr_latencies
This helper was introduced in b4bac84d3b ("nak: Add a Dst::file()
helper function") which missed updating the sm120 file.

Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39074>
2025-12-23 17:48:08 +00:00
Mel Henning
5f2caf6d63 nak: Take &ShaderModelInfo in instr_sched_common
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39074>
2025-12-23 17:48:08 +00:00
Eric Engestrom
3584bac0b2 nil: cleanup derelict allow(dead_code) annotations
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:14:46 +01:00
Eric Engestrom
6b9524f864 nak: cleanup derelict allow(dead_code) annotations
As well as one `allow(non_camel_case_types)`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:14:46 +01:00
Eric Engestrom
eef174b56b nak: use std::mem::size_of_val(data) instead of open-coding it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:20 +01:00
Eric Engestrom
de7d3cdbda nak: drop "unneeded return statement"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
41ce1939f9 nak: replace .find(x).is_some() with .contains(x)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
c52fa1ac14 nak: merge identical if branches for blackwell, ampere and ada
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
9cfb4b1fdb nak: replace .get(0) with .first()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
124fe82762 nak: drop "deref on an immutable reference"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
4fbda98cf4 nak: drop "reference which is immediately dereferenced by the compiler"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
daeed4a946 nak: allow LdCacheOp values to be named Cache*
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
9454006956 nak: drop cast of u8 to u8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00
Eric Engestrom
ddc26666da nak: drop clone of Copy-able types (RegOrigin & SSAValue)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00