From 89c79c3ed8d4f8cdf4f78782443bcf218425b412 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Wed, 17 Feb 2021 12:38:21 -0300 Subject: Cleanup: Abbreviate enums with 'UNSIGNED_' in the name --- source/blender/blenfont/intern/blf_font.c | 2 +- source/blender/blenkernel/intern/image_gpu.c | 4 ++-- source/blender/draw/engines/eevee/eevee_lightcache.c | 4 ++-- .../draw/engines/gpencil/gpencil_antialiasing.c | 4 ++-- .../engines/workbench/workbench_effect_antialiasing.c | 4 ++-- source/blender/draw/intern/draw_select_buffer.c | 2 +- source/blender/editors/gpencil/gpencil_fill.c | 2 +- source/blender/editors/interface/interface_icons.c | 8 ++++---- source/blender/editors/render/render_opengl.c | 2 +- source/blender/editors/screen/glutil.c | 2 +- source/blender/editors/screen/screen_draw.c | 2 +- source/blender/editors/sculpt_paint/paint_cursor.c | 8 ++++---- source/blender/editors/space_clip/clip_draw.c | 2 +- .../blender/editors/space_sequencer/sequencer_draw.c | 6 +++--- source/blender/editors/space_view3d/view3d_draw.c | 2 +- source/blender/gpu/GPU_texture.h | 6 +++--- source/blender/gpu/intern/gpu_framebuffer.cc | 2 +- source/blender/gpu/intern/gpu_select_pick.c | 2 +- source/blender/gpu/intern/gpu_texture_private.hh | 18 +++++++++--------- source/blender/gpu/opengl/gl_framebuffer.cc | 6 +++--- source/blender/gpu/opengl/gl_texture.hh | 6 +++--- source/blender/imbuf/intern/util_gpu.c | 2 +- source/blender/python/gpu/gpu_py.c | 6 +++--- source/blender/python/gpu/gpu_py_buffer.c | 18 +++++++++--------- source/blender/python/gpu/gpu_py_texture.c | 10 +++++----- source/blender/windowmanager/intern/wm_window.c | 2 +- 26 files changed, 66 insertions(+), 66 deletions(-) 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_offscreen_unbind(offscreen, true); GPU_offscreen_free(offscreen); diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 7eb08cbabac..e9f33d2fbd3 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -350,7 +350,7 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima eGPUTextureFormat format = col ? GPU_RGBA8 : GPU_R8; 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); + GPU_texture_update(target->overlay_texture, GPU_DATA_UBYTE, buffer); if (!col) { GPU_texture_swizzle_set(target->overlay_texture, "rrrr"); @@ -358,7 +358,7 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima } if (init) { - GPU_texture_update(target->overlay_texture, GPU_DATA_UNSIGNED_BYTE, buffer); + GPU_texture_update(target->overlay_texture, GPU_DATA_UBYTE, buffer); } if (buffer) { @@ -469,13 +469,13 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom) if (!cursor_snap.overlay_texture) { 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_update(cursor_snap.overlay_texture, GPU_DATA_UBYTE, buffer); GPU_texture_swizzle_set(cursor_snap.overlay_texture, "rrrr"); } if (init) { - GPU_texture_update(cursor_snap.overlay_texture, GPU_DATA_UNSIGNED_BYTE, buffer); + GPU_texture_update(cursor_snap.overlay_texture, GPU_DATA_UBYTE, buffer); } if (buffer) { diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 93c30c9a4ba..cbe8ec4ba00 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -1207,7 +1207,7 @@ static void draw_plane_marker_image(Scene *scene, GPUTexture *texture = GPU_texture_create_2d( "plane_marker_image", ibuf->x, ibuf->y, 1, GPU_RGBA8, NULL); - GPU_texture_update(texture, GPU_DATA_UNSIGNED_BYTE, display_buffer); + GPU_texture_update(texture, GPU_DATA_UBYTE, 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 201df1ceed6..b9fb577eb43 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1533,7 +1533,7 @@ static void *sequencer_OCIO_transform_ibuf(const bContext *C, /* Default */ *r_format = GPU_RGBA8; - *r_data = GPU_DATA_UNSIGNED_BYTE; + *r_data = GPU_DATA_UBYTE; /* Fallback to CPU based color space conversion. */ if (force_fallback) { @@ -1580,7 +1580,7 @@ static void *sequencer_OCIO_transform_ibuf(const bContext *C, if ((ibuf->rect || ibuf->rect_float) && !*r_glsl_used) { display_buffer = IMB_display_buffer_acquire_ctx(C, ibuf, &cache_handle); *r_format = GPU_RGBA8; - *r_data = GPU_DATA_UNSIGNED_BYTE; + *r_data = GPU_DATA_UBYTE; } if (cache_handle) { IMB_display_buffer_release(cache_handle); @@ -1682,7 +1682,7 @@ static void sequencer_draw_display_buffer(const bContext *C, display_buffer = (uchar *)ibuf->rect; format = GPU_RGBA8; - data = GPU_DATA_UNSIGNED_BYTE; + data = GPU_DATA_UBYTE; } else { display_buffer = sequencer_OCIO_transform_ibuf(C, ibuf, &glsl_used, &format, &data); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 12fb96c0737..a46d093c039 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2002,7 +2002,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Depsgraph *depsgraph, GPU_offscreen_read_pixels(ofs, GPU_DATA_FLOAT, ibuf->rect_float); } else if (ibuf->rect) { - GPU_offscreen_read_pixels(ofs, GPU_DATA_UNSIGNED_BYTE, ibuf->rect); + GPU_offscreen_read_pixels(ofs, GPU_DATA_UBYTE, ibuf->rect); } /* unbind */ diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h index 176d7bbb5af..2b4d8c8f577 100644 --- a/source/blender/gpu/GPU_texture.h +++ b/source/blender/gpu/GPU_texture.h @@ -171,9 +171,9 @@ typedef enum eGPUTextureFormat { typedef enum eGPUDataFormat { GPU_DATA_FLOAT, GPU_DATA_INT, - GPU_DATA_UNSIGNED_INT, - GPU_DATA_UNSIGNED_BYTE, - GPU_DATA_UNSIGNED_INT_24_8, + GPU_DATA_UINT, + GPU_DATA_UBYTE, + GPU_DATA_UINT_24_8, GPU_DATA_10_11_11_REV, } eGPUDataFormat; diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index 2813132c799..0dd7948532c 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -656,7 +656,7 @@ void GPU_offscreen_draw_to_screen(GPUOffScreen *ofs, int x, int y) void GPU_offscreen_read_pixels(GPUOffScreen *ofs, eGPUDataFormat format, void *pixels) { - BLI_assert(ELEM(format, GPU_DATA_UNSIGNED_BYTE, GPU_DATA_FLOAT)); + BLI_assert(ELEM(format, GPU_DATA_UBYTE, GPU_DATA_FLOAT)); const int w = GPU_texture_width(ofs->color); const int h = GPU_texture_height(ofs->color); diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c index 6cda7888712..89c94fd3ba5 100644 --- a/source/blender/gpu/intern/gpu_select_pick.c +++ b/source/blender/gpu/intern/gpu_select_pick.c @@ -483,7 +483,7 @@ bool gpu_select_pick_load_id(uint id, bool end) const uint rect_len = ps->src.rect_len; GPUFrameBuffer *fb = GPU_framebuffer_active_get(); GPU_framebuffer_read_depth( - fb, UNPACK4(ps->gl.clip_readpixels), GPU_DATA_UNSIGNED_INT, ps->gl.rect_depth_test->buf); + fb, UNPACK4(ps->gl.clip_readpixels), GPU_DATA_UINT, ps->gl.rect_depth_test->buf); /* perform initial check since most cases the array remains unchanged */ bool do_pass = false; diff --git a/source/blender/gpu/intern/gpu_texture_private.hh b/source/blender/gpu/intern/gpu_texture_private.hh index 51a953e110d..e03d5f6e6ce 100644 --- a/source/blender/gpu/intern/gpu_texture_private.hh +++ b/source/blender/gpu/intern/gpu_texture_private.hh @@ -387,13 +387,13 @@ inline int to_component_len(eGPUTextureFormat format) inline size_t to_bytesize(eGPUDataFormat data_format) { switch (data_format) { - case GPU_DATA_UNSIGNED_BYTE: + case GPU_DATA_UBYTE: return 1; case GPU_DATA_FLOAT: case GPU_DATA_INT: - case GPU_DATA_UNSIGNED_INT: + case GPU_DATA_UINT: return 4; - case GPU_DATA_UNSIGNED_INT_24_8: + case GPU_DATA_UINT_24_8: case GPU_DATA_10_11_11_REV: return 4; default: @@ -417,12 +417,12 @@ inline bool validate_data_format(eGPUTextureFormat tex_format, eGPUDataFormat da return data_format == GPU_DATA_FLOAT; case GPU_DEPTH24_STENCIL8: case GPU_DEPTH32F_STENCIL8: - return data_format == GPU_DATA_UNSIGNED_INT_24_8; + return data_format == GPU_DATA_UINT_24_8; case GPU_R8UI: case GPU_R16UI: case GPU_RG16UI: case GPU_R32UI: - return data_format == GPU_DATA_UNSIGNED_INT; + return data_format == GPU_DATA_UINT; case GPU_RG16I: case GPU_R16I: return data_format == GPU_DATA_INT; @@ -431,7 +431,7 @@ inline bool validate_data_format(eGPUTextureFormat tex_format, eGPUDataFormat da case GPU_RGBA8: case GPU_RGBA8UI: case GPU_SRGB8_A8: - return ELEM(data_format, GPU_DATA_UNSIGNED_BYTE, GPU_DATA_FLOAT); + return ELEM(data_format, GPU_DATA_UBYTE, GPU_DATA_FLOAT); case GPU_R11F_G11F_B10F: return ELEM(data_format, GPU_DATA_10_11_11_REV, GPU_DATA_FLOAT); default: @@ -449,12 +449,12 @@ inline eGPUDataFormat to_data_format(eGPUTextureFormat tex_format) return GPU_DATA_FLOAT; case GPU_DEPTH24_STENCIL8: case GPU_DEPTH32F_STENCIL8: - return GPU_DATA_UNSIGNED_INT_24_8; + return GPU_DATA_UINT_24_8; case GPU_R8UI: case GPU_R16UI: case GPU_RG16UI: case GPU_R32UI: - return GPU_DATA_UNSIGNED_INT; + return GPU_DATA_UINT; case GPU_RG16I: case GPU_R16I: return GPU_DATA_INT; @@ -463,7 +463,7 @@ inline eGPUDataFormat to_data_format(eGPUTextureFormat tex_format) case GPU_RGBA8: case GPU_RGBA8UI: case GPU_SRGB8_A8: - return GPU_DATA_UNSIGNED_BYTE; + return GPU_DATA_UBYTE; case GPU_R11F_G11F_B10F: return GPU_DATA_10_11_11_REV; default: diff --git a/source/blender/gpu/opengl/gl_framebuffer.cc b/source/blender/gpu/opengl/gl_framebuffer.cc index aea19295311..920dac407d7 100644 --- a/source/blender/gpu/opengl/gl_framebuffer.cc +++ b/source/blender/gpu/opengl/gl_framebuffer.cc @@ -365,7 +365,7 @@ void GLFrameBuffer::clear_attachment(GPUAttachmentType type, context_->state_manager->apply_state(); if (type == GPU_FB_DEPTH_STENCIL_ATTACHMENT) { - BLI_assert(data_format == GPU_DATA_UNSIGNED_INT_24_8); + BLI_assert(data_format == GPU_DATA_UINT_24_8); float depth = ((*(uint32_t *)clear_value) & 0x00FFFFFFu) / (float)0x00FFFFFFu; int stencil = ((*(uint32_t *)clear_value) >> 24); glClearBufferfi(GL_DEPTH_STENCIL, 0, depth, stencil); @@ -374,7 +374,7 @@ void GLFrameBuffer::clear_attachment(GPUAttachmentType type, if (data_format == GPU_DATA_FLOAT) { glClearBufferfv(GL_DEPTH, 0, (GLfloat *)clear_value); } - else if (data_format == GPU_DATA_UNSIGNED_INT) { + else if (data_format == GPU_DATA_UINT) { float depth = *(uint32_t *)clear_value / (float)0xFFFFFFFFu; glClearBufferfv(GL_DEPTH, 0, &depth); } @@ -388,7 +388,7 @@ void GLFrameBuffer::clear_attachment(GPUAttachmentType type, case GPU_DATA_FLOAT: glClearBufferfv(GL_COLOR, slot, (GLfloat *)clear_value); break; - case GPU_DATA_UNSIGNED_INT: + case GPU_DATA_UINT: glClearBufferuiv(GL_COLOR, slot, (GLuint *)clear_value); break; case GPU_DATA_INT: diff --git a/source/blender/gpu/opengl/gl_texture.hh b/source/blender/gpu/opengl/gl_texture.hh index 65a211e12a3..afe0e0195ce 100644 --- a/source/blender/gpu/opengl/gl_texture.hh +++ b/source/blender/gpu/opengl/gl_texture.hh @@ -274,11 +274,11 @@ inline GLenum to_gl(eGPUDataFormat format) return GL_FLOAT; case GPU_DATA_INT: return GL_INT; - case GPU_DATA_UNSIGNED_INT: + case GPU_DATA_UINT: return GL_UNSIGNED_INT; - case GPU_DATA_UNSIGNED_BYTE: + case GPU_DATA_UBYTE: return GL_UNSIGNED_BYTE; - case GPU_DATA_UNSIGNED_INT_24_8: + case GPU_DATA_UINT_24_8: return GL_UNSIGNED_INT_24_8; case GPU_DATA_10_11_11_REV: return GL_UNSIGNED_INT_10F_11F_11F_REV; diff --git a/source/blender/imbuf/intern/util_gpu.c b/source/blender/imbuf/intern/util_gpu.c index 8bedf8eb93c..2b99a0aa81d 100644 --- a/source/blender/imbuf/intern/util_gpu.c +++ b/source/blender/imbuf/intern/util_gpu.c @@ -49,7 +49,7 @@ static void imb_gpu_get_format(const ImBuf *ibuf, !IMB_colormanagement_space_is_scene_linear(ibuf->rect_colorspace)); high_bitdepth = (!(ibuf->flags & IB_halffloat) && high_bitdepth); - *r_data_format = (float_rect) ? GPU_DATA_FLOAT : GPU_DATA_UNSIGNED_BYTE; + *r_data_format = (float_rect) ? GPU_DATA_FLOAT : GPU_DATA_UBYTE; if (float_rect) { *r_texture_format = high_bitdepth ? GPU_RGBA32F : GPU_RGBA16F; diff --git a/source/blender/python/gpu/gpu_py.c b/source/blender/python/gpu/gpu_py.c index 522cd89c5c0..35cc945e76c 100644 --- a/source/blender/python/gpu/gpu_py.c +++ b/source/blender/python/gpu/gpu_py.c @@ -36,9 +36,9 @@ struct PyC_StringEnumItems bpygpu_dataformat_items[] = { {GPU_DATA_FLOAT, "FLOAT"}, {GPU_DATA_INT, "INT"}, - {GPU_DATA_UNSIGNED_INT, "UINT"}, - {GPU_DATA_UNSIGNED_BYTE, "UBYTE"}, - {GPU_DATA_UNSIGNED_INT_24_8, "UINT_24_8"}, + {GPU_DATA_UINT, "UINT"}, + {GPU_DATA_UBYTE, "UBYTE"}, + {GPU_DATA_UINT_24_8, "UINT_24_8"}, {GPU_DATA_10_11_11_REV, "10_11_11_REV"}, {0, NULL}, }; diff --git a/source/blender/python/gpu/gpu_py_buffer.c b/source/blender/python/gpu/gpu_py_buffer.c index aef819aec39..c8eaa9cd5c8 100644 --- a/source/blender/python/gpu/gpu_py_buffer.c +++ b/source/blender/python/gpu/gpu_py_buffer.c @@ -57,11 +57,11 @@ static const char *pygpu_buffer_formatstr(eGPUDataFormat data_format) return "f"; case GPU_DATA_INT: return "i"; - case GPU_DATA_UNSIGNED_INT: + case GPU_DATA_UINT: return "I"; - case GPU_DATA_UNSIGNED_BYTE: + case GPU_DATA_UBYTE: return "B"; - case GPU_DATA_UNSIGNED_INT_24_8: + case GPU_DATA_UINT_24_8: case GPU_DATA_10_11_11_REV: return "I"; default: @@ -114,10 +114,10 @@ static PyObject *pygpu_buffer__sq_item(BPyGPUBuffer *self, int i) return Py_BuildValue(formatstr, self->buf.as_float[i]); case GPU_DATA_INT: return Py_BuildValue(formatstr, self->buf.as_int[i]); - case GPU_DATA_UNSIGNED_BYTE: + case GPU_DATA_UBYTE: return Py_BuildValue(formatstr, self->buf.as_byte[i]); - case GPU_DATA_UNSIGNED_INT: - case GPU_DATA_UNSIGNED_INT_24_8: + case GPU_DATA_UINT: + case GPU_DATA_UINT_24_8: case GPU_DATA_10_11_11_REV: return Py_BuildValue(formatstr, self->buf.as_uint[i]); } @@ -433,10 +433,10 @@ static int pygpu_buffer__sq_ass_item(BPyGPUBuffer *self, int i, PyObject *v) return PyArg_Parse(v, "f:Expected floats", &self->buf.as_float[i]) ? 0 : -1; case GPU_DATA_INT: return PyArg_Parse(v, "i:Expected ints", &self->buf.as_int[i]) ? 0 : -1; - case GPU_DATA_UNSIGNED_BYTE: + case GPU_DATA_UBYTE: return PyArg_Parse(v, "b:Expected ints", &self->buf.as_byte[i]) ? 0 : -1; - case GPU_DATA_UNSIGNED_INT: - case GPU_DATA_UNSIGNED_INT_24_8: + case GPU_DATA_UINT: + case GPU_DATA_UINT_24_8: case GPU_DATA_10_11_11_REV: return PyArg_Parse(v, "b:Expected ints", &self->buf.as_uint[i]) ? 0 : -1; default: diff --git a/source/blender/python/gpu/gpu_py_texture.c b/source/blender/python/gpu/gpu_py_texture.c index 97dc99f5d58..2b1b5f672b0 100644 --- a/source/blender/python/gpu/gpu_py_texture.c +++ b/source/blender/python/gpu/gpu_py_texture.c @@ -314,7 +314,7 @@ static PyObject *pygpu_texture_clear(BPyGPUTexture *self, PyObject *args, PyObje } if (shape != 1 && - ELEM(pygpu_dataformat.value_found, GPU_DATA_UNSIGNED_INT_24_8, GPU_DATA_10_11_11_REV)) { + ELEM(pygpu_dataformat.value_found, GPU_DATA_UINT_24_8, GPU_DATA_10_11_11_REV)) { PyErr_SetString(PyExc_AttributeError, "`UINT_24_8` and `10_11_11_REV` only support single values"); return NULL; @@ -330,7 +330,7 @@ static PyObject *pygpu_texture_clear(BPyGPUTexture *self, PyObject *args, PyObje return NULL; } - if (pygpu_dataformat.value_found == GPU_DATA_UNSIGNED_BYTE) { + if (pygpu_dataformat.value_found == GPU_DATA_UBYTE) { /* Convert to byte. */ values.c[0] = values.i[0]; values.c[1] = values.i[1]; @@ -362,13 +362,13 @@ static PyObject *pygpu_texture_read(BPyGPUTexture *self) break; case GPU_DEPTH24_STENCIL8: case GPU_DEPTH32F_STENCIL8: - best_data_format = GPU_DATA_UNSIGNED_INT_24_8; + best_data_format = GPU_DATA_UINT_24_8; break; case GPU_R8UI: case GPU_R16UI: case GPU_RG16UI: case GPU_R32UI: - best_data_format = GPU_DATA_UNSIGNED_INT; + best_data_format = GPU_DATA_UINT; break; case GPU_RG16I: case GPU_R16I: @@ -379,7 +379,7 @@ static PyObject *pygpu_texture_read(BPyGPUTexture *self) case GPU_RGBA8: case GPU_RGBA8UI: case GPU_SRGB8_A8: - best_data_format = GPU_DATA_UNSIGNED_BYTE; + best_data_format = GPU_DATA_UBYTE; break; case GPU_R11F_G11F_B10F: best_data_format = GPU_DATA_10_11_11_REV; diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 6433cd7d12d..7dc6b0a1eb8 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -2026,7 +2026,7 @@ uint *WM_window_pixels_read(wmWindowManager *wm, wmWindow *win, int r_size[2]) const uint rect_len = r_size[0] * r_size[1]; uint *rect = MEM_mallocN(sizeof(*rect) * rect_len, __func__); - GPU_frontbuffer_read_pixels(0, 0, r_size[0], r_size[1], 4, GPU_DATA_UNSIGNED_BYTE, rect); + GPU_frontbuffer_read_pixels(0, 0, r_size[0], r_size[1], 4, GPU_DATA_UBYTE, rect); if (setup_context) { if (wm->windrawable) { -- cgit v1.2.3