r300g: fix hiz/zmask offset emissions.
authorDave Airlie <airlied@redhat.com>
Mon, 9 Aug 2010 09:56:45 +0000 (19:56 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 9 Aug 2010 09:56:45 +0000 (19:56 +1000)
ofs is in dwords, so need to shift it for registers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r300/r300_emit.c

index c35774c1490cf51dd566fff29568d0cd99da008e..7bd43b6eb5d63f06f781c29fec710cc107afc8b9 100644 (file)
@@ -393,7 +393,7 @@ void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state)
             /* HiZ RAM. */
             if (r300->screen->caps.hiz_ram) {
                 if (tex->hiz_mem[level]) {
-                    OUT_CS_REG(R300_ZB_HIZ_OFFSET, tex->hiz_mem[level]->ofs);
+                    OUT_CS_REG(R300_ZB_HIZ_OFFSET, tex->hiz_mem[level]->ofs << 2);
                     OUT_CS_REG(R300_ZB_HIZ_PITCH, surf_pitch);
                 } else {
                     OUT_CS_REG(R300_ZB_HIZ_OFFSET, 0);
@@ -402,7 +402,7 @@ void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state)
             }
             /* Z Mask RAM. (compressed zbuffer) */
             if (tex->zmask_mem[level]) {
-                OUT_CS_REG(R300_ZB_ZMASK_OFFSET, tex->zmask_mem[level]->ofs);
+                OUT_CS_REG(R300_ZB_ZMASK_OFFSET, tex->zmask_mem[level]->ofs << 2);
                 OUT_CS_REG(R300_ZB_ZMASK_PITCH, surf_pitch);
             } else {
                 OUT_CS_REG(R300_ZB_ZMASK_OFFSET, 0);