Constant buffers may be changed without the shader changing.
Check the correct dirty bits when marking constant buffers
as read during the draw to ensure proper synchronization.
Fixes: a40a6e551e ("etnaviv: draw: only mark resources as read/written when the state changed")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
(cherry picked from commit bfd7a8d8d3)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
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>
(cherry picked from commit 4708eb85d7)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
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>
(cherry picked from commit 7d73ea20ec)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
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>
(cherry picked from commit 61691034ac)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
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>
(cherry picked from commit b986250b69)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
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>
(cherry picked from commit be9caf8ed6)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
If two devices/instances are created, the VMID reservation will just
fail. It seems fine as long as it's reserved before SPM is used.
Fixes: a7a4abc8d8 ("radv: Move VMID reservation to vkCreateDevice")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
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>
(cherry picked from commit 4bb3b80b8f)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
Those outputs are never compact in GLSL mesh shaders. The assertions might
not be needed.
Cc: mesa-stable
Reviewed-by: Qiang Yu <yuq825@gmail.com>
(cherry picked from commit bba2536bb0)
Conflicts:
src/compiler/nir/nir_lower_clip_cull_distance_array_vars.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
Missing f in other cases seems to be caught either elsewhere in the
script or by the C compiler.
Fixes: c49d6e0480 ("nir/algebraic: Elide range clamping of f2u sources")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
(cherry picked from commit aba079b3af)
Conflicts:
src/compiler/nir/nir_algebraic.py
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
Comparing the ctx values and then updating the refcounts is not
thread-safe so add an assert to make sure the ctx wasn't updated
by another thread (via detach_ctx_from_buffer).
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 090f4d9a5d)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
This reverts commit 45b6aa1eb7.
This is not thread safe and will lead to buffer leaks, eg:
[threadA] _mesa_reference_buffer_object_ ctx=0x60bc07fa33f0 buf=0x60bc09b90020 CtxRefCount-=993187
[threadB] _mesa_glthread_release_upload_buffer ctx=0x60bc07fa33f0 buf=0x60bc09b90020 ref=7768 CtxRefCount=993212 -> 954
[threadB] _mesa_glthread_upload ctx=0x60bc07fa33f0 buf=0x60bc09eb7d00 CtxRefCount=1000000
[threadA] _mesa_reference_buffer_object_ ctx=0x60bc07fa33f0 buf=0x60bc09b90020 CtxRefCount-=993186
../src/mesa/main/bufferobj.h:201: _mesa_reference_buffer_object_: Assertion `oldObj->Ctx == ctx' failed.
The assert is one added by the previous commit.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14483
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 68ef044b3b)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
Add pipe format to sized internal format mappings for R32F,
RG32F and RGBA32F in the DRIImage format table. This fixes shader
image store operations on EGL images imported from DMA-BUF with
respective DRM formats.
Without these mappings, DMA-BUF imported textures received base internal
formats instead of sized internal formats, causing shader image unit
validation to fail and DispatchCompute write zeroes on compute shader
imageStore operation.
Fixes: 6d3f266406 ("dri: Add additional 16/32b float/int formats")
Signed-off-by: Lakshman Chandu Kondreddy <lkondred@qti.qualcomm.com>
(cherry picked from commit ffb5d5d224)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
ANV can return different memory requirements with and w/o the ALIAS bit.
See https://gitlab.freedesktop.org/mesa/mesa/-/issues/14671 for details.
Meanwhile, venus has a driver side cache for image memory requirements.
As blessed per spec for memory aliasing, venus strips the ALIAS bit when
populating the cache key. Because of the use of imageless mem req query,
the ALIAS mem req now can hit the cache first, leaving a smaller/relaxed
requirement in the cache...busted.
Venus is unable to fix ANV behavior behind the scene, so this workaround
is only to align Venus behavior with ANV to not suffer from Venus-only
rendering artifacts.
Cc: mesa-stable
(cherry picked from commit c2c9266fed)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
The Function glInternalReleaseBufferMESA is called whenever a
intermediate buffer is used by MESA internal and being released, however
it's only exported for GLES3, which leads to drawing w/o VBO not
operational for GLES1/2.
Fixes invalid operation warning in `glmark2-es2 -b build:use-vbo=false` for
GLES2 HW / any HW with MESA_GLES_VERSION_OVERRIDE=2.0 .
VBO-less drawing is possible for GLES 1.0 too, so this function is also
exported with GLES1. Tested on GLES1 with mesa-demos gears demo with
VBO allocation commented out.
Fixes: ae75b59cb5 ("glthread, tc: Fix buffer release with glthread and tc")
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
(cherry picked from commit ba43568f4b)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
Kopper draw codepath calls an internal helper called
InternalInvalidateFramebufferAncillaryMESA, which is currently only
exported for GLES3 contexts.
This leads to a warning when the underlying Vulkan driver capability
isn't enough for GLES3 or GLES version number is forced to 2.0 or the
program is a GLES1 one.
Export this internal helper for GLES1/2 too.
Fixes: 0c7994bb2d ("mapi: add InternalInvalidateFramebufferAncillaryMESA")
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
(cherry picked from commit f1d199285a)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
Mesa internally converts some draw calls to DrawArraysInstancedBaseInstance
or DrawElementsInstancedBaseVertexBaseInstance, which are only available
in GLES contexts via GL_EXT_base_instance, a GLES3-only extension.
Export these two functions into the internal namespace for GLES 2.0
contexts too.
This fixes black screen for `glmark2-es2 -b build:use-vbo=false` (which is
the first test item for glmark2 auto test sequence) on GLES 2 HW / GLES
3 HW with MESA_GLES_VERSION_OVERRIDE=2.0 .
Fixes: 7c1f8b63ad ("glthread: work around GL_INVALID_OPERATION with OpenGL ES 1.x draws")
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
(cherry picked from commit 2c770a8dce)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
We need to support this if we advertise KHR_swapchain_maintenance1
Cc: mesa-stable
Signed-off-by: llyyr <llyyr.public@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
(cherry picked from commit c3763b12e2)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
Similar to last MR, since we advertise support for
KHR_swapchain_maintenance1, we need to advertise this
Cc: mesa-stable
Signed-off-by: llyyr <llyyr.public@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
(cherry picked from commit a1dd7eec87)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
For large constants inlined into phis, this would overread the remap[] array,
which could crash. No CTS tests affected though.
Christoph found the bug and fixed it for Bifrost over in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39305. I just did a
quick CTS run of the obvious AGX backport over this morning's breakfast.
Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reported-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
(cherry picked from commit e4520b1dda)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
Otherwise, we'll only mark the first location for matrix and array
variables. Ideally, someone would split these before we get here but we
should at least be correct.
Cc: mesa-stable
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
(cherry picked from commit 871875d0ce)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>