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

shared.c File Reference


Detailed Description

Shared-context state.

#include "imports.h"
#include "mtypes.h"
#include "hash.h"
#include "arrayobj.h"
#include "bufferobj.h"
#include "shared.h"
#include "shader/program.h"
#include "shader/shader_api.h"

Functions

struct gl_shared_state_mesa_alloc_shared_state (GLcontext *ctx)
 Allocate and initialize a shared context state structure.
static void delete_displaylist_cb (GLuint id, void *data, void *userData)
 Callback for deleting a display list.
static void delete_texture_cb (GLuint id, void *data, void *userData)
 Callback for deleting a texture object.
static void delete_program_cb (GLuint id, void *data, void *userData)
 Callback for deleting a program object.
static void delete_bufferobj_cb (GLuint id, void *data, void *userData)
 Callback for deleting a buffer object.
static void free_shader_program_data_cb (GLuint id, void *data, void *userData)
 Callback for freeing shader program data.
static void delete_shader_cb (GLuint id, void *data, void *userData)
 Callback for deleting shader and shader programs objects.
static void delete_framebuffer_cb (GLuint id, void *data, void *userData)
 Callback for deleting a framebuffer object.
static void delete_renderbuffer_cb (GLuint id, void *data, void *userData)
 Callback for deleting a renderbuffer object.
void _mesa_free_shared_state (GLcontext *ctx, struct gl_shared_state *shared)
 Deallocate a shared state object and all children structures.


Function Documentation

struct gl_shared_state* _mesa_alloc_shared_state ( GLcontext ctx  )  [read]

Allocate and initialize a shared context state structure.

Initializes the display list, texture objects and vertex programs hash tables, allocates the texture objects. If it runs out of memory, frees everything already allocated before returning NULL.

Returns:
pointer to a gl_shared_state structure on success, or NULL on failure.

void _mesa_free_shared_state ( GLcontext ctx,
struct gl_shared_state shared 
)

Deallocate a shared state object and all children structures.

Parameters:
ctx GL context.
shared shared state pointer.
Frees the display lists, the texture objects (calling the driver texture deletion callback to free its private data) and the vertex programs, as well as their hash tables.

See also:
alloc_shared_state().

static void delete_bufferobj_cb ( GLuint  id,
void *  data,
void *  userData 
) [static]

Callback for deleting a buffer object.

Called by _mesa_HashDeleteAll().

static void delete_displaylist_cb ( GLuint  id,
void *  data,
void *  userData 
) [static]

Callback for deleting a display list.

Called by _mesa_HashDeleteAll().

static void delete_framebuffer_cb ( GLuint  id,
void *  data,
void *  userData 
) [static]

Callback for deleting a framebuffer object.

Called by _mesa_HashDeleteAll()

static void delete_program_cb ( GLuint  id,
void *  data,
void *  userData 
) [static]

Callback for deleting a program object.

Called by _mesa_HashDeleteAll().

static void delete_renderbuffer_cb ( GLuint  id,
void *  data,
void *  userData 
) [static]

Callback for deleting a renderbuffer object.

Called by _mesa_HashDeleteAll()

static void delete_shader_cb ( GLuint  id,
void *  data,
void *  userData 
) [static]

Callback for deleting shader and shader programs objects.

Called by _mesa_HashDeleteAll().

static void delete_texture_cb ( GLuint  id,
void *  data,
void *  userData 
) [static]

Callback for deleting a texture object.

Called by _mesa_HashDeleteAll().

static void free_shader_program_data_cb ( GLuint  id,
void *  data,
void *  userData 
) [static]

Callback for freeing shader program data.

Call it before delete_shader_cb to avoid memory access error.


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