#include "colormac.h"
#include "context.h"
#include "texformat.h"
#include "texstore.h"
#include "texformat_tmp.h"
#define DIM 3 |
#define DIM 2 |
#define DIM 1 |
struct gl_texture_format* _mesa_choose_tex_format | ( | GLcontext * | ctx, | |
GLint | internalFormat, | |||
GLenum | format, | |||
GLenum | type | |||
) | [read] |
Choose an appropriate texture format given the format, type and internalFormat parameters passed to glTexImage().
ctx | the GL context. | |
internalFormat | user's prefered internal texture format. | |
format | incoming image pixel format. | |
type | incoming image data type. |
void _mesa_format_to_type_and_comps | ( | const struct gl_texture_format * | format, | |
GLenum * | datatype, | |||
GLuint * | comps | |||
) |
Return datatype and number of components per texel for the given gl_texture_format.
static void fetch_null_texel | ( | const struct gl_texture_image * | texImage, | |
GLint | i, | |||
GLint | j, | |||
GLint | k, | |||
GLchan * | texel | |||
) | [static] |
Null texel fetch function.
Have to have this so the FetchTexel function pointer is never NULL.
static void fetch_null_texelf | ( | const struct gl_texture_image * | texImage, | |
GLint | i, | |||
GLint | j, | |||
GLint | k, | |||
GLfloat * | texel | |||
) | [static] |
static void store_null_texel | ( | struct gl_texture_image * | texImage, | |
GLint | i, | |||
GLint | j, | |||
GLint | k, | |||
const void * | texel | |||
) | [static] |
Initial value:
{ -1, 0, GL_NONE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, fetch_null_texel, fetch_null_texel, fetch_null_texel, fetch_null_texelf, fetch_null_texelf, fetch_null_texelf, store_null_texel }
Initial value:
{ MESA_FORMAT_A8, GL_ALPHA, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 8, 0, 0, 0, 0, 0, 1, _mesa_texstore_a8, NULL, NULL, NULL, fetch_texel_1d_f_a8, fetch_texel_2d_f_a8, fetch_texel_3d_f_a8, store_texel_a8 }
Initial value:
{ MESA_FORMAT_AL88, GL_LUMINANCE_ALPHA, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 8, 8, 0, 0, 0, 0, 2, _mesa_texstore_al88, NULL, NULL, NULL, fetch_texel_1d_f_al88, fetch_texel_2d_f_al88, fetch_texel_3d_f_al88, store_texel_al88 }
Initial value:
{ MESA_FORMAT_AL88_REV, GL_LUMINANCE_ALPHA, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 8, 8, 0, 0, 0, 0, 2, _mesa_texstore_al88, NULL, NULL, NULL, fetch_texel_1d_f_al88_rev, fetch_texel_2d_f_al88_rev, fetch_texel_3d_f_al88_rev, store_texel_al88_rev }
Initial value:
{ MESA_FORMAT_ALPHA, GL_ALPHA, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, CHAN_BITS, 0, 0, 0, 0, 0, sizeof(GLchan), _mesa_texstore_rgba, NULL, NULL, NULL, fetch_texel_1d_f_alpha, fetch_texel_2d_f_alpha, fetch_texel_3d_f_alpha, store_texel_alpha }
Initial value:
{ MESA_FORMAT_ALPHA_FLOAT16, GL_ALPHA, GL_FLOAT, 0, 0, 0, 8 * sizeof(GLhalfARB), 0, 0, 0, 0, 0, 1 * sizeof(GLhalfARB), _mesa_texstore_rgba_float16, NULL, NULL, NULL, fetch_texel_1d_f_alpha_f16, fetch_texel_2d_f_alpha_f16, fetch_texel_3d_f_alpha_f16, store_texel_alpha_f16 }
Initial value:
{ MESA_FORMAT_ALPHA_FLOAT32, GL_ALPHA, GL_FLOAT, 0, 0, 0, 8 * sizeof(GLfloat), 0, 0, 0, 0, 0, 1 * sizeof(GLfloat), _mesa_texstore_rgba_float32, NULL, NULL, NULL, fetch_texel_1d_f_alpha_f32, fetch_texel_2d_f_alpha_f32, fetch_texel_3d_f_alpha_f32, store_texel_alpha_f32 }
Initial value:
{ MESA_FORMAT_ARGB1555, GL_RGBA, GL_UNSIGNED_NORMALIZED_ARB, 5, 5, 5, 1, 0, 0, 0, 0, 0, 2, _mesa_texstore_argb1555, NULL, NULL, NULL, fetch_texel_1d_f_argb1555, fetch_texel_2d_f_argb1555, fetch_texel_3d_f_argb1555, store_texel_argb1555 }
Initial value:
{ MESA_FORMAT_ARGB1555_REV, GL_RGBA, GL_UNSIGNED_NORMALIZED_ARB, 5, 5, 5, 1, 0, 0, 0, 0, 0, 2, _mesa_texstore_argb1555, NULL, NULL, NULL, fetch_texel_1d_f_argb1555_rev, fetch_texel_2d_f_argb1555_rev, fetch_texel_3d_f_argb1555_rev, store_texel_argb1555_rev }
Initial value:
{ MESA_FORMAT_ARGB4444, GL_RGBA, GL_UNSIGNED_NORMALIZED_ARB, 4, 4, 4, 4, 0, 0, 0, 0, 0, 2, _mesa_texstore_argb4444, NULL, NULL, NULL, fetch_texel_1d_f_argb4444, fetch_texel_2d_f_argb4444, fetch_texel_3d_f_argb4444, store_texel_argb4444 }
Initial value:
{ MESA_FORMAT_ARGB4444_REV, GL_RGBA, GL_UNSIGNED_NORMALIZED_ARB, 4, 4, 4, 4, 0, 0, 0, 0, 0, 2, _mesa_texstore_argb4444, NULL, NULL, NULL, fetch_texel_1d_f_argb4444_rev, fetch_texel_2d_f_argb4444_rev, fetch_texel_3d_f_argb4444_rev, store_texel_argb4444_rev }
Initial value:
{ MESA_FORMAT_ARGB8888, GL_RGBA, GL_UNSIGNED_NORMALIZED_ARB, 8, 8, 8, 8, 0, 0, 0, 0, 0, 4, _mesa_texstore_argb8888, NULL, NULL, NULL, fetch_texel_1d_f_argb8888, fetch_texel_2d_f_argb8888, fetch_texel_3d_f_argb8888, store_texel_argb8888 }
Initial value:
{ MESA_FORMAT_ARGB8888_REV, GL_RGBA, GL_UNSIGNED_NORMALIZED_ARB, 8, 8, 8, 8, 0, 0, 0, 0, 0, 4, _mesa_texstore_argb8888, NULL, NULL, NULL, fetch_texel_1d_f_argb8888_rev, fetch_texel_2d_f_argb8888_rev, fetch_texel_3d_f_argb8888_rev, store_texel_argb8888_rev }
Initial value:
{ MESA_FORMAT_BGR888, GL_RGB, GL_UNSIGNED_NORMALIZED_ARB, 8, 8, 8, 0, 0, 0, 0, 0, 0, 3, _mesa_texstore_bgr888, NULL, NULL, NULL, fetch_texel_1d_f_bgr888, fetch_texel_2d_f_bgr888, fetch_texel_3d_f_bgr888, store_texel_bgr888 }
Initial value:
{ MESA_FORMAT_CI8, GL_COLOR_INDEX, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 0, 0, 0, 8, 0, 0, 1, _mesa_texstore_ci8, NULL, NULL, NULL, fetch_texel_1d_f_ci8, fetch_texel_2d_f_ci8, fetch_texel_3d_f_ci8, store_texel_ci8 }
Initial value:
{ MESA_FORMAT_DUDV8, GL_DUDV_ATI, GL_SIGNED_NORMALIZED, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, _mesa_texstore_dudv8, NULL, NULL, NULL, fetch_texel_1d_dudv8, fetch_texel_2d_dudv8, fetch_texel_3d_dudv8, NULL }
Initial value:
{ MESA_FORMAT_I8, GL_INTENSITY, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 0, 0, 8, 0, 0, 0, 1, _mesa_texstore_a8, NULL, NULL, NULL, fetch_texel_1d_f_i8, fetch_texel_2d_f_i8, fetch_texel_3d_f_i8, store_texel_i8 }
Initial value:
{ MESA_FORMAT_INTENSITY, GL_INTENSITY, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 0, 0, CHAN_BITS, 0, 0, 0, sizeof(GLchan), _mesa_texstore_rgba, NULL, NULL, NULL, fetch_texel_1d_f_intensity, fetch_texel_2d_f_intensity, fetch_texel_3d_f_intensity, store_texel_intensity }
Initial value:
{ MESA_FORMAT_INTENSITY_FLOAT16, GL_INTENSITY, GL_FLOAT, 0, 0, 0, 0, 0, 8 * sizeof(GLhalfARB), 0, 0, 0, 1 * sizeof(GLhalfARB), _mesa_texstore_rgba_float16, NULL, NULL, NULL, fetch_texel_1d_f_intensity_f16, fetch_texel_2d_f_intensity_f16, fetch_texel_3d_f_intensity_f16, store_texel_intensity_f16 }
Initial value:
{ MESA_FORMAT_INTENSITY_FLOAT32, GL_INTENSITY, GL_FLOAT, 0, 0, 0, 0, 0, 8 * sizeof(GLfloat), 0, 0, 0, 1 * sizeof(GLfloat), _mesa_texstore_rgba_float32, NULL, NULL, NULL, fetch_texel_1d_f_intensity_f32, fetch_texel_2d_f_intensity_f32, fetch_texel_3d_f_intensity_f32, store_texel_intensity_f32 }
Initial value:
{ MESA_FORMAT_L8, GL_LUMINANCE, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 0, 8, 0, 0, 0, 0, 1, _mesa_texstore_a8, NULL, NULL, NULL, fetch_texel_1d_f_l8, fetch_texel_2d_f_l8, fetch_texel_3d_f_l8, store_texel_l8 }
Initial value:
{ MESA_FORMAT_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 0, CHAN_BITS, 0, 0, 0, 0, sizeof(GLchan), _mesa_texstore_rgba, NULL, NULL, NULL, fetch_texel_1d_f_luminance, fetch_texel_2d_f_luminance, fetch_texel_3d_f_luminance, store_texel_luminance }
Initial value:
{ MESA_FORMAT_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, CHAN_BITS, CHAN_BITS, 0, 0, 0, 0, 2 * sizeof(GLchan), _mesa_texstore_rgba, NULL, NULL, NULL, fetch_texel_1d_f_luminance_alpha, fetch_texel_2d_f_luminance_alpha, fetch_texel_3d_f_luminance_alpha, store_texel_luminance_alpha }
Initial value:
{ MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, GL_LUMINANCE_ALPHA, GL_FLOAT, 0, 0, 0, 8 * sizeof(GLhalfARB), 8 * sizeof(GLhalfARB), 0, 0, 0, 0, 2 * sizeof(GLhalfARB), _mesa_texstore_rgba_float16, NULL, NULL, NULL, fetch_texel_1d_f_luminance_alpha_f16, fetch_texel_2d_f_luminance_alpha_f16, fetch_texel_3d_f_luminance_alpha_f16, store_texel_luminance_alpha_f16 }
Initial value:
{ MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, GL_LUMINANCE_ALPHA, GL_FLOAT, 0, 0, 0, 8 * sizeof(GLfloat), 8 * sizeof(GLfloat), 0, 0, 0, 0, 2 * sizeof(GLfloat), _mesa_texstore_rgba_float32, NULL, NULL, NULL, fetch_texel_1d_f_luminance_alpha_f32, fetch_texel_2d_f_luminance_alpha_f32, fetch_texel_3d_f_luminance_alpha_f32, store_texel_luminance_alpha_f32 }
Initial value:
{ MESA_FORMAT_LUMINANCE_FLOAT16, GL_LUMINANCE, GL_FLOAT, 0, 0, 0, 0, 8 * sizeof(GLhalfARB), 0, 0, 0, 0, 1 * sizeof(GLhalfARB), _mesa_texstore_rgba_float16, NULL, NULL, NULL, fetch_texel_1d_f_luminance_f16, fetch_texel_2d_f_luminance_f16, fetch_texel_3d_f_luminance_f16, store_texel_luminance_f16 }
Initial value:
{ MESA_FORMAT_LUMINANCE_FLOAT32, GL_LUMINANCE, GL_FLOAT, 0, 0, 0, 0, 8 * sizeof(GLfloat), 0, 0, 0, 0, 1 * sizeof(GLfloat), _mesa_texstore_rgba_float32, NULL, NULL, NULL, fetch_texel_1d_f_luminance_f32, fetch_texel_2d_f_luminance_f32, fetch_texel_3d_f_luminance_f32, store_texel_luminance_f32 }
Initial value:
{ MESA_FORMAT_RGB, GL_RGB, GL_UNSIGNED_NORMALIZED_ARB, CHAN_BITS, CHAN_BITS, CHAN_BITS, 0, 0, 0, 0, 0, 0, 3 * sizeof(GLchan), _mesa_texstore_rgba, NULL, NULL, NULL, fetch_texel_1d_f_rgb, fetch_texel_2d_f_rgb, fetch_texel_3d_f_rgb, store_texel_rgb }
Initial value:
{ MESA_FORMAT_RGB332, GL_RGB, GL_UNSIGNED_NORMALIZED_ARB, 3, 3, 2, 0, 0, 0, 0, 0, 0, 1, _mesa_texstore_rgb332, NULL, NULL, NULL, fetch_texel_1d_f_rgb332, fetch_texel_2d_f_rgb332, fetch_texel_3d_f_rgb332, store_texel_rgb332 }
Initial value:
{ MESA_FORMAT_RGB565, GL_RGB, GL_UNSIGNED_NORMALIZED_ARB, 5, 6, 5, 0, 0, 0, 0, 0, 0, 2, _mesa_texstore_rgb565, NULL, NULL, NULL, fetch_texel_1d_f_rgb565, fetch_texel_2d_f_rgb565, fetch_texel_3d_f_rgb565, store_texel_rgb565 }
Initial value:
{ MESA_FORMAT_RGB565_REV, GL_RGB, GL_UNSIGNED_NORMALIZED_ARB, 5, 6, 5, 0, 0, 0, 0, 0, 0, 2, _mesa_texstore_rgb565, NULL, NULL, NULL, fetch_texel_1d_f_rgb565_rev, fetch_texel_2d_f_rgb565_rev, fetch_texel_3d_f_rgb565_rev, store_texel_rgb565_rev }
Initial value:
{ MESA_FORMAT_RGB888, GL_RGB, GL_UNSIGNED_NORMALIZED_ARB, 8, 8, 8, 0, 0, 0, 0, 0, 0, 3, _mesa_texstore_rgb888, NULL, NULL, NULL, fetch_texel_1d_f_rgb888, fetch_texel_2d_f_rgb888, fetch_texel_3d_f_rgb888, store_texel_rgb888 }
Initial value:
{ MESA_FORMAT_RGB_FLOAT16, GL_RGB, GL_FLOAT, 8 * sizeof(GLhalfARB), 8 * sizeof(GLhalfARB), 8 * sizeof(GLhalfARB), 0, 0, 0, 0, 0, 0, 3 * sizeof(GLhalfARB), _mesa_texstore_rgba_float16, NULL, NULL, NULL, fetch_texel_1d_f_rgb_f16, fetch_texel_2d_f_rgb_f16, fetch_texel_3d_f_rgb_f16, store_texel_rgb_f16 }
Initial value:
{ MESA_FORMAT_RGB_FLOAT32, GL_RGB, GL_FLOAT, 8 * sizeof(GLfloat), 8 * sizeof(GLfloat), 8 * sizeof(GLfloat), 0, 0, 0, 0, 0, 0, 3 * sizeof(GLfloat), _mesa_texstore_rgba_float32, NULL, NULL, NULL, fetch_texel_1d_f_rgb_f32, fetch_texel_2d_f_rgb_f32, fetch_texel_3d_f_rgb_f32, store_texel_rgb_f32 }
Initial value:
{ MESA_FORMAT_RGBA, GL_RGBA, GL_UNSIGNED_NORMALIZED_ARB, CHAN_BITS, CHAN_BITS, CHAN_BITS, CHAN_BITS, 0, 0, 0, 0, 0, 4 * sizeof(GLchan), _mesa_texstore_rgba, NULL, NULL, NULL, fetch_texel_1d_f_rgba, fetch_texel_2d_f_rgba, fetch_texel_3d_f_rgba, store_texel_rgba }
Initial value:
{ MESA_FORMAT_RGBA4444, GL_RGBA, GL_UNSIGNED_NORMALIZED_ARB, 4, 4, 4, 4, 0, 0, 0, 0, 0, 2, _mesa_texstore_rgba4444, NULL, NULL, NULL, fetch_texel_1d_f_rgba4444, fetch_texel_2d_f_rgba4444, fetch_texel_3d_f_rgba4444, store_texel_rgba4444 }
Initial value:
{ MESA_FORMAT_RGBA5551, GL_RGBA, GL_UNSIGNED_NORMALIZED_ARB, 5, 5, 5, 1, 0, 0, 0, 0, 0, 2, _mesa_texstore_rgba5551, NULL, NULL, NULL, fetch_texel_1d_f_rgba5551, fetch_texel_2d_f_rgba5551, fetch_texel_3d_f_rgba5551, store_texel_rgba5551 }
Initial value:
{ MESA_FORMAT_RGBA8888, GL_RGBA, GL_UNSIGNED_NORMALIZED_ARB, 8, 8, 8, 8, 0, 0, 0, 0, 0, 4, _mesa_texstore_rgba8888, NULL, NULL, NULL, fetch_texel_1d_f_rgba8888, fetch_texel_2d_f_rgba8888, fetch_texel_3d_f_rgba8888, store_texel_rgba8888 }
Initial value:
{ MESA_FORMAT_RGBA8888_REV, GL_RGBA, GL_UNSIGNED_NORMALIZED_ARB, 8, 8, 8, 8, 0, 0, 0, 0, 0, 4, _mesa_texstore_rgba8888, NULL, NULL, NULL, fetch_texel_1d_f_rgba8888_rev, fetch_texel_2d_f_rgba8888_rev, fetch_texel_3d_f_rgba8888_rev, store_texel_rgba8888_rev }
Initial value:
{ MESA_FORMAT_RGBA_FLOAT16, GL_RGBA, GL_FLOAT, 8 * sizeof(GLhalfARB), 8 * sizeof(GLhalfARB), 8 * sizeof(GLhalfARB), 8 * sizeof(GLhalfARB), 0, 0, 0, 0, 0, 4 * sizeof(GLhalfARB), _mesa_texstore_rgba_float16, NULL, NULL, NULL, fetch_texel_1d_f_rgba_f16, fetch_texel_2d_f_rgba_f16, fetch_texel_3d_f_rgba_f16, store_texel_rgba_f16 }
Initial value:
{ MESA_FORMAT_RGBA_FLOAT32, GL_RGBA, GL_FLOAT, 8 * sizeof(GLfloat), 8 * sizeof(GLfloat), 8 * sizeof(GLfloat), 8 * sizeof(GLfloat), 0, 0, 0, 0, 0, 4 * sizeof(GLfloat), _mesa_texstore_rgba_float32, NULL, NULL, NULL, fetch_texel_1d_f_rgba_f32, fetch_texel_2d_f_rgba_f32, fetch_texel_3d_f_rgba_f32, store_texel_rgba_f32 }
Initial value:
{ MESA_FORMAT_S8_Z24, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 0, 0, 0, 0, 24, 8, 4, _mesa_texstore_s8_z24, NULL, NULL, NULL, fetch_texel_1d_f_s8_z24, fetch_texel_2d_f_s8_z24, fetch_texel_3d_f_s8_z24, store_texel_s8_z24 }
Initial value:
{ MESA_FORMAT_SIGNED_RGBA8888, GL_RGBA, GL_SIGNED_NORMALIZED, 8, 8, 8, 8, 0, 0, 0, 0, 0, 4, _mesa_texstore_signed_rgba8888, NULL, NULL, NULL, fetch_texel_1d_signed_rgba8888, fetch_texel_2d_signed_rgba8888, fetch_texel_3d_signed_rgba8888, store_texel_signed_rgba8888 }
Initial value:
{ MESA_FORMAT_SIGNED_RGBA8888_REV, GL_RGBA, GL_SIGNED_NORMALIZED, 8, 8, 8, 8, 0, 0, 0, 0, 0, 4, _mesa_texstore_signed_rgba8888, NULL, NULL, NULL, fetch_texel_1d_signed_rgba8888_rev, fetch_texel_2d_signed_rgba8888_rev, fetch_texel_3d_signed_rgba8888_rev, store_texel_signed_rgba8888_rev }
Initial value:
{ MESA_FORMAT_YCBCR, GL_YCBCR_MESA, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, _mesa_texstore_ycbcr, NULL, NULL, NULL, fetch_texel_1d_f_ycbcr, fetch_texel_2d_f_ycbcr, fetch_texel_3d_f_ycbcr, store_texel_ycbcr }
Initial value:
{ MESA_FORMAT_YCBCR_REV, GL_YCBCR_MESA, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, _mesa_texstore_ycbcr, NULL, NULL, NULL, fetch_texel_1d_f_ycbcr_rev, fetch_texel_2d_f_ycbcr_rev, fetch_texel_3d_f_ycbcr_rev, store_texel_ycbcr_rev }
Initial value:
{ MESA_FORMAT_Z16, GL_DEPTH_COMPONENT, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 0, 0, 0, 0, sizeof(GLushort) * 8, 0, sizeof(GLushort), _mesa_texstore_z16, NULL, NULL, NULL, fetch_texel_1d_f_z16, fetch_texel_2d_f_z16, fetch_texel_3d_f_z16, store_texel_z16 }
Initial value:
{ MESA_FORMAT_Z24_S8, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 0, 0, 0, 0, 24, 8, 4, _mesa_texstore_z24_s8, NULL, NULL, NULL, fetch_texel_1d_f_z24_s8, fetch_texel_2d_f_z24_s8, fetch_texel_3d_f_z24_s8, store_texel_z24_s8 }
Initial value:
{ MESA_FORMAT_Z32, GL_DEPTH_COMPONENT, GL_UNSIGNED_NORMALIZED_ARB, 0, 0, 0, 0, 0, 0, 0, sizeof(GLuint) * 8, 0, sizeof(GLuint), _mesa_texstore_z32, NULL, NULL, NULL, fetch_texel_1d_f_z32, fetch_texel_2d_f_z32, fetch_texel_3d_f_z32, store_texel_z32 }