this sucks, but if the gallium expectation is that changing vertex state
always requires a vb update, vbuf can no longer deduplicate repeated
calls
Fixes: 1638d486ff ("gallium/u_threaded,st/mesa: add a merged set_vertex_elements_and_buffers call")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37277>
many times (especially in viewperf), vertex buffers and draw buffers
have no prior access, which means incurring a heavy call to the barrier
function which will just return a no-op anyway
instead, have an inline helper to no-op these cases and just add the
expected access
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37277>
even doing this mechanism inside the barrier function doesn't yield
anywhere near the same gains (~15-20% in viewperf catia), mostly for
the draw buffers, so I'd assume it's just added register pressure
from the huge draw function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37277>
On windows, both msvc/gcc are using vs_module_defs to export symbols. So avoid use with_ld_version_script on win32
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37289>
It's not needed as we already have -D_CRT_SECURE_NO_WARNINGS
And use _CRT_NONSTDC_NO_DEPRECATE to disable other warnings
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37289>
Following the example of dri_sw_winsys, in order to support
importing client-allocated (u)dmabufs into GL renderers as well
as KMS.
This crucially allows Wayland compositors running on vkms + llvmpipe
to behave much more like on HW GPUs/display engines, making CI testing
more robust and intuitive.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37305>
The main intention is to allow to pass dmabuf handles, however as its
type differs depending on platform, just pass the whole whandle.
Also make use of it in llvmpipe_resource_from_handle(), in preparation
for the next commit.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37305>
It seems like everything involving the multithreaded ES2 tests is prone
to flaking out with a segfault. Just wildcard the lot until we can
bottom out what's actually going on.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37305>
In case the source or destination were previously written
through L2, we need to writeback L2 to avoid the CP DMA accessing
stale data.
However, as the CP DMA doesn't write L2 either, an invalidation
is also needed to make sure other clients don't access stale data
when they read it through L2 after the CP DMA is complete.
Doing an invalidation before the CP DMA operation should take
care of both.
Additionally, radv_src_access_flush also invalidates L2 before
the copied data can be read.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36820>
The current code assumes 2M and 4k pages. If an allocation request
is larger than 2M, allocation will be aligned to 2M, otherwise to
4k.
The new code is informed by pgsize_bitmap. The allocation is
aligned to a particular page boundary, if the request is at least
as large as that page boundary. Note that given
pgsize_bitmap = PGSIZE_4K | PGSIZE_2M
2M requests will now be aligned to a 2M boundary, rather than 4k,
which is the case with the current code.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37288>
This function returns the page size of the VM that we're using. The
GPU page size might be different from what the host process uses.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37288>
pgsize_bitmap specifies the page sizes supported by the VM.
Aligning the mappings to huge-r pages can increase access perf.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37288>
When the host process is 32-bit, size_t can not express all of the
device address space. Note that there's still a lot of code that
uses size_t for device sizes remaining. Cleaning that up is left
for future MRs.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37288>
This code cannot be reached, since we already checked for
`!valid_samples` and returned `VK_ERROR_FEATURE_NOT_PRESET` in that case
above, and have not altered `valid_samples` since.
Fixes: d5da6980d3 ("anv/sparse: don't support depth/stencil with sparse")
CID: 1662063
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37341>
Renamed brw_nir_trig_workarounds.py to brw_nir_workarounds.py to reflect
its expanded scope beyond just trignometric workarounds.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36990>
Added a workaround for a known shader in Horizon Forbidden West that causes
visual corruption on Intel anv driver. The fix clamps fsqrt inputs using
fmax(x, 1e-12) to avoid invalid values. Integrated the workaround via
brw_nir_apply_sqrt_workarounds() and applied it conditionally in the Vulkan
pipeline based on the shader's BLAKE3 hash.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12555
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36990>