void r600_context_streamout_end(struct r600_context *ctx);
void r600_context_draw_opaque_count(struct r600_context *ctx, struct r600_so_target *t);
void r600_need_cs_space(struct r600_context *ctx, unsigned num_dw, boolean count_draw_in);
-void r600_context_block_emit_dirty(struct r600_context *ctx, struct r600_block *block);
+void r600_context_block_emit_dirty(struct r600_context *ctx, struct r600_block *block, unsigned pkt_flags);
void r600_context_block_resource_emit_dirty(struct r600_context *ctx, struct r600_block *block);
int evergreen_context_init(struct r600_context *ctx);
r600_context_pipe_state_set_sampler_border(ctx, state, offset);
}
-void r600_context_block_emit_dirty(struct r600_context *ctx, struct r600_block *block)
+/**
+ * @param pkt_flags should be set to RADEON_CP_PACKET3_COMPUTE_MODE if this
+ * block will be used for compute shaders.
+ */
+void r600_context_block_emit_dirty(struct r600_context *ctx, struct r600_block *block,
+ unsigned pkt_flags)
{
struct radeon_winsys_cs *cs = ctx->cs;
int optional = block->nbo == 0 && !(block->flags & REG_FLAG_DIRTY_ALWAYS);
cp_dwords = new_dwords + 2;
}
memcpy(&cs->buf[cs->cdw], block->pm4, cp_dwords * 4);
+
+ /* We are applying the pkt_flags after copying the register block to
+ * the the command stream, because it is possible this block will be
+ * emitted with a different pkt_flags, and we don't want to store the
+ * pkt_flags in the block.
+ */
+ cs->buf[cs->cdw] |= pkt_flags;
cs->cdw += cp_dwords;
if (optional) {
r600_emit_atom(rctx, state);
}
LIST_FOR_EACH_ENTRY_SAFE(dirty_block, next_block, &rctx->dirty,list) {
- r600_context_block_emit_dirty(rctx, dirty_block);
+ r600_context_block_emit_dirty(rctx, dirty_block, 0 /* pkt_flags */);
}
LIST_FOR_EACH_ENTRY_SAFE(dirty_block, next_block, &rctx->resource_dirty,list) {
r600_context_block_resource_emit_dirty(rctx, dirty_block);