radeonsi: track constant buffer bind history in si_pipe_set_constant_buffer
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 21 Sep 2018 15:19:34 +0000 (17:19 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 19 Dec 2018 11:01:54 +0000 (12:01 +0100)
Other callers of si_set_constant_buffer don't need it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c

index f89692c87f81e2793c2e0474e3831a02a3e39d92..71ae00c53cb9de09d34c65e11cec072052d5f090 100644 (file)
@@ -1237,8 +1237,6 @@ static void si_set_constant_buffer(struct si_context *sctx,
                } else {
                        pipe_resource_reference(&buffer, input->buffer);
                        va = r600_resource(buffer)->gpu_address + input->buffer_offset;
-                       /* Only track usage for non-user buffers. */
-                       r600_resource(buffer)->bind_history |= PIPE_BIND_CONSTANT_BUFFER;
                }
 
                /* Set the descriptor. */
@@ -1284,6 +1282,9 @@ static void si_pipe_set_constant_buffer(struct pipe_context *ctx,
                return;
        }
 
+       if (input && input->buffer)
+               r600_resource(input->buffer)->bind_history |= PIPE_BIND_CONSTANT_BUFFER;
+
        slot = si_get_constbuf_slot(slot);
        si_set_constant_buffer(sctx, &sctx->const_and_shader_buffers[shader],
                               si_const_and_shader_buffer_descriptors_idx(shader),