[Bf-blender-cvs] [89c79c3ed8d] master: Cleanup: Abbreviate enums with 'UNSIGNED_' in the name
Germano Cavalcante
noreply at git.blender.org
Wed Feb 17 16:40:46 CET 2021
Commit: 89c79c3ed8d4f8cdf4f78782443bcf218425b412
Author: Germano Cavalcante
Date: Wed Feb 17 12:38:21 2021 -0300
Branches: master
https://developer.blender.org/rB89c79c3ed8d4f8cdf4f78782443bcf218425b412
Cleanup: Abbreviate enums with 'UNSIGNED_' in the name
===================================================================
M source/blender/blenfont/intern/blf_font.c
M source/blender/blenkernel/intern/image_gpu.c
M source/blender/draw/engines/eevee/eevee_lightcache.c
M source/blender/draw/engines/gpencil/gpencil_antialiasing.c
M source/blender/draw/engines/workbench/workbench_effect_antialiasing.c
M source/blender/draw/intern/draw_select_buffer.c
M source/blender/editors/gpencil/gpencil_fill.c
M source/blender/editors/interface/interface_icons.c
M source/blender/editors/render/render_opengl.c
M source/blender/editors/screen/glutil.c
M source/blender/editors/screen/screen_draw.c
M source/blender/editors/sculpt_paint/paint_cursor.c
M source/blender/editors/space_clip/clip_draw.c
M source/blender/editors/space_sequencer/sequencer_draw.c
M source/blender/editors/space_view3d/view3d_draw.c
M source/blender/gpu/GPU_texture.h
M source/blender/gpu/intern/gpu_framebuffer.cc
M source/blender/gpu/intern/gpu_select_pick.c
M source/blender/gpu/intern/gpu_texture_private.hh
M source/blender/gpu/opengl/gl_framebuffer.cc
M source/blender/gpu/opengl/gl_texture.hh
M source/blender/imbuf/intern/util_gpu.c
M source/blender/python/gpu/gpu_py.c
M source/blender/python/gpu/gpu_py_buffer.c
M source/blender/python/gpu/gpu_py_texture.c
M source/blender/windowmanager/intern/wm_window.c
===================================================================
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 189cbaf152d..f83ee409187 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -192,7 +192,7 @@ static GPUTexture *blf_batch_cache_texture_load(void)
int remain_row = tex_width - offset_x;
int width = remain > remain_row ? remain_row : remain;
GPU_texture_update_sub(gc->texture,
- GPU_DATA_UNSIGNED_BYTE,
+ GPU_DATA_UBYTE,
&gc->bitmap_result[bitmap_len_landed],
offset_x,
offset_y,
diff --git a/source/blender/blenkernel/intern/image_gpu.c b/source/blender/blenkernel/intern/image_gpu.c
index 2ee4505acf0..8847b88d6f2 100644
--- a/source/blender/blenkernel/intern/image_gpu.c
+++ b/source/blender/blenkernel/intern/image_gpu.c
@@ -647,7 +647,7 @@ static void gpu_texture_update_scaled(GPUTexture *tex,
}
void *data = (ibuf->rect_float) ? (void *)(ibuf->rect_float) : (void *)(ibuf->rect);
- eGPUDataFormat data_format = (ibuf->rect_float) ? GPU_DATA_FLOAT : GPU_DATA_UNSIGNED_BYTE;
+ eGPUDataFormat data_format = (ibuf->rect_float) ? GPU_DATA_FLOAT : GPU_DATA_UBYTE;
GPU_texture_update_sub(tex, data_format, data, x, y, layer, w, h, 1);
@@ -673,7 +673,7 @@ static void gpu_texture_update_unscaled(GPUTexture *tex,
}
void *data = (rect_float) ? (void *)(rect_float + tex_offset) : (void *)(rect + tex_offset);
- eGPUDataFormat data_format = (rect_float) ? GPU_DATA_FLOAT : GPU_DATA_UNSIGNED_BYTE;
+ eGPUDataFormat data_format = (rect_float) ? GPU_DATA_FLOAT : GPU_DATA_UBYTE;
/* Partial update without scaling. Stride and offset are used to copy only a
* subset of a possible larger buffer than what we are updating. */
diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c
index c4973dc2e8b..c7c457711f5 100644
--- a/source/blender/draw/engines/eevee/eevee_lightcache.c
+++ b/source/blender/draw/engines/eevee/eevee_lightcache.c
@@ -403,7 +403,7 @@ static bool eevee_lightcache_static_load(LightCache *lcache)
if (lcache->grid_tx.tex == NULL) {
lcache->grid_tx.tex = GPU_texture_create_2d_array(
"lightcache_irradiance", UNPACK3(lcache->grid_tx.tex_size), 1, IRRADIANCE_FORMAT, NULL);
- GPU_texture_update(lcache->grid_tx.tex, GPU_DATA_UNSIGNED_BYTE, lcache->grid_tx.data);
+ GPU_texture_update(lcache->grid_tx.tex, GPU_DATA_UBYTE, lcache->grid_tx.data);
if (lcache->grid_tx.tex == NULL) {
lcache->flag |= LIGHTCACHE_NOT_USABLE;
@@ -470,7 +470,7 @@ bool EEVEE_lightcache_load(LightCache *lcache)
static void eevee_lightbake_readback_irradiance(LightCache *lcache)
{
MEM_SAFE_FREE(lcache->grid_tx.data);
- lcache->grid_tx.data = GPU_texture_read(lcache->grid_tx.tex, GPU_DATA_UNSIGNED_BYTE, 0);
+ lcache->grid_tx.data = GPU_texture_read(lcache->grid_tx.tex, GPU_DATA_UBYTE, 0);
lcache->grid_tx.data_type = LIGHTCACHETEX_BYTE;
lcache->grid_tx.components = 4;
}
diff --git a/source/blender/draw/engines/gpencil/gpencil_antialiasing.c b/source/blender/draw/engines/gpencil/gpencil_antialiasing.c
index 511f09db247..eaf010e81c9 100644
--- a/source/blender/draw/engines/gpencil/gpencil_antialiasing.c
+++ b/source/blender/draw/engines/gpencil/gpencil_antialiasing.c
@@ -58,11 +58,11 @@ void GPENCIL_antialiasing_init(struct GPENCIL_Data *vedata)
if (txl->smaa_search_tx == NULL) {
txl->smaa_search_tx = GPU_texture_create_2d(
"smaa_search", SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT, 1, GPU_R8, NULL);
- GPU_texture_update(txl->smaa_search_tx, GPU_DATA_UNSIGNED_BYTE, searchTexBytes);
+ GPU_texture_update(txl->smaa_search_tx, GPU_DATA_UBYTE, searchTexBytes);
txl->smaa_area_tx = GPU_texture_create_2d(
"smaa_area", AREATEX_WIDTH, AREATEX_HEIGHT, 1, GPU_RG8, NULL);
- GPU_texture_update(txl->smaa_area_tx, GPU_DATA_UNSIGNED_BYTE, areaTexBytes);
+ GPU_texture_update(txl->smaa_area_tx, GPU_DATA_UBYTE, areaTexBytes);
GPU_texture_filter_mode(txl->smaa_search_tx, true);
GPU_texture_filter_mode(txl->smaa_area_tx, true);
diff --git a/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c b/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c
index 83aa7f6e344..c9f876f9573 100644
--- a/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c
+++ b/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c
@@ -244,11 +244,11 @@ void workbench_antialiasing_engine_init(WORKBENCH_Data *vedata)
if (txl->smaa_search_tx == NULL) {
txl->smaa_search_tx = GPU_texture_create_2d(
"smaa_search", SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT, 1, GPU_R8, NULL);
- GPU_texture_update(txl->smaa_search_tx, GPU_DATA_UNSIGNED_BYTE, searchTexBytes);
+ GPU_texture_update(txl->smaa_search_tx, GPU_DATA_UBYTE, searchTexBytes);
txl->smaa_area_tx = GPU_texture_create_2d(
"smaa_area", AREATEX_WIDTH, AREATEX_HEIGHT, 1, GPU_RG8, NULL);
- GPU_texture_update(txl->smaa_area_tx, GPU_DATA_UNSIGNED_BYTE, areaTexBytes);
+ GPU_texture_update(txl->smaa_area_tx, GPU_DATA_UBYTE, areaTexBytes);
GPU_texture_filter_mode(txl->smaa_search_tx, true);
GPU_texture_filter_mode(txl->smaa_area_tx, true);
diff --git a/source/blender/draw/intern/draw_select_buffer.c b/source/blender/draw/intern/draw_select_buffer.c
index ee5561e1e38..b5151293c1b 100644
--- a/source/blender/draw/intern/draw_select_buffer.c
+++ b/source/blender/draw/intern/draw_select_buffer.c
@@ -91,7 +91,7 @@ uint *DRW_select_buffer_read(struct Depsgraph *depsgraph,
BLI_rcti_size_y(&rect_clamp),
1,
0,
- GPU_DATA_UNSIGNED_INT,
+ GPU_DATA_UINT,
r_buf);
if (!BLI_rcti_compare(rect, &rect_clamp)) {
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index e1a4f40745c..a81d319ab42 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -723,7 +723,7 @@ static bool gpencil_render_offscreen(tGPDfill *tgpf)
GPU_offscreen_read_pixels(offscreen, GPU_DATA_FLOAT, ibuf->rect_float);
}
else if (ibuf->rect) {
- GPU_offscreen_read_pixels(offscreen, GPU_DATA_UNSIGNED_BYTE, ibuf->rect);
+ GPU_offscreen_read_pixels(offscreen, GPU_DATA_UBYTE, ibuf->rect);
}
if (ibuf->rect_float && ibuf->rect) {
IMB_rect_from_float(ibuf);
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 26f0f6ca98a..1739035f92c 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -889,15 +889,15 @@ void UI_icons_reload_internal_textures(void)
icongltex.invh = 1.0f / b32buf->y;
icongltex.tex[0] = GPU_texture_create_2d("icons", b32buf->x, b32buf->y, 2, GPU_RGBA8, NULL);
- GPU_texture_update_mipmap(icongltex.tex[0], 0, GPU_DATA_UNSIGNED_BYTE, b32buf->rect);
- GPU_texture_update_mipmap(icongltex.tex[0], 1, GPU_DATA_UNSIGNED_BYTE, b16buf->rect);
+ GPU_texture_update_mipmap(icongltex.tex[0], 0, GPU_DATA_UBYTE, b32buf->rect);
+ GPU_texture_update_mipmap(icongltex.tex[0], 1, GPU_DATA_UBYTE, b16buf->rect);
}
if (need_icons_with_border && icongltex.tex[1] == NULL) {
icongltex.tex[1] = GPU_texture_create_2d(
"icons_border", b32buf_border->x, b32buf_border->y, 2, GPU_RGBA8, NULL);
- GPU_texture_update_mipmap(icongltex.tex[1], 0, GPU_DATA_UNSIGNED_BYTE, b32buf_border->rect);
- GPU_texture_update_mipmap(icongltex.tex[1], 1, GPU_DATA_UNSIGNED_BYTE, b16buf_border->rect);
+ GPU_texture_update_mipmap(icongltex.tex[1], 0, GPU_DATA_UBYTE, b32buf_border->rect);
+ GPU_texture_update_mipmap(icongltex.tex[1], 1, GPU_DATA_UBYTE, b16buf_border->rect);
}
}
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 6744461b2f2..48f937fb4ec 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -351,7 +351,7 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R
G.f &= ~G_FLAG_RENDER_VIEWPORT;
gp_rect = MEM_mallocN(sizeof(uchar[4]) * sizex * sizey, "offscreen rect");
- GPU_offscreen_read_pixels(oglrender->ofs, GPU_DATA_UNSIGNED_BYTE, gp_rect);
+ GPU_offscreen_read_pixels(oglrender->ofs, GPU_DATA_UBYTE, gp_rect);
for (i = 0; i < sizex * sizey * 4; i += 4) {
blend_color_mix_byte(&render_rect[i], &render_rect[i], &gp_rect[i]);
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index a88afecd064..e366760a55d 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -131,7 +131,7 @@ void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state,
}
const bool use_float_data = ELEM(gpu_format, GPU_RGBA16F, GPU_RGB16F, GPU_R16F);
- eGPUDataFormat gpu_data = (use_float_data) ? GPU_DATA_FLOAT : GPU_DATA_UNSIGNED_BYTE;
+ eGPUDataFormat gpu_data = (use_float_data) ? GPU_DATA_FLOAT : GPU_DATA_UBYTE;
size_t stride = components * ((use_float_data) ? sizeof(float) : sizeof(uchar));
GPUTexture *tex = GPU_texture_create_2d("immDrawPixels", tex_w, tex_h, 1, gpu_format, NULL);
diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c
index 1ea64c542f5..2ba7ef8f972 100644
--- a/source/blender/editors/screen/screen_draw.c
+++ b/source/blender/editors/screen/screen_draw.c
@@ -610,7 +610,7 @@ void ED_screen_preview_render(const bScreen *screen, int size_x, int size_y, uin
screen_preview_draw(screen, size_x, size_y);
- GPU_offscreen_read_pixels(offscreen, GPU_DATA_UNSIGNED_BYTE, r_rect);
+ GPU_offscreen_read_pixels(offscreen, GPU_DATA_UBYTE, r_rect);
GPU_offs
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list