Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-05-29 01:08:10 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-05-30 14:42:21 +0300
commit77f5210f22332b3594fabe08bee5809fc8333dba (patch)
tree82f8fbba7d762d30363a40eb9d41f0df828d7586 /source/blender/draw/intern/draw_cache_impl_particles.c
parentdc0c490b7601b4dced13be6a9877f68ee9712736 (diff)
GPU: Remove GPU_INDEX_U8
This type of indices is not natively supported on modern GPU and gives warning on some implementation. The memory savings it provides is also quite minimal and unlikely to be visible on nowadays hardware. This remove some uneeded struct members and makes primitive restart always enabled by default. This can be broken by addons if they are not careful enough but many other states have this problem. Also leverage GL_PRIMITIVE_RESTART_FIXED_INDEX if ARB_ES3_compatibility is supported. This removes all API calls to change restart index depending on indices length.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_particles.c')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_particles.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c
index 9a15c51598f..5b1916447a6 100644
--- a/source/blender/draw/intern/draw_cache_impl_particles.c
+++ b/source/blender/draw/intern/draw_cache_impl_particles.c
@@ -1053,7 +1053,7 @@ static void particle_batch_cache_ensure_procedural_indices(PTCacheEdit *edit,
GPU_vertbuf_data_alloc(vbo, 1);
GPUIndexBufBuilder elb;
- GPU_indexbuf_init_ex(&elb, prim_type, element_count, element_count, true);
+ GPU_indexbuf_init_ex(&elb, prim_type, element_count, element_count);
if (edit != NULL && edit->pathcache != NULL) {
particle_batch_cache_fill_segments_indices(
@@ -1194,8 +1194,7 @@ static void particle_batch_cache_ensure_pos_and_seg(PTCacheEdit *edit,
GPU_vertbuf_data_alloc(hair_cache->pos, hair_cache->point_len);
GPUIndexBufBuilder elb;
- GPU_indexbuf_init_ex(
- &elb, GPU_PRIM_LINE_STRIP, hair_cache->elems_len, hair_cache->point_len, true);
+ GPU_indexbuf_init_ex(&elb, GPU_PRIM_LINE_STRIP, hair_cache->elems_len, hair_cache->point_len);
if (num_uv_layers || num_col_layers) {
BKE_mesh_tessface_ensure(psmd->mesh_final);
@@ -1499,8 +1498,7 @@ static void particle_batch_cache_ensure_edit_pos_and_seg(PTCacheEdit *edit,
GPU_vertbuf_data_alloc(hair_cache->pos, hair_cache->point_len);
GPU_vertbuf_attr_get_raw_data(hair_cache->pos, pos_id, &data_step);
- GPU_indexbuf_init_ex(
- &elb, GPU_PRIM_LINE_STRIP, hair_cache->elems_len, hair_cache->point_len, true);
+ GPU_indexbuf_init_ex(&elb, GPU_PRIM_LINE_STRIP, hair_cache->elems_len, hair_cache->point_len);
if (edit != NULL && edit->pathcache != NULL) {
particle_batch_cache_fill_segments_edit(