This fixes some problems with drawing without glClear having been called
before as the frame buffer pitch was not properly initialized then.
Mathias Gottschlag
From 6a5e91ed7bd3836b51d9b7bcd9e1ad934ca79281 Mon Sep 17 00:00:00 2001
From: Mathias Gottschlag <[email protected]>
Date: Sat, 25 Apr 2009 01:27:23 +0200
Subject: [PATCH] r300-gallium: Set framebuffer pitch on every framebuffer change.
---
src/gallium/drivers/r300/r300_emit.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 417d5f6..cce5c59 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -160,7 +160,7 @@ void r300_emit_fb_state(struct r300_context* r300,
struct r300_texture* tex;
CS_LOCALS(r300);
- BEGIN_CS((6 * fb->nr_cbufs) + (fb->zsbuf ? 6 : 0) + 4);
+ BEGIN_CS((7 * fb->nr_cbufs) + (fb->zsbuf ? 7 : 0) + 4);
for (i = 0; i < fb->nr_cbufs; i++) {
tex = (struct r300_texture*)fb->cbufs[i]->texture;
OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1);
@@ -168,6 +168,9 @@ void r300_emit_fb_state(struct r300_context* r300,
OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i),
r300_translate_out_fmt(fb->cbufs[i]->format));
+ unsigned pixpitch = tex->stride / tex->tex.block.size;
+ OUT_CS_REG(R300_RB3D_COLORPITCH0 + (4 * i), pixpitch |
+ r300_translate_colorformat(tex->tex.format));
}
if (fb->zsbuf) {
@@ -180,6 +183,8 @@ void r300_emit_fb_state(struct r300_context* r300,
} else {
OUT_CS_REG(R300_ZB_FORMAT, 0x0);
}
+ unsigned pixpitch = tex->stride / tex->tex.block.size;
+ OUT_CS_REG(R300_ZB_DEPTHPITCH, pixpitch);
}
OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT,
--
1.6.0.4------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev