Mesa (master): llvmpipe: initialize default fb correctly in setup

Roland Scheidegger sroland at kemper.freedesktop.org
Fri Jun 23 22:18:55 UTC 2017


Module: Mesa
Branch: master
Commit: 8bfe451ed30918244618608871423b2a72cf9767
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8bfe451ed30918244618608871423b2a72cf9767

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Fri Jun 23 19:40:18 2017 +0200

llvmpipe: initialize default fb correctly in setup

If lp_setup_bind_framebuffer() is never called, then setup fb x1/y1 was not
correctly initialized. This can happen if there's never a fb set - both
cso and llvmpipe would consider setting this with no cbufs and no zsbuf a
redundant change and therefore it would never get set.
We rely on this setup fb rect being initialized correctly for the tri intersect
tests, throwing away tris which don't intersect. Not initializing it meant
we'd then say it intersected, and we'd try to bin that despite that we have
no actual tiles to bin it to, leading to assertion failures (pretty harmless
since tile 0/0 always exists nevertheless as tiles are statically allocated,
albeit that should change at some point).
(Note probably not an issue with gl state tracker)

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>

---

 src/gallium/drivers/llvmpipe/lp_setup.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index 38d91385cf..32387ab553 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -1347,6 +1347,10 @@ lp_setup_create( struct pipe_context *pipe,
    
    setup->dirty = ~0;
 
+   /* Initialize empty default fb correctly, so the rect is empty */
+   setup->framebuffer.x1 = -1;
+   setup->framebuffer.y1 = -1;
+
    return setup;
 
 no_scenes:




More information about the mesa-commit mailing list