mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-03 00:00:25 +01:00
nv40: use native Z24_S8 format for zeta buffer
This commit is contained in:
parent
85d626508a
commit
f01e305e98
3 changed files with 3 additions and 9 deletions
|
|
@ -10,12 +10,6 @@ void
|
|||
nv40_clear(struct pipe_context *pipe, struct pipe_surface *ps,
|
||||
unsigned clearValue)
|
||||
{
|
||||
/*XXX: We're actually Z24_S8... */
|
||||
if (ps->format == PIPE_FORMAT_S8_Z24) {
|
||||
clearValue = (((clearValue & 0xff000000) >> 24) |
|
||||
((clearValue & 0x00ffffff) << 8));
|
||||
}
|
||||
|
||||
pipe->region_fill(pipe, ps->region, 0, 0, 0, ps->width, ps->height,
|
||||
clearValue);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ nv40_is_format_supported(struct pipe_context *pipe, uint format)
|
|||
switch (format) {
|
||||
case PIPE_FORMAT_U_A8_R8_G8_B8:
|
||||
case PIPE_FORMAT_U_R5_G6_B5:
|
||||
case PIPE_FORMAT_S8_Z24:
|
||||
case PIPE_FORMAT_Z24_S8:
|
||||
return TRUE;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ nv40_get_tile_rgba(struct pipe_context *pipe,
|
|||
p += w0 * 4;
|
||||
}
|
||||
break;
|
||||
case PIPE_FORMAT_S8_Z24:
|
||||
case PIPE_FORMAT_Z24_S8:
|
||||
{
|
||||
const float scale = 1.0 / (float) 0xffffff;
|
||||
for (i = 0; i < h; i++) {
|
||||
|
|
@ -89,7 +89,7 @@ nv40_get_tile_rgba(struct pipe_context *pipe,
|
|||
pRow[0] =
|
||||
pRow[1] =
|
||||
pRow[2] =
|
||||
pRow[3] = (pixel & 0xffffff) * scale;
|
||||
pRow[3] = ((pixel & 0xffffff) >> 8) * scale;
|
||||
pRow += 4;
|
||||
}
|
||||
src += ps->region->pitch;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue