Mesa (11.2): st/mesa: fix glReadBuffer() assertion failure

Emil Velikov evelikov at kemper.freedesktop.org
Thu Apr 14 19:39:07 UTC 2016


Module: Mesa
Branch: 11.2
Commit: f03afb6200cf51a2f2b014b6965f1f1bcde265b2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f03afb6200cf51a2f2b014b6965f1f1bcde265b2

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Apr  7 17:38:41 2016 -0600

st/mesa: fix glReadBuffer() assertion failure

If the first call in a GL app is glReadPixels(GL_FRONT) we'd fail the
assert(st->ctx->FragmentProgram._Current) at st_atom_shader.c:114 in
update_fp().

This is because we were calling st_validate_state() without first
updating Mesa state with _mesa_update_state().

The regression came from commit 83b589301f4a150f4 "st/mesa: fix
frontbuffer glReadPixels regressions".

The new piglit gl-1.0-simple-readbuffer test exercises this.

Cc: "11.1 11.2" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
(cherry picked from commit 4420f189b6d6dd68b517cd73dfdf3775d7d0f580)

---

 src/mesa/state_tracker/st_cb_fbo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index ff570e0..456ad83 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -40,6 +40,7 @@
 #include "main/glformats.h"
 #include "main/macros.h"
 #include "main/renderbuffer.h"
+#include "main/state.h"
 
 #include "pipe/p_context.h"
 #include "pipe/p_defines.h"
@@ -729,6 +730,7 @@ st_ReadBuffer(struct gl_context *ctx, GLenum buffer)
        fb->Attachment[fb->_ColorReadBufferIndex].Type == GL_NONE) {
       /* add the buffer */
       st_manager_add_color_renderbuffer(st, fb, fb->_ColorReadBufferIndex);
+      _mesa_update_state(ctx);
       st_validate_state(st, ST_PIPELINE_RENDER);
    }
 }




More information about the mesa-commit mailing list