GPU: set 'GL_PACK_ALIGNMENT' 1 as default

This fixes T91828.

The current value of `GL_PACK_ALIGNMENT` may result in crash in the `gpu` module if the buffer is not aligned.

Differential Revision: https://developer.blender.org/D12720
This commit is contained in:
Germano Cavalcante 2021-09-30 17:22:12 -03:00
parent eb3a8fb4e8
commit bdc66c9569
Notes: blender-bot 2023-02-14 03:44:41 +01:00
Referenced by issue #91828, Blender crashes when reading to bgl.Buffer / gpu.types.Buffer
1 changed files with 1 additions and 0 deletions

View File

@ -52,6 +52,7 @@ GLStateManager::GLStateManager()
glDisable(GL_DITHER);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPrimitiveRestartIndex((GLuint)0xFFFFFFFF);