If this happens then "after" is NULL, so we can't use it to get the
block, and the instruction is never moved at the end so we have to
create the split instructions before creating the collect to make sure
they are in the right order.
This happens when reloading a complex vector value that has been
coalesced at the end of a basic block, which apparently hasn't happened
until a gfxbench5 shader on zink hit this case. This fixes it.
Closes: #7054
Fixes: 613eaac7b5 ("ir3: Initial support for spilling non-shared registers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18082>
Now that we are able to set iova from userspace we could support
the replay feature of BDA.
In order to prevent address clashing between ordinary allocations
and replayable ones we allocate:
- ordinary allocations - from the lowest address;
- replayable allocations - from the highest address.
Passes: dEQP-VK.binding_model.buffer_device_address.*replay*
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15676>
With MSM_INFO_SET_IOVA it's now possible for userspace to manually
set iova instead of relying on kernel.
In preparation to support bufferDeviceAddressCaptureReplay.
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15676>
The default lib prefix is `lib`, so adding `lib` to the lib name just
results in `liblibbroadcom_v3d.a` for instance.
Those are internal, build-temporary static libraries that end up being
linked into the real user-visible libraries, so it doesn't really
matter, but we might as well just clean up their names anyway.
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18171>
turnip uses priority 0. pps should too (actually, it makes sense to do
so regardless of what turnip does).
turnip is not expected to starve pps, but it does with drm-next for
5.20.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18093>
It isnt used anymore, last used in tu_wsi_display.c which doesnt
exist anymore.
Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17927>
When you're debugging some deqp test or app, it's irritating to page
through 8 MRT clear shaders in turnip to get to what you're looking for.
Use the info.internal flag to suppress those shaders. (but if you want to
IR3_SHADER_DEBUG=internal, then yeah, print them all).
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18002>
`tu_WaitForFences` and `tu_GetFenceStatus` ended up using `ioctl` instead of
`safe_ioctl` and as a result were responsible for handling `EAGAIN`/`EINTR`
but they weren't handled correctly in wait calls which led to dropping the
wait if the thread received a signal without automatic syscall restarting on
release builds and an assertion due to `errorno` being `EINTR` on debug
builds.
This fixes early wait returns which would lead to UB or cause crashes due to
hitting debug assertions in Skyline Emulator.
Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18031>
source_root function is deprecated in Meson version 0.56.0, so let's use
instead a current_source_dir() function, available in all Meson
versions. This also allows to deduplicate some code by declaring
commonly used string at the top meson.build file.
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17974>
The goal here is to allow zink and ANGLE to switch sRGB on and off, but
keep UBWC enabled for most textures.
This doesn't quite work yet for zink on gbm, where zink asks the device if
it supports a UBWC-modifier image with unorm+sRGB mutable formats (yes),
but then doesn't pass the unorm+sRGB format list to vkImageCreate(), which
then asserts because it couldn't make a general
VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT UBWC image.
The format list here comes from Danylo's testing in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17278#note_1447812
Reduces frame times in Genshin Impact GLES AoV 2.02063% +/- 0.207575% (n=5)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17900>
"If viewFormatCount is zero, pViewFormats is ignored and the image is
created as if the VkImageFormatListCreateInfo structure were not included
in the pNext chain of VkImageCreateInfo."
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17900>
We can't invalidate CCU if there is any dirty data that hasn't been
flushed yet. In the case where we clear depth, we know that the depth
attachment itself isn't dirty but there may be dirty data from other
renderpasses. Therefore we need to flush before invalidating depth.
Fixes: 487aa80 ("tu: Rewrite flushing to use barriers")
Closes: #6987
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17940>
This includes the new timeout fixes so that tests that throw lots of debug
don't delay the timeout triggering, and the fraction vs shuffling behavior
change so that "--fraction 2" doesn't just skip every other test as it
appears in the caselist (every vertex shader variant, for example).
The fraction vs shuffling change does mean we see some different fails on
some drivers now.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17876>
Emit VFD_DECODE and VFD_DEST separately, similarly to what Gallium does.
This means we emit a few more VFD_DECODE for binning shaders and when
there are unused attributes, but hopefully the overhead won't be too
much. In exchange we lose one draw state, and in the future we can
pre-compute the dynamic vertex state independently of the shader, so
there should be lower CPU overhead with dynamic vertex inputs.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17554>
This is a workaround for #6753, without having to build and install a
custom xlib in our containers. Maybe some day debian will have a
backport?
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17549>
Move most includes and defines in tu_private.h to the new tu_common.h.
tu_common.h is a header that all other files include, mostly indirectly
through tu_private.h. The only exceptions are tu_perfetto.h and
tu_tracepoints.h, because ir3 headers are not compatible with C++.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17811>
Since the CCU only gets used for unaligned attachment stores or resolves
with the wrong formats, we can use that space for attachments in many
cases.
This gets two more of vk-5-normal's main renderpass's attachments to fit
in the next gmem_pixels increment, leaving 1 to go. Other renderpasses do
get better gmem_pixels, and a few get better tile sizes as a result, but
the fps increase from those looks to be <.2% at least.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16921>
We now choose between two (equal as of this commit) layouts based on
whether the renderpass's stores will use the CCU space, and assert that we
always know the chosen layout when we go using the gmem offsets.
This required making vkCmdClearAttachments in a secondary take the 3D path
instead of gmem blits, since secondaries only have to be compatible with
the primary's renderpass, rather than equal.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16921>
insert_dst checked whether dst is unused, however for precolored
inputs we always want to reserve a reg for them. Input could be
unused only if we explicitly want it.
Suggested-by: Connor Abbott <cwabbott0@gmail.com>
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17771>
It gets a bit repetitive to specify the same varset on each value. The
rnn decode already handles it when specified on the enum, we just need
to relax the schema to allow this.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17817>
The original reason it was split was because of libdrm ABI. But that no
longer applies since we pulled it into mesa.
While we are at it, remove the c++ workaround.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17817>
Updating PC_TESSFACTOR_ADDR could race with the next draw which uses it.
Fixes GL CTS tests running via Zink:
KHR-Single-GL46.enhanced_layouts.glsl_contant_values
KHR-GLES32.core.tessellation_shader.tessellation_shader_point_mode.point_rendering
KHR-GLES32.core.tessellation_shader.winding.quads_cw
KHR-GLES32.core.tessellation_shader.winding.triangles_cw
And probably more.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6815
Suggested-by: Connor Abbott <cwabbott0@gmail.com>
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17833>
Skip gather_push_constants when shared consts are enabled. This makes
sure push_consts is only zero-initialized, and reserved_user_consts is
0. This saves some space in the const file.
This change also adds a few asserts and a comment to
lower_load_push_constant. Because shared consts share the same range
for all stages, we should not apply per-stage offsets in
lower_load_push_constant. It worked because nir_lower_explicit_io
always sets base to 0 for nir_var_mem_push_const and
shader->push_consts.lo was always 0 for all stages.
Fixes: 0c787d57e6 ("tu: increase maxPushConstantsSize to 256.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17777>
Turnip supports VK_EXT_direct_mode_display and can use the common
implementation of AcquireDrmDisplayEXT() & GetDrmDisplayEXT() (which use
wsi->can_present_on_device() that turnip implements).
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17768>
A simple implementations of breadcrumbs tracking of GPU progress
intended to be the last resort when debugging unrecoverable hangs.
For best results use Vulkan traces to have a predictable place of hang.
Requires compilation with TU_BREADCRUMBS_ENABLED=1. See tu_cs_breadcrumbs.c
for details on how to use this feature.
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15452>
Some of these are actually bugfixes, some like the drawcall information
are just for autotune so they are just performance fixes. However this
came from an audit into what state is used in CmdEndRenderPass().
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>