[Mesa-dev] [PATCH] llvmpipe: fix bogus assertions for buffer surfaces

sroland at vmware.com sroland at vmware.com
Fri May 31 12:35:20 PDT 2013


From: Roland Scheidegger <sroland at vmware.com>

One of the assertion made no sense for buffer rendertargets
(due to the union), so drop it. (The same assertion is present already in
the path for texture surfaces later.).
---
 src/gallium/drivers/llvmpipe/lp_texture.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c
index a02ddbc..b959e82 100644
--- a/src/gallium/drivers/llvmpipe/lp_texture.c
+++ b/src/gallium/drivers/llvmpipe/lp_texture.c
@@ -485,7 +485,6 @@ llvmpipe_create_surface(struct pipe_context *pipe,
 {
    struct pipe_surface *ps;
 
-   assert(surf_tmpl->u.tex.level <= pt->last_level);
    if (!(pt->bind & (PIPE_BIND_DEPTH_STENCIL | PIPE_BIND_RENDER_TARGET)))
       debug_printf("Illegal surface creation without bind flag\n");
 
@@ -513,7 +512,8 @@ llvmpipe_create_surface(struct pipe_context *pipe,
          ps->u.buf.first_element = surf_tmpl->u.buf.first_element;
          ps->u.buf.last_element = surf_tmpl->u.buf.last_element;
          assert(ps->u.buf.first_element <= ps->u.buf.last_element);
-         assert(ps->u.buf.last_element < ps->width);
+         assert(util_format_get_blocksize(surf_tmpl->format) *
+                ps->u.buf.last_element < pt->width0);
       }
    }
    return ps;
-- 
1.7.9.5


More information about the mesa-dev mailing list