📄 texformat_tmp.h
字号:
}#if DIM == 3static void store_texel_rgb_f32(struct gl_texture_image *texImage, GLint i, GLint j, GLint k, const void *texel){ const GLfloat *depth = (const GLfloat *) texel; GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); dst[0] = *depth;}#endif/* MESA_FORMAT_RGB_F16 *******************************************************//* Fetch texel from 1D, 2D or 3D RGB_FLOAT16 texture, * returning 4 GLfloats. */static void FETCH(f_rgb_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, 3); texel[RCOMP] = _mesa_half_to_float(src[0]); texel[GCOMP] = _mesa_half_to_float(src[1]); texel[BCOMP] = _mesa_half_to_float(src[2]); texel[ACOMP] = 1.0F;}#if DIM == 3static void store_texel_rgb_f16(struct gl_texture_image *texImage, GLint i, GLint j, GLint k, const void *texel){ const GLfloat *depth = (const GLfloat *) texel; GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); dst[0] = _mesa_float_to_half(*depth);}#endif/* MESA_FORMAT_ALPHA_F32 *****************************************************//* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT32 texture, * returning 4 GLfloats. */static void FETCH(f_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, 1); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = 0.0F; texel[ACOMP] = src[0];}#if DIM == 3static void store_texel_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, 1); dst[0] = rgba[ACOMP];}#endif/* MESA_FORMAT_ALPHA_F32 *****************************************************//* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT16 texture, * returning 4 GLfloats. */static void FETCH(f_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, 1); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = 0.0F; texel[ACOMP] = _mesa_half_to_float(src[0]);}#if DIM == 3static 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -