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>2020-09-04 23:56:30 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-05 18:49:14 +0300
commitbac4606937514405641659d91a30bf3e6832cdf7 (patch)
tree740db8bff5e694c2e9f943f928e08030925d0fcf /source/blender/editors
parent7d4adbdfaba4f23b2adbf96f97ce18806aca31c8 (diff)
Cleanup: GPUTexture: Remove use of GPU_texture_create_nD
Use creation + update function instead.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_icons.c25
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c8
-rw-r--r--source/blender/editors/space_clip/clip_draw.c12
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c4
4 files changed, 13 insertions, 36 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 70061427c33..8801d2956bb 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -866,30 +866,15 @@ void UI_icons_reload_internal_textures(void)
icongltex.invw = 1.0f / b32buf->x;
icongltex.invh = 1.0f / b32buf->y;
- icongltex.tex[0] = GPU_texture_create_nD(b32buf->x,
- b32buf->y,
- 0,
- 2,
- b32buf->rect,
- GPU_RGBA8,
- GPU_DATA_UNSIGNED_BYTE,
- 0,
- false,
- NULL);
+ icongltex.tex[0] = GPU_texture_create_2d(b32buf->x, b32buf->y, GPU_RGBA8, NULL, NULL);
+ GPU_texture_add_mipmap(icongltex.tex[0], GPU_DATA_UNSIGNED_BYTE, 0, b32buf->rect);
GPU_texture_add_mipmap(icongltex.tex[0], GPU_DATA_UNSIGNED_BYTE, 1, b16buf->rect);
}
if (need_icons_with_border && icongltex.tex[1] == NULL) {
- icongltex.tex[1] = GPU_texture_create_nD(b32buf_border->x,
- b32buf_border->y,
- 0,
- 2,
- b32buf_border->rect,
- GPU_RGBA8,
- GPU_DATA_UNSIGNED_BYTE,
- 0,
- false,
- NULL);
+ icongltex.tex[1] = GPU_texture_create_2d(
+ b32buf_border->x, b32buf_border->y, GPU_RGBA8, NULL, NULL);
+ GPU_texture_add_mipmap(icongltex.tex[1], GPU_DATA_UNSIGNED_BYTE, 0, b32buf_border->rect);
GPU_texture_add_mipmap(icongltex.tex[1], GPU_DATA_UNSIGNED_BYTE, 1, b16buf_border->rect);
}
}
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 0486fc9fe0f..4d885364440 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -348,8 +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_nD(
- size, size, 0, 2, buffer, format, GPU_DATA_UNSIGNED_BYTE, 0, false, NULL);
+ target->overlay_texture = GPU_texture_create_2d(size, size, format, NULL, NULL);
+ GPU_texture_update(target->overlay_texture, GPU_DATA_UNSIGNED_BYTE, buffer);
if (!col) {
GPU_texture_swizzle_set(target->overlay_texture, "rrrr");
@@ -466,8 +466,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_nD(
- size, size, 0, 2, buffer, GPU_R8, GPU_DATA_UNSIGNED_BYTE, 0, false, NULL);
+ cursor_snap.overlay_texture = GPU_texture_create_2d(size, size, GPU_R8, NULL, NULL);
+ GPU_texture_update(cursor_snap.overlay_texture, GPU_DATA_UNSIGNED_BYTE, buffer);
GPU_texture_swizzle_set(cursor_snap.overlay_texture, "rrrr");
}
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index 17539b2c423..8fbf9fa2144 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -1211,16 +1211,8 @@ static void draw_plane_marker_image(Scene *scene,
GPU_blend(GPU_BLEND_ALPHA);
}
- GPUTexture *texture = GPU_texture_create_nD(ibuf->x,
- ibuf->y,
- 0,
- 2,
- display_buffer,
- GPU_RGBA8,
- GPU_DATA_UNSIGNED_BYTE,
- 0,
- false,
- NULL);
+ GPUTexture *texture = GPU_texture_create_2d(ibuf->x, ibuf->y, GPU_RGBA8, NULL, NULL);
+ GPU_texture_update(texture, GPU_DATA_UNSIGNED_BYTE, display_buffer);
GPU_texture_filter_mode(texture, false);
GPU_matrix_push();
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 2f094661863..9504ed88bb1 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1639,8 +1639,8 @@ static void sequencer_draw_display_buffer(const bContext *C,
GPU_matrix_identity_projection_set();
}
- GPUTexture *texture = GPU_texture_create_nD(
- ibuf->x, ibuf->y, 0, 2, display_buffer, format, data, 0, false, NULL);
+ GPUTexture *texture = GPU_texture_create_2d(ibuf->x, ibuf->y, format, NULL, NULL);
+ GPU_texture_update(texture, data, display_buffer);
GPU_texture_filter_mode(texture, false);
GPU_texture_bind(texture, 0);