From 2d9eee15c58ba1d3e2bd05a17ca09d74421c47ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 17 Jul 2020 15:58:33 +0200 Subject: Cleanup: GPU: Set default GL_UNPACK_ALIGNMENT to 1 Ogl default is 4 but for almost all cases, blender use tightly packed format. This avoid confusion and state change for the common case. The only case that __might__ need alignement is DDS loader (untested) so leaving this as it is. --- source/blender/gpu/intern/gpu_texture.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'source/blender/gpu/intern/gpu_texture.c') diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index c4d7eccf9f9..4c847236f09 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -1465,16 +1465,8 @@ void GPU_texture_update_sub(GPUTexture *tex, BLI_assert((int)tex->format > -1); BLI_assert(tex->components > -1); - const uint bytesize = gpu_get_bytesize(tex->format); GLenum data_format = gpu_get_gl_dataformat(tex->format, &tex->format_flag); GLenum data_type = gpu_get_gl_datatype(gpu_data_format); - GLint alignment; - - /* The default pack size for textures is 4, which won't work for byte based textures */ - if (bytesize == 1) { - glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - } glBindTexture(tex->target, tex->bindcode); switch (tex->target) { @@ -1505,10 +1497,6 @@ void GPU_texture_update_sub(GPUTexture *tex, BLI_assert(!"tex->target mode not supported"); } - if (bytesize == 1) { - glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); - } - glBindTexture(tex->target, 0); } -- cgit v1.2.3