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/editors/sculpt_paint/paint_cursor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/sculpt_paint/paint_cursor.c') diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 4d885364440..08733a26187 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -348,7 +348,8 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima if (!target->overlay_texture) { eGPUTextureFormat format = col ? GPU_RGBA8 : GPU_R8; - target->overlay_texture = GPU_texture_create_2d(size, size, format, NULL, NULL); + target->overlay_texture = GPU_texture_create_2d( + "paint_cursor_overlay", size, size, 1, format, NULL); GPU_texture_update(target->overlay_texture, GPU_DATA_UNSIGNED_BYTE, buffer); if (!col) { @@ -466,7 +467,8 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom) BLI_task_parallel_range(0, size, &data, load_tex_cursor_task_cb, &settings); if (!cursor_snap.overlay_texture) { - cursor_snap.overlay_texture = GPU_texture_create_2d(size, size, GPU_R8, NULL, NULL); + cursor_snap.overlay_texture = GPU_texture_create_2d( + "cursor_snap_overaly", size, size, 1, GPU_R8, NULL); GPU_texture_update(cursor_snap.overlay_texture, GPU_DATA_UNSIGNED_BYTE, buffer); GPU_texture_swizzle_set(cursor_snap.overlay_texture, "rrrr"); -- cgit v1.2.3