Failing to allocate resources when DRM_FORMAT_INVALID
is passed as a modifier breaks tegra. Change this behaviour
so that this modifier is instead interpreted as a don't care,
allowing for the driver to choose an appropriate modifier internally.
v2: change nouveau instead of tegra (Thierry Rieding)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6693
Fixes: 129d83cac2 ("nouveau: Use format modifiers in buffer allocation")
Signed-off-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18649>
(cherry picked from commit 941c70a28a8db3a852ca5245354effa2bf1e7cf8)
We don't check whether the register is overwritten between the actual
conditional test and the test of the used result, so don't try to
optimize the evaluation of the conditional.
Fixes: 79ca456b48
r600/sfn: rewrite NIR backend
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
(cherry picked from commit 6de40d17baf403978dd136dbbc36c0167dbf7ef9)
Docu says:
Ensure that the KILL* instruction is the last instruction
in an ALU clause, because the remaining instructions executed
in the clause do not reflect the updated valid state after
the kill operation.
Fixes: 79ca456b48
r600/sfn: rewrite NIR backend
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18983>
(cherry picked from commit 99b7a12ec12d5d76826051772fe474a547582e5e)
Like on adreno 3xx, hw binning and scissor optimizations don't work correctly
together on a4xx and a5xx GPUs.
Disable binning as a workaround if scissor optimizations are being used.
Fixes: f68c6951b88efaae3e19
Signed-off-by: Alejandro Tafalla <atafalla@dnyon.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18925>
(cherry picked from commit afe4b534b52af41ba3265c7150e012f8577d03b7)
We have the correct merged color write enable state as a local var here,
use that instead of the zero cmd->state.color_write_enable. Fixes
blending in many traces with ANGLE on turnip. In the process of fixing,
clarify the logic a little bit.
Fixes: 169e03800d ("tu: Implement VK_EXT_color_write_enable")
Fixes: #7328
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18956>
(cherry picked from commit dadb29cf2e21ba6b28a2d9ac62dd4ff13f7df9a2)
It turns out that the ir3_setup_const_state() already includes reserved
consts, so we were accidentally counting it twice. This makes us use
less consts, and if there are enough reserved consts can make it go
negative and wrap around. Fix this while also making sure the previous
bug remains fixed.
Fixes: 8cb1deded60 ("ir3/analyze_ubo_ranges: Account for reserved consts")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18840>
(cherry picked from commit dcab399a173f2ab99f408e2db1bafc114c29cfd9)
If the abs source modifiers is not supported for the current
instruction because it is an instruction with three sources we
may still see a parent mov that has the `abs` modifier. In this
case we must not propagate that abs modifier from that parent
instructions.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7350
Fixes: cd73b6174b
nir/lower_to_source_mods: Stop turning add, sat, and neg into mov
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18902>
(cherry picked from commit 9ebe893a61f30c2b1bb24e7870a2ba314356a4fd)
It doesn't make sense for a "s_waitcnt vmcnt(0)" to affect a store or DS
instruction.
LLVM checks for "s_waitcnt vmcnt(0) lgkmcnt(0) expcnt(0)" but ignores
s_waitcnt_vscnt (which I assume is a bug).
No fossil-db changes.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: bcf94bb933 ("aco: properly recognize that s_waitcnt mitigates VMEMtoScalarWriteHazard")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18270>
(cherry picked from commit 2bd16256a6a8f830dc43aa7224879d11edb9583a)
this feels like a compiler bug, but somehow just specifying the
shorter path ends up with a broken/partial header include
Fixes: d760a9151b ("gallium: Learn about kopper")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18858>
(cherry picked from commit 8da9e65500819b2e430028b96b1f68c99f220bdd)
the original improvement for this correctly handled cases where
the offset/count values were swizzled with .xxxx, but it was broken
for any other swizzling
this adds a nir pass to more easily manipulate the swizzles and rewrite
the multi-component ops as multiple ops with the swizzled params
fixes#6697
Fixes: 8e97f51c67 ("zink: handle swizzled offset/count values for shader bitfield ops")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18706>
(cherry picked from commit af775f842cad7eff4deaff9a476a3702970b5645)
this is a valid error condition
cc: mesa-stable
fixes:
GTF-GL46.gtf21.GL2FixedTests.buffer_objects.buffer_objects
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18856>
(cherry picked from commit 004c5b60caa3a58177be62e1f4f9eb7388979126)
this is guaranteed to need some kind of layout change, so ensure the
barrier actually happens
cc: mesa-stable
SoroushIMG <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18855>
(cherry picked from commit 5bc19dd5f7d329b786d005e9166ca59544347ce9)
Offscreen winsys introduced in Mesa 22.2 depends on glx(dri) and libswkmsdri.
The error message is:
/usr/bin/ld: src/gallium/auxiliary/libgalliumvlwinsys.a.p/vl_vl_winsys_dri_vgem.c.o: in function `vl_vgem_drm_screen_create':
vl_winsys_dri_vgem.c:(.text.vl_vgem_drm_screen_create+0x28): undefined reference to `kms_dri_create_winsys'
Fixes: 31dcb396 (gallium/vl: Add software winsys and offscreen winsys)
Cc: mesa-stable
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18843>
(cherry picked from commit ae201bcd42a7b5efe5b21270e081d242d2a97aad)
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>
(cherry picked from commit 8f159a8576efbb7bb3755d215a54b87c4c99a0d2)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18349>
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>
(cherry picked from commit 6718bff75b4d3823df5f9c1d66eace07d37e9c92)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18349>
This fixes a performance regression with yquake2 cause by
the enablement of cpu_storage by default for radeonsi in
a5a8e19741.
Fixes: a5a8e19741 ("radeonsi: enable tc cpu_storage by default")
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18774>
(cherry picked from commit e06c332bf77ed7ec0b37a58f644e0f4e0c06fbee)
If the GPU-side storage has been written to without using cpu_storage,
then we have to initialize the CPU-side storage correctly.
This requires a sync + copy but it's a one time operation so it shouldn't
affect performance much.
I don't think it fixes any existing bug, but the next commit will need
this to behave correctly.
cc: mesa-stable
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18774>
(cherry picked from commit 8af8dc97bc3edb912899a5da9399614677567810)
This can be accessed from :
- RT shaders
- CS trampoline shader
We missed the second part here.
Fixes: 0465714790 ("intel/nir/rt: add more helpers for ray queries")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16970>
(cherry picked from commit 57593c539529f0b06c2395d1882e6e6d6477362a)
We keep the nir_builder::impl value around, but we've run some passes
that might have change the main function.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 96fde5518b ("intel/rt: Add a helper to create the raygen trampoline shader")
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16970>
(cherry picked from commit 8d580de4a9dd6ce859a9f0aeadb83cc3c3d4ce5a)
Another case of not clearing the metadata correctly.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c78be5da30 ("intel/fs: lower ray query intrinsics")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16970>
(cherry picked from commit 1ffd28149f4779a2097262ecc61ec39e96cdcd11)
this isn't "used", but it's the default
cc: mesa-stable
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18845>
(cherry picked from commit 7829fb9adf9b21c6f35c1932ee86f8f64dfda7cf)
it's otherwise possible (and likely) that optimizations won't
happen since there's no shader key data active
Fixes: 5b2f850425 ("zink: rewrite 64bit shader i/o as 32bit")
SoroushIMG <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18728>
(cherry picked from commit 0f053f0f07cb28a50faa6732430f08e8ba368900)
Seems I messed this up when converting things, and nobody noticed until
now!
Fixes: d4397c0048 ("docs: use envvar role for envvars")
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18641>
(cherry picked from commit c816081eea2865d04bc67950e79ec7e8b143b88d)
ensure that this isn't accidentally triggering for non-xfb shaders
Fixes: 6d40db84c9 ("zink: handle direct xfb output from output variables")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18784>
(cherry picked from commit 53004e57d68af9673cab6195ce67213245ec149f)