Commit graph

198610 commits

Author SHA1 Message Date
Marek Olšák
978ad93375 nir/algebraic: optimize (a & b) & (a & c) ==> (a & b) & c
shader-db with ACO:
    3 shaders have -0.57% average decrease in the code size

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32449>
2024-12-03 01:24:27 +00:00
Marek Olšák
83b093f95e nir/algebraic: use is_used_once in a few iand/ior patterns
shader-db with ACO:
    1 shader has -4 decrease in the code size

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32449>
2024-12-03 01:24:27 +00:00
Antonino Maniscalco
2b9738ce6d nir,zink,asahi: support passing through gl_PrimitiveID
When this pass is used with Zink, gl_PrimitiveID needs to be passed
through, however this is unnecessary for other divers.

Analogous to previous commit

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Fixes: d0342e28b3 ("nir: Add helper to create passthrough GS shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32397>
2024-12-03 00:24:04 +00:00
Alyssa Rosenzweig
23601d6632 zink: fix gl_PrimitiveID reads with quads
Zink emulates quads with a GS, which imposes requirements for gl_PrimitiveID.
Handle them here. Previously Zink went out of spec.

Fixes spec@glsl-1.50@execution@primitive-id-no-gs-quads and
spec@glsl-1.50@execution@primitive-id-no-gs-quad-strip.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Antonino Maniscalco <antomani103@gmail.com>
Fixes: e2220ee55e ("zink: filled quad emulation gs generation function")
Closes: #12214
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32397>
2024-12-03 00:24:04 +00:00
Dylan Baker
845f5eca27 maintainer-scripts: Bump Vulkan release version to 1.4
Since support is landed or landing for several drivers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32442>
2024-12-03 00:20:05 +00:00
Faith Ekstrand
69bce622e9 nvk: Move Vulkan 1.4 properties to the 1.4 section
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32443>
2024-12-02 23:20:07 +00:00
Faith Ekstrand
cf4e10e466 nvk: Move Vulkan 1.4 features to the 1.4 section
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32443>
2024-12-02 23:20:07 +00:00
Faith Ekstrand
01046afae5 nvk: Only support Vulkan 1.4 on Turing+
It needs hostImageCopy which we don't have working pre-Turing yet.

Fixes: 173171f73e ("nvk: Advertise Vulkan 1.4")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32443>
2024-12-02 23:20:07 +00:00
Jesse Natalie
128caf94ca microsoft/compiler: Put holes in driver_location based on I/O variable sizes
DXIL requires that each I/O variable has a unique semantic name, but when
dealing with semantics that take up multiple slots, that variable implicitly
takes up multiple names. So when assigning driver_location, we need to do
the same.

That means also updating outputs and patch constants to have a mapping from
driver_location to a compacted index, since the metadata arrays *can't* have
holes.

This would be simpler if we could hang it off the nir_variable but there's
not really any free fields to be able to do that. We only need this compacted
mapping inside the DXIL backend anyway so we can just store the array in the
module.

Tested-by: Benjamin Otte <otte@gnome.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12128
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32047>
2024-12-02 22:40:39 +00:00
Dylan Baker
5a6531b5d6 anv: bump conformance version to 1.4
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32441>
2024-12-02 21:56:40 +00:00
Dylan Baker
212565f42e anv: Add new Vulkan 1.4 features and properties
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32441>
2024-12-02 21:56:39 +00:00
Dylan Baker
953d8a61f8 anv: bump max number of push constants to 256
As is required by Vulkan 1.4

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32441>
2024-12-02 21:56:39 +00:00
Dylan Baker
8105f80244 anv: advertise Vulkan 1.4
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32441>
2024-12-02 21:56:39 +00:00
Connor Abbott
0c55770b3e tu: Expose Vulkan 1.4 on a7xx
Vulkan 1.4 can only be exposed on a7xx devices due to a number of bumps
in the required limits, including bumping maxDescriptorSets to 7. a7xx
bumped the number of bindless bases from 5 to 8, with one reserved for
the driver.

I've followed what we've already done and exposed a conformanceVersion
of 1.4.0.0 for all a7xx devices, even though I've only submitted
conformance for X1-85. I'm not sure if we want to change this, but at
least for now a618 on Chromebooks and X1-85 on laptops are the only
cases where turnip is being "shipped" to users in some official
capacity, so it shouldn't be a huge deal.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32437>
2024-12-02 21:22:44 +00:00
Connor Abbott
21838dcbb6 tu: Add Vulkan 1.4 features and properties
Only add features and properties new to Vulkan 1.4.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32437>
2024-12-02 21:22:44 +00:00
Caterina Shablia
2cac1389e5 panvk: enable shaderInt8, VK_KHR_8bit_storage and VK_KHR_shader_float16_int8
We already could handle int8 load/stores and arithmetic.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32361>
2024-12-02 20:58:23 +00:00
Caterina Shablia
d9ce6b266f panvk: implement vkGetDeviceImageMemoryRequirements
Vulkan runtime doesn't layer vkGetImageMemoryRequirements2
on top of vkGetDeviceImageMemoryRequirements, as that would
require initializing a full image, which is expensive on
certain drivers such as NVK, so it's up to us to implement
both functions.

In our implementation of vkGetDeviceImageMemoryRequirements,
we initialize a slimmed down image and then forward everything
to vkGetImageMemoryRequirements2.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32361>
2024-12-02 20:58:23 +00:00
Caterina Shablia
110f5edf7a panvk: add panvk_image_init helper
This factors out the initialization of panvk_image, so we can reuse the
logic for computing requirements without crating an actual VkImage
object first.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32361>
2024-12-02 20:58:23 +00:00
Constantine Shablia
dbdaefb6ed panvk: never require dedicated allocation for images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32361>
2024-12-02 20:58:23 +00:00
Constantine Shablia
ed64fa034b panvk: never prefer or require dedicated allocation for buffers
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32361>
2024-12-02 20:58:23 +00:00
Constantine Shablia
ef120460e7 panvk: replace vkGetBufferMemoryRequirements2 with vkGetDeviceBufferMemoryRequirements
Mesa's Vulkan runtime will implement the former in terms of the
latter for us.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32361>
2024-12-02 20:58:22 +00:00
Rebecca Mckeever
07b8ce4351 panvk: Support D32_S8 as a multiplanar format
This format was already supported on Bifrost as a single
plane format. Valhall doesn't support this interleaved D32_S8,
so we add support for multiplanar D32_S8 and move Bifrost to
this layout too, as it's more memory efficient than the
interleaved layout.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32275>
2024-12-02 20:18:43 +00:00
Boris Brezillon
cc2cb69e2e pan/texture: Pass pan_image_section_info around
Pass pan_image_section_info around instead of passing each field
of the struct separately.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32275>
2024-12-02 20:18:43 +00:00
Boris Brezillon
0dfb28cebc pan/texture: Stop passing a layout to panfrost_emit_plane()
The layout can be extracted from the iview and plane_index arguments.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32275>
2024-12-02 20:18:43 +00:00
Boris Brezillon
d731abb17a pan/texture: s/index/plane_index/ in panfrost_emit_plane()
Index is vague as it could refer to the array index too. Let's clarify
the situation by renaming the argument plane_index.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32275>
2024-12-02 20:18:43 +00:00
Boris Brezillon
3cf2658a9a pan/texture: Stop passing the view format around
The format is never adjusted, and can thus be extracted from the view.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32275>
2024-12-02 20:18:43 +00:00
Boris Brezillon
726dec5abd pan/texture: Move the plane info retrieval logic to a helper function
This allows us to properly split the multiplanar and single plane cases
in panfrost_emit_surface(), which makes the code easier to follow.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32275>
2024-12-02 20:18:43 +00:00
Rebecca Mckeever
a8ed53881e pan/desc: Add a pan_image_view_get_s_plane() helper and use it
The depth and stencil planes might be different. Let's add a specific
helper to retrieve the stencil plane. We keep using
pan_image_view_get_zs_plane() for the depth plane, because it's
guaranteed to always be on the first plane.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32275>
2024-12-02 20:18:43 +00:00
Rebecca Mckeever
c9b4030f33 pan/desc: Pass an image to pan_force_clean_write_rt()
Pass an image to pan_force_clean_write_rt() so we can easily
support the multiplanar depth-stencil case, and rename the
function pan_force_clean_write_on() to avoid the confusion.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32275>
2024-12-02 20:18:43 +00:00
Rebecca Mckeever
878a7d6de0 pan/texture: Accept holes in the pan_image_view::planes array
We are about to add multiplanar depth/stencil support. A stencil
only view of a multiplanar d32_s8 format will have NULL depth plane
(plane0), so we need to prepare the texture logic to deal with that.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32275>
2024-12-02 20:18:43 +00:00
Rebecca Mckeever
5df95a97f1 pan/texture: s/pan_image_view_get_rt_image/pan_image_view_get_color_plane/
Pick a name that's consistent with pan_image_view_get_plane().

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32275>
2024-12-02 20:18:43 +00:00
Rebecca Mckeever
c0140148f1 pan/texture: s/pan_image_view_get_zs_image/pan_image_view_get_zs_plane/
Pick a name that's consistent with pan_image_view_get_plane().

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32275>
2024-12-02 20:18:43 +00:00
Eric R. Smith
a0dd108b8a panfrost: convert resources before binding them to images
pan_resource_modifier_convert can use a blit to convert images
from AFBC. If we call this from panfrost_set_shader_images then
we end up crashing due to using an inconsistent set of images.
Fix this by doing the AFBC/AFRC conversion before the image
bindings.

This fixes a crash in piglit oes_egl_image_external_essl3 tests.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30243>
2024-12-02 19:49:58 +00:00
Eric R. Smith
fc3cfaa4aa panfrost: add a perf warning when resources need to be converted
This is a minor debugging aid.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30243>
2024-12-02 19:49:58 +00:00
Alyssa Rosenzweig
56acdca86d hk: claim 1.4
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:47 +00:00
Alyssa Rosenzweig
3f5086016b hk: implement timestamps
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:47 +00:00
Alyssa Rosenzweig
55cd987de2 asahi: fix agxdecode memory mapping
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:47 +00:00
Asahi Lina
fbb38a30a6 asahi: Add timestamp buffer ops
TODO: virt support (needs virglrenderer changes & virt ABI break)

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00
Asahi Lina
6697fb26ed asahi: UAPI update to add support for user timestamp buffers
Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00
Alyssa Rosenzweig
751bd986fb asahi: add =bodump debug help
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00
Alyssa Rosenzweig
8caddd2ca1 asahi: fix agx_batch_add_bo
when we have exactly POT BOs. fixes crash in portal 2. oh lord.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00
Alyssa Rosenzweig
f34cd9e966 asahi: add more asserts around bo add
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00
Alyssa Rosenzweig
f98971e776 asahi,hk: mmap BO on first use
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00
Alyssa Rosenzweig
e7b3dcb9f7 asahi: label individual pools
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00
Alyssa Rosenzweig
09c8520293 asahi: fix u_blitter related leaks
see also 689f38b2b4 ("panfrost: fix refcnt imbalance related to blitter")

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00
Alyssa Rosenzweig
d49f0786c8 asahi: fix page size alignment
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00
Alyssa Rosenzweig
59b0dd7c64 asahi: drop dead
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00
Asahi Lina
07e836b932 asahi: Fix agx_gpu_time_to_ns & implement DRM_ASAHI_GET_TIME
agx_gpu_time_to_ns() was broken since it was overflowing the u64
timestamp after just ~10 minutes. Fix that by automatically computing a
reduced conversion fraction, and add support for DRM_ASAHI_GET_TIME
where supported (replacing the CPU timer hack).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00
Asahi Lina
925eca02c4 asahi: UAPI update to add GET_TIME & cleanup
Also fix editor config for this file & disable clang-format, to make
syncing with the kernel easier.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00
Alyssa Rosenzweig
d894941895 hk,asahi,libagx: unify a bit of code
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
2024-12-02 19:26:46 +00:00