static struct fd4_format formats[PIPE_FORMAT_COUNT] = {
/* 8-bit */
VT(R8_UNORM, 8_UNORM, R8_UNORM, WZYX),
- VT(R8_SNORM, 8_SNORM, NONE, WZYX),
- VT(R8_UINT, 8_UINT, NONE, WZYX),
- VT(R8_SINT, 8_SINT, NONE, WZYX),
+ VT(R8_SNORM, 8_SNORM, R8_SNORM, WZYX),
+ VT(R8_UINT, 8_UINT, R8_UINT, WZYX),
+ VT(R8_SINT, 8_SINT, R8_SINT, WZYX),
V_(R8_USCALED, 8_UINT, NONE, WZYX),
V_(R8_SSCALED, 8_UINT, NONE, WZYX),
}
}
-/* we need to special case a bit the depth/stencil restore, because we are
- * using the texture sampler to blit into the depth/stencil buffer, *not*
- * into a color buffer. Otherwise fd4_tex_swiz() will do the wrong thing,
- * as it is assuming that you are sampling into normal render target..
- *
- * TODO looks like we can probably share w/ a3xx..
- */
-enum pipe_format
-fd4_gmem_restore_format(enum pipe_format format)
-{
- switch (format) {
- case PIPE_FORMAT_Z24X8_UNORM:
- case PIPE_FORMAT_Z24_UNORM_S8_UINT:
- return PIPE_FORMAT_R8G8B8A8_UNORM;
- case PIPE_FORMAT_Z16_UNORM:
- return PIPE_FORMAT_R8G8_UNORM;
- case PIPE_FORMAT_S8_UINT:
- return PIPE_FORMAT_R8_UNORM;
- default:
- return format;
- }
-}
-
enum a4xx_depth_format
fd4_pipe2depth(enum pipe_format format)
{
{
switch (swiz) {
default:
- case PIPE_SWIZZLE_X: return A4XX_TEX_X;
+ case PIPE_SWIZZLE_X: return A4XX_TEX_X;
case PIPE_SWIZZLE_Y: return A4XX_TEX_Y;
- case PIPE_SWIZZLE_Z: return A4XX_TEX_Z;
+ case PIPE_SWIZZLE_Z: return A4XX_TEX_Z;
case PIPE_SWIZZLE_W: return A4XX_TEX_W;
- case PIPE_SWIZZLE_0: return A4XX_TEX_ZERO;
- case PIPE_SWIZZLE_1: return A4XX_TEX_ONE;
+ case PIPE_SWIZZLE_0: return A4XX_TEX_ZERO;
+ case PIPE_SWIZZLE_1: return A4XX_TEX_ONE;
}
}