etnaviv: Allow clearing constant buffer using buffer==NULL user_buffer==NULL
authorWladimir J. van der Laan <laanwj@gmail.com>
Sat, 28 Oct 2017 13:57:14 +0000 (15:57 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Thu, 2 Nov 2017 10:03:30 +0000 (11:03 +0100)
Prevents an assertion when using GALLIUM_HUD with ioquake3,
when cso_restore_constant_buffer_slot0 restores an empty
constant buffer in slot 0.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
src/gallium/drivers/etnaviv/etnaviv_state.c

index 34bcb1906991c198cd3e2070a076bf662cebbbbc..ba62c5f194a2aedd517de30465993b35c40984fa 100644 (file)
@@ -89,7 +89,7 @@ etna_set_constant_buffer(struct pipe_context *pctx,
 
    /* Note that the state tracker can unbind constant buffers by
     * passing NULL here. */
-   if (unlikely(!cb))
+   if (unlikely(!cb || (!cb->buffer && !cb->user_buffer)))
       return;
 
    /* there is no support for ARB_uniform_buffer_object */