struct r600_pipe_shader *ps_shader;
struct r600_pipe_shader *vs_shader;
/* shader information */
- bool ps_rebuild;
- bool vs_rebuild;
unsigned sprite_coord_enable;
bool flatshade;
};
r600_pipe_state_add_reg(rstate, R600_GROUP_CONTEXT,
R_028894_SQ_PGM_START_FS,
0x00000000, 0xFFFFFFFF, shader->bo);
- rctx->vs_rebuild = FALSE;
}
static void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader *shader)
r600_pipe_state_add_reg(rstate, R600_GROUP_CONTEXT,
R_0288CC_SQ_PGM_CF_OFFSET_PS,
0x00000000, 0xFFFFFFFF, NULL);
- rctx->ps_rebuild = FALSE;
}
static int r600_pipe_shader(struct pipe_context *ctx, struct r600_pipe_shader *shader)
if (shader == NULL)
return -EINVAL;
- if (shader->bo) {
- switch (shader->shader.processor_type) {
- case TGSI_PROCESSOR_VERTEX:
- if (!rctx->vs_rebuild)
- return 0;
- break;
- case TGSI_PROCESSOR_FRAGMENT:
- if (!rctx->ps_rebuild)
- return 0;
- break;
- default:
- return -EINVAL;
- }
- }
/* there should be enough input */
if (rctx->vertex_elements->count < shader->shader.bc.nresource) {
R600_ERR("%d resources provided, expecting %d\n",
if (draw->index_buffer) {
rbuffer = (struct r600_resource*)draw->index_buffer;
rdraw.indices = rbuffer->bo;
+ rdraw.indices_bo_offset = 0;
}
r600_context_draw(&rctx->ctx, &rdraw);
}
return;
if (rctx->flatshade != rs->flatshade) {
- rctx->ps_rebuild = TRUE;
+// rctx->ps_rebuild = TRUE;
}
if (rctx->sprite_coord_enable != rs->sprite_coord_enable) {
- rctx->ps_rebuild = TRUE;
+// rctx->ps_rebuild = TRUE;
}
rctx->flatshade = rs->flatshade;
rctx->sprite_coord_enable = rs->sprite_coord_enable;
rctx->vertex_elements = v;
if (v) {
v->refcount++;
- rctx->vs_rebuild = TRUE;
+// rctx->vs_rebuild = TRUE;
}
}
r600_context_flush(ctx);
}
}
+
+ /* find number of color buffer */
+ for (int i = 0; i < 8; i++) {
+ cb[i] = r600_context_reg_bo(ctx, R600_GROUP_CONTEXT, R_028040_CB_COLOR0_BASE + (i << 2));
+ if (cb[i]) {
+ ndwords += 7;
+ }
+ }
+
if ((ctx->pm4_dirty_cdwords + ndwords + ctx->pm4_cdwords) > ctx->pm4_ndwords) {
/* need to flush */
r600_context_flush(ctx);
/* flush color buffer */
for (int i = 0; i < 8; i++) {
- cb[i] = r600_context_reg_bo(ctx, R600_GROUP_CONTEXT, R_028040_CB_COLOR0_BASE + (i << 2));
if (cb[i]) {
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_SURFACE_SYNC, 3);
ctx->pm4[ctx->pm4_cdwords++] = (S_0085F0_CB0_DEST_BASE_ENA(1) << i) |