This codepath had a bug (always setting `elems[0]`) since it was last
reworked, but there's no subgroup instruction that uses this helper and
support Composites, so it can be replace with an assert.
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40356>
There's no reason to adjust the matrix once unconditionally, and then
agaiun conditionally after overwriting the matrix. If we just make the
second adjustment unconditional, we should be good.
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40175>
This is just cleaning up some naming, so we consistently refer to things
dealing with luma as "y" and things dealing with chroma as "c".
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40175>
There's a few things going on here:
1. Vulkan makes the YCbCr model and YCbCr range completely orthogonal.
This means that we need to be able to handle an identity transform
while still doing range-remapping, so we apply the range mapping and
color-transform separately, and let the optimizer clean things up.
This is similar to what we did before, but it means it's a bit harder
to get completely optimal code out of this.
2. Vulkan defines that the YCbCr inputs come in a bit of an unusual
order; Cr, Y, Cb. This means we need to reorder things a bit when
applying the YCbCr range and multiplying the YCbCr color-model
matrix. This makes the code a little bit confusing to read at times.
3. Because the alpha-channel is passed through this function, we need to
expand the matrix to 4x3. This is similar to what we've already been
doing, but also a bit unusual. In the future, we might want to keep
the alpha-channel out of this code-path, and just work on a vec3
here.
I suspect that all of these can be solved by rearranging the code a bit.
But I've left that as an excercize for later to make sure we get this
right first, with as few modifications as possible. Some people might
disagree with this approach, but let's see.
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40175>
This adds some reusable math to set up YCbCr to RGB color transforms. It
covers ITU BT.601, ITU BT.709 and ITU BT.2020 YUV <-> RGB conversion, as
well as "narrow"" and "full" range.
This code is intended to replace three different implementations of
YUV-transforms already present in Mesa, all of them with different
parameterizations and differences in data-formats. These implementations
are: nir_lower_tex.c, vk_nir_convert_ycbcr.c and vl_csc.c.
None of the exising implementations seems to fully cover all of the needs
of the others. The one that comes the closest is the one in vl_csc.c, but
it has a few issues:
1. It doesn't differentiate between per-channel bit-sizes, which the
Vulkan code needs.
2. It uses enums from p_video_enums.h in Gallium to paremeterize the
behavior.
3. It's written in a monolithic way, handling up to two
range-remappings, which the other implementations doesn't need.
While it could be possible to entangle all of that, that would likely
end up being a more or less a new implementation anyway. So let's instead
try to pick the best of all three implementations into one new one,
that's broken into smaller pieces that can be assembled into either of
the three.
In addition, this implementation has a bunch of unit-tests, to make sure
we don't introduce subtle breakages down the line.
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40175>
Removed this by mistake during a rebase presumably.
This fixes a regression with
dEQP-VK.pipeline.monolithic.multisample.m10_resolve.* on <= GFX8.
Fixes: 1746837a71 ("radv/meta: remove CB_RESOLVE")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40449>
Allow applications to control the virtual address where device memory
is mapped by passing MAP_FIXED to mmap via pan_kmod_bo_mmap().
Support VK_MEMORY_UNMAP_RESERVE_BIT_EXT by replacing the mapping with
a PROT_NONE anonymous mapping to keep the address range reserved.
Only memoryMapPlaced and memoryUnmapReserve are advertised.
memoryMapRangePlaced is not supported because the DRM GEM mmap offset
mechanism requires mapping from offset 0.
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40315>
DRM GEM mmap offsets go through drm_vma_offset_exact_lookup_locked()
which requires an exact match on the GEM offset. Passing a non-zero
bo_offset causes EINVAL because the kernel can't find the BO at the
shifted offset. Every caller already passes bo_offset=0 and maps the
full BO size, so drop those parameters and use bo->size directly.
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40315>
No idea if this is more typical of navi31 or not, but it's what my system
has.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40409>
The cmd_buffer->vertex_bindings was not cleared when resetting the command buffer.
The previous misaligned_mask_invalid bits were not preserved when calling radv_CmdBindVertexBuffers2 multiple times.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40312>
If we are growing a CL, double the BO allocation size to reduce the
number of allocations in large command buffers. This showed significant
performance improvements in workloads with large CLs (e.g. WebGL
Aquarium with 5000 fishes). Also, this is the same strategy that v3dv
uses.
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40425>
Android requires VK_ANDROID_native_buffer v8+ to advertise KHR_swapchain
v69+ for supporting wsi image alias. On newer Android, the same is
required to advertise EXT_swapchain_maintenance1 to avoid memory hit
upon swapchain creation/recreation. This change completes the support.
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40384>
We can produce a transposed value sometimes, and we have to make sure
that val->transposed is also updated when that happens.
Noticed by inspection after the previous commit.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40017>
Since the stack pointer may wrap around the stack size in overflow
cases, traversal logic calculates the real stack pointer with
nir_umod_imm(b, stack, args->stack_entries * args->stack_stride).
For ray queries, "stack" was initialized to
"stack_base + local_invocation_idx * 4". This was completely broken, as
the umod would later delete the stack base completely and overwrite the
start of LDS, which belongs to the apps' shared memory.
Instead, add the stack base as a constant offset in the load/store_stack
callback. (This should also save 1 VALU per ray query)
Also, delete radv_ray_traversal_args::stack_base since it's unused now.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40420>
RADV wants to abstract the compiler from any instance/device/pdev
objects.
The previous NULL check for instance seems to be useless.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40379>