mesa/src
Kenneth Graunke bd6120f562 tnl: Try not to botch index buffer munging when start > 0.
Commit 4c751ad67a (vbo/dlist: use a shared
index buffer) caused multiple draws to use the same index buffer, and
began setting the primitive's `start` field to the offset needed to
access the right portion of the index buffer.

Unfortunately, t_rebase_prims completely botches handling this case.
Say for example we had start = 40, min_index = 6, max_index = 11.
The actual indexes in the buffer are ib[40..45].  t_rebase_prims,
however, would allocate an index buffer containing only 6 elements,
and populate them with <ib[0..5] - min_index>.  For one, this reads
the wrong source data, leading to garbage index values.  For another,
it stores the new index buffer in the wrong spot, so drawing will try
and read elements [40..45] of an array of length 6, and crash.

This patch makes t_rebase_prims allocate a larger index buffer, with
the blank space at the beginning, and try to copy the correct section
of index buffer data over.  This only works if `start` is the same for
all primitives, however, so if we detect different ones, we recurse
to rebase and call draw() separately for each different start value.

Fixes: 4c751ad67a ("vbo/dlist: use a shared index buffer")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4082
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8522>
2021-01-20 00:29:04 +00:00
..
amd radv: flush L2 for images affected by the pipe misaligned issue on GFX10+ 2021-01-19 19:51:44 +00:00
android_stub egl/android: implement image cleanup callback 2020-12-15 06:05:27 +00:00
broadcom v3dv: use PIPE_TIMEOUT_INFINITE 2021-01-19 11:54:22 +01:00
compiler glsl: only expose int64 atomics when extension is enabled 2021-01-16 18:21:03 +00:00
drm-shim drm-shim: Fix unused variable warnings from asserts in release build. 2020-08-28 22:45:08 +00:00
egl egl/dri2: fix image loaderPrivate type mixup 2020-12-24 00:05:15 +09:00
etnaviv etnaviv, v3d: Fix valgrind include paths. 2020-12-15 19:39:29 +00:00
freedreno turnip: disable UBWC on Z24_S8 MSAA images on A630 2021-01-18 17:32:21 +01:00
gallium r600/sfn: Remove StoreMerger unused member b. 2021-01-19 15:06:25 -08:00
gbm egl: implement EGL_EXT_protected_surface support 2020-11-02 10:15:47 +01:00
getopt
glx glx/tests: Fix leaks in the unit tests. 2020-12-15 19:39:29 +00:00
gtest
hgl hgl: Major refactor and cleanup 2021-01-09 20:51:35 -06:00
imgui
intel intel/fs: Separate SLM size calculation from encoding 2021-01-19 21:49:04 +00:00
loader loader: Print dlerror() output in the failure message 2020-11-04 21:45:37 +00:00
mapi glapi: fix unused-function warning 2020-12-01 16:51:01 +00:00
mesa tnl: Try not to botch index buffer munging when start > 0. 2021-01-20 00:29:04 +00:00
microsoft nir: replace .lower_sub with .has_fsub and .has_isub 2021-01-11 19:13:51 +00:00
nouveau nouveau: add drm-shim support 2021-01-11 22:45:01 +00:00
panfrost pan/bi: Iterate from zero when setting RA interference 2021-01-18 20:49:45 +00:00
util Fall back on clock_gettime when timespec_get() is unavailable 2021-01-16 00:14:46 +00:00
virtio virgl: Enable GL_EXT_texture_sRGB_RG8 2021-01-04 21:19:35 +00:00
vulkan anv: Add a trivial implementation of VK_KHR_deferred_host_operation 2021-01-18 10:09:51 -06:00
meson.build nouveau: add drm-shim support 2021-01-11 22:45:01 +00:00
SConscript driconf: drop now unused translation facility 2020-06-22 21:50:12 +00:00