Blender  V2.93
Classes | Variables
gpu_buffers.c File Reference
#include <limits.h>
#include <stddef.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_bitmap.h"
#include "BLI_ghash.h"
#include "BLI_hash.h"
#include "BLI_math.h"
#include "BLI_math_color.h"
#include "BLI_math_color_blend.h"
#include "BLI_utildefines.h"
#include "DNA_meshdata_types.h"
#include "DNA_userdef_types.h"
#include "BKE_DerivedMesh.h"
#include "BKE_ccg.h"
#include "BKE_mesh.h"
#include "BKE_paint.h"
#include "BKE_pbvh.h"
#include "BKE_subdiv_ccg.h"
#include "GPU_batch.h"
#include "GPU_buffers.h"
#include "gpu_private.h"
#include "bmesh.h"

Go to the source code of this file.

Classes

struct  GPU_PBVH_Buffers
 

Functions

PBVH Utils
void gpu_pbvh_init ()
 
void gpu_pbvh_exit ()
 
static bool gpu_pbvh_vert_buf_data_set (GPU_PBVH_Buffers *buffers, uint vert_len)
 
static void gpu_pbvh_batch_init (GPU_PBVH_Buffers *buffers, GPUPrimType prim)
 
Mesh PBVH
static bool gpu_pbvh_is_looptri_visible (const MLoopTri *lt, const MVert *mvert, const MLoop *mloop, const int *sculpt_face_sets)
 
void GPU_pbvh_mesh_buffers_update (GPU_PBVH_Buffers *buffers, const MVert *mvert, const float *vmask, const MLoopCol *vcol, const int *sculpt_face_sets, const int face_sets_color_seed, const int face_sets_color_default, const MPropCol *vtcol, const int update_flags)
 
GPU_PBVH_BuffersGPU_pbvh_mesh_buffers_build (const MPoly *mpoly, const MLoop *mloop, const MLoopTri *looptri, const MVert *mvert, const int *face_indices, const int *sculpt_face_sets, const int face_indices_len, const struct Mesh *mesh)
 
Grid PBVH
static void gpu_pbvh_grid_fill_index_buffers (GPU_PBVH_Buffers *buffers, SubdivCCG *UNUSED(subdiv_ccg), const int *UNUSED(face_sets), const int *grid_indices, uint visible_quad_len, int totgrid, int gridsize)
 
void GPU_pbvh_grid_buffers_update_free (GPU_PBVH_Buffers *buffers, const struct DMFlagMat *grid_flag_mats, const int *grid_indices)
 
void GPU_pbvh_grid_buffers_update (GPU_PBVH_Buffers *buffers, SubdivCCG *subdiv_ccg, CCGElem **grids, const struct DMFlagMat *grid_flag_mats, int *grid_indices, int totgrid, const int *sculpt_face_sets, const int face_sets_color_seed, const int face_sets_color_default, const struct CCGKey *key, const int update_flags)
 
GPU_PBVH_BuffersGPU_pbvh_grid_buffers_build (int totgrid, BLI_bitmap **grid_hidden)
 
BMesh PBVH
static void gpu_bmesh_vert_to_buffer_copy (BMVert *v, GPUVertBuf *vert_buf, int v_index, const float fno[3], const float *fmask, const int cd_vert_mask_offset, const bool show_mask, const bool show_vcol, bool *empty_mask)
 
static int gpu_bmesh_vert_visible_count (GSet *bm_unique_verts, GSet *bm_other_verts)
 
static int gpu_bmesh_face_visible_count (GSet *bm_faces)
 
void GPU_pbvh_bmesh_buffers_update_free (GPU_PBVH_Buffers *buffers)
 
void GPU_pbvh_bmesh_buffers_update (GPU_PBVH_Buffers *buffers, BMesh *bm, GSet *bm_faces, GSet *bm_unique_verts, GSet *bm_other_verts, const int update_flags)
 
Generic
GPU_PBVH_BuffersGPU_pbvh_bmesh_buffers_build (bool smooth_shading)
 
GPUBatchGPU_pbvh_buffers_batch_get (GPU_PBVH_Buffers *buffers, bool fast, bool wires)
 
bool GPU_pbvh_buffers_has_overlays (GPU_PBVH_Buffers *buffers)
 
short GPU_pbvh_buffers_material_index_get (GPU_PBVH_Buffers *buffers)
 
static void gpu_pbvh_buffers_clear (GPU_PBVH_Buffers *buffers)
 
void GPU_pbvh_buffers_update_flush (GPU_PBVH_Buffers *buffers)
 
void GPU_pbvh_buffers_free (GPU_PBVH_Buffers *buffers)
 

Variables

struct {
   GPUVertFormat   format
 
   uint   pos
 
   uint   nor
 
   uint   msk
 
   uint   col
 
   uint   fset
 
g_vbo_id = {{0}}
 

Detailed Description

Mesh drawing using OpenGL VBO (Vertex Buffer Objects)

Definition in file gpu_buffers.c.

Function Documentation

◆ gpu_bmesh_face_visible_count()

static int gpu_bmesh_face_visible_count ( GSet bm_faces)
static

◆ gpu_bmesh_vert_to_buffer_copy()

static void gpu_bmesh_vert_to_buffer_copy ( BMVert v,
GPUVertBuf vert_buf,
int  v_index,
const float  fno[3],
const float fmask,
const int  cd_vert_mask_offset,
const bool  show_mask,
const bool  show_vcol,
bool *  empty_mask 
)
static

◆ gpu_bmesh_vert_visible_count()

static int gpu_bmesh_vert_visible_count ( GSet bm_unique_verts,
GSet bm_other_verts 
)
static

◆ gpu_pbvh_batch_init()

static void gpu_pbvh_batch_init ( GPU_PBVH_Buffers buffers,
GPUPrimType  prim 
)
static

◆ GPU_pbvh_bmesh_buffers_build()

GPU_PBVH_Buffers* GPU_pbvh_bmesh_buffers_build ( bool  smooth_shading)

◆ GPU_pbvh_bmesh_buffers_update()

void GPU_pbvh_bmesh_buffers_update ( GPU_PBVH_Buffers buffers,
BMesh bm,
GSet bm_faces,
GSet bm_unique_verts,
GSet bm_other_verts,
const int  update_flags 
)

◆ GPU_pbvh_bmesh_buffers_update_free()

void GPU_pbvh_bmesh_buffers_update_free ( GPU_PBVH_Buffers buffers)

◆ GPU_pbvh_buffers_batch_get()

GPUBatch* GPU_pbvh_buffers_batch_get ( GPU_PBVH_Buffers buffers,
bool  fast,
bool  wires 
)

◆ gpu_pbvh_buffers_clear()

static void gpu_pbvh_buffers_clear ( GPU_PBVH_Buffers buffers)
static

◆ GPU_pbvh_buffers_free()

void GPU_pbvh_buffers_free ( GPU_PBVH_Buffers buffers)

◆ GPU_pbvh_buffers_has_overlays()

bool GPU_pbvh_buffers_has_overlays ( GPU_PBVH_Buffers buffers)

Definition at line 1073 of file gpu_buffers.c.

References GPU_PBVH_Buffers::show_overlay.

Referenced by sculpt_draw_cb().

◆ GPU_pbvh_buffers_material_index_get()

short GPU_pbvh_buffers_material_index_get ( GPU_PBVH_Buffers buffers)

Definition at line 1078 of file gpu_buffers.c.

References GPU_PBVH_Buffers::material_index.

Referenced by sculpt_draw_cb().

◆ GPU_pbvh_buffers_update_flush()

void GPU_pbvh_buffers_update_flush ( GPU_PBVH_Buffers buffers)

◆ gpu_pbvh_exit()

void gpu_pbvh_exit ( void  )

Definition at line 130 of file gpu_buffers.c.

Referenced by GPU_exit().

◆ GPU_pbvh_grid_buffers_build()

GPU_PBVH_Buffers* GPU_pbvh_grid_buffers_build ( int  totgrid,
BLI_bitmap **  grid_hidden 
)

◆ GPU_pbvh_grid_buffers_update()

void GPU_pbvh_grid_buffers_update ( GPU_PBVH_Buffers buffers,
SubdivCCG subdiv_ccg,
CCGElem **  grids,
const struct DMFlagMat grid_flag_mats,
int *  grid_indices,
int  totgrid,
const int *  sculpt_face_sets,
const int  face_sets_color_seed,
const int  face_sets_color_default,
const struct CCGKey key,
const int  update_flags 
)

◆ GPU_pbvh_grid_buffers_update_free()

void GPU_pbvh_grid_buffers_update_free ( GPU_PBVH_Buffers buffers,
const struct DMFlagMat grid_flag_mats,
const int *  grid_indices 
)

◆ gpu_pbvh_grid_fill_index_buffers()

static void gpu_pbvh_grid_fill_index_buffers ( GPU_PBVH_Buffers buffers,
SubdivCCG UNUSEDsubdiv_ccg,
const int *  UNUSEDface_sets,
const int *  grid_indices,
uint  visible_quad_len,
int  totgrid,
int  gridsize 
)
static

◆ gpu_pbvh_init()

void gpu_pbvh_init ( void  )

◆ gpu_pbvh_is_looptri_visible()

static bool gpu_pbvh_is_looptri_visible ( const MLoopTri lt,
const MVert mvert,
const MLoop mloop,
const int *  sculpt_face_sets 
)
static

◆ GPU_pbvh_mesh_buffers_build()

GPU_PBVH_Buffers* GPU_pbvh_mesh_buffers_build ( const MPoly mpoly,
const MLoop mloop,
const MLoopTri looptri,
const MVert mvert,
const int *  face_indices,
const int *  sculpt_face_sets,
const int  face_indices_len,
const struct Mesh mesh 
)

◆ GPU_pbvh_mesh_buffers_update()

void GPU_pbvh_mesh_buffers_update ( GPU_PBVH_Buffers buffers,
const MVert mvert,
const float vmask,
const MLoopCol vcol,
const int *  sculpt_face_sets,
const int  face_sets_color_seed,
const int  face_sets_color_default,
const MPropCol vtcol,
const int  update_flags 
)

◆ gpu_pbvh_vert_buf_data_set()

static bool gpu_pbvh_vert_buf_data_set ( GPU_PBVH_Buffers buffers,
uint  vert_len 
)
static

Variable Documentation

◆ col

uint col

Definition at line 103 of file gpu_buffers.c.

◆ format

Definition at line 102 of file gpu_buffers.c.

◆ fset

uint fset

Definition at line 103 of file gpu_buffers.c.

Referenced by GPU_pbvh_grid_buffers_update(), and GPU_pbvh_mesh_buffers_update().

◆ 

struct { ... } g_vbo_id

◆ msk

uint msk

Definition at line 103 of file gpu_buffers.c.

◆ nor

uint nor

Definition at line 103 of file gpu_buffers.c.

◆ pos

uint pos

Definition at line 103 of file gpu_buffers.c.