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/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 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) (limited to 'source/blender/gpu') 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; -- cgit v1.2.3