1 #include "intel_context.h"
3 #include "main/enums.h"
4 #include "main/formats.h"
7 * Returns the renderbuffer DataType for a MESA_FORMAT.
10 intel_mesa_format_to_rb_datatype(gl_format format)
13 case MESA_FORMAT_ARGB8888:
14 case MESA_FORMAT_XRGB8888:
15 case MESA_FORMAT_SARGB8:
17 case MESA_FORMAT_GR88:
21 case MESA_FORMAT_AL88:
22 case MESA_FORMAT_RGB565:
23 case MESA_FORMAT_ARGB1555:
24 case MESA_FORMAT_ARGB4444:
26 return GL_UNSIGNED_BYTE;
28 case MESA_FORMAT_RG1616:
30 return GL_UNSIGNED_SHORT;
31 case MESA_FORMAT_X8_Z24:
32 return GL_UNSIGNED_INT;
33 case MESA_FORMAT_S8_Z24:
34 return GL_UNSIGNED_INT_24_8_EXT;
35 case MESA_FORMAT_RGBA_FLOAT32:
36 case MESA_FORMAT_RG_FLOAT32:
37 case MESA_FORMAT_R_FLOAT32:
38 case MESA_FORMAT_INTENSITY_FLOAT32:
39 case MESA_FORMAT_LUMINANCE_FLOAT32:
40 case MESA_FORMAT_ALPHA_FLOAT32:
41 case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32:
44 /* The core depthstencil wrappers demand this. */
45 case MESA_FORMAT_Z32_FLOAT_X24S8:
46 return GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
49 /* Unsupported format. We may hit this when people ask for FBO-incomplete
56 int intel_compressed_num_bytes(GLuint mesaFormat)
61 block_size = _mesa_get_format_bytes(mesaFormat);
62 _mesa_get_format_block_size(mesaFormat, &bw, &bh);
64 return block_size / bw;