Commit Graph

190709 Commits

Author SHA1 Message Date
Mary Guillemard
f3639f7900 panvk: Move compile logic out of shader_create
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Mary Guillemard
67341a8126 panvk: Link shaders at draw time
This moves the linking step at draw time so we can later support
VK_EXT_shader_module.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Mary Guillemard
a984419a2d panvk: Kill panvk_pipeline_shader and use panvk_shader directly
Copy the shader pointers and linking data attached to the pipeline
at bind time.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Mary Guillemard
05020699b9 panvk: Move the linking bits to panvk_shader
Needed if we support late linking which is required for
VK_EXT_shader_object.

We also stop pretending the linking is generic and reflect the fact we
always link vertex with fragment shaders.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Mary Guillemard
9c39185e20 panvk: Upload render state in panvk_shader
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Mary Guillemard
384ebea7ac panvk: Upload copy tables in panvk_shader
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Mary Guillemard
d54592ec72 panvk: Upload shader in panvk_shader
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Mary Guillemard
b186220566 panvk: Keep panvk_shader alive in panvk_pipeline_shader
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Mary Guillemard
a0f49428fd panvk: Remove dynarray from panvk_shader
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Mary Guillemard
e8633b3b49 panvk: Remove panvk_lower_blend
It is unused, get ride of it.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Boris Brezillon
2eaa437574 panvk: Use memory pools for internal GPU data attached to vulkan objects
Some panvk objects need to allocate GPU memory but don't have Pool
objects to get this memory from. Use device-wide mempools with
.owns_bos=false, such that small allocations don't have to pay the 4k
granularity price of private BO allocations.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Boris Brezillon
906fb2371a panvk: Prepare panvk_mempool for shared device memory pools
If we want to be able to allocate private device memory for small
objects and don't have a Pool to allocate from, we'd rather provide
some sort of device-wide heap to avoid the memory overhead incurred
by page-size BO granularity.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Boris Brezillon
7b017b1c97 panvk: Store private BOs in lists instead of dynarrays
This we don't get memory allocations in scopes where failures are not
supposed to happen, and this will also simplify things when we get to
implement memory pools at the device level.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Boris Brezillon
0e5140f88c panvk: Refcount private BOs
Will be needed if we want device memory pools.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29161>
2024-06-17 07:31:50 +00:00
Samuel Pitoiset
8fcfadf28e radv: store a pointer to the logical device in dgc_cmdbuf
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29725>
2024-06-17 06:45:44 +00:00
Samuel Pitoiset
7fb401c7b2 radv: add a helper to load the pipeline VA for DGC
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29725>
2024-06-17 06:45:44 +00:00
Samuel Pitoiset
57206eb888 radv: remove redundant nir_builder param in some DGC helpers
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29725>
2024-06-17 06:45:44 +00:00
Samuel Pitoiset
7ff6f492d5 radv: add new macros for emiting packets in DGC
This is way cleaner.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29725>
2024-06-17 06:45:44 +00:00
Samuel Pitoiset
85d79376d8 radv: do not use nir_pkt3() when the packet len is constant with DGC
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29725>
2024-06-17 06:45:44 +00:00
Samuel Pitoiset
dd66e43bd9 radv: remove dynamic uniform/storage buffers support with DGC
vkd3d-proton is the only user of NV DGC and it doesn't need that.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29726>
2024-06-17 06:13:57 +00:00
Alyssa Rosenzweig
fda97d6d0a asahi: be more clever about GS side effects
We need a heuristic for handling GS side effects in the least surprising way
possible. Upgrade our previous heuristic to a better one, moving more side
effects into the prepass from the rast shader. This is technically an optimization but mitigates VDM timeouts in absurd Vulkan CTS cases.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29742>
2024-06-16 12:15:22 -04:00
Alyssa Rosenzweig
dcdad4fecb asahi: implement robustness2 for msaa image stores
Same trick as for robustness2 buffer images.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29742>
2024-06-16 12:15:22 -04:00
Alyssa Rosenzweig
9a29d08f9f asahi: fix vbo clamp with stride=0
dEQP-VK.pipeline.monolithic.bind_buffers_2.single.stride_0_4_offset_0_0.count_1

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29742>
2024-06-16 12:15:22 -04:00
Alyssa Rosenzweig
38c36990b6 asahi: implement rba2 semantics for vbo
Different APIs have different robustness requirements for VBOs. Add a knob to
select the desired robustness so we can implement rba2 in honeykrisp.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29742>
2024-06-16 12:15:22 -04:00
Alyssa Rosenzweig
d035976c00 libagx: generalize query copies
for xfb in hk

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29742>
2024-06-16 12:15:22 -04:00
Alyssa Rosenzweig
4a71456a1a libagx: make index buffer fetch robust
for hk

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29742>
2024-06-16 12:15:22 -04:00
Alyssa Rosenzweig
87f9fe3c58 libagx: fix uint8_t definition
yikes!

this was causing cascading fails with hk.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29742>
2024-06-16 10:10:33 -04:00
Alyssa Rosenzweig
88cdcd8f72 agx: fix fmin/fmax with (-0, 0) pair
We need additional lowering to handle negzero properly. fixes float_controls2
fails but strictly the bug was already present!

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29742>
2024-06-16 10:10:33 -04:00
Alyssa Rosenzweig
ab21d179d6 agx: fix 64-bit bcsel ingestion
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29742>
2024-06-16 10:01:46 -04:00
Jianxun Zhang
09277c7ea6 blorp: Fix offset when ambiguating MCS buffer (xe2)
The MCS region to ambiguate needs to shift 4KB from its
starting address. The first 4KB is reserved for hardware.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28919>
2024-06-15 14:57:59 +00:00
Jianxun Zhang
8aa0373a50 blorp: Scaledown rectangle of MSAA fast clear (xe2)
The scaledown rectangle of MSAA fast clear on Xe2 is 8 times
in X and 2 in Y dimension of previous platforms.

Absorb refactoring change suggested by
Nanley Chery <nanley.g.chery@intel.com>

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28919>
2024-06-15 14:57:59 +00:00
Jianxun Zhang
4b64b04963 isl: Add AUX MCS encoding into aux modes (xe2)
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28919>
2024-06-15 14:57:59 +00:00
Jianxun Zhang
765fb3e158 isl: Add a heading 4KB to MCS surface (xe2)
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28919>
2024-06-15 14:57:59 +00:00
Faith Ekstrand
f39520e02c nvk: Dirty cbufs in CmdPushDescriptorSetWithTemplate2KHR
Fixes: 091a945b57 ("nvk: Be much more conservative about rebinding cbufs")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29737>
2024-06-15 06:14:28 +00:00
Faith Ekstrand
81e6c612f1 nvk: Use NVK_VK_GRAPHICS_STAGE_BITS in dirty_cbufs_for_descriprots()
This is a no-op change for now but it'll be a problem when we hook up
task/mesh if we don't consider those to be graphics stages.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29737>
2024-06-15 06:14:28 +00:00
Faith Ekstrand
faaf33556e nouveau: Fix a race in nouveau_ws_bo_destroy()
It's possible if nouveau_ws_bo_destroy() races with
nouveau_ws_bo_from_dma_buf() for the BO to be found in the cache and
referenced between dropping the final reference and actually invoking
GEM_CLOSE.  This would result in us having a closed BO somewhere in our
cache.

Fixes: c370260a8f ("nouveau/winsys: Add dma-buf import support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29737>
2024-06-15 06:14:28 +00:00
Faith Ekstrand
7e3d157bee nak,nir: Drop r2ur_nv in favor of as_uniform
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29737>
2024-06-15 06:14:27 +00:00
Dave Airlie
f7434d7576 nouveau/nvc0: increase overallocation on shader bo to 2K
I've been seeing a bunch of read page faults at the end of the
shader allocation, nvk uses a full page at the end to overallocate
so align with that and see if it goes away.

ahulliet and skeggsb both said 2k was used.

Cc: mesa-stable
Reviewed-by: Arthur Huillet <ahuillet@nvidia.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29722>
2024-06-15 01:12:39 +00:00
Lionel Landwerlin
13dc2a28ce intel/fs: fix lower_simd_width for MOV_INDIRECT
MOV_INDIRECT picks one lane from the src[0] and moves it to all lanes
in the destination. Even if we split the instruction, src[0] should
remain identical.

Noticed this while trying to use this instruction in SIMD32. All
current use cases are limited to SIMD8 shaders (or SIMD16 on Xe2). Or
maybe in SIMD32 but with a uniform src[0]. That's we think we've never
seen the issue so far.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28036>
2024-06-14 22:21:26 +00:00
Mike Blumenkrantz
2bb35bf489 lavapipe: fix mesh+task binding with shader objects
if mesh and task shaders are bound separately, and if they have different
workgroup sizes, the setting of workgroup size will be broken if
set during shader bind

this must be deferred to draw time to pull the correct values

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29733>
2024-06-14 22:07:14 +00:00
Boris Brezillon
7bea6f8612 panvk: Overhaul the Bifrost descriptor set implementation
Turns out the current approach makes implementation of advanced features
like update-after-bind or shader modules quite challenging. Instead of
adding hacks all over the place to support these features, let's use
the Valhall descriptor model.

Each shader now gets its own descriptor tables, which are fed by pilot
shaders copying the descriptors used by the shader from the descriptor
sets currently bound the command buffer.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-developped-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29654>
2024-06-14 20:52:21 +00:00
Mary Guillemard
ad86990056 panvk: Fix shader destruction when vk_shader_module_to_nir fail
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29654>
2024-06-14 20:52:21 +00:00
Boris Brezillon
84e452b456 panvk: Extend Valhall descriptor set implementation to support Bifrost
The Bifrost descriptor model is a dead end for advanced features like
shader modules, pipeline libraries or update-after-bind. Let's prepare
the Valhall implementation so we can re-use it on Bifrost.

The implementation itself was pretty generic already. We just need to
map image descriptors to AttributeBuffer instead Texture descriptors,
and the Buffer object had no equivalent on Bifrost, so we just use a
software-defined panvk_ssbo_addr object containing the SSBO address and
size, and make sure this object is padded to 32-bytes.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29654>
2024-06-14 20:52:21 +00:00
Rebecca Mckeever
1b467b9d5c panvk: Add Valhall Descriptor{Set,Pool} implementations
Valhall descriptor model was loosely based on the Vulkan descriptor
model. Provide a new implementation for the VkDescriptor{Set,Pool}
objects that matches this new model.

Co-developed-by: Mary Guillemard <mary.guillemard@collabora.com>
Co-developed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29654>
2024-06-14 20:52:21 +00:00
Rebecca Mckeever
73518dc169 panvk: Add Valhall DescriptorSetLayout implementation
Valhall descriptor model was loosely based on the Vulkan descriptor
model. Provide a new implementation for the VkDescriptorSetLayout
object that matches this new model.

Co-developed-by: Mary Guillemard <mary.guillemard@collabora.com>
Co-developed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29654>
2024-06-14 20:52:21 +00:00
Boris Brezillon
3796bfbb76 panvk: Prepare things for compiling valhall source files
Valhall (v9/v10) will be added progressively. In order to allow that,
we need to extend the panvk_per_arch() macro for v9/v10 and tweak
meson.build so it does include valhall sources without compiling
common per-arch files.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29654>
2024-06-14 20:52:21 +00:00
Boris Brezillon
6a4e1235ac panvk: Prepare for Valhall buffer views
The only difference here is the fact image attributes are gone, and
texture descriptors are used instead. We rework the code so it uses
panfrost_new_texture() to emit the texture/plane descriptors, which
leaves us with one less thing to worry about.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29654>
2024-06-14 20:52:21 +00:00
Boris Brezillon
970d382117 panvk: Prepare for Valhall image views
There's no image attribute on Valhall, storage images are passed as
texture descriptors.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29654>
2024-06-14 20:52:20 +00:00
Danylo Piliaiev
1aab0fc4f5 tu: Add attachments' UBWC info to renderpass tracepoint
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29707>
2024-06-14 20:18:32 +00:00
Danylo Piliaiev
0aa0c065df util/u_trace: Add support for fixed-length string params in tracepoints
The argument would look like:
 Arg(type='str', var='ubwc', c_format='%s', length_arg='12', copy_func='strncpy')

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29707>
2024-06-14 20:18:32 +00:00