summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorJerome Glisse <[email protected]>2010-09-22 14:00:53 -0400
committerJerome Glisse <[email protected]>2010-09-22 14:19:05 -0400
commitb8835a3992edb7b01712ea83b5729ef0f6f94e4f (patch)
tree099d1f11b344690d1d570597a97a0c2daa310696 /src/gallium/winsys
parent516ac2bd50ad1e71bd2a359d247532d9f18bcf99 (diff)
r600g: disable shader rebuild optimization & account cb flush packet
Shader rebuild should be more clever, we should store along each shader all the value that change shader program rather than using flags in context (ie change sequence like : change vs buffer, draw, change vs buffer, switch shader will trigger useless shader rebuild). Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/r600/drm/r600_state2.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/winsys/r600/drm/r600_state2.c b/src/gallium/winsys/r600/drm/r600_state2.c
index 32c7171b518..cde4ec37f9a 100644
--- a/src/gallium/winsys/r600/drm/r600_state2.c
+++ b/src/gallium/winsys/r600/drm/r600_state2.c
@@ -914,6 +914,15 @@ void r600_context_draw(struct r600_context *ctx, const struct r600_draw *draw)
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);
@@ -955,7 +964,6 @@ void r600_context_draw(struct r600_context *ctx, const struct r600_draw *draw)
/* 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) |