Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_impl_subdivision.cc
| Show First 20 Lines • Show All 608 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| if (cache->extra_coarse_face_data == nullptr) { | if (cache->extra_coarse_face_data == nullptr) { | ||||
| cache->extra_coarse_face_data = GPU_vertbuf_calloc(); | cache->extra_coarse_face_data = GPU_vertbuf_calloc(); | ||||
| static GPUVertFormat format; | static GPUVertFormat format; | ||||
| if (format.attr_len == 0) { | if (format.attr_len == 0) { | ||||
| GPU_vertformat_attr_add(&format, "data", GPU_COMP_U32, 1, GPU_FETCH_INT); | GPU_vertformat_attr_add(&format, "data", GPU_COMP_U32, 1, GPU_FETCH_INT); | ||||
| } | } | ||||
| GPU_vertbuf_init_with_format_ex(cache->extra_coarse_face_data, &format, GPU_USAGE_DYNAMIC); | GPU_vertbuf_init_with_format_ex(cache->extra_coarse_face_data, &format, GPU_USAGE_DYNAMIC); | ||||
| GPU_vertbuf_data_alloc(cache->extra_coarse_face_data, mesh->totpoly); | GPU_vertbuf_data_alloc(cache->extra_coarse_face_data, | ||||
| cache->bm ? cache->bm->totface : mesh->totpoly); | |||||
| } | } | ||||
| uint32_t *flags_data = (uint32_t *)(GPU_vertbuf_get_data(cache->extra_coarse_face_data)); | uint32_t *flags_data = (uint32_t *)(GPU_vertbuf_get_data(cache->extra_coarse_face_data)); | ||||
| if (cache->bm) { | if (cache->bm) { | ||||
| BMesh *bm = cache->bm; | BMesh *bm = cache->bm; | ||||
| BMFace *f; | BMFace *f; | ||||
| BMIter iter; | BMIter iter; | ||||
| ▲ Show 20 Lines • Show All 1,314 Lines • Show Last 20 Lines | |||||