From 77f5210f22332b3594fabe08bee5809fc8333dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 29 May 2019 00:08:10 +0200 Subject: 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. --- source/blender/draw/intern/draw_cache_impl_particles.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source/blender/draw/intern/draw_cache_impl_particles.c') 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( -- cgit v1.2.3