mesa/src
Juan A. Suarez Romero 48c086cb42 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>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40642>
2026-04-01 09:10:26 +00:00
..
amd vulkan: rename VK_EXT_device_fault features 2026-04-01 07:39:37 +00:00
android_stub android_stub: fix missing prototypes issues 2025-12-02 20:03:02 +00:00
asahi nir,treewide: add nir_image_intrinsic_type 2026-03-31 09:10:27 +00:00
broadcom vc4: fix unwanted buffer release on uploader 2026-04-01 09:10:26 +00:00
c11 c11/threads: fix build on c23 2025-11-10 07:01:50 +10:00
compiler vulkan,spirv: update headers 2026-04-01 07:39:37 +00:00
drm-shim drm-shim: handle DRM_CAP_ADDFB2_MODIFIERS 2025-11-24 12:34:08 +00:00
egl meson: Add support for buidling zink + Turnip/KGSL 2026-03-31 15:00:29 +00:00
etnaviv etnaviv/ml: Skip all synthetic tests as we now have several real models 2026-03-23 12:57:09 +00:00
freedreno ci: add api@clgetmemobjectinfo to fails 2026-03-31 17:39:47 +00:00
gallium vc4: fix unwanted buffer release on uploader 2026-04-01 09:10:26 +00:00
gbm gbm: Make documentation for gbm_bo_map more explicit 2025-12-29 10:05:38 +00:00
getopt
gfxstream gfxstream: Fix vkSetDebugUtilsObjectNameEXT crash for unwrapped objects 2026-03-30 17:47:45 +00:00
glx meson: Add support for buidling zink + Turnip/KGSL 2026-03-31 15:00:29 +00:00
gtest
imagination pvr: fix dirty tracking for stencil ops 2026-03-28 19:39:01 +08:00
imgui
intel ci: add api@clgetmemobjectinfo to fails 2026-03-31 17:39:47 +00:00
kosmickrisp kk: Implement VK_KHR_draw_indirect_count as HK does 2026-03-31 11:42:22 +00:00
loader kmsro: wire Zink up as a fallback 2026-03-13 18:54:26 +00:00
mesa treewide: Enable lowering of primitive ID in a bunch of Vulkan drivers 2026-03-25 03:11:56 +00:00
microsoft nir,treewide: add nir_image_intrinsic_type 2026-03-31 09:10:27 +00:00
nouveau nir,treewide: add nir_image_intrinsic_type 2026-03-31 09:10:27 +00:00
panfrost panvk: Advertise VK_KHR_shader_untyped_pointers on v9+ 2026-03-31 11:57:10 +00:00
poly panvk/csf: implement VK_EXT_primitives_generated_query primitive restart 2026-01-21 09:03:34 +00:00
tool intel: Include available counter descriptions in the perfetto counter spec 2026-03-06 08:47:16 +00:00
util util: Add more libdrm stubs 2026-03-31 15:00:29 +00:00
virtio ci/venus: Skip crashing Android CTS test on ANV 2026-03-25 07:51:08 +00:00
vulkan vulkan,spirv: update headers 2026-04-01 07:39:37 +00:00
x11 meson: Add support for buidling zink + Turnip/KGSL 2026-03-31 15:00:29 +00:00
.clang-format util: Add sparse bitset data structure 2025-11-06 21:34:33 +00:00
meson.build gallium/dril: Don't use gbm if there is no gbm configured 2026-02-17 08:24:02 +00:00