[Mesa-dev] [PATCH] st/mesa: Fix recurring surfaceless contexts

2012-01-24 Thread Benjamin Franzke
A current incomplete framebuffer was incorrectly used as a
st_framebuffer. When accessing st_framebuffer childs bad things happen:
e.g. st_framebuffer::iface was used to check whether its an incomplete
fb, instead we need to compare st_framebuffer::Base against
mesa_get_incomplete_framebuffer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44919
Note: This is a candidate for the 8.0 branch.
---
 src/mesa/state_tracker/st_manager.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_manager.c 
b/src/mesa/state_tracker/st_manager.c
index 63920a3..7efc173 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -688,7 +688,9 @@ st_framebuffer_reuse_or_create(struct gl_framebuffer *fb,
 {
struct st_framebuffer *cur = st_ws_framebuffer(fb), *stfb = NULL;
 
-   if (cur  cur-iface == stfbi) {
+   /* dummy framebuffers cant be used as st_framebuffer */
+   if (cur  cur-Base != _mesa_get_incomplete_framebuffer() 
+   cur-iface == stfbi) {
   /* reuse the current stfb */
   st_framebuffer_reference(stfb, cur);
}
@@ -779,7 +781,7 @@ st_manager_flush_frontbuffer(struct st_context *st)
   return;
 
/* never a dummy fb */
-   assert(stfb-iface);
+   assert(stfb-Base != _mesa_get_incomplete_framebuffer());
stfb-iface-flush_front(stfb-iface, ST_ATTACHMENT_FRONT_LEFT);
 }
 
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] st/mesa: Fix recurring surfaceless contexts

2012-01-24 Thread Brian Paul
On Tue, Jan 24, 2012 at 9:03 AM, Benjamin Franzke
benjaminfran...@googlemail.com wrote:
 A current incomplete framebuffer was incorrectly used as a
 st_framebuffer. When accessing st_framebuffer childs bad things happen:
 e.g. st_framebuffer::iface was used to check whether its an incomplete
 fb, instead we need to compare st_framebuffer::Base against
 mesa_get_incomplete_framebuffer.

 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44919
 Note: This is a candidate for the 8.0 branch.
 ---
  src/mesa/state_tracker/st_manager.c |    6 --
  1 files changed, 4 insertions(+), 2 deletions(-)

Looks OK to me.

Reviewed-by: Brian Paul bri...@vmware.com
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev