Fix: gpu_colors_enable could cause 3d display corruption because it always enables glColorMaterial. Make sure to call gpu_colors_disable even if we don't have a mask layer, to match gpu_colors_enable above
This commit is contained in:
@@ -1986,7 +1986,7 @@ void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial)
|
||||
if (buffers->vert_buf && buffers->index_buf) {
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_NORMAL_ARRAY);
|
||||
if (buffers->vmask || buffers->gridkey.has_mask) {
|
||||
if (has_mask) {
|
||||
gpu_colors_enable(VBO_ENABLED);
|
||||
}
|
||||
else {
|
||||
@@ -2036,6 +2036,9 @@ void GPU_draw_buffers(GPU_Buffers *buffers, DMSetMaterial setMaterial)
|
||||
if (has_mask) {
|
||||
gpu_colors_disable(VBO_ENABLED);
|
||||
}
|
||||
else {
|
||||
gpu_colors_disable(VBO_DISABLED);
|
||||
}
|
||||
}
|
||||
/* fallbacks if we are out of memory or VBO is disabled */
|
||||
else if (buffers->totface) {
|
||||
|
||||
Reference in New Issue
Block a user