mesa/src
Nicolai Hähnle 637240d824 st/mesa: guard sampler views changes with a mutex
Some locking is unfortunately required, because well-formed GL programs
can have multiple threads racing to access the same texture, e.g.: two
threads/contexts rendering from the same texture, or one thread destroying
a context while the other is rendering from or modifying a texture.

Since even the simple mutex caused noticable slowdowns in the piglit
drawoverhead micro-benchmark, this patch uses a slightly more involved
approach to keep locks out of the fast path:

- the initial lookup of sampler views happens without taking a lock
- a per-texture lock is only taken when we have to modify the sampler
  view(s)
- since each thread mostly operates only on the entry corresponding to
  its context, the main issue is re-allocation of the sampler view array
  when it needs to be grown, but the old copy is not freed

Old copies of the sampler views array are kept around in a linked list
until the entire texture object is deleted. The total memory wasted
in this way is roughly equal to the size of the current sampler views
array.

Fixes non-deterministic memory corruption in some
dEQP-EGL.functional.sharing.gles2.multithread.* tests, e.g.
dEQP-EGL.functional.sharing.gles2.multithread.simple.images.texture_source.create_texture_render

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-11-09 11:50:55 +01:00
..
amd ac/nir: add support for all intrinsics. (v2) 2017-11-09 01:25:59 +00:00
broadcom broadcom/vc5: Remove unused v3d_compiler.c 2017-11-08 18:30:47 +00:00
compiler glsl: Make #pragma STDGL invariant(all) only modify outputs. 2017-11-08 23:11:48 -08:00
egl egl/android: add a note about .swap_buffers_with_damage 2017-11-08 14:42:12 +00:00
gallium gallium: clarify the constraints on sampler_view_destroy 2017-11-09 11:50:54 +01:00
gbm wayland-drm: static inline wayland_drm_buffer_get 2017-11-08 14:40:12 +00:00
getopt
glx meson: standardize .so version to major.minor.patch 2017-11-07 10:47:20 +00:00
gtest meson: convert gtest to an internal dependency 2017-10-03 10:02:08 -07:00
hgl
intel intel/nir: Use the correct indirect lowering masks in link_shaders 2017-11-08 20:10:04 -08:00
loader radeonsi: remove unused field in the PCI ID table 2017-11-07 17:26:36 +01:00
mapi meson: drop GLESv1 .so version back to 1.0.0 2017-11-07 10:47:20 +00:00
mesa st/mesa: guard sampler views changes with a mutex 2017-11-09 11:50:55 +01:00
util u_queue: add a futex-based implementation of fences 2017-11-09 11:37:39 +01:00
vulkan vulkan: Update headers and registry to 1.0.64 2017-10-26 05:17:57 +10:00
git_sha1.h.in meson: Build i965 and dri stack 2017-10-09 13:42:44 -07:00
Makefile.am wayland-drm: static inline wayland_drm_buffer_get 2017-11-08 14:40:12 +00:00
meson.build meson: build classic osmesa 2017-10-27 11:06:45 -07:00
SConscript buildsys: move file regeneration logic to the script itself 2017-10-27 13:38:37 +01:00