Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-07-17 16:58:33 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-07-18 04:43:52 +0300
commit2d9eee15c58ba1d3e2bd05a17ca09d74421c47ea (patch)
tree5178eda0d4dfef2081cad696d37052f3a797a39b /source/blender/gpu/intern/gpu_texture.c
parent0ef57d3fc079795f77ab7f13bca842ab172af08f (diff)
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.
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture.c')
-rw-r--r--source/blender/gpu/intern/gpu_texture.c12
1 files changed, 0 insertions, 12 deletions
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);
}