Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_buffers.c
| Show First 20 Lines • Show All 444 Lines • ▼ Show 20 Lines | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Grid PBVH | /** \name Grid PBVH | ||||
| * \{ */ | * \{ */ | ||||
| static void gpu_pbvh_grid_fill_index_buffers(GPU_PBVH_Buffers *buffers, | static void gpu_pbvh_grid_fill_index_buffers(GPU_PBVH_Buffers *buffers, | ||||
| SubdivCCG *UNUSED(subdiv_ccg), | SubdivCCG *UNUSED(subdiv_ccg), | ||||
| const int *UNUSED(face_sets), | const int *UNUSED(face_sets), | ||||
| int *grid_indices, | const int *grid_indices, | ||||
| uint visible_quad_len, | uint visible_quad_len, | ||||
| int totgrid, | int totgrid, | ||||
| int gridsize) | int gridsize) | ||||
| { | { | ||||
| GPUIndexBufBuilder elb, elb_lines; | GPUIndexBufBuilder elb, elb_lines; | ||||
| GPUIndexBufBuilder elb_fast, elb_lines_fast; | GPUIndexBufBuilder elb_fast, elb_lines_fast; | ||||
| GPU_indexbuf_init(&elb, GPU_PRIM_TRIS, 2 * visible_quad_len, INT_MAX); | GPU_indexbuf_init(&elb, GPU_PRIM_TRIS, 2 * visible_quad_len, INT_MAX); | ||||
| ▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | static void gpu_pbvh_grid_fill_index_buffers(GPU_PBVH_Buffers *buffers, | ||||
| buffers->index_buf = GPU_indexbuf_build(&elb); | buffers->index_buf = GPU_indexbuf_build(&elb); | ||||
| buffers->index_buf_fast = GPU_indexbuf_build(&elb_fast); | buffers->index_buf_fast = GPU_indexbuf_build(&elb_fast); | ||||
| buffers->index_lines_buf = GPU_indexbuf_build(&elb_lines); | buffers->index_lines_buf = GPU_indexbuf_build(&elb_lines); | ||||
| buffers->index_lines_buf_fast = GPU_indexbuf_build(&elb_lines_fast); | buffers->index_lines_buf_fast = GPU_indexbuf_build(&elb_lines_fast); | ||||
| } | } | ||||
| void GPU_pbvh_grid_buffers_update_free(GPU_PBVH_Buffers *buffers, | void GPU_pbvh_grid_buffers_update_free(GPU_PBVH_Buffers *buffers, | ||||
| const struct DMFlagMat *grid_flag_mats, | const struct DMFlagMat *grid_flag_mats, | ||||
| int *grid_indices) | const int *grid_indices) | ||||
| { | { | ||||
| const bool smooth = grid_flag_mats[grid_indices[0]].flag & ME_SMOOTH; | const bool smooth = grid_flag_mats[grid_indices[0]].flag & ME_SMOOTH; | ||||
| if (buffers->smooth != smooth) { | if (buffers->smooth != smooth) { | ||||
| buffers->smooth = smooth; | buffers->smooth = smooth; | ||||
| GPU_BATCH_DISCARD_SAFE(buffers->triangles); | GPU_BATCH_DISCARD_SAFE(buffers->triangles); | ||||
| GPU_BATCH_DISCARD_SAFE(buffers->triangles_fast); | GPU_BATCH_DISCARD_SAFE(buffers->triangles_fast); | ||||
| GPU_BATCH_DISCARD_SAFE(buffers->lines); | GPU_BATCH_DISCARD_SAFE(buffers->lines); | ||||
| ▲ Show 20 Lines • Show All 542 Lines • Show Last 20 Lines | |||||