Blender V2.61 - r43446
|
Go to the source code of this file.
Classes | |
struct | GPUBuffer |
struct | GPUBufferMaterial |
struct | GPUDrawObject |
struct | GPUAttrib |
Defines | |
#define | DEBUG_VBO(X) |
Typedefs | |
typedef struct GPUBuffer | GPUBuffer |
typedef struct GPUBufferMaterial | GPUBufferMaterial |
typedef struct GPUDrawObject | GPUDrawObject |
typedef struct GPUAttrib | GPUAttrib |
typedef struct GPU_Buffers | GPU_Buffers |
Functions | |
void | GPU_global_buffer_pool_free (void) |
GPUBuffer * | GPU_buffer_alloc (int size) |
void | GPU_buffer_free (GPUBuffer *buffer) |
GPUDrawObject * | GPU_drawobject_new (struct DerivedMesh *dm) |
void | GPU_drawobject_free (struct DerivedMesh *dm) |
void | GPU_vertex_setup (struct DerivedMesh *dm) |
void | GPU_normal_setup (struct DerivedMesh *dm) |
void | GPU_uv_setup (struct DerivedMesh *dm) |
void | GPU_color_setup (struct DerivedMesh *dm) |
void | GPU_edge_setup (struct DerivedMesh *dm) |
void | GPU_uvedge_setup (struct DerivedMesh *dm) |
void | GPU_interleaved_setup (GPUBuffer *buffer, int data[]) |
int | GPU_attrib_element_size (GPUAttrib data[], int numdata) |
void | GPU_interleaved_attrib_setup (GPUBuffer *buffer, GPUAttrib data[], int numdata) |
void * | GPU_buffer_lock (GPUBuffer *buffer) |
void * | GPU_buffer_lock_stream (GPUBuffer *buffer) |
void | GPU_buffer_unlock (GPUBuffer *buffer) |
void | GPU_color3_upload (struct DerivedMesh *dm, unsigned char *data) |
void | GPU_color4_upload (struct DerivedMesh *dm, unsigned char *data) |
void | GPU_color_switch (int mode) |
void | GPU_buffer_draw_elements (GPUBuffer *elements, unsigned int mode, int start, int count) |
void | GPU_buffer_unbind (void) |
int | GPU_buffer_legacy (struct DerivedMesh *dm) |
GPU_Buffers * | GPU_build_mesh_buffers (struct GHash *map, struct MVert *mvert, struct MFace *mface, int *face_indices, int totface, int *vert_indices, int uniq_verts, int totvert) |
void | GPU_update_mesh_buffers (GPU_Buffers *buffers, struct MVert *mvert, int *vert_indices, int totvert) |
GPU_Buffers * | GPU_build_grid_buffers (struct DMGridData **grids, int *grid_indices, int totgrid, int gridsize) |
void | GPU_update_grid_buffers (GPU_Buffers *buffers, struct DMGridData **grids, int *grid_indices, int totgrid, int gridsize, int smooth) |
void | GPU_draw_buffers (GPU_Buffers *buffers) |
void | GPU_free_buffers (GPU_Buffers *buffers) |
Definition in file GPU_buffers.h.
#define DEBUG_VBO | ( | X | ) |
Definition at line 39 of file GPU_buffers.h.
Referenced by cdDM_drawEdges(), cdDM_drawFacesColored(), cdDM_drawFacesSolid(), cdDM_drawFacesTex_common(), cdDM_drawLooseEdges(), cdDM_drawMappedFaces(), and cdDM_drawMappedFacesGLSL().
typedef struct GPU_Buffers GPU_Buffers |
Definition at line 161 of file GPU_buffers.h.
typedef struct GPUBufferMaterial GPUBufferMaterial |
typedef struct GPUDrawObject GPUDrawObject |
int GPU_attrib_element_size | ( | GPUAttrib | data[], |
int | numdata | ||
) |
Definition at line 1074 of file gpu_buffers.c.
References elementsize(), GPU_typesize(), i, and GPUAttrib::size.
Referenced by cdDM_drawMappedFacesGLSL(), and GPU_interleaved_attrib_setup().
GPUBuffer* GPU_buffer_alloc | ( | int | size | ) |
Definition at line 185 of file gpu_buffers.c.
References GPUBufferPool::buffers, gpu_buffer_pool_delete_last(), gpu_buffer_pool_remove_index(), gpu_get_global_buffer_pool(), i, GPUBuffer::id, MEM_callocN(), MEM_mallocN(), NULL, GPUBuffer::pointer, GPUBuffer::size, size(), GPUBufferPool::totbuf, and useVBOs.
Referenced by cdDM_drawMappedFacesGLSL(), and gpu_buffer_setup().
void GPU_buffer_draw_elements | ( | GPUBuffer * | elements, |
unsigned int | mode, | ||
int | start, | ||
int | count | ||
) |
Definition at line 1261 of file gpu_buffers.c.
References GPUBuffer::pointer, and useVBOs.
Referenced by cdDM_drawEdges(), and cdDM_drawLooseEdges().
void GPU_buffer_free | ( | GPUBuffer * | buffer | ) |
Definition at line 262 of file gpu_buffers.c.
References BLI_thread_is_main(), GPUBufferPool::buffers, gpu_buffer_pool_delete_last(), gpu_get_global_buffer_pool(), i, MAX_FREE_GPU_BUFFERS, GPUBufferPool::maxsize, MEM_reallocN(), and GPUBufferPool::totbuf.
Referenced by cdDM_drawMappedFacesGLSL(), gpu_buffer_setup(), GPU_color3_upload(), and GPU_drawobject_free().
int GPU_buffer_legacy | ( | struct DerivedMesh * | dm | ) |
Definition at line 1201 of file gpu_buffers.c.
References DerivedMesh::drawObject, UserDef::gameflags, GPU_drawobject_new(), GPUDrawObject::legacy, rna_array::test, U, and USER_DISABLE_VBO.
Referenced by cdDM_drawEdges(), cdDM_drawFacesColored(), cdDM_drawFacesSolid(), cdDM_drawFacesTex_common(), cdDM_drawLooseEdges(), cdDM_drawMappedFaces(), cdDM_drawMappedFacesGLSL(), cdDM_drawUVEdges(), cdDM_drawVerts(), and draw_mesh_textured_old().
void* GPU_buffer_lock | ( | GPUBuffer * | buffer | ) |
Definition at line 1212 of file gpu_buffers.c.
References GPUBuffer::id, GPUBuffer::pointer, and useVBOs.
void* GPU_buffer_lock_stream | ( | GPUBuffer * | buffer | ) |
Definition at line 1229 of file gpu_buffers.c.
References GPUBuffer::id, GPUBuffer::pointer, GPUBuffer::size, and useVBOs.
Referenced by cdDM_drawMappedFacesGLSL().
void GPU_buffer_unbind | ( | void | ) |
Definition at line 1126 of file gpu_buffers.c.
References GLStates, GPU_BUFFER_COLOR_STATE, GPU_BUFFER_ELEMENT_STATE, GPU_BUFFER_NORMAL_STATE, GPU_BUFFER_TEXCOORD_STATE, GPU_BUFFER_VERTEX_STATE, i, MAX_GPU_ATTRIB_DATA, and useVBOs.
Referenced by cdDM_drawEdges(), cdDM_drawFacesColored(), cdDM_drawFacesSolid(), cdDM_drawFacesTex_common(), cdDM_drawLooseEdges(), cdDM_drawMappedFaces(), cdDM_drawMappedFacesGLSL(), cdDM_drawUVEdges(), and cdDM_drawVerts().
void GPU_buffer_unlock | ( | GPUBuffer * | buffer | ) |
Definition at line 1248 of file gpu_buffers.c.
References useVBOs.
Referenced by cdDM_drawMappedFacesGLSL().
GPU_Buffers* GPU_build_grid_buffers | ( | struct DMGridData ** | grids, |
int * | grid_indices, | ||
int | totgrid, | ||
int | gridsize | ||
) |
Referenced by build_grids_leaf_node().
GPU_Buffers* GPU_build_mesh_buffers | ( | struct GHash * | map, |
struct MVert * | mvert, | ||
struct MFace * | mface, | ||
int * | face_indices, | ||
int | totface, | ||
int * | vert_indices, | ||
int | uniq_verts, | ||
int | totvert | ||
) |
Definition at line 1335 of file gpu_buffers.c.
References BLI_ghash_lookup(), GPU_Buffers::face_indices, UserDef::gameflags, GET_INT_FROM_POINTER, GPU_update_mesh_buffers(), i, GPU_Buffers::index_buf, GPU_Buffers::index_type, MEM_callocN(), GPU_Buffers::mface, NULL, SET_INT_IN_POINTER, GPU_Buffers::tot_tri, GPU_Buffers::totface, U, USER_DISABLE_VBO, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and GPU_Buffers::vert_buf.
Referenced by build_mesh_leaf_node().
void GPU_color3_upload | ( | struct DerivedMesh * | dm, |
unsigned char * | data | ||
) |
Definition at line 1162 of file gpu_buffers.c.
References GPUDrawObject::colors, DerivedMesh::drawObject, GPU_buffer_copy_color3(), GPU_buffer_free(), gpu_buffer_setup(), GPU_drawobject_new(), and GPUDrawObject::tot_triangle_point.
Referenced by cdDM_drawFacesTex_common().
void GPU_color4_upload | ( | struct DerivedMesh * | dm, |
unsigned char * | data | ||
) |
Referenced by cdDM_drawFacesColored().
void GPU_color_setup | ( | struct DerivedMesh * | dm | ) |
Definition at line 997 of file gpu_buffers.c.
References GPUDrawObject::colors, DerivedMesh::drawObject, GLStates, GPU_BUFFER_COLOR, GPU_BUFFER_COLOR_STATE, gpu_buffer_setup_common(), GPUBuffer::id, GPUBuffer::pointer, and useVBOs.
Referenced by cdDM_drawFacesColored(), cdDM_drawFacesTex_common(), and cdDM_drawMappedFaces().
void GPU_color_switch | ( | int | mode | ) |
Definition at line 1185 of file gpu_buffers.c.
References GLStates, and GPU_BUFFER_COLOR_STATE.
Referenced by cdDM_drawFacesTex_common().
void GPU_draw_buffers | ( | GPU_Buffers * | buffers | ) |
Definition at line 1559 of file gpu_buffers.c.
References DMGridData::co, MVert::co, co, GPU_Buffers::face_indices, GPU_Buffers::grid_indices, GPU_Buffers::grids, GPU_Buffers::gridsize, i, GPU_Buffers::index_buf, GPU_Buffers::index_type, GPU_Buffers::mface, GPU_Buffers::mvert, MVert::no, DMGridData::no, GPU_Buffers::tot_quad, GPU_Buffers::tot_tri, GPU_Buffers::totface, GPU_Buffers::totgrid, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and GPU_Buffers::vert_buf.
Referenced by BLI_pbvh_node_draw().
void GPU_drawobject_free | ( | struct DerivedMesh * | dm | ) |
Definition at line 445 of file gpu_buffers.c.
References GPUDrawObject::colors, DerivedMesh::drawObject, GPUDrawObject::edges, GPU_buffer_free(), GPUDrawObject::materials, MEM_freeN(), GPUDrawObject::normals, NULL, GPUDrawObject::points, GPUDrawObject::triangle_to_mface, GPUDrawObject::uv, GPUDrawObject::uvedges, GPUDrawObject::vert_points, and GPUDrawObject::vert_points_mem.
Referenced by DM_release(), sculpt_flush_update(), and sculpt_undo_restore().
GPUDrawObject* GPU_drawobject_new | ( | struct DerivedMesh * | dm | ) |
Definition at line 391 of file gpu_buffers.c.
References DerivedMesh::getFaceArray, DerivedMesh::getNumEdges, DerivedMesh::getNumFaces, DerivedMesh::getNumVerts, gpu_drawobject_init_vert_points(), i, GPUBufferMaterial::mat_nr, GPUDrawObject::materials, MAX_MATERIALS, MEM_callocN(), MEM_mallocN(), GPUBufferMaterial::start, GPUDrawObject::tot_triangle_point, GPUDrawObject::totedge, GPUDrawObject::totmaterial, GPUBufferMaterial::totpoint, GPUDrawObject::totvert, and GPUDrawObject::triangle_to_mface.
Referenced by GPU_buffer_legacy(), gpu_buffer_setup_common(), and GPU_color3_upload().
void GPU_edge_setup | ( | struct DerivedMesh * | dm | ) |
Definition at line 1014 of file gpu_buffers.c.
References DerivedMesh::drawObject, GPUDrawObject::edges, GLStates, GPU_BUFFER_EDGE, GPU_BUFFER_ELEMENT_STATE, gpu_buffer_setup_common(), GPU_BUFFER_VERTEX, GPU_BUFFER_VERTEX_STATE, GPUBuffer::id, GPUBuffer::pointer, GPUDrawObject::points, and useVBOs.
Referenced by cdDM_drawEdges(), and cdDM_drawLooseEdges().
void GPU_free_buffers | ( | GPU_Buffers * | buffers | ) |
Definition at line 1631 of file gpu_buffers.c.
References GPU_Buffers::index_buf, MEM_freeN(), and GPU_Buffers::vert_buf.
Referenced by BLI_pbvh_free().
void GPU_global_buffer_pool_free | ( | void | ) |
Definition at line 177 of file gpu_buffers.c.
References gpu_buffer_pool_free(), and NULL.
Referenced by WM_exit_ext().
Definition at line 1086 of file gpu_buffers.c.
References elementsize(), GPU_attrib_element_size(), GPU_typesize(), i, GPUBuffer::id, GPUAttrib::index, MAX_GPU_ATTRIB_DATA, GPUBuffer::pointer, GPUAttrib::size, size(), GPUAttrib::type, and useVBOs.
Referenced by cdDM_drawMappedFacesGLSL().
void GPU_interleaved_setup | ( | GPUBuffer * | buffer, |
int | data[] | ||
) |
void GPU_normal_setup | ( | struct DerivedMesh * | dm | ) |
Definition at line 963 of file gpu_buffers.c.
References DerivedMesh::drawObject, GLStates, GPU_BUFFER_NORMAL, GPU_BUFFER_NORMAL_STATE, gpu_buffer_setup_common(), GPUBuffer::id, GPUDrawObject::normals, GPUBuffer::pointer, and useVBOs.
Referenced by cdDM_drawFacesSolid(), cdDM_drawFacesTex_common(), cdDM_drawMappedFaces(), and cdDM_drawMappedFacesGLSL().
void GPU_update_grid_buffers | ( | GPU_Buffers * | buffers, |
struct DMGridData ** | grids, | ||
int * | grid_indices, | ||
int | totgrid, | ||
int | gridsize, | ||
int | smooth | ||
) |
Definition at line 1415 of file gpu_buffers.c.
References co, GPU_Buffers::grid_indices, GPU_Buffers::grids, GPU_Buffers::gridsize, i, normal_quad_v3(), NULL, GPU_Buffers::totgrid, and GPU_Buffers::vert_buf.
Referenced by pbvh_update_draw_buffers().
void GPU_update_mesh_buffers | ( | GPU_Buffers * | buffers, |
struct MVert * | mvert, | ||
int * | vert_indices, | ||
int | totvert | ||
) |
Definition at line 1299 of file gpu_buffers.c.
References MVert::co, VertexBufferFormat::co, copy_v3_v3(), i, GPU_Buffers::mvert, MVert::no, VertexBufferFormat::no, NULL, and GPU_Buffers::vert_buf.
Referenced by GPU_build_mesh_buffers(), and pbvh_update_draw_buffers().
void GPU_uv_setup | ( | struct DerivedMesh * | dm | ) |
Definition at line 980 of file gpu_buffers.c.
References DerivedMesh::drawObject, GLStates, gpu_buffer_setup_common(), GPU_BUFFER_TEXCOORD_STATE, GPU_BUFFER_UV, GPUBuffer::id, GPUBuffer::pointer, useVBOs, and GPUDrawObject::uv.
Referenced by cdDM_drawFacesTex_common().
void GPU_uvedge_setup | ( | struct DerivedMesh * | dm | ) |
Definition at line 1039 of file gpu_buffers.c.
References DerivedMesh::drawObject, GLStates, gpu_buffer_setup_common(), GPU_BUFFER_UVEDGE, GPU_BUFFER_VERTEX_STATE, GPUBuffer::id, GPUBuffer::pointer, useVBOs, and GPUDrawObject::uvedges.
Referenced by cdDM_drawUVEdges().
void GPU_vertex_setup | ( | struct DerivedMesh * | dm | ) |
Definition at line 946 of file gpu_buffers.c.
References DerivedMesh::drawObject, GLStates, gpu_buffer_setup_common(), GPU_BUFFER_VERTEX, GPU_BUFFER_VERTEX_STATE, GPUBuffer::id, GPUBuffer::pointer, GPUDrawObject::points, and useVBOs.
Referenced by cdDM_drawFacesColored(), cdDM_drawFacesSolid(), cdDM_drawFacesTex_common(), cdDM_drawMappedFaces(), cdDM_drawMappedFacesGLSL(), and cdDM_drawVerts().