llvmpipe: don't assert on illegal surface creation.
authorRoland Scheidegger <sroland@vmware.com>
Fri, 1 Mar 2013 14:32:03 +0000 (15:32 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 2 Mar 2013 01:54:31 +0000 (02:54 +0100)
Since c8eb2d0e829d0d2aea6a982620da0d3cfb5982e2 llvmpipe checks if it's
actually legal to create a surface. The opengl state tracker doesn't quite
obey this so for now just warn instead of assert.
Also warn instead of disabled assert when creating sampler views
(same reasoning).

Addresses https://bugs.freedesktop.org/show_bug.cgi?id=61647.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/drivers/llvmpipe/lp_state_sampler.c
src/gallium/drivers/llvmpipe/lp_texture.c

index 3b31d4ff5d50da51a20dea8beee2d69e71a6602a..7441973bda2308029809b205a17abc499606eb13 100644 (file)
@@ -218,9 +218,8 @@ llvmpipe_create_sampler_view(struct pipe_context *pipe,
     * XXX we REALLY want to see the correct bind flag here but the OpenGL
     * state tracker can't guarantee that at least for texture buffer objects.
     */
-#if 0
-   assert(texture->bind & PIPE_BIND_SAMPLER_VIEW);
-#endif
+   if (!(texture->bind & PIPE_BIND_SAMPLER_VIEW))
+      debug_printf("Illegal sampler view creation without bind flag\n");
 
    if (view) {
       *view = *templ;
index e4ae3c1b65ff1a876da21ba500983e88ca43d02d..9de05e7692657916b2a431d8aa025bae4e5e0db2 100644 (file)
@@ -577,7 +577,8 @@ llvmpipe_create_surface(struct pipe_context *pipe,
    struct pipe_surface *ps;
 
    assert(surf_tmpl->u.tex.level <= pt->last_level);
-   assert(pt->bind & (PIPE_BIND_DEPTH_STENCIL | PIPE_BIND_RENDER_TARGET));
+   if (!(pt->bind & (PIPE_BIND_DEPTH_STENCIL | PIPE_BIND_RENDER_TARGET)))
+      debug_printf("Illegal surface creation without bind flag\n");
 
    ps = CALLOC_STRUCT(pipe_surface);
    if (ps) {