glthread crash in _mesa_glthread_upload
How to reproduce:
- install Minetest, https://www.minetest.net/
-
mesa_glthread=true minetest
(or replay this trace with glthread enabled: minetest.zip)
Stacktrace:
[0] from 0x00007ffff7a10d94 at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:440
[1] from 0x00007ffff353f7fd in _mesa_glthread_upload+565 at ../src/mesa/main/glthread_bufferobj.c:137
[2] from 0x00007ffff3542417 in upload_vertices+1746 at ../src/mesa/main/glthread_draw.c:243
[3] from 0x00007ffff3542417 in draw_elements+2717 at ../src/mesa/main/glthread_draw.c:663
[4] from 0x00007ffff354689a in _mesa_marshal_DrawElements+67 at ../src/mesa/main/glthread_draw.c:985
The crash is caused by the new path added by 7f22e0fd for uploads, but the root cause is in c9c9f57b. This commit does not handle size == GL_BGRA
case which was fine until 7f22e0fd tries to upload the data before the size is corrected.
cc @mareko
Edited by Pierre-Eric Pelloux-Prayer