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

teximage.c File Reference


Detailed Description

Texture image-related functions.

#include "glheader.h"
#include "bufferobj.h"
#include "context.h"
#include "convolve.h"
#include "enums.h"
#include "fbobject.h"
#include "framebuffer.h"
#include "hash.h"
#include "image.h"
#include "imports.h"
#include "macros.h"
#include "state.h"
#include "texcompress.h"
#include "texformat.h"
#include "teximage.h"
#include "texstate.h"
#include "texstore.h"
#include "mtypes.h"

Data Structures

struct  cb_info
 Callback info for walking over FBO hash table. More...

Defines

#define NEW_COPY_TEX_STATE
 State changes which we care about for glCopyTex[Sub]Image() calls.

Functions

void * _mesa_alloc_texmemory (GLsizei bytes)
 We allocate texture memory on 512-byte boundaries so we can use MMX/SSE elsewhere.
void _mesa_free_texmemory (void *m)
 Free texture memory allocated with _mesa_alloc_texmemory().
static int logbase2 (int n)
GLint _mesa_base_tex_format (GLcontext *ctx, GLint internalFormat)
 Return the simple base format for a given internal texture format.
static GLboolean is_compressed_format (GLcontext *ctx, GLenum internalFormat)
 Test if it is a supported compressed format.
GLuint _mesa_tex_target_to_face (GLenum target)
 For cube map faces, return a face index in [0,5].
void _mesa_set_tex_image (struct gl_texture_object *tObj, GLenum target, GLint level, struct gl_texture_image *texImage)
 Store a gl_texture_image pointer in a gl_texture_object structure according to the target and level parameters.
struct gl_texture_image_mesa_new_texture_image (GLcontext *ctx)
 Allocate a texture image structure.
void _mesa_free_texture_image_data (GLcontext *ctx, struct gl_texture_image *texImage)
 Free texture image data.
void _mesa_delete_texture_image (GLcontext *ctx, struct gl_texture_image *texImage)
 Free texture image.
GLboolean _mesa_is_proxy_texture (GLenum target)
 Test if a target is a proxy target.
struct gl_texture_object_mesa_select_tex_object (GLcontext *ctx, const struct gl_texture_unit *texUnit, GLenum target)
 Get the texture object that corresponds to the target of the given texture unit.
struct gl_texture_image_mesa_select_tex_image (GLcontext *ctx, const struct gl_texture_object *texObj, GLenum target, GLint level)
 Get a texture image pointer from a texture object, given a texture target and mipmap level.
struct gl_texture_image_mesa_get_tex_image (GLcontext *ctx, struct gl_texture_object *texObj, GLenum target, GLint level)
 Like _mesa_select_tex_image() but if the image doesn't exist, allocate it and install it.
struct gl_texture_image_mesa_get_proxy_tex_image (GLcontext *ctx, GLenum target, GLint level)
 Return pointer to the specified proxy texture image.
GLint _mesa_max_texture_levels (GLcontext *ctx, GLenum target)
 Get the maximum number of allowed mipmap levels.
static void clear_teximage_fields (struct gl_texture_image *img)
 Reset the fields of a gl_texture_image struct to zero.
void _mesa_init_teximage_fields (GLcontext *ctx, GLenum target, struct gl_texture_image *img, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum internalFormat)
 Initialize basic fields of the gl_texture_image struct.
void _mesa_clear_texture_image (GLcontext *ctx, struct gl_texture_image *texImage)
 Free and clear fields of the gl_texture_image struct.
GLboolean _mesa_test_proxy_teximage (GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLenum format, GLenum type, GLint width, GLint height, GLint depth, GLint border)
 This is the fallback for Driver.TestProxyTexImage().
static GLboolean target_can_be_compressed (GLcontext *ctx, GLenum target)
 Helper function to determine whether a target supports compressed textures.
static GLboolean texture_error_check (GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLenum format, GLenum type, GLuint dimensions, GLint width, GLint height, GLint depth, GLint border)
 Test the glTexImage[123]D() parameters for errors.
static GLboolean subtexture_error_check (GLcontext *ctx, GLuint dimensions, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint width, GLint height, GLint depth, GLenum format, GLenum type)
 Test glTexSubImage[123]D() parameters for errors.
static GLboolean subtexture_error_check2 (GLcontext *ctx, GLuint dimensions, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const struct gl_texture_image *destTex)
static GLboolean copytexture_error_check (GLcontext *ctx, GLuint dimensions, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border)
 Test glCopyTexImage[12]D() parameters for errors.
static GLboolean copytexsubimage_error_check1 (GLcontext *ctx, GLuint dimensions, GLenum target, GLint level)
 Test glCopyTexSubImage[12]D() parameters for errors.
static GLboolean copytexsubimage_error_check2 (GLcontext *ctx, GLuint dimensions, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, const struct gl_texture_image *teximage)
 Second part of error checking for glCopyTexSubImage[12]D().
static void check_rtt_cb (GLuint key, void *data, void *userData)
 Check render to texture callback.
static void update_fbo_texture (GLcontext *ctx, struct gl_texture_object *texObj, GLuint face, GLuint level)
 When a texture image is specified we have to check if it's bound to any framebuffer objects (render to texture) in order to detect changes in size or format since that effects FBO completeness.
static INLINE void check_gen_mipmap (GLcontext *ctx, GLenum target, struct gl_texture_object *texObj, GLint level)
 If the texture object's GenerateMipmap flag is set and we've changed the texture base level image, regenerate the rest of the mipmap levels now.
static GLenum override_internal_format (GLenum internalFormat, GLint width, GLint height)
 Debug helper: override the user-requested internal format.
void GLAPIENTRY _mesa_TexImage1D (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_TexImage2D (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_TexImage3D (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_TexImage3DEXT (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_TexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_TexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_TexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
void GLAPIENTRY _mesa_CopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border)
void GLAPIENTRY _mesa_CopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
void GLAPIENTRY _mesa_CopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
void GLAPIENTRY _mesa_CopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
void GLAPIENTRY _mesa_CopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
static GLenum compressed_texture_error_check (GLcontext *ctx, GLint dimensions, GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize)
 Error checking for glCompressedTexImage[123]D().
static GLenum compressed_subtexture_error_check (GLcontext *ctx, GLint dimensions, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize)
 Error checking for glCompressedTexSubImage[123]D().
void GLAPIENTRY _mesa_CompressedTexImage1DARB (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data)
void GLAPIENTRY _mesa_CompressedTexImage2DARB (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
void GLAPIENTRY _mesa_CompressedTexImage3DARB (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)
void GLAPIENTRY _mesa_CompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data)
void GLAPIENTRY _mesa_CompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
void GLAPIENTRY _mesa_CompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)


Define Documentation

#define NEW_COPY_TEX_STATE

Value:

State changes which we care about for glCopyTex[Sub]Image() calls.

In particular, we care about pixel transfer state and buffer state (such as glReadBuffer to make sure we read from the right renderbuffer).


Function Documentation

void* _mesa_alloc_texmemory ( GLsizei  bytes  ) 

We allocate texture memory on 512-byte boundaries so we can use MMX/SSE elsewhere.

GLint _mesa_base_tex_format ( GLcontext ctx,
GLint  internalFormat 
)

Return the simple base format for a given internal texture format.

For example, given GL_LUMINANCE12_ALPHA4, return GL_LUMINANCE_ALPHA.

Parameters:
ctx GL context.
internalFormat the internal texture format token or 1, 2, 3, or 4.
Returns:
the corresponding base internal format (GL_ALPHA, GL_LUMINANCE, GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA), or -1 if invalid enum.
This is the format which is used during texture application (i.e. the texture format and env mode determine the arithmetic used.

XXX this could be static

void _mesa_clear_texture_image ( GLcontext ctx,
struct gl_texture_image texImage 
)

Free and clear fields of the gl_texture_image struct.

Parameters:
ctx GL context.
texImage texture image structure to be cleared.
After the call, texImage will have no data associated with it. Its fields are cleared so that its parent object will test incomplete.

void GLAPIENTRY _mesa_CompressedTexImage1DARB ( GLenum  target,
GLint  level,
GLenum  internalFormat,
GLsizei  width,
GLint  border,
GLsizei  imageSize,
const GLvoid *  data 
)

void GLAPIENTRY _mesa_CompressedTexImage2DARB ( GLenum  target,
GLint  level,
GLenum  internalFormat,
GLsizei  width,
GLsizei  height,
GLint  border,
GLsizei  imageSize,
const GLvoid *  data 
)

void GLAPIENTRY _mesa_CompressedTexImage3DARB ( GLenum  target,
GLint  level,
GLenum  internalFormat,
GLsizei  width,
GLsizei  height,
GLsizei  depth,
GLint  border,
GLsizei  imageSize,
const GLvoid *  data 
)

void GLAPIENTRY _mesa_CompressedTexSubImage1DARB ( GLenum  target,
GLint  level,
GLint  xoffset,
GLsizei  width,
GLenum  format,
GLsizei  imageSize,
const GLvoid *  data 
)

void GLAPIENTRY _mesa_CompressedTexSubImage2DARB ( GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLsizei  width,
GLsizei  height,
GLenum  format,
GLsizei  imageSize,
const GLvoid *  data 
)

void GLAPIENTRY _mesa_CompressedTexSubImage3DARB ( GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLint  zoffset,
GLsizei  width,
GLsizei  height,
GLsizei  depth,
GLenum  format,
GLsizei  imageSize,
const GLvoid *  data 
)

void GLAPIENTRY _mesa_CopyTexImage1D ( GLenum  target,
GLint  level,
GLenum  internalFormat,
GLint  x,
GLint  y,
GLsizei  width,
GLint  border 
)

void GLAPIENTRY _mesa_CopyTexImage2D ( GLenum  target,
GLint  level,
GLenum  internalFormat,
GLint  x,
GLint  y,
GLsizei  width,
GLsizei  height,
GLint  border 
)

void GLAPIENTRY _mesa_CopyTexSubImage1D ( GLenum  target,
GLint  level,
GLint  xoffset,
GLint  x,
GLint  y,
GLsizei  width 
)

void GLAPIENTRY _mesa_CopyTexSubImage2D ( GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLint  x,
GLint  y,
GLsizei  width,
GLsizei  height 
)

void GLAPIENTRY _mesa_CopyTexSubImage3D ( GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLint  zoffset,
GLint  x,
GLint  y,
GLsizei  width,
GLsizei  height 
)

void _mesa_delete_texture_image ( GLcontext ctx,
struct gl_texture_image texImage 
)

Free texture image.

Parameters:
texImage texture image.
Free the texture image structure and the associated image data.

void _mesa_free_texmemory ( void *  m  ) 

Free texture memory allocated with _mesa_alloc_texmemory().

void _mesa_free_texture_image_data ( GLcontext ctx,
struct gl_texture_image texImage 
)

Free texture image data.

This function is a fallback called via ctx->Driver.FreeTexImageData().

Parameters:
texImage texture image.
Free the texture image data if it's not marked as client data.

struct gl_texture_image* _mesa_get_proxy_tex_image ( GLcontext ctx,
GLenum  target,
GLint  level 
) [read]

Return pointer to the specified proxy texture image.

Note that proxy textures are per-context, not per-texture unit.

Returns:
pointer to texture image or NULL if invalid target, invalid level, or out of memory.

struct gl_texture_image* _mesa_get_tex_image ( GLcontext ctx,
struct gl_texture_object texObj,
GLenum  target,
GLint  level 
) [read]

Like _mesa_select_tex_image() but if the image doesn't exist, allocate it and install it.

Only return NULL if passed a bad parameter or run out of memory.

void _mesa_init_teximage_fields ( GLcontext ctx,
GLenum  target,
struct gl_texture_image img,
GLsizei  width,
GLsizei  height,
GLsizei  depth,
GLint  border,
GLenum  internalFormat 
)

Initialize basic fields of the gl_texture_image struct.

Parameters:
ctx GL context.
target texture target (GL_TEXTURE_1D, GL_TEXTURE_RECTANGLE, etc).
img texture image structure to be initialized.
width image width.
height image height.
depth image depth.
border image border.
internalFormat internal format.
Fills in the fields of img with the given information. Note: width, height and depth include the border.

GLboolean _mesa_is_proxy_texture ( GLenum  target  ) 

Test if a target is a proxy target.

Parameters:
target texture target.
Returns:
GL_TRUE if the target is a proxy target, GL_FALSE otherwise.

GLint _mesa_max_texture_levels ( GLcontext ctx,
GLenum  target 
)

Get the maximum number of allowed mipmap levels.

Parameters:
ctx GL context.
target texture target.
Returns:
the maximum number of allowed mipmap levels for the given texture target, or zero if passed a bad target.
See also:
gl_constants.

struct gl_texture_image* _mesa_new_texture_image ( GLcontext ctx  )  [read]

Allocate a texture image structure.

Called via ctx->Driver.NewTextureImage() unless overriden by a device driver.

Returns:
a pointer to gl_texture_image struct with all fields initialized to zero.

struct gl_texture_image* _mesa_select_tex_image ( GLcontext ctx,
const struct gl_texture_object texObj,
GLenum  target,
GLint  level 
) [read]

Get a texture image pointer from a texture object, given a texture target and mipmap level.

The target and level parameters should have already been error-checked.

Parameters:
ctx GL context.
texObj texture unit.
target texture target.
level image level.
Returns:
pointer to the texture image structure, or NULL on failure.

struct gl_texture_object* _mesa_select_tex_object ( GLcontext ctx,
const struct gl_texture_unit texUnit,
GLenum  target 
) [read]

Get the texture object that corresponds to the target of the given texture unit.

Parameters:
ctx GL context.
texUnit texture unit.
target texture target.
Returns:
pointer to the texture object on success, or NULL on failure.
See also:
gl_texture_unit.

void _mesa_set_tex_image ( struct gl_texture_object tObj,
GLenum  target,
GLint  level,
struct gl_texture_image texImage 
)

Store a gl_texture_image pointer in a gl_texture_object structure according to the target and level parameters.

Parameters:
tObj texture object.
target texture target.
level image level.
texImage texture image.
This was basically prompted by the introduction of cube maps.

GLboolean _mesa_test_proxy_teximage ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  internalFormat,
GLenum  format,
GLenum  type,
GLint  width,
GLint  height,
GLint  depth,
GLint  border 
)

This is the fallback for Driver.TestProxyTexImage().

Test the texture level, width, height and depth against the ctx->Const limits for textures.

A hardware driver might override this function if, for example, the max 3D texture size is 512x512x64 (i.e. not a cube).

Note that width, height, depth == 0 is not an error. However, a texture with zero width/height/depth will be considered "incomplete" and texturing will effectively be disabled.

Parameters:
target one of GL_PROXY_TEXTURE_1D, GL_PROXY_TEXTURE_2D, GL_PROXY_TEXTURE_3D, GL_PROXY_TEXTURE_RECTANGLE_NV, GL_PROXY_TEXTURE_CUBE_MAP_ARB.
level as passed to glTexImage
internalFormat as passed to glTexImage
format as passed to glTexImage
type as passed to glTexImage
width as passed to glTexImage
height as passed to glTexImage
depth as passed to glTexImage
border as passed to glTexImage
Returns:
GL_TRUE if the image is acceptable, GL_FALSE if not acceptable.

GLuint _mesa_tex_target_to_face ( GLenum  target  ) 

For cube map faces, return a face index in [0,5].

For other targets return 0;

void GLAPIENTRY _mesa_TexImage1D ( GLenum  target,
GLint  level,
GLint  internalFormat,
GLsizei  width,
GLint  border,
GLenum  format,
GLenum  type,
const GLvoid *  pixels 
)

void GLAPIENTRY _mesa_TexImage2D ( GLenum  target,
GLint  level,
GLint  internalFormat,
GLsizei  width,
GLsizei  height,
GLint  border,
GLenum  format,
GLenum  type,
const GLvoid *  pixels 
)

void GLAPIENTRY _mesa_TexImage3D ( GLenum  target,
GLint  level,
GLint  internalFormat,
GLsizei  width,
GLsizei  height,
GLsizei  depth,
GLint  border,
GLenum  format,
GLenum  type,
const GLvoid *  pixels 
)

void GLAPIENTRY _mesa_TexImage3DEXT ( GLenum  target,
GLint  level,
GLenum  internalFormat,
GLsizei  width,
GLsizei  height,
GLsizei  depth,
GLint  border,
GLenum  format,
GLenum  type,
const GLvoid *  pixels 
)

void GLAPIENTRY _mesa_TexSubImage1D ( GLenum  target,
GLint  level,
GLint  xoffset,
GLsizei  width,
GLenum  format,
GLenum  type,
const GLvoid *  pixels 
)

void GLAPIENTRY _mesa_TexSubImage2D ( GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLsizei  width,
GLsizei  height,
GLenum  format,
GLenum  type,
const GLvoid *  pixels 
)

void GLAPIENTRY _mesa_TexSubImage3D ( GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLint  zoffset,
GLsizei  width,
GLsizei  height,
GLsizei  depth,
GLenum  format,
GLenum  type,
const GLvoid *  pixels 
)

static INLINE void check_gen_mipmap ( GLcontext ctx,
GLenum  target,
struct gl_texture_object texObj,
GLint  level 
) [static]

If the texture object's GenerateMipmap flag is set and we've changed the texture base level image, regenerate the rest of the mipmap levels now.

static void check_rtt_cb ( GLuint  key,
void *  data,
void *  userData 
) [static]

Check render to texture callback.

Called from _mesa_HashWalk().

static void clear_teximage_fields ( struct gl_texture_image img  )  [static]

Reset the fields of a gl_texture_image struct to zero.

Parameters:
img texture image structure.
This is called when a proxy texture test fails, we set all the image members (except DriverData) to zero. It's also used in glTexImage[123]D as a safeguard to be sure all required fields get initialized properly by the Driver.TexImage[123]D functions.

static GLenum compressed_subtexture_error_check ( GLcontext ctx,
GLint  dimensions,
GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLint  zoffset,
GLsizei  width,
GLsizei  height,
GLsizei  depth,
GLenum  format,
GLsizei  imageSize 
) [static]

Error checking for glCompressedTexSubImage[123]D().

Warning:
There are some bad assumptions here about the size of compressed texture tiles (multiple of 4) used to test the validity of the offset and size parameters.
Returns:
error code or GL_NO_ERROR.

static GLenum compressed_texture_error_check ( GLcontext ctx,
GLint  dimensions,
GLenum  target,
GLint  level,
GLenum  internalFormat,
GLsizei  width,
GLsizei  height,
GLsizei  depth,
GLint  border,
GLsizei  imageSize 
) [static]

Error checking for glCompressedTexImage[123]D().

Returns:
error code or GL_NO_ERROR.

static GLboolean copytexsubimage_error_check1 ( GLcontext ctx,
GLuint  dimensions,
GLenum  target,
GLint  level 
) [static]

Test glCopyTexSubImage[12]D() parameters for errors.

Note that this is the first part of error checking. See also copytexsubimage_error_check2() below for the second part.

Parameters:
ctx GL context.
dimensions texture image dimensions (must be 1, 2 or 3).
target texture target given by the user.
level image level given by the user.
Returns:
GL_TRUE if an error was detected, or GL_FALSE if no errors.

static GLboolean copytexsubimage_error_check2 ( GLcontext ctx,
GLuint  dimensions,
GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLint  zoffset,
GLsizei  width,
GLsizei  height,
const struct gl_texture_image teximage 
) [static]

Second part of error checking for glCopyTexSubImage[12]D().

Parameters:
xoffset sub-image x offset given by the user.
yoffset sub-image y offset given by the user.
zoffset sub-image z offset given by the user.
width image width given by the user.
height image height given by the user.

static GLboolean copytexture_error_check ( GLcontext ctx,
GLuint  dimensions,
GLenum  target,
GLint  level,
GLint  internalFormat,
GLint  width,
GLint  height,
GLint  border 
) [static]

Test glCopyTexImage[12]D() parameters for errors.

Parameters:
ctx GL context.
dimensions texture image dimensions (must be 1, 2 or 3).
target texture target given by the user.
level image level given by the user.
internalFormat internal format given by the user.
width image width given by the user.
height image height given by the user.
border texture border.
Returns:
GL_TRUE if an error was detected, or GL_FALSE if no errors.
Verifies each of the parameters against the constants specified in __GLcontextRec::Const and the supported extensions, and according to the OpenGL specification.

static GLboolean is_compressed_format ( GLcontext ctx,
GLenum  internalFormat 
) [static]

Test if it is a supported compressed format.

Parameters:
internalFormat the internal format token provided by the user.
GL_TRUE if internalFormat is a supported compressed format, or GL_FALSE otherwise.

Currently only GL_COMPRESSED_RGB_FXT1_3DFX and GL_COMPRESSED_RGBA_FXT1_3DFX are supported.

static int logbase2 ( int  n  )  [static]

static GLenum override_internal_format ( GLenum  internalFormat,
GLint  width,
GLint  height 
) [static]

Debug helper: override the user-requested internal format.

static GLboolean subtexture_error_check ( GLcontext ctx,
GLuint  dimensions,
GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLint  zoffset,
GLint  width,
GLint  height,
GLint  depth,
GLenum  format,
GLenum  type 
) [static]

Test glTexSubImage[123]D() parameters for errors.

Parameters:
ctx GL context.
dimensions texture image dimensions (must be 1, 2 or 3).
target texture target given by the user.
level image level given by the user.
xoffset sub-image x offset given by the user.
yoffset sub-image y offset given by the user.
zoffset sub-image z offset given by the user.
format pixel data format given by the user.
type pixel data type given by the user.
width image width given by the user.
height image height given by the user.
depth image depth given by the user.
Returns:
GL_TRUE if an error was detected, or GL_FALSE if no errors.
Verifies each of the parameters against the constants specified in __GLcontextRec::Const and the supported extensions, and according to the OpenGL specification.

static GLboolean subtexture_error_check2 ( GLcontext ctx,
GLuint  dimensions,
GLenum  target,
GLint  level,
GLint  xoffset,
GLint  yoffset,
GLint  zoffset,
GLint  width,
GLint  height,
GLint  depth,
GLenum  format,
GLenum  type,
const struct gl_texture_image destTex 
) [static]

static GLboolean target_can_be_compressed ( GLcontext ctx,
GLenum  target 
) [static]

Helper function to determine whether a target supports compressed textures.

static GLboolean texture_error_check ( GLcontext ctx,
GLenum  target,
GLint  level,
GLint  internalFormat,
GLenum  format,
GLenum  type,
GLuint  dimensions,
GLint  width,
GLint  height,
GLint  depth,
GLint  border 
) [static]

Test the glTexImage[123]D() parameters for errors.

Parameters:
ctx GL context.
target texture target given by the user.
level image level given by the user.
internalFormat internal format given by the user.
format pixel data format given by the user.
type pixel data type given by the user.
dimensions texture image dimensions (must be 1, 2 or 3).
width image width given by the user.
height image height given by the user.
depth image depth given by the user.
border image border given by the user.
Returns:
GL_TRUE if an error was detected, or GL_FALSE if no errors.
Verifies each of the parameters against the constants specified in __GLcontextRec::Const and the supported extensions, and according to the OpenGL specification.

static void update_fbo_texture ( GLcontext ctx,
struct gl_texture_object texObj,
GLuint  face,
GLuint  level 
) [static]

When a texture image is specified we have to check if it's bound to any framebuffer objects (render to texture) in order to detect changes in size or format since that effects FBO completeness.

Any FBOs rendering into the texture must be re-validated.


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