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>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39036>
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>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39036>
Unifies nir per instruction float control.
In the future this can be split into contract/reassoc/transform
like SPIR-V.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (except SPIR-V)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39103>
It is not actually available to all the platforms mesa can be compiled
to, so let's keep an opt-in list of supported platforms instead, and
compile it out on all other platforms.
Fixes: 48a0478126 ("zink: add renderdoc handling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39176>
This is the least invasive way to switch all of Mesa to BLAKE3. It's done
this way for transitional reasons.
SHA1_DIGEST_LENGTH is already equal to BLAKE3_KEY_LEN. This just switches
the SHA1 implementation to BLAKE3.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39110>
The last 12 bytes are always 0 for now. With this, all SHA1 functions
can be internally implemented as BLAKE3, so that we can switch everything
to BLAKE3 by only changing the implementation of the sha1 utility.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39110>
Turnip has to build/munge descriptors in a bunch of places. Extract out
helpers so we don't have to duplicate the gen8 vs earlier descriptor
format changes everywhere.
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39141>
The descriptor format changes in gen8, which is mostly abstracted by
the fdl helpers. But to utilize that we need to plumb the CHIP thru
12 layers for different ways of vk doing the same thing.
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39141>
DEPTH field is actually STRUCTSIZETEXELS. And for buffers the iova only
needs to be byte aligned, replacing STARTOFFSETTEXELS on a6xx/a7xx.
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39141>
Since commit e8c81652c9 ("vulkan/wsi/headless: do not destroy images
that are never created"), the CTS failure that prevents headless surface
from being advertised is already solved.
Re-advertise VK_EXT_headless_surface for pvr driver.
Running `dEQP-VK.wsi.headless.*` with VK CTS 1.4.5.0 results in no
failure on BXM-4-64 .
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39038>
It's allowed in the specification that a graphics pipeline being created
with either a render pass or a VkPipelineRenderingCreateInfo , in this
case the multiview mask should be set to 0. However, currently the code
in pvr_early_init_shader_data() tries to access RenderingCreateInfo w/o
checking for NULL, which leads to potential crash.
Set multiview to disabled if no RenderingCreateInfo is available.
This fixes crash of Vulkan CTS 1.4.4.0 / 1.4.5.0 test case
dEQP-VK.pipeline.monolithic.misc.no_rendering .
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39050>
Otherwise, issues like:
tessellator/tessellator.cpp:385:1:
note: declare 'static' if the function is not intended to be used
outside of this translation unit
385 | FXP floatToFixed(const float& input)
| ^
| static
are observed.
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
v3: add declaration for GetMSB since it's unused but desirable to keep
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39162>
When this flag is set, it gives a hint to KMD to skip some operations around
compressed buffers, like copying the auxiliary buffer to smem during eviction.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38425>