Rhys Perry [Thu, 4 Aug 2022 17:08:38 +0000 (18:08 +0100)]
radv: enable 64-bit vertex formats
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6956
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17894>
Rhys Perry [Tue, 2 Aug 2022 14:10:50 +0000 (15:10 +0100)]
radv,aco: implement 64-bit vertex inputs
Note that, from 22.4.1. Vertex Input Extraction of Vulkan spec:
The input variable in the shader must be declared as a 64-bit data type if
and only if format is a 64-bit data type.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17894>
Rhys Perry [Tue, 2 Aug 2022 13:40:46 +0000 (14:40 +0100)]
radv: enable R8G8B8, B8G8R8 and R16G16B16 vertex formats
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6956
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17894>
Rhys Perry [Wed, 3 Aug 2022 14:56:24 +0000 (15:56 +0100)]
radv: remove radv_translate_vertex_format
This is not used anymore.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17894>
Rhys Perry [Wed, 3 Aug 2022 13:38:16 +0000 (14:38 +0100)]
radv,aco: use pipe_format for dynamic vertex input state
Also prepare for 64-bit and R8G8B8/R16G16B16 with the addition of
radv_vs_input_state::nontrivial_formats.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5021
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17894>
Rhys Perry [Fri, 29 Jul 2022 19:14:59 +0000 (20:14 +0100)]
radv,aco: use pipe_format for static vertex input state
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17894>
Rhys Perry [Wed, 3 Aug 2022 17:03:28 +0000 (18:03 +0100)]
radv: add radv_is_vertex_buffer_format_supported
We will want to support formats which cannot used for texel buffers.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17894>
Rhys Perry [Fri, 29 Jul 2022 18:34:47 +0000 (19:34 +0100)]
ac: add ac_vtx_format_info
This will be used by RADV and ACO.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17894>
Rhys Perry [Thu, 4 Aug 2022 14:07:09 +0000 (15:07 +0100)]
util/format,vulkan/format: update p_format for Vulkan vertex buffers
We need to move some earlier (so they are <= 255 like the comment says)
and add a few 64-bit ones.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17894>
Rhys Perry [Wed, 8 Sep 2021 14:24:10 +0000 (15:24 +0100)]
nir: use a GC context for instructions
Gives an roughly -15% change in compile-time for RADV/ACO.
Memory usage increase seems to be 5-6%.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5034
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12910>
Rhys Perry [Wed, 8 Sep 2021 15:41:00 +0000 (16:41 +0100)]
nir: adjust nir_src_copy signature to take a nir_instr *
This is almost always a nir_instr and updating the src of a nir_if will
have to work slightly differently in the future.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12910>
Rhys Perry [Wed, 8 Sep 2021 10:37:07 +0000 (11:37 +0100)]
Revert "nir: Drop the unused instr arg for src/dest copy functions."
This reverts commit
c3a01841184ee8303c0c5ebe58491301622c5ad6.
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12910>
Rhys Perry [Wed, 8 Sep 2021 14:28:53 +0000 (15:28 +0100)]
nir/serialize: remove unused parameter from read_src()
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12910>
Rhys Perry [Wed, 8 Sep 2021 14:21:57 +0000 (15:21 +0100)]
util: add freelist allocator with mark/sweep
Based on the allocator https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/524,
but modified a bit (in particular, it's now separate from ralloc).
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12910>
Rhys Perry [Wed, 8 Sep 2021 15:13:01 +0000 (16:13 +0100)]
util/ralloc: add HEADER_ALIGN macro
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12910>
Connor Abbott [Tue, 19 Mar 2019 13:16:41 +0000 (14:16 +0100)]
nir: Free instructions more often
Soon we'll be allocating instructions out of a per-shader pool, which
means that if we don't free too many instructions during the main
optimization loop, the final nir_sweep() call will create holes which
can't be filled. By freeing instructions more aggressively, we can
allocate more instructions from the freelist which will reduce the final
memory usage.
Modified from Connor Abbott's original patch to rebase on top of
refactored DCE and so that the use-after-free in nir_algebraic_impl() is
fixed.
Co-authored-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12910>
Jonathan [Wed, 13 Jul 2022 19:11:33 +0000 (21:11 +0200)]
gallium/u_threaded: buffer sharedness tracking
This fixes TC's buffer invalidation code for buffers that are shared
between contexts.
TC is unable to notify other TCs in case it replaces a shared buffer's
underlying storage when invalidating, causing those other TCs to use
wrong buffer IDs for busyness tracking, which leads to corruption due
to invalidation fast-paths being triggered when they shouldn't be.
This patch addresses this issue by tracking if a buffer is shared, and
if it is, disabling buffer storage replacement for the affected buffer.
This is achieved by tracking which TC instance first accessed a certain
buffer. If a second instance then accesses it as well, it will realize
that it isn't the only one working on the buffer and mark the buffer
accordingly.
If TC needs to invalidate a buffer for the correctness of an operation
at any point, it will fall back to doing the operation in a synchronous
fashion with this patch if the buffer is shared and currently busy.
It might be possible to later detect that a buffer has become un-shared;
however, this is outside of the scope of this bugfix patch.
v2: Do not disable buffer busyness tracking for shared buffers.
Fixes:
e9c41b32 ("gallium/u_threaded: add buffer lists - tracking of buffers referenced by tc")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17338>
Jonathan [Wed, 13 Jul 2022 19:00:28 +0000 (21:00 +0200)]
gallium/u_threaded: Prepare for buffer sharedness tracking
tc_add_to_buffer_list and tc_bind_buffer need the tc instance too.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17338>
Jesse Natalie [Tue, 30 Aug 2022 14:16:47 +0000 (07:16 -0700)]
u_atomic: Add a helper for pointer compare-exchange
Notably this helps with MSVC, which complains about compiling the not-taken
branches of the ternary when called with pointer args. Using a version that
doesn't have "runtime" sizeof checks eliminates the warnings.
Reviewed-by: Jonathan Strobl <jonathan.strobl@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17338>
Rob Clark [Tue, 30 Aug 2022 14:59:34 +0000 (07:59 -0700)]
Revert "ci: disable the freedreno farm."
It is back again. Hopefully it stays that way.
This reverts commit
ab473a4f486146dcd474d81addc3bfcb136efd9f.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18321>
Daniel Schürmann [Tue, 16 Aug 2022 22:23:36 +0000 (00:23 +0200)]
aco/live_var_analysis: implement faster merging of live_out sets for some cases
If we know that logical and linear predecessors are the same,
we don't need to check for the register type of each variable.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18105>
Daniel Schürmann [Tue, 16 Aug 2022 22:18:54 +0000 (00:18 +0200)]
aco: use std::vector::reserve() more often
This removes the majority of vector re-allocations.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18105>
Christian Gmeiner [Mon, 29 Aug 2022 15:29:06 +0000 (17:29 +0200)]
lima/ci: Make use of .lava-piglit
This brings back the old CI behaviour.
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18299>
Erik Faye-Lund [Tue, 9 Aug 2022 12:11:46 +0000 (14:11 +0200)]
gallium/u_transfer_helper: hide deinterleave helpers
There's no more callers of these, so let's make them an implementation
detail instead of public API.
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17959>
Erik Faye-Lund [Tue, 9 Aug 2022 12:11:22 +0000 (14:11 +0200)]
zink: use full transfer-helper api
This is going to make it easier to maintain u_transfer_helper in the
future.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17959>
Erik Faye-Lund [Tue, 9 Aug 2022 12:07:03 +0000 (14:07 +0200)]
gallium/u_transfer_helper: add in-place interleave flag
This flag should allow Zink to stop using the interleave-specific API,
and instead just use the normal/full u_transfer_helper API, and start
using some more of these helpers.
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17959>
Erik Faye-Lund [Tue, 9 Aug 2022 11:22:59 +0000 (13:22 +0200)]
gallium/u_transfer_helper: clean up boolean flags
Whenever we add or remove a flag here, we need to update a bunch of
drivers in a fragile way. Moving to flags here instead should make this
a bit easier to maintain in the future.
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17959>
Daniel Schürmann [Wed, 24 Aug 2022 16:42:09 +0000 (18:42 +0200)]
nir/opt_algebraic: a & ~a -> 0
Also re-ordered some optimizations for better readability.
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18250>
Martin Roukala (né Peres) [Fri, 26 Aug 2022 08:09:51 +0000 (11:09 +0300)]
radv/ci: uprev boot2container
This brings in massively-tidier logs.
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18267>
Iago Toral Quiroga [Thu, 25 Aug 2022 07:58:00 +0000 (09:58 +0200)]
v3dv: expose VK_KHR_maintenance4
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246>
Iago Toral Quiroga [Thu, 25 Aug 2022 08:05:47 +0000 (10:05 +0200)]
v3dv: implement vkGetDeviceImageSparseMemoryRequirementsKHR
Added with KHR_maintenance4.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246>
Iago Toral Quiroga [Thu, 25 Aug 2022 07:56:53 +0000 (09:56 +0200)]
v3dv: implement vkGetDeviceBufferMemoryRequirementsKHR
Added with VK_KHR_maintenance4.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246>
Iago Toral Quiroga [Thu, 25 Aug 2022 07:41:06 +0000 (09:41 +0200)]
v3dv: add a buffer_init helper
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246>
Iago Toral Quiroga [Thu, 25 Aug 2022 07:40:50 +0000 (09:40 +0200)]
v3dv: add a get_buffer_memory_requirements helper
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246>
Iago Toral Quiroga [Thu, 25 Aug 2022 07:23:14 +0000 (09:23 +0200)]
v3dv: implement vkGetDeviceImageMemoryRequirementsKHR
Added with KHR_maintenance4.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246>
Iago Toral Quiroga [Thu, 25 Aug 2022 07:22:46 +0000 (09:22 +0200)]
v3dv: add a get_image_memory_requirements helper
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246>
Iago Toral Quiroga [Thu, 25 Aug 2022 07:01:10 +0000 (09:01 +0200)]
v3dv: add a v3dv_image_init helper
This is different from the internal create_image in that it doesn't
allocate memory for an image object, instead it expects the object
to be created and it initializes it from a VkImageCreateInfo struct.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246>
Iago Toral Quiroga [Thu, 25 Aug 2022 06:41:23 +0000 (08:41 +0200)]
v3dv: set maxBufferSize property
Included since KHR_maintenance4 and Vulkan 1.3.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246>
Iago Toral Quiroga [Thu, 25 Aug 2022 06:23:27 +0000 (08:23 +0200)]
v3dv: ref/unref pipeline layout objects
Since KHR_maintenance4 it is possible to destroy pipeline layouts
immediately after creating pipelines.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246>
Iago Toral Quiroga [Thu, 25 Aug 2022 06:12:29 +0000 (08:12 +0200)]
v3dv: add a helper to destoy pipeline layouts
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246>
Pierre-Eric Pelloux-Prayer [Thu, 18 Aug 2022 14:43:32 +0000 (16:43 +0200)]
radeonsi: use LOAD_CONTEXT_REG_INDEX for VGT_STRMOUT_DRAW_OPAQUE
Based on PAL's UniversalCmdBuffer::CmdDrawOpaque.
We don't need to use PFP_SYNC_ME because it's done in emit_cache_flush.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18129>
Erik Faye-Lund [Wed, 24 Aug 2022 13:20:42 +0000 (15:20 +0200)]
mesa: fall-back to fp16 for bptc-textures
FP16 is way more commonly supported than FP32, and requires half the
memory bandwidth. Because the internal format of BPTC is really FP16,
let's fall back to that instead.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Wed, 24 Aug 2022 13:16:37 +0000 (15:16 +0200)]
mesa/main: add fp16-versions of bptc decompression functions
These are essential copies of the float-versions, with minor
adjustments.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Wed, 24 Aug 2022 12:41:47 +0000 (14:41 +0200)]
mesa/main: remove always-true define
We don't include this header anwhere where BPTC_BLOCK_DECODE isn't
already true, so let's remove it.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Thu, 11 Aug 2022 10:32:16 +0000 (12:32 +0200)]
zink: allow X32 -> A32
The 32-bit per component pipe_formats are a bit different than the 8 and
16 bit formats, in that there's no UNORM or SNORM variants of them. So
let's just omit those variants.
While we're at it, update a comment that was already out-of-date anyway.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Wed, 10 Aug 2022 06:59:28 +0000 (08:59 +0200)]
mesa/st: enable bptc extension with fallback
This implements emulation of BPTC for all drivers that don't natively
support it in HW, similar to what we have for ETC and ASTC already. The
only significant difference is that we don't implement any transcoding
DRI-conf for it.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Wed, 10 Aug 2022 06:45:16 +0000 (08:45 +0200)]
mesa/st: implement fallback for bptc
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Wed, 10 Aug 2022 09:16:28 +0000 (11:16 +0200)]
mesa: add _mesa_unpack_bptc-function
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Wed, 10 Aug 2022 06:27:19 +0000 (08:27 +0200)]
mesa: add format-helper for bptc
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Wed, 10 Aug 2022 06:24:29 +0000 (08:24 +0200)]
mesa/st: add context-flag for bptc-support
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Thu, 11 Aug 2022 14:12:00 +0000 (16:12 +0200)]
mesa/st: do not use memcpy when using compressed fallback
If we're using the memcpy-path, we don't update the compressed image,
which will be needed if an application try to download the texture-image
again afterwards.
This isn't a problem yet, because none of the current compressed formats
with fallback are copyable as per the OpenGL 4.6 Core spec, table 8.14.
However, this is about to change, when we introduce fallback for BPTC
formats.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Thu, 11 Aug 2022 09:07:52 +0000 (11:07 +0200)]
mesa/st: avoid double-mapping if both images are the same
If both src_image and dst_image are pointing to the same image, we'll
end up double mapping the image, which throws an assert in
st_texture_image_map.
So let's check if these images are the same, and avoid the extra mapping
in that case.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Wed, 10 Aug 2022 11:06:57 +0000 (13:06 +0200)]
mesa/st: simplify st_compressed_format_fallback
By looking at the format-layout, we can do switch-cases here instead of
serial calls to _mesa_is_format_foo(). This isn't a huge deal yet, but
this function is going to learn about a lot more formats soon...
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Wed, 10 Aug 2022 10:29:07 +0000 (12:29 +0200)]
mesa/main: simplify implementation of _mesa_is_format_astc_2d
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Erik Faye-Lund [Wed, 10 Aug 2022 10:26:49 +0000 (12:26 +0200)]
mesa/main: simplify implmementation of _mesa_is_format_etc2
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
Chad Versace [Wed, 24 Aug 2022 23:49:11 +0000 (16:49 -0700)]
venus: Document VK_EXT_texture_compression_astc_hdr support
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Thu, 11 Aug 2022 00:49:46 +0000 (17:49 -0700)]
venus: Enable VK_EXT_tooling_info
Implement it locally with the common implementation.
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Thu, 11 Aug 2022 00:03:07 +0000 (17:03 -0700)]
venus: Enable VK_EXT_private_data
Implement it as hybrid native/passthrough as a workaround until venus
learns how to deep surgery on pNext chains. Eventually, we want to
implement it purely natively. For details, see the big code comment.
See: https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/908
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Signed-off-by: Chad Versace <chadversary@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Thu, 11 Aug 2022 01:43:02 +0000 (18:43 -0700)]
venus: Enable VK_KHR_format_feature_flags2
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Thu, 11 Aug 2022 00:56:42 +0000 (17:56 -0700)]
venus: Enable VK_EXT_ycbcr_2plane_444_formats
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Thu, 11 Aug 2022 00:39:24 +0000 (17:39 -0700)]
venus: Enable VK_EXT_texel_buffer_alignment
The patch looks asymmetic because the extension was promoted to 1.3 but
not its feature struct.
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Thu, 11 Aug 2022 00:32:15 +0000 (17:32 -0700)]
venus: Enable VK_EXT_subgroup_size_control
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Wed, 10 Aug 2022 23:05:06 +0000 (16:05 -0700)]
venus: Enable VK_KHR_zero_initialize_workgroup_memory
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Wed, 10 Aug 2022 23:02:20 +0000 (16:02 -0700)]
venus: Enable VK_KHR_shader_terminate_invocation
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Wed, 10 Aug 2022 22:57:41 +0000 (15:57 -0700)]
venus: Enable VK_KHR_shader_non_semantic_info
This extension has no Vulkan API, only SPIR-V API.
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Wed, 10 Aug 2022 22:45:48 +0000 (15:45 -0700)]
venus: Enable VK_KHR_shader_integer_dot_product
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Thu, 11 Aug 2022 19:50:17 +0000 (12:50 -0700)]
venus: Simplify vn_GetPhysicalDeviceProperties2
Reduce approximately 220 lines to 80.
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Thu, 11 Aug 2022 19:41:43 +0000 (12:41 -0700)]
venus: Simplify vn_GetPhysicalDeviceFeatures2
Reduce approximately 300 lines to 60.
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Thu, 11 Aug 2022 19:16:32 +0000 (12:16 -0700)]
vulkan: Make vk_copy_struct_guts() public
Venus wants to copy struct guts too.
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Chad Versace [Wed, 10 Aug 2022 21:01:17 +0000 (14:01 -0700)]
venus: Sort passthrough extensions
Only the Vulkan 1.3 extensions were unsorted.
Signed-off-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>
Rhys Perry [Fri, 5 Aug 2022 13:11:44 +0000 (14:11 +0100)]
aco: remove dead code for querying image size/samples/levels
ac_nir_lower_resinfo() now lowers these.
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/17991>
Rhys Perry [Fri, 5 Aug 2022 12:50:59 +0000 (13:50 +0100)]
radv: enable ac_nir_lower_resinfo for ACO
fossil-db (navi21):
Totals from 4022 (2.98% of 134913) affected shaders:
VGPRs: 207824 -> 205264 (-1.23%); split: -1.25%, +0.02%
CodeSize:
18486240 ->
18778488 (+1.58%); split: -0.00%, +1.58%
MaxWaves: 84398 -> 84882 (+0.57%)
Instrs: 3408968 -> 3470936 (+1.82%); split: -0.00%, +1.82%
Latency:
43493420 ->
43168394 (-0.75%); split: -1.57%, +0.82%
InvThroughput: 6911341 -> 6816816 (-1.37%); split: -1.41%, +0.05%
VClause: 88256 -> 82728 (-6.26%); split: -6.31%, +0.04%
SClause: 130061 -> 131526 (+1.13%); split: -0.39%, +1.51%
Copies: 219849 -> 238548 (+8.51%); split: -0.05%, +8.56%
Branches: 79168 -> 79174 (+0.01%); split: -0.00%, +0.01%
PreSGPRs: 180683 -> 184952 (+2.36%); split: -0.17%, +2.53%
PreVGPRs: 179716 -> 178956 (-0.42%)
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/17991>
Rhys Perry [Fri, 5 Aug 2022 15:34:30 +0000 (16:34 +0100)]
nir/lower_tex: ignore width of cube textures
On AMD hardware, height is faster to access and we're already doing so.
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/17991>
Rhys Perry [Fri, 5 Aug 2022 15:35:42 +0000 (16:35 +0100)]
aco: add SCC clobber in build_cube_select
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17991>
Rhys Perry [Fri, 5 Aug 2022 15:34:09 +0000 (16:34 +0100)]
nir/print: support nir_texop_descriptor_amd
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes:
3098000e712 ("nir: add nir_texop_descriptor_amd")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17991>
Marek Olšák [Tue, 23 Aug 2022 22:53:40 +0000 (18:53 -0400)]
radeonsi: move set_patch_vertices into si_state_shaders.cpp
it's a better place for it
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Marek Olšák [Tue, 23 Aug 2022 21:51:49 +0000 (17:51 -0400)]
radeonsi: move patch_vertices-related tessellation updates out of si_draw
This only depends on the patch_vertices and the TCS.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Marek Olšák [Sun, 14 Aug 2022 13:12:03 +0000 (09:12 -0400)]
radeonsi: remove 1 draw packet order codepath, keep the first one
Multi-mode multi-draws will make it more complicated, so let's start with
simpler code.
I changed the order a little: I put the VBO update next to emit_draw_packets.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Marek Olšák [Sun, 14 Aug 2022 12:50:31 +0000 (08:50 -0400)]
radeonsi: cosmetic changes in si_emit_rasterizer_prim_state
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Marek Olšák [Sun, 14 Aug 2022 12:20:01 +0000 (08:20 -0400)]
radeonsi: set GS_STATE_OUTPRIM and PROVOKING_VTX_INDEX only when they change
This moves setting those registers from an unconditional place in draw_vbo
into si_set_rasterized_prim (for draw_vbo), si_update_rasterized_prim
(for bind_xx_shader), and si_bind_rs_state.
It's a little more complicated than expected.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Marek Olšák [Sun, 14 Aug 2022 10:55:19 +0000 (06:55 -0400)]
radeonsi: precompute GS_OUT_PRIM in advance
We don't have to do it every draw now if the rasterized prim type
doesn't change.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Marek Olšák [Sun, 14 Aug 2022 10:46:09 +0000 (06:46 -0400)]
radeonsi: unify the logic that sets rast_prim
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Marek Olšák [Sun, 14 Aug 2022 07:57:58 +0000 (03:57 -0400)]
radeonsi: move fixing ngg_culling into si_update_shaders
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Marek Olšák [Sun, 14 Aug 2022 07:43:54 +0000 (03:43 -0400)]
radeonsi: remove the prim_restart_tri_strips_only option
Not used enough, no difference in performance for Dirt Rally on 6800.
Move the variable down.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Marek Olšák [Sun, 14 Aug 2022 07:27:53 +0000 (03:27 -0400)]
radeonsi: move *rs to its only use in si_draw
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Marek Olšák [Sun, 14 Aug 2022 06:52:34 +0000 (02:52 -0400)]
radeonsi: make the primitive type constant with tessellation
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Marek Olšák [Sun, 14 Aug 2022 06:48:30 +0000 (02:48 -0400)]
radeonsi: don't pass num_patches via derived_tess_state, pass it via si_context
This removes the parameter from si_emit_derived_tess_state and uses
si_context to pass it. This rework is needed for multi-mode draws
where num_patches will be needed much later.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Marek Olšák [Mon, 15 Aug 2022 06:56:57 +0000 (02:56 -0400)]
radeonsi/ci: add skips of tests not built on Linux
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>
Jason Ekstrand [Mon, 15 Aug 2022 14:29:11 +0000 (09:29 -0500)]
panfrost: Use util/bitpack_helpers.h
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18062>
Jason Ekstrand [Mon, 15 Aug 2022 14:17:37 +0000 (09:17 -0500)]
asahi: Use util/bitpack_helpers.h
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18062>
Jason Ekstrand [Mon, 15 Aug 2022 14:13:17 +0000 (09:13 -0500)]
util: Add util_bitpack_[su]fixed_clamp helpers
These clamp the value to the fixed-point range instead of asserting.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18062>
Jason Ekstrand [Mon, 15 Aug 2022 14:07:02 +0000 (09:07 -0500)]
broadcom: Use util/bitpack_helpers.h
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18062>
Jason Ekstrand [Mon, 15 Aug 2022 13:52:20 +0000 (08:52 -0500)]
util,intel: Pull the bit packing helpers from genxml to a common header
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18062>
Mike Blumenkrantz [Tue, 30 Aug 2022 00:03:23 +0000 (20:03 -0400)]
zink: defer all compute shader creation
with other various changes, this should enable the entirety of compute
shader creation to occur in the compile thread
it also enables (slightly) simplifying shader create by moving cube check
out to the caller
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18197>
Mike Blumenkrantz [Mon, 15 Aug 2022 16:57:08 +0000 (12:57 -0400)]
zink: add function to check whether a shader has cube samplers
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18197>
Mike Blumenkrantz [Fri, 12 Aug 2022 17:28:32 +0000 (13:28 -0400)]
zink: generate sha1 for compute programs
this got broken in the move to u_live_shader_cache, which does not
handle compute programs and thus does not populate the shader's sha1
cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18197>
Mike Blumenkrantz [Mon, 15 Aug 2022 16:45:41 +0000 (12:45 -0400)]
zink: init fbfetch/bindless ctx stuff on shader create
deferring until later will be problematic for threads
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18197>
Mike Blumenkrantz [Mon, 15 Aug 2022 16:26:19 +0000 (12:26 -0400)]
zink: add a context pointer to zink_program struct
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18197>
Mike Blumenkrantz [Mon, 15 Aug 2022 16:21:19 +0000 (12:21 -0400)]
zink: add locking for descriptor layout caches
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18197>
Mike Blumenkrantz [Fri, 12 Aug 2022 15:34:29 +0000 (11:34 -0400)]
zink: add partial async shader compile support
when compute shaders can be precompiled, they can be precompiled asynchronously
which allows the implementation of the parallel shader compile hooks
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18197>