⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 texformat_tmp.h

📁 mesa-6.5-minigui源码
💻 H
📖 第 1 页 / 共 3 页
字号:
static void store_texel_alpha_f16(struct gl_texture_image *texImage,                                  GLint i, GLint j, GLint k, const void *texel){   const GLfloat *rgba = (const GLfloat *) texel;   GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1);   dst[0] = _mesa_float_to_half(rgba[ACOMP]);}#endif/* MESA_FORMAT_LUMINANCE_F32 *************************************************//* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT32 texture, * returning 4 GLfloats. */static void FETCH(f_luminance_f32)( const struct gl_texture_image *texImage,                                    GLint i, GLint j, GLint k, GLfloat *texel ){   const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1);   texel[RCOMP] =   texel[GCOMP] =   texel[BCOMP] = src[0];   texel[ACOMP] = 1.0F;}#if DIM == 3static void store_texel_luminance_f32(struct gl_texture_image *texImage,                                  GLint i, GLint j, GLint k, const void *texel){   const GLfloat *rgba = (const GLfloat *) texel;   GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1);   dst[0] = rgba[RCOMP];}#endif/* MESA_FORMAT_LUMINANCE_F16 *************************************************//* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT16 texture, * returning 4 GLfloats. */static void FETCH(f_luminance_f16)( const struct gl_texture_image *texImage,                                    GLint i, GLint j, GLint k, GLfloat *texel ){   const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1);   texel[RCOMP] =   texel[GCOMP] =   texel[BCOMP] = _mesa_half_to_float(src[0]);   texel[ACOMP] = 1.0F;}#if DIM == 3static void store_texel_luminance_f16(struct gl_texture_image *texImage,                                  GLint i, GLint j, GLint k, const void *texel){   const GLfloat *rgba = (const GLfloat *) texel;   GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1);   dst[0] = _mesa_float_to_half(rgba[RCOMP]);}#endif/* MESA_FORMAT_LUMINANCE_ALPHA_F32 *******************************************//* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT32 texture, * returning 4 GLfloats. */static void FETCH(f_luminance_alpha_f32)( const struct gl_texture_image *texImage,                                    GLint i, GLint j, GLint k, GLfloat *texel ){   const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2);   texel[RCOMP] =   texel[GCOMP] =   texel[BCOMP] = src[0];   texel[ACOMP] = src[1];}#if DIM == 3static void store_texel_luminance_alpha_f32(struct gl_texture_image *texImage,                                  GLint i, GLint j, GLint k, const void *texel){   const GLfloat *rgba = (const GLfloat *) texel;   GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2);   dst[0] = rgba[RCOMP];   dst[1] = rgba[ACOMP];}#endif/* MESA_FORMAT_LUMINANCE_ALPHA_F16 *******************************************//* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT16 texture, * returning 4 GLfloats. */static void FETCH(f_luminance_alpha_f16)( const struct gl_texture_image *texImage,                                    GLint i, GLint j, GLint k, GLfloat *texel ){   const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2);   texel[RCOMP] =   texel[GCOMP] =   texel[BCOMP] = _mesa_half_to_float(src[0]);   texel[ACOMP] = _mesa_half_to_float(src[1]);}#if DIM == 3static void store_texel_luminance_alpha_f16(struct gl_texture_image *texImage,                                  GLint i, GLint j, GLint k, const void *texel){   const GLfloat *rgba = (const GLfloat *) texel;   GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2);   dst[0] = _mesa_float_to_half(rgba[RCOMP]);   dst[1] = _mesa_float_to_half(rgba[ACOMP]);}#endif/* MESA_FORMAT_INTENSITY_F32 *************************************************//* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT32 texture, * returning 4 GLfloats. */static void FETCH(f_intensity_f32)( const struct gl_texture_image *texImage,                                    GLint i, GLint j, GLint k, GLfloat *texel ){   const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1);   texel[RCOMP] =   texel[GCOMP] =   texel[BCOMP] =   texel[ACOMP] = src[0];}#if DIM == 3static void store_texel_intensity_f32(struct gl_texture_image *texImage,                                  GLint i, GLint j, GLint k, const void *texel){   const GLfloat *rgba = (const GLfloat *) texel;   GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1);   dst[0] = rgba[RCOMP];}#endif/* MESA_FORMAT_INTENSITY_F16 *************************************************//* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT16 texture, * returning 4 GLfloats. */static void FETCH(f_intensity_f16)( const struct gl_texture_image *texImage,                                    GLint i, GLint j, GLint k, GLfloat *texel ){   const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1);   texel[RCOMP] =   texel[GCOMP] =   texel[BCOMP] =   texel[ACOMP] = _mesa_half_to_float(src[0]);}#if DIM == 3static void store_texel_intensity_f16(struct gl_texture_image *texImage,                                  GLint i, GLint j, GLint k, const void *texel){   const GLfloat *rgba = (const GLfloat *) texel;   GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1);   dst[0] = _mesa_float_to_half(rgba[RCOMP]);}#endif/* * Begin Hardware formats *//* MESA_FORMAT_RGBA8888 ******************************************************//* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLchans */static void FETCH(rgba8888)( const struct gl_texture_image *texImage,			     GLint i, GLint j, GLint k, GLchan *texel ){   const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);   texel[RCOMP] = UBYTE_TO_CHAN( (s >> 24)        );   texel[GCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff );   texel[BCOMP] = UBYTE_TO_CHAN( (s >>  8) & 0xff );   texel[ACOMP] = UBYTE_TO_CHAN( (s      ) & 0xff );}#if DIM == 3static void store_texel_rgba8888(struct gl_texture_image *texImage,                                 GLint i, GLint j, GLint k, const void *texel){   const GLubyte *rgba = (const GLubyte *) texel;   GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);   *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);}#endif/* MESA_FORMAT_RGBA888_REV ***************************************************//* Fetch texel from 1D, 2D or 3D abgr8888 texture, return 4 GLchans */static void FETCH(rgba8888_rev)( const struct gl_texture_image *texImage,                                 GLint i, GLint j, GLint k, GLchan *texel ){   const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);   texel[RCOMP] = UBYTE_TO_CHAN( (s      ) & 0xff );   texel[GCOMP] = UBYTE_TO_CHAN( (s >>  8) & 0xff );   texel[BCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff );   texel[ACOMP] = UBYTE_TO_CHAN( (s >> 24)        );}#if DIM == 3static void store_texel_rgba8888_rev(struct gl_texture_image *texImage,                                  GLint i, GLint j, GLint k, const void *texel){   const GLubyte *rgba = (const GLubyte *) texel;   GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);   *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);}#endif/* MESA_FORMAT_ARGB8888 ******************************************************//* Fetch texel from 1D, 2D or 3D argb8888 texture, return 4 GLchans */static void FETCH(argb8888)( const struct gl_texture_image *texImage,			     GLint i, GLint j, GLint k, GLchan *texel ){   const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);   texel[RCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff );   texel[GCOMP] = UBYTE_TO_CHAN( (s >>  8) & 0xff );   texel[BCOMP] = UBYTE_TO_CHAN( (s      ) & 0xff );   texel[ACOMP] = UBYTE_TO_CHAN( (s >> 24)        );}#if DIM == 3static void store_texel_argb8888(struct gl_texture_image *texImage,                                 GLint i, GLint j, GLint k, const void *texel){   const GLubyte *rgba = (const GLubyte *) texel;   GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);   *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);}#endif/* MESA_FORMAT_ARGB8888_REV **************************************************//* Fetch texel from 1D, 2D or 3D argb8888_rev texture, return 4 GLchans */static void FETCH(argb8888_rev)( const struct gl_texture_image *texImage,                                 GLint i, GLint j, GLint k, GLchan *texel ){   const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);   texel[RCOMP] = UBYTE_TO_CHAN( (s >>  8) & 0xff );   texel[GCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff );   texel[BCOMP] = UBYTE_TO_CHAN( (s >> 24)        );   texel[ACOMP] = UBYTE_TO_CHAN( (s      ) & 0xff );}#if DIM == 3static void store_texel_argb8888_rev(struct gl_texture_image *texImage,                                  GLint i, GLint j, GLint k, const void *texel){   const GLubyte *rgba = (const GLubyte *) texel;   GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);   *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);}#endif/* MESA_FORMAT_RGB888 ********************************************************//* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */static void FETCH(rgb888)( const struct gl_texture_image *texImage,			   GLint i, GLint j, GLint k, GLchan *texel ){   const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3);   texel[RCOMP] = UBYTE_TO_CHAN( src[2] );   texel[GCOMP] = UBYTE_TO_CHAN( src[1] );   texel[BCOMP] = UBYTE_TO_CHAN( src[0] );   texel[ACOMP] = CHAN_MAX;}#if DIM == 3static void store_texel_rgb888(struct gl_texture_image *texImage,                               GLint i, GLint j, GLint k, const void *texel){   const GLubyte *rgba = (const GLubyte *) texel;   GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3);   dst[0] = rgba[RCOMP];   dst[1] = rgba[GCOMP];   dst[2] = rgba[BCOMP];}#endif/* MESA_FORMAT_BGR888 ********************************************************//* Fetch texel from 1D, 2D or 3D bgr888 texture, return 4 GLchans */static void FETCH(bgr888)( const struct gl_texture_image *texImage,			   GLint i, GLint j, GLint k, GLchan *texel ){   const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3);   texel[RCOMP] = UBYTE_TO_CHAN( src[0] );   texel[GCOMP] = UBYTE_TO_CHAN( src[1] );   texel[BCOMP] = UBYTE_TO_CHAN( src[2] );   texel[ACOMP] = CHAN_MAX;}#if DIM == 3static void store_texel_bgr888(struct gl_texture_image *texImage,                               GLint i, GLint j, GLint k, const void *texel){   const GLubyte *rgba = (const GLubyte *) texel;   GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3);   dst[0] = rgba[BCOMP];   dst[1] = rgba[GCOMP];   dst[2] = rgba[RCOMP];}#endif/* use color expansion like (g << 2) | (g >> 4) (does somewhat random rounding)   instead of slow (g << 2) * 255 / 252 (always rounds down) *//* MESA_FORMAT_RGB565 ********************************************************//* Fetch texel from 1D, 2D or 3D rgb565 texture, return 4 GLchans */static void FETCH(rgb565)( const struct gl_texture_image *texImage,			   GLint i, GLint j, GLint k, GLchan *texel ){   const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);   const GLushort s = *src;   texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) );   texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xfc) | ((s >>  9) & 0x3) );   texel[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) | ((s >>  2) & 0x7) );   texel[ACOMP] = CHAN_MAX;}#if DIM == 3static void store_texel_rgb565(struct gl_texture_image *texImage,                               GLint i, GLint j, GLint k, const void *texel){   const GLubyte *rgba = (const GLubyte *) texel;   GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);   *dst = PACK_COLOR_565(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);}#endif/* MESA_FORMAT_RGB565_REV ****************************************************//* Fetch texel from 1D, 2D or 3D rgb565_rev texture, return 4 GLchans */static void FETCH(rgb565_rev)( const struct gl_texture_image *texImage,                               GLint i, GLint j, GLint k, GLchan *texel ){   const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);   const GLushort s = (*src >> 8) | (*src << 8); /* byte swap */   texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) );   texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xfc) | ((s >>  9) & 0x3) );   texel[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) | ((s >>  2) & 0x7) );   texel[ACOMP] = CHAN_MAX;}#if DIM == 3static void store_texel_rgb565_rev(struct gl_texture_image *texImage,                                  GLint i, GLint j, GLint k, const void *texel){   const GLubyte *rgba = (const GLubyte *) texel;   GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);   *dst = PACK_COLOR_565(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]);}#endif/* MESA_FORMAT_ARGB4444 ******************************************************//* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */static void FETCH(argb4444)( const struct gl_texture_image *texImage,			     GLint i, GLint j, GLint k, GLchan *texel ){   const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);   const GLushort s = *src;   texel[RCOMP] = UBYTE_TO_CHAN( ((s >>  8) & 0xf) | ((s >> 4) & 0xf0) );   texel[GCOMP] = UBYTE_TO_CHAN( ((s >>  4) & 0xf) | ((s     ) & 0xf0) );   texel[BCOMP] = UBYTE_TO_CHAN( ((s      ) & 0xf) | ((s << 4) & 0xf0) );   texel[ACOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) | ((s >> 8) & 0xf0) );}#if DIM == 3static void store_texel_argb4444(struct gl_texture_image *texImage,                                 GLint i, GLint j, GLint k, const void *texel){   const GLubyte *rgba = (const GLubyte *) texel;   GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);   *dst = PACK_COLOR_4444(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);}#endif/* MESA_FORMAT_ARGB4444_REV **************************************************//* Fetch texel from 1D, 2D or 3D argb4444_rev texture, return 4 GLchans */static void FETCH(argb4444_rev)( const struct gl_texture_image *texImage,                                 GLint i, GLint j, GLint k, GLchan *texel ){   const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1);   texel[RCOMP] = UBYTE_TO_CHAN( ((s      ) & 0xf) | ((s << 4) & 0xf0) );   texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) | ((s >> 8) & 0xf0) );   texel[BCOMP] = UBYTE_TO_CHAN( ((s >>  8) & 0xf) | ((s >> 4) & 0xf0) );   texel[ACOMP] = UBYTE_TO_CHAN( ((s >>  4) & 0xf) | ((s     ) & 0xf0) );}#if DIM == 3static void store_texel_argb4444_rev(struct gl_texture_image *texImage,                                 GLint i, GLint j, GLint k, const void *texel){   const GLubyte *rgba = (const GLubyte *) texel;   GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);   *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]);}#endif/* MESA_FORMAT_ARGB1555 ******************************************************//* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */static void FETCH(argb1555)( const struct gl_texture_image *texImage,			     GLint i, GLint j, GLint k, GLchan *texel ){   const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -