gallium: implement compute pbo download
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 5 Aug 2021 19:28:52 +0000 (15:28 -0400)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 18 Nov 2021 13:00:07 +0000 (08:00 -0500)
commite7b95619596167025d26f07efb04dc5bfd5e9aee
treea9c128cd87b0df57e8cbabb51408cf893bbdec7b
parented65b5e8399fc59fe011381338cc06bc3f7ec5d6
gallium: implement compute pbo download

this reworks PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER into an
enum as PIPE_CAP_TEXTURE_TRANSFER_MODES, enabling drivers to choose
a (sometimes) faster, compute-based download mechanism based on a new
pipe_screen hook

compute pbo download is implemented using shaders with a prolog to convert
the input format to generic rgb float values, then an epilog to convert
to the output value. the prolog and epilog are determined based on a vec4
of packed ubo data which is dynamically updated based on the API usage

currently, the only known limitations are:
* GL_ARB_texture_cube_map_array is broken somehow (and disabled)
* AMD hardware somehow can't do depth readback?

otherwise it should work for every possible case

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11984>
docs/gallium/screen.rst
src/gallium/include/pipe/p_defines.h
src/mesa/meson.build
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_context.h
src/mesa/state_tracker/st_pbo.c
src/mesa/state_tracker/st_pbo.h
src/mesa/state_tracker/st_pbo_compute.c [new file with mode: 0644]