mesa/st: Handle empty frame-buffers without asserting.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 24 Apr 2014 13:48:37 +0000 (14:48 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 24 Apr 2014 13:48:37 +0000 (14:48 +0100)
Fixes assertion failures with radeonsi.

Tested-by: Marek Olšák <maraeo@gmail.com>
src/mesa/state_tracker/st_atom_framebuffer.c

index a17417c3590a1c3ae08fcaaac4f5f9f0fbcdb020..eb5f783cecbd32733d34a03074311fc60a6fbdd9 100644 (file)
@@ -147,11 +147,10 @@ update_framebuffer_state( struct st_context *st )
    }
 #endif
 
-   /* _mesa_test_framebuffer_completeness refuses framebuffers with no
-    * attachments, so this should never happen.
-    */
-   assert(framebuffer->width  != UINT_MAX);
-   assert(framebuffer->height != UINT_MAX);
+   if (framebuffer->width == UINT_MAX)
+      framebuffer->width = 0;
+   if (framebuffer->height == UINT_MAX)
+      framebuffer->height = 0;
 
    cso_set_framebuffer(st->cso_context, framebuffer);
 }