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.
This commit is contained in:
2020-07-17 15:58:33 +02:00
parent 0ef57d3fc0
commit 2d9eee15c5
4 changed files with 7 additions and 19 deletions

View File

@@ -357,11 +357,6 @@ static void draw_filled_lasso(wmGesture *gt)
GPU_blend(true);
GPU_blend_set_func(GPU_ONE, GPU_ONE);
GLint unpack_alignment;
glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpack_alignment);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR);
GPU_shader_bind(state.shader);
GPU_shader_uniform_vector(
@@ -382,8 +377,6 @@ static void draw_filled_lasso(wmGesture *gt)
GPU_shader_unbind();
glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment);
MEM_freeN(pixel_buf);
GPU_blend(false);