mesa/src/broadcom
Juan A. Suarez Romero ec101645ff
Some checks failed
macOS-CI / macOS-CI (dri) (push) Has been cancelled
macOS-CI / macOS-CI (xlib) (push) Has been cancelled
vc4: fix unwanted buffer release on uploader
When converting the index buffer from 4-bytes to 2-bytes, we use the
uploader for the job. Since commit b3133e250e we do an uploader alloc
ref, which releases the uploader buffer if there is no enough space,
creating a new one.

The problem happens when we also need this buffer because it is the one
containing the index buffer to convert. This happens, for instance, if
we need to convert the primitives because they are not supported (e.g.,
converting quads to triangles), as this is done
also using the uploader.

The solution is to ensure the uploader's buffer has an extra reference
so when released, it is not destroyed. This can easily achieved by
calling first pipe_buffer_map_range(), which is required to access the
buffer, and it increases the references.

This fixes `spec@!opengl 1.1@longprim`.

Fixes: b3133e250e ("gallium: add pipe_context::resource_release to eliminate buffer refcounting")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
(cherry picked from commit 48c086cb42)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:35 +02:00
..
ci vc4: fix unwanted buffer release on uploader 2026-04-01 11:45:35 +02:00
cle broadcom/cle: bump up gen version for v3d 2026-02-04 18:39:35 +01:00
clif build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
common broadcom/common: fix V3D 7.1 TFU ICFG IFORMAT values 2026-04-01 11:45:33 +02:00
compiler nir/lower_blend: Move the format to nir_lower_blend_rt 2026-01-19 21:33:14 +00:00
drm-shim v3d/drm-shim: add support for multisync 2025-08-04 08:06:36 +02:00
ds mesa: replace most occurrences of getenv() with os_get_option() 2025-11-06 04:36:13 +00:00
perfcntrs broadcom: Add perfcount library 2024-12-02 14:13:24 +00:00
qpu broadcom/compiler: enable umul24 and imul24 ALU opcodes 2025-11-26 13:32:39 +00:00
simulator treewide: use UTIL_DYNARRAY_INIT 2025-11-04 13:39:48 +00:00
vulkan v3dv: improve barrier handling for secondary command buffers 2026-01-21 07:37:49 +00:00
.editorconfig
meson.build broadcom: Add perfetto data source 2024-12-13 12:29:11 +00:00