Commit graph

130 commits

Author SHA1 Message Date
Aitor Camacho
97756219c4 kk: Set command buffer state to 0 when reset
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
nvk and hk were setting the state to 0, but we weren't which led to issues
with the state being carried over after resetting.

Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40193>
2026-03-09 13:37:09 +00:00
Georg Lehmann
dfd35d3a3c kk,llvmpipe,nouveau: remove lower_vector_cmp from scalar backends
nir_lower_alu_width already does this.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40197>
2026-03-04 19:50:27 +00:00
Jan Alexander Steffens (heftig)
8720bea4cb kk: Fix debug printf specifier
On i686-pc-linux-gnu, `offset` is larger than a long.

Signed-off-by: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Reviewed-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40106>
2026-02-26 17:37:28 +00:00
Aitor Camacho
710c87bced kk: Increase push constant size to 256 from 128
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40086>
2026-02-25 10:30:41 +00:00
osy
3f75aa3b75 kk: enable VK_KHR_external_{fence,semaphore}_fd
We only support VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT with
FD == -1.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39067>
2026-02-24 14:23:05 +00:00
Aitor Camacho
bdb970fc5a kk: Default to max descriptor size if mutable list is empty
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39858>
2026-02-13 09:46:21 +00:00
Aitor Camacho
fc8ab6787b kk: Fix image access issues
Some images would have both non-write and non-read making them readwrite.

Reviewed-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39858>
2026-02-13 09:46:21 +00:00
Aitor Camacho
4de48d7161 kk: Force fragment output matches render targets'
Metal is quite pedantic when it comes to fragment output and render target
types, so unless they match, it'll fail to compile.

Reviewed-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39858>
2026-02-13 09:46:21 +00:00
Aitor Camacho
220660038e kk: Fix push descriptor set layout when rebinding
Push descriptors would not update the layout after creation.

Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39858>
2026-02-13 09:46:21 +00:00
Aitor Camacho
d775ac85ba kk: Assign type to load_frag_coord
Reviewed-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39858>
2026-02-13 09:46:21 +00:00
Aitor Camacho
05cca7eb36 kk: Fix crash in PositiveShaderImageAccess.UndefImage
Clean sample instructions that have an undef texture as a source

Reviewed-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39858>
2026-02-13 09:46:21 +00:00
Aitor Camacho
67ed957261 kk: Remove helper invocation flag in read system values
Metal exposes helper invocation via function call and does not have a
value for this.

Reviewed-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39802>
2026-02-12 20:00:20 +00:00
Aitor Camacho
cc6c200719 kk: Expose sampleRateShading
Reviewed-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39699>
2026-02-09 13:35:01 +00:00
Aitor Camacho
f0b038cb7f kk: Expose VK_EXT_image_2d_view_of_3d
Add missing flag for the 2d_view_of_3d, no further changes needed.

Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39702>
2026-02-09 13:16:39 +00:00
Aitor Camacho
65bb2cd51e kk: Expose largePoints
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39702>
2026-02-09 13:16:39 +00:00
Aitor Camacho
575dd21e11 kk: Expose depthBiasClamp
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39702>
2026-02-09 13:16:39 +00:00
Aitor Camacho
e11fd9a178 kk: Expose VK_EXT_texel_buffer_alignment
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39702>
2026-02-09 13:16:38 +00:00
Aitor Camacho
93d8c652da kk: Expose VK_EXT_extended_dynamic_state2
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39702>
2026-02-09 13:16:37 +00:00
Aitor Camacho
d0291969ff kk: Expose pushDescriptor from 1.4
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39702>
2026-02-09 13:16:36 +00:00
Georg Lehmann
36417f016e kk/compiler: remove unpack_half support
Acked-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39511>
2026-02-06 06:12:36 +00:00
Aitor Camacho
29900e8229 kk: Fix disabling workaround 4
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes: 67d05f71e9 ("kk: Track fragment helper status since Metal does not correctly demote them")

Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39589>
2026-02-04 19:10:32 +00:00
Aitor Camacho
8a4a369795 kk: Move nir_opt_shrink_stores after nir_opt_remove_phis for correct shrink
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39522>
2026-01-28 15:12:39 +00:00
Aitor Camacho
a8fac76ea6 kk: Enable vertexPipelineStoresAndAtomics
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38880>
2026-01-28 10:30:26 +00:00
Aitor Camacho
f08a542756 kk: Remove primitive type from pipeline and rely on dynamic one
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39543>
2026-01-27 10:52:09 +00:00
Mel Henning
9cb4703c94 kk: Use pipeline_layout.dynamic_descriptor_offset
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39411>
2026-01-22 17:04:19 +00:00
Mel Henning
c6e725de05 kk: Use layout->vk.dynamic_descriptor_count
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39411>
2026-01-22 17:04:19 +00:00
Aitor Camacho
cdbf7242f3 kk: Fix graphics pipeline serialization
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Bundles all graphics pipeline creation information required by Metal into
the vertex shader so we can later rebuild the pipeline. This allows us to
correctly create pipelines from caches that were loaded from files.

Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39454>
2026-01-22 15:50:31 +00:00
Aitor Camacho
99d8246d1c kk: Move gfx pipeline data to the info struct within kk_shader
Makes it easier to serialize and add data specific to the gfx pipeline.

Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39454>
2026-01-22 15:50:31 +00:00
Aitor Camacho
75f6f46c0f kk: Fix compute pipeline cache
When deserializing the compute shader from a blob, we need to recreate the
pipeline because the blob may have been loaded from file and therefore the
reference to the Metal resource will be invalid.

Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39454>
2026-01-22 15:50:30 +00:00
Aitor Camacho
622ebba476 kk: Correctly release pipeline handles at shader destroy
The condition to release Metal pipelines incorrectly checks which shader
stage we are destroying leading to leads when graphics pipelines had to
be released.

Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39454>
2026-01-22 15:50:30 +00:00
Aitor Camacho
15c0dd39fc kk: Fix shader uint32_t value serialization
We need to write with blob_write_uint32 if we are using blob_read_uint32

Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39454>
2026-01-22 15:50:29 +00:00
Aitor Camacho
b350f059f5 kk: Fill pipelineUUID
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39454>
2026-01-22 15:50:29 +00:00
Aitor Camacho
669a4dd56b kk: Use nir_opt_shrink_stores
Reviewed-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39301>
2026-01-22 15:32:43 +00:00
Aitor Camacho
4f7bdb1dde kk: Force frag output component count to match render targets'
Reviewed-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39301>
2026-01-22 15:32:43 +00:00
Aitor Camacho
8147ea59fe kk: Bundle nir_to_msl options into a struct for easier option addition
Reviewed-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39301>
2026-01-22 15:32:43 +00:00
Aitor Camacho
1b1e38ffd5 kk: Update kk_bind_descriptor_sets comment to reflect updated binding
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39203>
2026-01-21 18:16:05 +00:00
Faith Ekstrand
68d22b5a2a nir/lower_blend: Move the format to nir_lower_blend_rt
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39367>
2026-01-19 21:33:14 +00:00
Aitor Camacho
a0aa212561 kk: Disable KHR_shader_maximal_reconvergence since subgroups are broken
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixing subgroups will be a considerable time sink, so for now just disable
this optional feature until we have time to investigate and fix everything.

Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39337>
2026-01-16 02:06:39 +00:00
Aitor Camacho
b86e1b55dd kk: Fix texturequerylod
Reviewed-By: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39337>
2026-01-16 02:06:39 +00:00
Aitor Camacho
4543fd1789 kk: 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.

Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39337>
2026-01-16 02:06:39 +00:00
Aitor Camacho
5d0c5b6a45 kk: Remove unneeded member in kk_descriptor_set_binding_layout
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39337>
2026-01-16 02:06:39 +00:00
Aitor Camacho
4affda5a6a kk: Fix reported maxInlineUniformBlockSize to match spec expectations
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39337>
2026-01-16 02:06:39 +00:00
Aitor Camacho
288a0f05d3 kk: Expose extendedDynamicState required by VK_EXT_extended_dynamic_state
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39337>
2026-01-16 02:06:38 +00:00
Aitor Camacho
1025715c6a kk: Fix compilation error when viewMask is 0
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-By: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39321>
2026-01-15 04:54:45 +00:00
Aitor Camacho
cf14870ada kk: Fix maxTexelBufferElements value
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39200>
2026-01-07 20:06:20 +00:00
Aitor Camacho
d49bf717a4 kk: Add environment variable to force robustness on all shaders
Add 'force_robustness' to 'MESA_DEBUG_KK' to force robustness in all
shaders.

Reviewed-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38881>
2026-01-07 19:51:44 +00:00
Emma Anholt
059d301c79 nir: Drop the mode argument of nir_lower_vars_to_scratch().
It only makes sense for function temps, and that's the only way it's been
used.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37245>
2025-12-17 19:50:28 +00:00
Aitor Camacho
57c93d31f2 kk: Expose occlusionQueryPrecise
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Acked-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38957>
2025-12-16 19:05:16 +00:00
Aitor Camacho
317a249205 kk: Attachmentless render passes start postponed to pipeline bind
Sample count is only known at pipeline bind not when the render pass is
started since there is no attachments to infer sample count.

Acked-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38957>
2025-12-16 19:05:16 +00:00
Aitor Camacho
279679ce0c kk: Remove render pass logic in event set/reset entrypoints
vkCmdSetEvent2 and vkCmdResetEvent2 can only be called from outside a
render pass so there is no need to handle anything about them.

Acked-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
Signed-off-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38957>
2025-12-16 19:05:16 +00:00