core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

texstore.h File Reference


Detailed Description

Texture image storage routines.

Author:
Brian Paul

#include "mtypes.h"

Functions

GLboolean _mesa_texstore_rgba (TEXSTORE_PARAMS)
 Store an image in any of the formats: _mesa_texformat_rgba _mesa_texformat_rgb _mesa_texformat_alpha _mesa_texformat_luminance _mesa_texformat_luminance_alpha _mesa_texformat_intensity.
GLboolean _mesa_texstore_color_index (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_rgba8888 (TEXSTORE_PARAMS)
 Store a texture in MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV.
GLboolean _mesa_texstore_argb8888 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_rgb888 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_bgr888 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_rgb565 (TEXSTORE_PARAMS)
 Store an rgb565 or rgb565_rev texture image.
GLboolean _mesa_texstore_rgb565_rev (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_rgba4444 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_argb4444 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_argb4444_rev (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_rgba5551 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_argb1555 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_argb1555_rev (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_al88 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_al88_rev (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_rgb332 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_a8 (TEXSTORE_PARAMS)
 Texstore for _mesa_texformat_a8, _mesa_texformat_l8, _mesa_texformat_i8.
GLboolean _mesa_texstore_ci8 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_ycbcr (TEXSTORE_PARAMS)
 Texstore for _mesa_texformat_ycbcr or _mesa_texformat_ycbcr_rev.
GLboolean _mesa_texstore_z24_s8 (TEXSTORE_PARAMS)
 Store a combined depth/stencil texture image.
GLboolean _mesa_texstore_s8_z24 (TEXSTORE_PARAMS)
 Store a combined depth/stencil texture image.
GLboolean _mesa_texstore_z16 (TEXSTORE_PARAMS)
 Store a 16-bit integer depth component texture image.
GLboolean _mesa_texstore_z32 (TEXSTORE_PARAMS)
 Store a 32-bit integer depth component texture image.
GLboolean _mesa_texstore_rgba_float32 (TEXSTORE_PARAMS)
 Store an image in any of the formats: _mesa_texformat_rgba_float32 _mesa_texformat_rgb_float32 _mesa_texformat_alpha_float32 _mesa_texformat_luminance_float32 _mesa_texformat_luminance_alpha_float32 _mesa_texformat_intensity_float32.
GLboolean _mesa_texstore_rgba_float16 (TEXSTORE_PARAMS)
 As above, but store 16-bit floats.
GLboolean _mesa_texstore_rgb_fxt1 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_rgba_fxt1 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_rgb_dxt1 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_rgba_dxt1 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_rgba_dxt3 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_rgba_dxt5 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_dudv8 (TEXSTORE_PARAMS)
GLboolean _mesa_texstore_signed_rgba8888 (TEXSTORE_PARAMS)
 Store a texture in MESA_FORMAT_SIGNED_RGBA8888 or MESA_FORMAT_SIGNED_RGBA8888_REV.
GLchan * _mesa_make_temp_chan_image (GLcontext *ctx, GLuint dims, GLenum logicalBaseFormat, GLenum textureBaseFormat, GLint srcWidth, GLint srcHeight, GLint srcDepth, GLenum srcFormat, GLenum srcType, const GLvoid *srcAddr, const struct gl_pixelstore_attrib *srcPacking)
 Make a temporary (color) texture image with GLchan components.
void _mesa_set_fetch_functions (struct gl_texture_image *texImage, GLuint dims)
 Initialize the texture image's FetchTexelc and FetchTexelf methods.
void _mesa_store_teximage1d (GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage)
 This is the software fallback for Driver.TexImage1D() and Driver.CopyTexImage1D().
void _mesa_store_teximage2d (GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage)
void _mesa_store_teximage3d (GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage)
void _mesa_store_texsubimage1d (GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint width, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage)
void _mesa_store_texsubimage2d (GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint width, GLint height, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage)
void _mesa_store_texsubimage3d (GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage)
void _mesa_store_compressed_teximage1d (GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, GLsizei imageSize, const GLvoid *data, struct gl_texture_object *texObj, struct gl_texture_image *texImage)
void _mesa_store_compressed_teximage2d (GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border, GLsizei imageSize, const GLvoid *data, struct gl_texture_object *texObj, struct gl_texture_image *texImage)
 Fallback for Driver.CompressedTexImage2D().
void _mesa_store_compressed_teximage3d (GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint depth, GLint border, GLsizei imageSize, const GLvoid *data, struct gl_texture_object *texObj, struct gl_texture_image *texImage)
void _mesa_store_compressed_texsubimage1d (GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data, struct gl_texture_object *texObj, struct gl_texture_image *texImage)
 Fallback for Driver.CompressedTexSubImage1D().
void _mesa_store_compressed_texsubimage2d (GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data, struct gl_texture_object *texObj, struct gl_texture_image *texImage)
 Fallback for Driver.CompressedTexSubImage2D().
void _mesa_store_compressed_texsubimage3d (GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data, struct gl_texture_object *texObj, struct gl_texture_image *texImage)
 Fallback for Driver.CompressedTexSubImage3D().
const GLvoid * _mesa_validate_pbo_teximage (GLcontext *ctx, GLuint dimensions, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *unpack, const char *funcName)
 Check if an unpack PBO is active prior to fetching a texture image.
const GLvoid * _mesa_validate_pbo_compressed_teximage (GLcontext *ctx, GLsizei imageSize, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, const char *funcName)
 Check if an unpack PBO is active prior to fetching a compressed texture image.
void _mesa_unmap_teximage_pbo (GLcontext *ctx, const struct gl_pixelstore_attrib *unpack)
 This function must be called after either of the validate_pbo_*_teximage() functions.


Function Documentation

GLchan* _mesa_make_temp_chan_image ( GLcontext ctx,
GLuint  dims,
GLenum  logicalBaseFormat,
GLenum  textureBaseFormat,
GLint  srcWidth,
GLint  srcHeight,
GLint  srcDepth,
GLenum  srcFormat,
GLenum  srcType,
const GLvoid *  srcAddr,
const struct gl_pixelstore_attrib srcPacking 
)

Make a temporary (color) texture image with GLchan components.

Apply all needed pixel unpacking and pixel transfer operations. Note that there are both logicalBaseFormat and textureBaseFormat parameters. Suppose the user specifies GL_LUMINANCE as the internal texture format but the graphics hardware doesn't support luminance textures. So, might use an RGB hardware format instead. If logicalBaseFormat != textureBaseFormat we have some extra work to do.

Parameters:
ctx the rendering context
dims image dimensions: 1, 2 or 3
logicalBaseFormat basic texture derived from the user's internal texture format value
textureBaseFormat the actual basic format of the texture
srcWidth source image width
srcHeight source image height
srcDepth source image depth
srcFormat source image format
srcType source image type
srcAddr source image address
srcPacking source image pixel packing
Returns:
resulting image with format = textureBaseFormat and type = GLchan.

void _mesa_set_fetch_functions ( struct gl_texture_image texImage,
GLuint  dims 
)

Initialize the texture image's FetchTexelc and FetchTexelf methods.

void _mesa_store_compressed_teximage1d ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  internalFormat,
GLint  width,
GLint  border,
GLsizei  imageSize,
const GLvoid *  data,
struct gl_texture_object texObj,
struct gl_texture_image texImage 
)

void _mesa_store_compressed_teximage2d ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  internalFormat,
GLint  width,
GLint  height,
GLint  border,
GLsizei  imageSize,
const GLvoid *  data,
struct gl_texture_object texObj,
struct gl_texture_image texImage 
)

Fallback for Driver.CompressedTexImage2D().

void _mesa_store_compressed_teximage3d ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  internalFormat,
GLint  width,
GLint  height,
GLint  depth,
GLint  border,
GLsizei  imageSize,
const GLvoid *  data,
struct gl_texture_object texObj,
struct gl_texture_image texImage 
)

void _mesa_store_compressed_texsubimage1d ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  xoffset,
GLsizei  width,
GLenum  format,
GLsizei  imageSize,
const GLvoid *  data,
struct gl_texture_object texObj,
struct gl_texture_image texImage 
)

Fallback for Driver.CompressedTexSubImage1D().

void _mesa_store_compressed_texsubimage2d ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLsizei  width,
GLsizei  height,
GLenum  format,
GLsizei  imageSize,
const GLvoid *  data,
struct gl_texture_object texObj,
struct gl_texture_image texImage 
)

Fallback for Driver.CompressedTexSubImage2D().

void _mesa_store_compressed_texsubimage3d ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLint  zoffset,
GLsizei  width,
GLsizei  height,
GLsizei  depth,
GLenum  format,
GLsizei  imageSize,
const GLvoid *  data,
struct gl_texture_object texObj,
struct gl_texture_image texImage 
)

Fallback for Driver.CompressedTexSubImage3D().

void _mesa_store_teximage1d ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  internalFormat,
GLint  width,
GLint  border,
GLenum  format,
GLenum  type,
const GLvoid *  pixels,
const struct gl_pixelstore_attrib packing,
struct gl_texture_object texObj,
struct gl_texture_image texImage 
)

This is the software fallback for Driver.TexImage1D() and Driver.CopyTexImage1D().

See also:
_mesa_store_teximage2d() Note that the width may not be the actual texture width since it may be changed by convolution w/ GL_REDUCE. The texImage->Width field will have the actual texture size.

void _mesa_store_teximage2d ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  internalFormat,
GLint  width,
GLint  height,
GLint  border,
GLenum  format,
GLenum  type,
const GLvoid *  pixels,
const struct gl_pixelstore_attrib packing,
struct gl_texture_object texObj,
struct gl_texture_image texImage 
)

void _mesa_store_teximage3d ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  internalFormat,
GLint  width,
GLint  height,
GLint  depth,
GLint  border,
GLenum  format,
GLenum  type,
const GLvoid *  pixels,
const struct gl_pixelstore_attrib packing,
struct gl_texture_object texObj,
struct gl_texture_image texImage 
)

void _mesa_store_texsubimage1d ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  xoffset,
GLint  width,
GLenum  format,
GLenum  type,
const GLvoid *  pixels,
const struct gl_pixelstore_attrib packing,
struct gl_texture_object texObj,
struct gl_texture_image texImage 
)

void _mesa_store_texsubimage2d ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLint  width,
GLint  height,
GLenum  format,
GLenum  type,
const GLvoid *  pixels,
const struct gl_pixelstore_attrib packing,
struct gl_texture_object texObj,
struct gl_texture_image texImage 
)

void _mesa_store_texsubimage3d ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLint  zoffset,
GLint  width,
GLint  height,
GLint  depth,
GLenum  format,
GLenum  type,
const GLvoid *  pixels,
const struct gl_pixelstore_attrib packing,
struct gl_texture_object texObj,
struct gl_texture_image texImage 
)

GLboolean _mesa_texstore_a8 ( TEXSTORE_PARAMS   ) 

Texstore for _mesa_texformat_a8, _mesa_texformat_l8, _mesa_texformat_i8.

GLboolean _mesa_texstore_al88 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_al88_rev ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_argb1555 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_argb1555_rev ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_argb4444 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_argb4444_rev ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_argb8888 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_bgr888 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_ci8 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_color_index ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_dudv8 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_rgb332 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_rgb565 ( TEXSTORE_PARAMS   ) 

Store an rgb565 or rgb565_rev texture image.

GLboolean _mesa_texstore_rgb565_rev ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_rgb888 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_rgb_dxt1 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_rgb_fxt1 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_rgba ( TEXSTORE_PARAMS   ) 

Store an image in any of the formats: _mesa_texformat_rgba _mesa_texformat_rgb _mesa_texformat_alpha _mesa_texformat_luminance _mesa_texformat_luminance_alpha _mesa_texformat_intensity.

GLboolean _mesa_texstore_rgba4444 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_rgba5551 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_rgba8888 ( TEXSTORE_PARAMS   ) 

Store a texture in MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV.

GLboolean _mesa_texstore_rgba_dxt1 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_rgba_dxt3 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_rgba_dxt5 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_rgba_float16 ( TEXSTORE_PARAMS   ) 

As above, but store 16-bit floats.

GLboolean _mesa_texstore_rgba_float32 ( TEXSTORE_PARAMS   ) 

Store an image in any of the formats: _mesa_texformat_rgba_float32 _mesa_texformat_rgb_float32 _mesa_texformat_alpha_float32 _mesa_texformat_luminance_float32 _mesa_texformat_luminance_alpha_float32 _mesa_texformat_intensity_float32.

GLboolean _mesa_texstore_rgba_fxt1 ( TEXSTORE_PARAMS   ) 

GLboolean _mesa_texstore_s8_z24 ( TEXSTORE_PARAMS   ) 

Store a combined depth/stencil texture image.

GLboolean _mesa_texstore_signed_rgba8888 ( TEXSTORE_PARAMS   ) 

Store a texture in MESA_FORMAT_SIGNED_RGBA8888 or MESA_FORMAT_SIGNED_RGBA8888_REV.

GLboolean _mesa_texstore_ycbcr ( TEXSTORE_PARAMS   ) 

Texstore for _mesa_texformat_ycbcr or _mesa_texformat_ycbcr_rev.

GLboolean _mesa_texstore_z16 ( TEXSTORE_PARAMS   ) 

Store a 16-bit integer depth component texture image.

GLboolean _mesa_texstore_z24_s8 ( TEXSTORE_PARAMS   ) 

Store a combined depth/stencil texture image.

GLboolean _mesa_texstore_z32 ( TEXSTORE_PARAMS   ) 

Store a 32-bit integer depth component texture image.

void _mesa_unmap_teximage_pbo ( GLcontext ctx,
const struct gl_pixelstore_attrib unpack 
)

This function must be called after either of the validate_pbo_*_teximage() functions.

It unmaps the PBO buffer if it was mapped earlier.

const GLvoid* _mesa_validate_pbo_compressed_teximage ( GLcontext ctx,
GLsizei  imageSize,
const GLvoid *  pixels,
const struct gl_pixelstore_attrib packing,
const char *  funcName 
)

Check if an unpack PBO is active prior to fetching a compressed texture image.

If so, do bounds checking and map the buffer into main memory. Any errors detected will be recorded. The caller _must_ call _mesa_unmap_teximage_pbo() too!

const GLvoid* _mesa_validate_pbo_teximage ( GLcontext ctx,
GLuint  dimensions,
GLsizei  width,
GLsizei  height,
GLsizei  depth,
GLenum  format,
GLenum  type,
const GLvoid *  pixels,
const struct gl_pixelstore_attrib unpack,
const char *  funcName 
)

Check if an unpack PBO is active prior to fetching a texture image.

If so, do bounds checking and map the buffer into main memory. Any errors detected will be recorded. The caller _must_ call _mesa_unmap_teximage_pbo() too!


Generated on Sun Sep 27 06:47:46 2009 for Mesa Main by  doxygen 1.5.4