st/mesa: set blend state for PBO readbacks
authorMarek Olšák <marek.olsak@amd.com>
Wed, 22 Feb 2017 20:39:55 +0000 (21:39 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 24 Feb 2017 23:03:09 +0000 (00:03 +0100)
v2: restore the state

Cc: 13.0 17.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_cb_readpixels.c

index 5ce2421bbfbb86a40c0644ff105f20cf9593d075..78ea0c7bf8ccaf2c438b638eea2b8701945a02cc 100644 (file)
@@ -131,6 +131,7 @@ try_pbo_readpixels(struct st_context *st, struct st_renderbuffer *strb,
    cso_save_state(cso, (CSO_BIT_FRAGMENT_SAMPLER_VIEWS |
                         CSO_BIT_FRAGMENT_SAMPLERS |
                         CSO_BIT_FRAGMENT_IMAGE0 |
+                        CSO_BIT_BLEND |
                         CSO_BIT_VERTEX_ELEMENTS |
                         CSO_BIT_AUX_VERTEX_BUFFER_SLOT |
                         CSO_BIT_FRAMEBUFFER |
@@ -213,6 +214,11 @@ try_pbo_readpixels(struct st_context *st, struct st_renderbuffer *strb,
    fb.layers = 1;
    cso_set_framebuffer(cso, &fb);
 
+   /* Any blend state would do. Set this just to prevent drivers having
+    * blend == NULL.
+    */
+   cso_set_blend(cso, &st->pbo.upload_blend);
+
    cso_set_viewport_dims(cso, fb.width, fb.height, invert_y);
 
    if (invert_y)