* command stream. */
struct r600_atom {
void (*emit)(struct r600_common_context *ctx, struct r600_atom *state);
- unsigned num_dw;
unsigned short id;
};
struct r600_streamout {
struct r600_atom begin_atom;
bool begin_emitted;
- unsigned num_dw_for_end;
unsigned enabled_mask;
unsigned num_targets;
{
struct r600_common_context *rctx = (struct r600_common_context *)ctx;
struct r600_query_hw *rquery = (struct r600_query_hw *)query;
- struct r600_query_buffer *qbuf;
struct r600_atom *atom = &rctx->render_cond_atom;
- /* Compute the size of SET_PREDICATION packets. */
- atom->num_dw = 0;
if (query) {
bool needs_workaround = false;
rctx->render_cond_force_off = old_force_off;
}
-
- if (needs_workaround) {
- atom->num_dw = 5;
- } else {
- for (qbuf = &rquery->buffer; qbuf; qbuf = qbuf->previous)
- atom->num_dw += (qbuf->results_end / rquery->result_size) * 5;
-
- if (rquery->b.type == PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE)
- atom->num_dw *= R600_MAX_STREAMS;
- }
}
rctx->render_cond = query;
*/
num_dw += query->num_cs_dw_end;
}
- /* primitives generated query */
- num_dw += ctx->streamout.enable_atom.num_dw;
/* guess for ZPASS enable or PERFECT_ZPASS_COUNT enable updates */
num_dw += 13;
void si_streamout_buffers_dirty(struct r600_common_context *rctx)
{
- struct r600_atom *begin = &rctx->streamout.begin_atom;
- unsigned num_bufs = util_bitcount(rctx->streamout.enabled_mask);
- unsigned num_bufs_appended = util_bitcount(rctx->streamout.enabled_mask &
- rctx->streamout.append_bitmask);
-
- if (!num_bufs)
+ if (!rctx->streamout.enabled_mask)
return;
- rctx->streamout.num_dw_for_end =
- 12 + /* flush_vgt_streamout */
- num_bufs * 11; /* STRMOUT_BUFFER_UPDATE, BUFFER_SIZE */
-
- begin->num_dw = 12; /* flush_vgt_streamout */
- begin->num_dw += num_bufs * 4; /* SET_CONTEXT_REG */
- begin->num_dw +=
- num_bufs_appended * 8 + /* STRMOUT_BUFFER_UPDATE */
- (num_bufs - num_bufs_appended) * 6; + /* STRMOUT_BUFFER_UPDATE */
-
- rctx->set_atom_dirty(rctx, begin, true);
-
+ rctx->set_atom_dirty(rctx, &rctx->streamout.begin_atom, true);
r600_set_streamout_enable(rctx, true);
}
rctx->b.stream_output_target_destroy = r600_so_target_destroy;
rctx->streamout.begin_atom.emit = r600_emit_streamout_begin;
rctx->streamout.enable_atom.emit = r600_emit_streamout_enable;
- rctx->streamout.enable_atom.num_dw = 6;
}
ctx->scissors.atom.emit = si_emit_scissors;
ctx->viewports.atom.emit = si_emit_viewport_states;
- ctx->scissors.atom.num_dw = (2 + 16 * 2) + 6;
- ctx->viewports.atom.num_dw = 2 + 16 * 6;
-
ctx->b.b.set_scissor_states = si_set_scissor_states;
ctx->b.b.set_viewport_states = si_set_viewport_states;
}