Mesa (gallium-0.2): CELL: fix stencil twiddling, stencil invert
Robert Ellison
papillo at kemper.freedesktop.org
Thu Nov 13 18:19:51 UTC 2008
Module: Mesa
Branch: gallium-0.2
Commit: 2c29a6896a4a026ed3568db9caf90f422b711d8b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c29a6896a4a026ed3568db9caf90f422b711d8b
Author: Robert Ellison <papillo at tungstengraphics.com>
Date: Thu Nov 13 11:22:12 2008 -0700
CELL: fix stencil twiddling, stencil invert
Many stencil tests were failing because of a failure to read the
stencil buffer, due to "twiddling" (or "untwiddling") "an unsupported
texture format". This is fixed for the case of a stencil/Z S824Z format
(which twiddles just like the 32-bit color formats).
tests/stencilwrap.c was failing on the GL_INVERT test, because
the emitted code for "spe_xori" turned out not to be an actual
"xori" instruction, but rather a "stqd" instruction, because
of a typo in the rtasm code. This is now fixed, and
tests/stencil_wrap now works.
---
src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h | 6 +++---
src/gallium/drivers/cell/ppu/cell_texture.c | 6 ++++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h
index f1500ce..7c211ff 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h
+++ b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h
@@ -214,9 +214,9 @@ EMIT_RI10s(spe_orhi, 0x005)
EMIT_RI10s(spe_ori, 0x004)
EMIT_R (spe_orx, 0x1f0)
EMIT_RR (spe_xor, 0x241)
-EMIT_RI10s(spe_xorbi, 0x026)
-EMIT_RI10s(spe_xorhi, 0x025)
-EMIT_RI10s(spe_xori, 0x024)
+EMIT_RI10s(spe_xorbi, 0x046)
+EMIT_RI10s(spe_xorhi, 0x045)
+EMIT_RI10s(spe_xori, 0x044)
EMIT_RR (spe_nand, 0x0c9)
EMIT_RR (spe_nor, 0x049)
EMIT_RR (spe_eqv, 0x249)
diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c
index ae88d06..47cd960 100644
--- a/src/gallium/drivers/cell/ppu/cell_texture.c
+++ b/src/gallium/drivers/cell/ppu/cell_texture.c
@@ -314,6 +314,7 @@ cell_twiddle_texture(struct pipe_screen *screen,
switch (ct->base.format) {
case PIPE_FORMAT_A8R8G8B8_UNORM:
case PIPE_FORMAT_B8G8R8A8_UNORM:
+ case PIPE_FORMAT_S8Z24_UNORM:
{
int numFaces = ct->base.target == PIPE_TEXTURE_CUBE ? 6 : 1;
int offset = bufWidth * bufHeight * 4 * surface->face;
@@ -337,7 +338,7 @@ cell_twiddle_texture(struct pipe_screen *screen,
}
break;
default:
- printf("Cell: twiddle unsupported texture format\n");
+ printf("Cell: twiddle unsupported texture format 0x%x\n", ct->base.format);
;
}
@@ -363,6 +364,7 @@ cell_untwiddle_texture(struct pipe_screen *screen,
switch (ct->base.format) {
case PIPE_FORMAT_A8R8G8B8_UNORM:
case PIPE_FORMAT_B8G8R8A8_UNORM:
+ case PIPE_FORMAT_S8Z24_UNORM:
{
int numFaces = ct->base.target == PIPE_TEXTURE_CUBE ? 6 : 1;
int offset = surface->stride * texHeight * 4 * surface->face;
@@ -382,7 +384,7 @@ cell_untwiddle_texture(struct pipe_screen *screen,
default:
{
ct->untiled_data[level] = NULL;
- printf("Cell: untwiddle unsupported texture format\n");
+ printf("Cell: untwiddle unsupported texture format 0x%x\n", ct->base.format);
}
}
More information about the mesa-commit
mailing list