diff options
author | Zack Rusin <[email protected]> | 2014-03-06 18:43:44 -0500 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2014-03-07 12:49:33 -0500 |
commit | dfa25ea5cd19d5a050a1c94bd7370a2259b9f007 (patch) | |
tree | 8ce2db3ceab01311df710c2d7f307f5b708312c5 /src/gallium/drivers/radeon | |
parent | 7d5903980ed7c4405e20dbc4f5ade9d202c559cb (diff) |
gallium: allow setting of the internal stream output offset
D3D10 allows setting of the internal offset of a buffer, which is
in general only incremented via actual stream output writes. By
allowing setting of the internal offset draw_auto is capable
of rendering from buffers which have not been actually streamed
out to. Our interface didn't allow. This change functionally
shouldn't make any difference to OpenGL where instead of an
append_bitmask you just get a real array where -1 means append
(like in D3D) and 0 means do not append.
Signed-off-by: Zack Rusin <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_streamout.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index cbd3f0e8c64..a178e9c5719 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -413,7 +413,7 @@ void r600_streamout_buffers_dirty(struct r600_common_context *rctx); void r600_set_streamout_targets(struct pipe_context *ctx, unsigned num_targets, struct pipe_stream_output_target **targets, - unsigned append_bitmask); + unsigned *offset); void r600_emit_streamout_end(struct r600_common_context *rctx); void r600_streamout_init(struct r600_common_context *rctx); diff --git a/src/gallium/drivers/radeon/r600_streamout.c b/src/gallium/drivers/radeon/r600_streamout.c index adc11e005d7..b6cf8584e2a 100644 --- a/src/gallium/drivers/radeon/r600_streamout.c +++ b/src/gallium/drivers/radeon/r600_streamout.c @@ -108,10 +108,11 @@ void r600_streamout_buffers_dirty(struct r600_common_context *rctx) void r600_set_streamout_targets(struct pipe_context *ctx, unsigned num_targets, struct pipe_stream_output_target **targets, - unsigned append_bitmask) + const unsigned *offsets) { struct r600_common_context *rctx = (struct r600_common_context *)ctx; unsigned i; + unsigned append_bitmask = 0; /* Stop streamout. */ if (rctx->streamout.num_targets && rctx->streamout.begin_emitted) { @@ -122,6 +123,8 @@ void r600_set_streamout_targets(struct pipe_context *ctx, for (i = 0; i < num_targets; i++) { pipe_so_target_reference((struct pipe_stream_output_target**)&rctx->streamout.targets[i], targets[i]); r600_context_add_resource_size(ctx, targets[i]->buffer); + if (offsets[i] == ((unsigned)-1)) + append_bitmask |= 1 << i; } for (; i < rctx->streamout.num_targets; i++) { pipe_so_target_reference((struct pipe_stream_output_target**)&rctx->streamout.targets[i], NULL); |