llvmpipe: unmap display target of shader image/sampler
Revive hooks for cleaning up shader sampler and image data and when
finalizing llvmpipe_draw_vbo. In cleanup routines, for any sampler or
image that was set up with displaytarget_map, call displaytarget_unmap.
This fixes leaks of mmap calls of the underlying displaytarget
resources.
v2 (Daniel Stone):
- Use a single cleanup function for sampler/image to simplify patchset
v3 (Emil Velikov):
- use llvmpipe_resource_[un]map instead of open-coding through
winsys
v4:
- check tex/image for NULL before calling into
llvmpipe_resource_unmap (fixes dEQP crash of llvmpipe runner)
Signed-off-by: Heinrich Fink <hfink@snap.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11741>