OSDN Git Service

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 7eac477..bdd41b4 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);