u32 vgt_draw_initiator;
u32 indices_bo_offset;
unsigned db_render_override;
+ unsigned db_render_control;
struct r600_resource *indices;
};
if (draw->indices) {
ndwords = 11;
}
- /* when increasing ndwords, bump the max limit too */
- assert(ndwords <= R600_MAX_DRAW_CS_DWORDS);
-
- /* queries need some special values
- * (this is non-zero if any query is active) */
if (ctx->num_cs_dw_queries_suspend) {
- if (ctx->screen->family >= CHIP_RV770) {
- r600_context_reg(ctx,
- R_028D0C_DB_RENDER_CONTROL,
- S_028D0C_R700_PERFECT_ZPASS_COUNTS(1),
- S_028D0C_R700_PERFECT_ZPASS_COUNTS(1));
- }
- r600_context_reg(ctx,
- R_028D10_DB_RENDER_OVERRIDE,
- S_028D10_NOOP_CULL_DISABLE(1),
- S_028D10_NOOP_CULL_DISABLE(1));
+ if (ctx->screen->family >= CHIP_RV770)
+ ndwords += 3;
+ ndwords += 3;
}
+ /* when increasing ndwords, bump the max limit too */
+ assert(ndwords <= R600_MAX_DRAW_CS_DWORDS);
+
r600_need_cs_space(ctx, 0, TRUE);
assert(ctx->pm4_cdwords + ctx->pm4_dirty_cdwords + ndwords < RADEON_MAX_CMDBUF_DWORDS);
ctx->streamout_start = FALSE;
}
+ /* queries need some special values
+ * (this is non-zero if any query is active) */
+ if (ctx->num_cs_dw_queries_suspend) {
+ if (ctx->screen->family >= CHIP_RV770) {
+ pm4 = &ctx->pm4[ctx->pm4_cdwords];
+ pm4[0] = PKT3(PKT3_SET_CONTEXT_REG, 1, 0);
+ pm4[1] = (R_028D0C_DB_RENDER_CONTROL - R600_CONTEXT_REG_OFFSET) >> 2;
+ pm4[2] = draw->db_render_control | S_028D0C_R700_PERFECT_ZPASS_COUNTS(1);
+ ctx->pm4_cdwords += 3;
+ ndwords -= 3;
+ }
+ pm4 = &ctx->pm4[ctx->pm4_cdwords];
+ pm4[0] = PKT3(PKT3_SET_CONTEXT_REG, 1, 0);
+ pm4[1] = (R_028D10_DB_RENDER_OVERRIDE - R600_CONTEXT_REG_OFFSET) >> 2;
+ pm4[2] = draw->db_render_override | S_028D10_NOOP_CULL_DISABLE(1);
+ ctx->pm4_cdwords += 3;
+ ndwords -= 3;
+ }
+
/* draw packet */
pm4 = &ctx->pm4[ctx->pm4_cdwords];
struct r600_pipe_state rstate;
unsigned alpha_ref;
unsigned db_render_override;
+ unsigned db_render_control;
ubyte valuemask[2];
ubyte writemask[2];
};
r600_pipe_state_add_reg(rstate, R_028D30_DB_PRELOAD_CONTROL, 0x00000000, NULL, 0);
r600_pipe_state_add_reg(rstate, R_028D44_DB_ALPHA_TO_MASK, 0x0000AA00, NULL, 0);
+ dsa->db_render_override = db_render_override;
+ dsa->db_render_control = db_render_control;
+
return rstate;
}
{
struct pipe_depth_stencil_alpha_state dsa;
struct r600_pipe_state *rstate;
+ struct r600_pipe_dsa *dsa_state;
+ unsigned db_render_control;
boolean quirk = false;
if (rctx->family == CHIP_RV610 || rctx->family == CHIP_RV630 ||
}
rstate = rctx->context.create_depth_stencil_alpha_state(&rctx->context, &dsa);
- r600_pipe_state_add_reg(rstate,
- R_028D0C_DB_RENDER_CONTROL,
- S_028D0C_DEPTH_COPY_ENABLE(1) |
- S_028D0C_STENCIL_COPY_ENABLE(1) |
- S_028D0C_COPY_CENTROID(1),
- NULL, 0);
+ dsa_state = (struct r600_pipe_dsa*)rstate;
+
+ db_render_control =
+ S_028D0C_DEPTH_COPY_ENABLE(1) |
+ S_028D0C_STENCIL_COPY_ENABLE(1) |
+ S_028D0C_COPY_CENTROID(1);
+
+ r600_pipe_state_add_reg(rstate, R_028D0C_DB_RENDER_CONTROL, db_render_control, NULL, 0);
+
+ dsa_state->db_render_control = db_render_control;
+
return rstate;
}
void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *dinfo)
{
struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_pipe_dsa *dsa = (struct r600_pipe_dsa*)rctx->states[R600_PIPE_STATE_DSA];
struct pipe_draw_info info = *dinfo;
struct r600_draw rdraw = {};
struct pipe_index_buffer ib = {};
r600_context_pipe_state_set(&rctx->ctx, &rctx->vgt);
+ rdraw.db_render_override = dsa->db_render_override;
+ rdraw.db_render_control = dsa->db_render_control;
+
if (rctx->chip_class >= EVERGREEN) {
- struct r600_pipe_dsa *dsa = (struct r600_pipe_dsa*)rctx->states[R600_PIPE_STATE_DSA];
- rdraw.db_render_override = dsa->db_render_override;
evergreen_context_draw(&rctx->ctx, &rdraw);
} else {
r600_context_draw(&rctx->ctx, &rdraw);