Use v3dv_job_apply_barrier_state to consume pending barriers when
executing secondary command buffers. This ensures we only serialize
against relevant stages, addressing FIXME.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39278>
PAL always set WD_SWITCH_ON_EOP for pre gfx10 when primitive
restart is enabled to prevent gpu hang.
It only happens when specific index stream with primitive
restart. Since we don't know what's the exact problem,
just follow PAL to disable 4x primitive rate when primitive
restart is enabled.
GFX10+ does not use this function.
Cc: mesa-stable
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/39292>
PAL always set WD_SWITCH_ON_EOP for pre gfx10 when primitve
restart is enabled to prevent gpu hang.
It only happens when specific index stream with primitive
restart. Since we don't know what's the exact problem,
just follow PAL to disable 4x primitive rate when primitive
restart is enabled.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14629
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/39292>
Only add the appropriate picture_{h264,h264_enc,vc1,...}.c file when the
corresponding codec is enabled via the -Dvideo-codecs flag.
Add stub functions to va_private.h, so that the code in decode.c and
encode.c remains untouched.
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39354>
Add mpeg12dec as a selectable video-codec and add a corresponding check
to vl_codec_supported.
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39354>
Add jpeg as a selectable video-codec and add a corresponding check to
vl_codec_supported.
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39354>
Each node has their own opacity bits, so we don't need to track these
opacity flags at header level.
This commit also fixes the instance flag. Instance flag is 8bit wide,
but we were always using 4 lower bits.
Cc: mesa-stable
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39053>
Setting this bit always might hurt performance. It might forces
traversal to treat all leafs always valid.
Cc: mesa-stable
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39053>
Query the signature of the traversal function stored in the any-hit
shader and make the parameter locations between the two match up, to
remove unnecessary movs inside the traversal loop.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39314>
Parameter assignment hints allow to influence parameter register
assignment logic with user-specified affinities. If there is an affinity
declared for a parameter, the assignment logic will try to match the
registers a parameter and its affinity are assigned.
It also allows to hint that certain registers are not suitable for
assigning parameters to and should be avoided.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39314>
We can express any-hit/intersection shaders as functions, too.
Any-hit/Intersection shaders need the usual parameters like launch
IDs/descriptor data/ray properties, origin, direction/etc., but also
some special parameters related to traversal state. Any-hit/intersection
shaders need to return whether the hit was accepted and/or traversal
should be terminated, as well as the intersection T value (for
intersection shaders). Both any-hit and intersection shaders also need
to be passed hit attributes via parameters. Closest-Hit shaders need
those too, but we pass them out-of-band via LDS. LDS is used for the
traversal stack when any-hit/intersection shaders, so we need to pass
them via parameters.
Hit attributes are similar to ray payloads in the sense that they're
dynamically sized depending on how much space the application uses.
However, unlike ray payloads, hit attribute sizes have a strict upper
bound of 8 dwords. To make managing parameters easier, we put all hit
attributes in a single vector parameter with 0-8 components. This
prevents having a function with two sets of arbitrary numbers of
parameters.
This commit sets up ahit/isec function signatures and implements
lowering for ahit/isec-specific intrinsics in the context of these
functions. Subsequent commits will merely have to call into these
functions to execute a separate-compiled any-hit/intersection shader.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39314>
terminate_ray should only return from any-hit shaders, it should not
skip the intersection shader. If we insert a nir_jump_return when
processing the already-inlined any-hit shader, the intersection shader
will be skipped.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39314>
Makes a bunch of copy propagation and other passes work much better.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39382>
These are based on digging through the git history on each file.
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39397>
This replaces all full lisence headers with SPDX identifiers and
generally makes things more consistent. I've also dropped the few
remaining author tags. If someone wants to know who wrote a bit of
code, `git blame` is going to be way more accurate than author tags
anyway.
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39397>
This reverts a single hung from 669ddc5241 ("pan/blend: Use the blend
builder helpers instead of nir_lower_blend()"). That commit did fix the
test on a bunch of platforms, just not G52.
Fixes: 669ddc5241 ("pan/blend: Use the blend builder helpers instead of nir_lower_blend()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39397>
C++23 removed certain transitive includes so you need to add C++ headers
directly to utilize their functions and classes. We add cstdlib header
for abort.
Errors:
external/mesa3d/src/gfxstream/guest/vulkan_enc/goldfish_vk_counting_guest.cpp:9505:13:
error: use of undeclared identifier 'abort'
9505 | abort();
Test: m vulkan.ranchu
Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39360>
Common wsi should only create that semaphore if present wait is enabled.
Drivers may only advertise KHR_present_wait2 w/o KHR_present_wait. So
the common wsi core has to check for both.
Fixes: bf285c3be9 ("vulkan/wsi: Add basic support for PresentWait2")
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39322>
For mitigating the below VVL violation:
> VUID-vkCmdPipelineBarrier-srcStageMask-09634
>
> vkCmdPipelineBarrier(): dstStageMask is VK_PIPELINE_STAGE_HOST_BIT
> but srcQueueFamilyIndex (0) != dstQueueFamilyIndex (4294967293).
>
> The Vulkan spec states: If either srcStageMask or dstStageMask
> includes VK_PIPELINE_STAGE_HOST_BIT, for any element of
> pBufferMemoryBarriers, srcQueueFamilyIndex and dstQueueFamilyIndex
> must be equal
Fixes: 153857fb64 ("vulkan/wsi: amend barriers for blit dst buffer going to foreign queue")
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39322>
Without this, non-dynamically-supported state changes that require a pipeline
change (like blend states without full_ds3) that happen in between drawcalls
get ignored unless another one of the conditions also happened to be true.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39381>
comp-to-single is supported since GFX10, it's a new type of DCC fast
clear which doesn't require FCE and doesn't require to set fast clear
registers (ie. comp-to-reg). This means that it's possible to fast clear
even if not all slices are bound, because the clear code is stored in
the main image.
This improves performance in Dirt Rally 2.0 by +2-5%. Other games that
have layered clears would also benefit on GFX10+.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39394>
Like vkCmdClearAttachments(). This is a preliminary change for the
next commit which will enable these fast clears when comp-to-single
is supported.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39394>
Only clamp shadow sampler comparators for "unsigned normalized
fixed-point format[s]" as per the Vulkan spec.
Fixes: 69a56d33de ("pco: Fix for shadow sampler comparison not clamping the compare value")
Reported-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39389>
Previously, there were no meson.build rules for the Android
portion of gfxstream_vk, since nobody builds gfxstream_vk + Android
via the Android NDK.
Using Soong (and not the Android NDK) is an absolute requirement,
since Android Virtual Devices (AVDs) were amongst to fully
transition to Soong over Android makefiles, leading to
breath-taking and exhilarating build speeds.
The meson build rules that do exist works are designed for
gfxstream_vk + Linux. That leads to higher maintainence
costs: maintaining hand-written Android.bp files for Android,
and meson.build for Linux.
Enter meson2hermetic. With this tool, meson.build becomes the
source of truth, and Android.bp are generating automatically,
reducing maintainence costs.
But for this to work, the portion of gfxstream_vk that didn't
have meson build rules needs them. This patch does this
and there are two things to note:
1) gfxstream_vk + Android needs dependencies that don't have
any pkg-config files, and exist only with the AOSP tree.
These include things like:
- libqemupipe.ranchu
- libOpenglCodecCommon
- libgralloc_cb.ranchu
- renderControlEncoder
Most of these dependencies support the Goldfish AVD, and will
be deleted over time as the that emulator transitions to
virtio-gpu. There are more generic Android deps too, like
"android_base".
Generic Android dependencies are given the prefix "android-",
while Goldfish (a.k.a Android Emulator) is given the prefix
"android-aemu-".
The ability to use dependencies that don't have a direct
Linux-distro style analogue is the one of motivators
meson2hermetic.
2) There's a special "gfxstream_emulated_android" case. This
is for the GfxstreamEnd2EndTests target, which uses the code
defined here:
- src/gfxstream/guest/android/ANativeWindowEmulated.cpp
- src/gfxstream/guest/android/GrallocEmulated.cpp
This is used by Gfxstream Github for CI/CD.
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39279>
When building without the android-stub and with meson2hermetic,
we need to find vulkan headers somewhere.
Without this, the following error is observed:
vulkan/runtime/vk_android.c:46:10: fatal error: 'hardware/hwvulkan.h' file not found
46 | #include <hardware/hwvulkan.h>
| ^~~~~~~~~~~~~~~~~~~~~
This provided via the hwvulkan_headers target in:
${AOSP}/frameworks/native/vulkan
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39279>
If tool isn't found, we shouldn't call full_path() on it.
This is the case for Android + meson2hermetic.
Fixes: 2f652e0b36 ("meson: move the generic symbols check arguments to a common variable")
Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39279>
Otherwise, the following warning is observed with musl
headers, which translates to an error on Android.
external/musl/include/sys/poll.h:1:2: error:
redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror,-W#warnings]
warning redirecting incorrect #include <sys/poll.h> to <poll.h>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39279>