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.
This commit is contained in:
Robert Ellison
2008-11-13 11:22:12 -07:00
parent 42330d929c
commit 2c29a6896a
2 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -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)
+4 -2
View File
@@ -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);
}
}