}
}
break;
+ case PIPE_FORMAT_Z24_S8:
+ {
+ float scale = (float) ((1 << 24) - 1);
+
+ for (j = 0; j < QUAD_SIZE; j++) {
+ qzzzz[j] = (unsigned) (quad->outputs.depth[j] * scale);
+ }
+
+ for (j = 0; j < QUAD_SIZE; j++) {
+ int x = quad->x0 % TILE_SIZE + (j & 1);
+ int y = quad->y0 % TILE_SIZE + (j >> 1);
+ bzzzz[j] = tile->data.depth32[y][x] >> 8;
+ }
+ }
+ break;
default:
assert(0);
}
tile->data.depth32[y][x] = s8z24;
}
break;
+ case PIPE_FORMAT_Z24_S8:
+ for (j = 0; j < QUAD_SIZE; j++) {
+ int x = quad->x0 % TILE_SIZE + (j & 1);
+ int y = quad->y0 % TILE_SIZE + (j >> 1);
+ uint z24s8 = tile->data.depth32[y][x];
+ z24s8 = (z24s8 & 0xff) | (bzzzz[j] << 24);
+ tile->data.depth32[y][x] = z24s8;
+ }
+ break;
default:
assert(0);
}
stencilVals[j] = tile->data.depth32[y][x] >> 24;
}
break;
+ case PIPE_FORMAT_Z24_S8:
+ for (j = 0; j < QUAD_SIZE; j++) {
+ int x = quad->x0 % TILE_SIZE + (j & 1);
+ int y = quad->y0 % TILE_SIZE + (j >> 1);
+ stencilVals[j] = tile->data.depth32[y][x] & 0xff;
+ }
+ break;
case PIPE_FORMAT_U_S8:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
tile->data.depth32[y][x] = s8z24;
}
break;
+ case PIPE_FORMAT_Z24_S8:
+ for (j = 0; j < QUAD_SIZE; j++) {
+ int x = quad->x0 % TILE_SIZE + (j & 1);
+ int y = quad->y0 % TILE_SIZE + (j >> 1);
+ uint z24s8 = tile->data.depth32[y][x];
+ z24s8 = (z24s8 & 0xffffff00) | stencilVals[j];
+ tile->data.depth32[y][x] = z24s8;
+ }
+ break;
case PIPE_FORMAT_U_S8:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
}
+/*** PIPE_FORMAT_Z24_S8 ***/
+
+/**
+ * Return Z component as four float in [0,1]. Stencil part ignored.
+ */
+static void
+z24s8_get_tile(struct pipe_surface *ps,
+ unsigned x, unsigned y, unsigned w, unsigned h, float *p)
+{
+ const uint *src
+ = ((const uint *) (ps->region->map + ps->offset))
+ + y * ps->region->pitch + x;
+ const double scale = 1.0 / ((1 << 24) - 1);
+ unsigned i, j;
+ unsigned w0 = w;
+
+ assert(ps->format == PIPE_FORMAT_Z24_S8);
+
+ CLIP_TILE;
+
+ for (i = 0; i < h; i++) {
+ float *pRow = p;
+ for (j = 0; j < w; j++) {
+ pRow[j * 4 + 0] =
+ pRow[j * 4 + 1] =
+ pRow[j * 4 + 2] =
+ pRow[j * 4 + 3] = (float) (scale * (src[j] >> 8));
+ }
+ src += ps->region->pitch;
+ p += 4 * w0;
+ }
+}
+
+
/**
* Called via pipe->get_tex_surface()
* XXX is this in the right place?
case PIPE_FORMAT_S8_Z24:
s8z24_get_tile(ps, x, y, w, h, p);
break;
+ case PIPE_FORMAT_Z24_S8:
+ z24s8_get_tile(ps, x, y, w, h, p);
+ break;
default:
assert(0);
}
case PIPE_FORMAT_S8_Z24:
/*s8z24_put_tile(ps, x, y, w, h, p);*/
break;
+ case PIPE_FORMAT_Z24_S8:
+ /*z24s8_put_tile(ps, x, y, w, h, p);*/
+ break;
default:
assert(0);
}
return;
is_depth_stencil = (ps->format == PIPE_FORMAT_S8_Z24 ||
+ ps->format == PIPE_FORMAT_Z24_S8 ||
ps->format == PIPE_FORMAT_U_Z16 ||
ps->format == PIPE_FORMAT_U_Z32 ||
ps->format == PIPE_FORMAT_U_S8);
struct pipe_surface *ps = tc->surface;
boolean is_depth_stencil
= (ps->format == PIPE_FORMAT_S8_Z24 ||
+ ps->format == PIPE_FORMAT_Z24_S8 ||
ps->format == PIPE_FORMAT_U_Z16 ||
ps->format == PIPE_FORMAT_U_Z32 ||
ps->format == PIPE_FORMAT_U_S8);
}
}
break;
+ case PIPE_FORMAT_Z24_S8:
+ {
+ uint clear_val = ((uint) (tc->clear_value[0] * 0xffffff)) << 8;
+ clear_val |= ((uint) tc->clear_value[1]) & 0xff;
+ for (i = 0; i < TILE_SIZE; i++) {
+ for (j = 0; j < TILE_SIZE; j++) {
+ tile->data.depth32[i][j] = clear_val;
+ }
+ }
+ }
+ break;
case PIPE_FORMAT_U_S8:
{
ubyte clear_val = (uint) tc->clear_value[0];