[Mesa-dev] [PATCH] etnaviv: Allow clearing constant buffer using buffer==NULL user_buffer==NULL

Wladimir J. van der Laan laanwj at gmail.com
Sat Oct 28 13:57:14 UTC 2017


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 at gmail.com>
---
 src/gallium/drivers/etnaviv/etnaviv_state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c b/src/gallium/drivers/etnaviv/etnaviv_state.c
index 34bcb19..91f12f3 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_state.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_state.c
@@ -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 == NULL && cb->user_buffer == NULL))
       return;
 
    /* there is no support for ARB_uniform_buffer_object */
-- 
2.7.4



More information about the mesa-dev mailing list