Rhys Perry
dfbb4b384a
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 >
2022-08-30 19:02:11 +00:00
Rhys Perry
d09b658dbd
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 >
2022-08-30 18:21:44 +00:00
Rhys Perry
69ba1c4d59
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 >
2022-08-30 18:21:44 +00:00
Rhys Perry
aa2d6e020b
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 >
2022-08-30 18:21:44 +00:00
Rhys Perry
1df320dae7
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 >
2022-08-30 18:21:44 +00:00
Rhys Perry
69a9b343e8
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 >
2022-08-30 18:21:44 +00:00
Rhys Perry
9bd7b0b305
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 >
2022-08-30 18:21:44 +00:00
Connor Abbott
9d9b891f94
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 >
2022-08-30 18:21:44 +00:00
Jonathan
8f159a8576
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 >
2022-08-30 17:27:48 +00:00
Jonathan
aa87803069
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 >
2022-08-30 17:27:48 +00:00
Jesse Natalie
6718bff75b
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 >
2022-08-30 17:27:48 +00:00
Daniel Schürmann
f676326a1a
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 >
2022-08-30 16:03:26 +00:00
Daniel Schürmann
3d6ea4f666
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 >
2022-08-30 16:03:26 +00:00
Christian Gmeiner
902bf8ce07
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 >
2022-08-30 15:46:34 +00:00
Erik Faye-Lund
530683096b
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 >
2022-08-30 14:36:32 +00:00
Erik Faye-Lund
c033a12c52
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 >
2022-08-30 14:36:32 +00:00
Erik Faye-Lund
81a73abc63
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 >
2022-08-30 14:36:32 +00:00
Erik Faye-Lund
c5a01854df
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 >
2022-08-30 14:36:32 +00:00
Daniel Schürmann
9b843f8e4a
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 >
2022-08-30 14:10:22 +00:00
Iago Toral Quiroga
ed9189025f
v3dv: expose VK_KHR_maintenance4
...
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18246 >
2022-08-30 11:10:14 +00:00
Iago Toral Quiroga
746664610b
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 >
2022-08-30 11:10:14 +00:00
Iago Toral Quiroga
48e8564235
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 >
2022-08-30 11:10:14 +00:00
Iago Toral Quiroga
5d5b9bbad9
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 >
2022-08-30 11:10:14 +00:00
Iago Toral Quiroga
07a68e107c
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 >
2022-08-30 11:10:14 +00:00
Iago Toral Quiroga
d198b05f78
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 >
2022-08-30 11:10:14 +00:00
Iago Toral Quiroga
3aa623ae03
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 >
2022-08-30 11:10:14 +00:00
Iago Toral Quiroga
c354ca69c6
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 >
2022-08-30 11:10:14 +00:00
Iago Toral Quiroga
2c388c1d49
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 >
2022-08-30 11:10:14 +00:00
Iago Toral Quiroga
14dab6b10c
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 >
2022-08-30 11:10:14 +00:00
Iago Toral Quiroga
425f8aa7a4
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 >
2022-08-30 11:10:14 +00:00
Pierre-Eric Pelloux-Prayer
adad285fc9
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 >
2022-08-30 10:51:43 +00:00
Erik Faye-Lund
7f7c8e83df
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
72ad3787a3
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
253b521b6e
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
1961022e1a
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
e4ff42684b
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
4f4e28face
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
2b7dfd8de1
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
529e70271f
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
403b9bf870
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
8f446322e1
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
673d241f36
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
985fde28a2
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
bf6e70965d
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 >
2022-08-30 08:36:47 +00:00
Erik Faye-Lund
207798c557
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 >
2022-08-30 08:36:46 +00:00
Chad Versace
6d0c86c777
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 >
2022-08-30 08:09:55 +00:00
Chad Versace
2bf2a05312
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 >
2022-08-30 08:09:55 +00:00
Chad Versace
4d80ccbf2d
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 >
2022-08-30 08:09:55 +00:00
Chad Versace
fc2d37882c
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 >
2022-08-30 08:09:55 +00:00
Chad Versace
ea273dd8b9
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 >
2022-08-30 08:09:55 +00:00