From ab95cdaba970a30127d804bd1e66ad25ab021ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sat, 5 Sep 2020 17:33:56 +0200 Subject: GPUTexture: Change texture creation API This is to modernize the API: - Add meaningful name to all textures (except DRW textures). - Remove unused err_out argument: only used for offscreen python. - Add mipmap count to creation functions for future changes. - Clarify the data usage in creation functions. This is a cleanup commit, there is no functional change. # Conflicts: # source/blender/gpu/GPU_texture.h --- source/blender/draw/intern/draw_cache_impl_particles.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 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 3ecdbff1e96..52d1fcfdb80 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -809,7 +809,8 @@ static void particle_batch_cache_ensure_procedural_final_points(ParticleHairCach /* Create vbo immediately to bind to texture buffer. */ GPU_vertbuf_use(cache->final[subdiv].proc_buf); - cache->final[subdiv].proc_tex = GPU_texture_create_from_vertbuf(cache->final[subdiv].proc_buf); + cache->final[subdiv].proc_tex = GPU_texture_create_from_vertbuf("part_proc", + cache->final[subdiv].proc_buf); } static void particle_batch_cache_ensure_procedural_strand_data(PTCacheEdit *edit, @@ -1008,18 +1009,19 @@ static void particle_batch_cache_ensure_procedural_strand_data(PTCacheEdit *edit /* Create vbo immediately to bind to texture buffer. */ GPU_vertbuf_use(cache->proc_strand_buf); - cache->strand_tex = GPU_texture_create_from_vertbuf(cache->proc_strand_buf); + cache->strand_tex = GPU_texture_create_from_vertbuf("part_strand", cache->proc_strand_buf); GPU_vertbuf_use(cache->proc_strand_seg_buf); - cache->strand_seg_tex = GPU_texture_create_from_vertbuf(cache->proc_strand_seg_buf); + cache->strand_seg_tex = GPU_texture_create_from_vertbuf("part_strand_seg", + cache->proc_strand_seg_buf); for (int i = 0; i < cache->num_uv_layers; i++) { GPU_vertbuf_use(cache->proc_uv_buf[i]); - cache->uv_tex[i] = GPU_texture_create_from_vertbuf(cache->proc_uv_buf[i]); + cache->uv_tex[i] = GPU_texture_create_from_vertbuf("part_uv", cache->proc_uv_buf[i]); } for (int i = 0; i < cache->num_col_layers; i++) { GPU_vertbuf_use(cache->proc_col_buf[i]); - cache->col_tex[i] = GPU_texture_create_from_vertbuf(cache->proc_col_buf[i]); + cache->col_tex[i] = GPU_texture_create_from_vertbuf("part_col", cache->proc_col_buf[i]); } } @@ -1109,7 +1111,7 @@ static void particle_batch_cache_ensure_procedural_pos(PTCacheEdit *edit, /* Create vbo immediately to bind to texture buffer. */ GPU_vertbuf_use(cache->proc_point_buf); - cache->point_tex = GPU_texture_create_from_vertbuf(cache->proc_point_buf); + cache->point_tex = GPU_texture_create_from_vertbuf("part_point", cache->proc_point_buf); } static void particle_batch_cache_ensure_pos_and_seg(PTCacheEdit *edit, -- cgit v1.2.3