[Mesa-dev] [PATCH 2/3] llvmpipe: don't assert when trying to render to surfaces with multiple layers

sroland at vmware.com sroland at vmware.com
Wed Mar 13 14:12:06 PDT 2013


From: Roland Scheidegger <sroland at vmware.com>

instead just warn when creating the surface, rendering will simply happen
to first layer.
---
 src/gallium/drivers/llvmpipe/lp_scene.c   |    2 --
 src/gallium/drivers/llvmpipe/lp_texture.c |    3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c
index a0912eb..a888586 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.c
+++ b/src/gallium/drivers/llvmpipe/lp_scene.c
@@ -157,7 +157,6 @@ lp_scene_begin_rasterization(struct lp_scene *scene)
    for (i = 0; i < scene->fb.nr_cbufs; i++) {
       struct pipe_surface *cbuf = scene->fb.cbufs[i];
       if (llvmpipe_resource_is_texture(cbuf->texture)) {
-         assert(cbuf->u.tex.first_layer == cbuf->u.tex.last_layer);
          scene->cbufs[i].stride = llvmpipe_resource_stride(cbuf->texture,
                                                            cbuf->u.tex.level);
 
@@ -178,7 +177,6 @@ lp_scene_begin_rasterization(struct lp_scene *scene)
 
    if (fb->zsbuf) {
       struct pipe_surface *zsbuf = scene->fb.zsbuf;
-      assert(zsbuf->u.tex.first_layer == zsbuf->u.tex.last_layer);
       scene->zsbuf.stride = llvmpipe_resource_stride(zsbuf->texture, zsbuf->u.tex.level);
       scene->zsbuf.blocksize = 
          util_format_get_blocksize(zsbuf->texture->format);
diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c
index 9de05e7..99bd6d3 100644
--- a/src/gallium/drivers/llvmpipe/lp_texture.c
+++ b/src/gallium/drivers/llvmpipe/lp_texture.c
@@ -593,6 +593,9 @@ llvmpipe_create_surface(struct pipe_context *pipe,
          ps->u.tex.level = surf_tmpl->u.tex.level;
          ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
          ps->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
+         if (ps->u.tex.first_layer != ps->u.tex.last_layer) {
+            debug_printf("creating surface with multiple layers, rendering to first layer only\n");
+         }
       }
       else {
          /* setting width as number of elements should get us correct renderbuffer width */
-- 
1.7.9.5



More information about the mesa-dev mailing list