st/mesa: fix ReadPixels into packed formats with PBO
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 7 Nov 2016 16:49:24 +0000 (17:49 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 16 Nov 2016 09:31:25 +0000 (10:31 +0100)
When using the GPU download path, we bind the PBO as a buffer texture,
so call is_format_supported accordingly. On radeonsi, this means that
GPU downloads aren't used for UNSIGNED_SHORT_5_6_5 destinations, for
example.

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pbo.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
src/mesa/state_tracker/st_cb_readpixels.c

index b79f1062a19b9e657c63773dc1d959d6a2eb5717..cab6abef3237141b86c58d79f5a6810073f21505 100644 (file)
@@ -112,8 +112,7 @@ try_pbo_readpixels(struct st_context *st, struct st_renderbuffer *strb,
    if (texture->nr_samples > 1)
       return false;
 
-   if (!screen->is_format_supported(screen, dst_format, PIPE_TEXTURE_2D,
-                                    texture->nr_samples,
+   if (!screen->is_format_supported(screen, dst_format, PIPE_BUFFER, 0,
                                     PIPE_BIND_SHADER_IMAGE))
       return false;