unsigned geom_flags)
{
static const enum pipe_format tex_supported[] = {
- PIPE_FORMAT_R8G8B8A8_UNORM,
- PIPE_FORMAT_A8R8G8B8_UNORM,
- PIPE_FORMAT_R5G6B5_UNORM,
PIPE_FORMAT_L8_UNORM,
- PIPE_FORMAT_A8_UNORM,
PIPE_FORMAT_I8_UNORM,
+ PIPE_FORMAT_A8_UNORM,
+ PIPE_FORMAT_L16_UNORM,
+ /*PIPE_FORMAT_I16_UNORM,*/
+ /*PIPE_FORMAT_A16_UNORM,*/
PIPE_FORMAT_A8L8_UNORM,
+ PIPE_FORMAT_R5G6B5_UNORM,
+ PIPE_FORMAT_A1R5G5B5_UNORM,
+ PIPE_FORMAT_A4R4G4B4_UNORM,
+ PIPE_FORMAT_X8R8G8B8_UNORM,
+ PIPE_FORMAT_A8R8G8B8_UNORM,
+ /* video */
PIPE_FORMAT_YCBCR,
PIPE_FORMAT_YCBCR_REV,
+ /* compressed */
+ /*PIPE_FORMAT_FXT1_RGBA,*/
+ PIPE_FORMAT_DXT1_RGB,
+ PIPE_FORMAT_DXT1_RGBA,
+ PIPE_FORMAT_DXT3_RGBA,
+ PIPE_FORMAT_DXT5_RGBA,
+ /* sRGB */
+ PIPE_FORMAT_R8G8B8A8_SRGB,
+ PIPE_FORMAT_A8L8_SRGB,
+ PIPE_FORMAT_L8_SRGB,
+ PIPE_FORMAT_DXT1_SRGB,
+ /* depth */
+ PIPE_FORMAT_Z32_FLOAT,
PIPE_FORMAT_X8Z24_UNORM,
PIPE_FORMAT_S8Z24_UNORM,
+ PIPE_FORMAT_Z16_UNORM,
+ /* signed */
+ PIPE_FORMAT_R8G8_SNORM,
+ PIPE_FORMAT_R8G8B8A8_SNORM,
PIPE_FORMAT_NONE /* list terminator */
};
- static const enum pipe_format surface_supported[] = {
+ static const enum pipe_format render_supported[] = {
+ PIPE_FORMAT_X8R8G8B8_UNORM,
PIPE_FORMAT_A8R8G8B8_UNORM,
PIPE_FORMAT_R5G6B5_UNORM,
+ PIPE_FORMAT_NONE /* list terminator */
+ };
+ static const enum pipe_format depth_supported[] = {
+ PIPE_FORMAT_Z32_FLOAT,
PIPE_FORMAT_X8Z24_UNORM,
PIPE_FORMAT_S8Z24_UNORM,
+ PIPE_FORMAT_Z16_UNORM,
PIPE_FORMAT_NONE /* list terminator */
};
const enum pipe_format *list;
uint i;
- if(tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET)
- list = surface_supported;
+ if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL)
+ list = depth_supported;
+ else if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET)
+ list = render_supported;
else
list = tex_supported;
case PIPE_FORMAT_A8_UNORM:
return BRW_SURFACEFORMAT_A8_UNORM;
- case PIPE_FORMAT_A8L8_UNORM:
- return BRW_SURFACEFORMAT_L8A8_UNORM;
+ case PIPE_FORMAT_L16_UNORM:
+ return BRW_SURFACEFORMAT_L16_UNORM;
- case PIPE_FORMAT_A8R8G8B8_UNORM: /* XXX */
- case PIPE_FORMAT_B8G8R8A8_UNORM: /* XXX */
- case PIPE_FORMAT_R8G8B8A8_UNORM: /* XXX */
- return BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
+ /* XXX: Add these to gallium
+ case PIPE_FORMAT_I16_UNORM:
+ return BRW_SURFACEFORMAT_I16_UNORM;
- case PIPE_FORMAT_R8G8B8X8_UNORM:
- return BRW_SURFACEFORMAT_R8G8B8X8_UNORM;
+ case PIPE_FORMAT_A16_UNORM:
+ return BRW_SURFACEFORMAT_A16_UNORM;
+ */
+
+ case PIPE_FORMAT_A8L8_UNORM:
+ return BRW_SURFACEFORMAT_L8A8_UNORM;
case PIPE_FORMAT_R5G6B5_UNORM:
return BRW_SURFACEFORMAT_B5G6R5_UNORM;
case PIPE_FORMAT_A4R4G4B4_UNORM:
return BRW_SURFACEFORMAT_B4G4R4A4_UNORM;
+ case PIPE_FORMAT_X8R8G8B8_UNORM:
+ return BRW_SURFACEFORMAT_R8G8B8X8_UNORM;
- case PIPE_FORMAT_L16_UNORM:
- return BRW_SURFACEFORMAT_L16_UNORM;
-
- /* XXX: Z texturing:
- case PIPE_FORMAT_I16_UNORM:
- return BRW_SURFACEFORMAT_I16_UNORM;
- */
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ return BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
- /* XXX: Z texturing:
- case PIPE_FORMAT_A16_UNORM:
- return BRW_SURFACEFORMAT_A16_UNORM;
- */
+ /*
+ * Video formats
+ */
case PIPE_FORMAT_YCBCR_REV:
return BRW_SURFACEFORMAT_YCRCB_NORMAL;
case PIPE_FORMAT_YCBCR:
return BRW_SURFACEFORMAT_YCRCB_SWAPUVY;
+ /*
+ * Compressed formats.
+ */
/* XXX: Add FXT to gallium?
case PIPE_FORMAT_FXT1_RGBA:
return BRW_SURFACEFORMAT_FXT1;
case PIPE_FORMAT_DXT5_RGBA:
return BRW_SURFACEFORMAT_BC3_UNORM;
+ /*
+ * sRGB formats
+ */
+
case PIPE_FORMAT_R8G8B8A8_SRGB:
return BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB;
case PIPE_FORMAT_DXT1_SRGB:
return BRW_SURFACEFORMAT_BC1_UNORM_SRGB;
+ /*
+ * Depth formats
+ */
+
+ case PIPE_FORMAT_Z16_UNORM:
+ return BRW_SURFACEFORMAT_I16_UNORM;
+
case PIPE_FORMAT_S8Z24_UNORM:
case PIPE_FORMAT_X8Z24_UNORM:
return BRW_SURFACEFORMAT_I24X8_UNORM;
-#if 0
- /* XXX: these different surface formats don't seem to
- * make any difference for shadow sampler/compares.
- */
- if (depth_mode == GL_INTENSITY)
- return BRW_SURFACEFORMAT_I24X8_UNORM;
- else if (depth_mode == GL_ALPHA)
- return BRW_SURFACEFORMAT_A24X8_UNORM;
- else
- return BRW_SURFACEFORMAT_L24X8_UNORM;
-#endif
+ case PIPE_FORMAT_Z32_FLOAT:
+ return BRW_SURFACEFORMAT_I32_FLOAT;
/* XXX: presumably for bump mapping. Add this to mesa state
* tracker?
+ *
+ * XXX: Add flipped versions of these formats to Gallium.
*/
case PIPE_FORMAT_R8G8_SNORM:
return BRW_SURFACEFORMAT_R8G8_SNORM;