freedreno: update valid_buffer_range for SO buffers
authorRob Clark <robdclark@gmail.com>
Fri, 1 Jul 2016 02:52:23 +0000 (22:52 -0400)
committerRob Clark <robdclark@gmail.com>
Sat, 2 Jul 2016 12:58:50 +0000 (08:58 -0400)
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_state.c

index 53ea39b3d2923e83317e3fbffac13ba36a3b6841..252d153e341d6971154125df8846072050e4fe03 100644 (file)
@@ -316,6 +316,7 @@ fd_create_stream_output_target(struct pipe_context *pctx,
                unsigned buffer_size)
 {
        struct pipe_stream_output_target *target;
+       struct fd_resource *rsc = fd_resource(prsc);
 
        target = CALLOC_STRUCT(pipe_stream_output_target);
        if (!target)
@@ -328,6 +329,10 @@ fd_create_stream_output_target(struct pipe_context *pctx,
        target->buffer_offset = buffer_offset;
        target->buffer_size = buffer_size;
 
+       assert(rsc->base.b.target == PIPE_BUFFER);
+       util_range_add(&rsc->valid_buffer_range,
+               buffer_offset, buffer_offset + buffer_size);
+
        return target;
 }