From: Nicolai Hähnle <[email protected]>

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.
---
 src/mesa/state_tracker/st_cb_readpixels.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_readpixels.c 
b/src/mesa/state_tracker/st_cb_readpixels.c
index b79f106..cab6abe 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -105,22 +105,21 @@ try_pbo_readpixels(struct st_context *st, struct 
st_renderbuffer *strb,
    struct pipe_resource *texture = strb->texture;
    const struct util_format_description *desc;
    struct st_pbo_addresses addr;
    struct pipe_framebuffer_state fb;
    enum pipe_texture_target view_target;
    bool success = false;
 
    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;
 
    desc = util_format_description(dst_format);
 
    /* Compute PBO addresses */
    addr.bytes_per_pixel = desc->block.bits / 8;
    addr.xoffset = x;
    addr.yoffset = y;
    addr.width = width;
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to