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_volume.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source/blender/draw/intern/draw_cache_impl_volume.c') diff --git a/source/blender/draw/intern/draw_cache_impl_volume.c b/source/blender/draw/intern/draw_cache_impl_volume.c index a74e557cc29..3b9c127abc3 100644 --- a/source/blender/draw/intern/draw_cache_impl_volume.c +++ b/source/blender/draw/intern/draw_cache_impl_volume.c @@ -258,12 +258,9 @@ static DRWVolumeGrid *volume_grid_cache_get(Volume *volume, BKE_volume_grid_dense_voxels(volume, grid, dense_min, dense_max, voxels); /* Create GPU texture. */ - cache_grid->texture = GPU_texture_create_3d(resolution[0], - resolution[1], - resolution[2], - (channels == 3) ? GPU_RGB16F : GPU_R16F, - voxels, - NULL); + eGPUTextureFormat format = (channels == 3) ? GPU_RGB16F : GPU_R16F; + cache_grid->texture = GPU_texture_create_3d( + "volume_grid", UNPACK3(resolution), 1, format, voxels); GPU_texture_swizzle_set(cache_grid->texture, (channels == 3) ? "rgb1" : "rrr1"); GPU_texture_wrap_mode(cache_grid->texture, false, false); -- cgit v1.2.3