diff options
author | Roland Scheidegger <[email protected]> | 2014-05-30 00:37:17 +0200 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-06-06 17:06:55 -0700 |
commit | 3aaae6056e03f45d0229ff2a0b52efb3abf0fab7 (patch) | |
tree | f4ceda9cacf67290c4d1cbd34c56582ca7b3c4fa /src | |
parent | 8b71741222cd8e9551d3e4356f0a2bbcb1bd1251 (diff) |
llvmpipe: fix crash when not all attachments are populated in a fb
Framebuffers can have NULL attachments since a while. llvmpipe handled
that properly for lp_rast_shade_quads_mask but it seems the change didn't
make it to lp_rast_shade_tile.
This fixes piglit fbo-drawbuffers-none test (though I need to increase
the FB_SIZE from 32 to 256 so the tris cover some tiles fully).
https://bugs.freedesktop.org/show_bug.cgi?id=79421
Cc: "10.1 10.2" <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>
(cherry picked from commit 576868140bbb1abd177e7fd122720883d773137e)
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_rast.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index d50ee482142..f7c5b03b8d1 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -312,9 +312,15 @@ lp_rast_shade_tile(struct lp_rasterizer_task *task, /* color buffer */ for (i = 0; i < scene->fb.nr_cbufs; i++){ - stride[i] = scene->cbufs[i].stride; - color[i] = lp_rast_get_unswizzled_color_block_pointer(task, i, tile_x + x, - tile_y + y, inputs->layer); + if (scene->fb.cbufs[i]) { + stride[i] = scene->cbufs[i].stride; + color[i] = lp_rast_get_unswizzled_color_block_pointer(task, i, tile_x + x, + tile_y + y, inputs->layer); + } + else { + stride[i] = 0; + color[i] = NULL; + } } /* depth buffer */ |