radeonsi: fix crash while binding a NULL constant buffer
authorMarek Olšák <maraeo@gmail.com>
Thu, 21 Mar 2013 18:29:29 +0000 (19:29 +0100)
committerMarek Olšák <maraeo@gmail.com>
Tue, 26 Mar 2013 00:28:18 +0000 (01:28 +0100)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index 7eac477327ac737d12e614175604651fc2fc26a9..bdd41b455344a70a1699d9e5cdf8f5e15ec7de96 100644 (file)
@@ -2491,7 +2491,7 @@ static void si_set_constant_buffer(struct pipe_context *ctx, uint shader, uint i
        /* Note that the state tracker can unbind constant buffers by
         * passing NULL here.
         */
-       if (cb == NULL)
+       if (cb == NULL || (!cb->buffer && !cb->user_buffer))
                return;
 
        pm4 = CALLOC_STRUCT(si_pm4_state);