st/mesa: Accelerate PBO uploads

Graphics / Mesa 3D Graphics Library / Mesa - Fredrik Höglund [kde.org] - 3 February 2016 07:10 UTC

Create a PIPE_BUFFER sampler view on the pixel-unpack buffer, and draw the image on the texture with a fragment shader that maps fragment coordinates to buffer coordinates.

Modifications by Nicolai Hähnle:- various cleanups and fixes (e.g. error handling, corner cases)- split try_pbo_upload into two functions, which will allow code to be shared with compressed texture uploads- modify the source format selection to only test for support against the PIPE_BUFFER target

v2:- update handling of TGSI_SEMANTIC_POSITION for recent changes in master- MaxTextureBufferSize is number of texels, not bytes (Ilia Mirkin)- only enable when integers are supported (Marek Olšák)- try harder to hit the TextureBufferOffsetAlignment- remove unnecessary MOV from the fragment shader

757071c st/mesa: Accelerate PBO uploads
src/mesa/state_tracker/st_cb_texture.c | 890 +++++++++++++++++++++++++++++++-
src/mesa/state_tracker/st_cb_texture.h | 5 +
src/mesa/state_tracker/st_context.c | 2 +
src/mesa/state_tracker/st_context.h | 10 +
4 files changed, 898 insertions(+), 9 deletions(-)

Upstream: cgit.freedesktop.org


  • Share