[Bf-blender-cvs] [7df51ca11a2] master: Possible fix for T76113: Use GL_STATIC_DRAW in immBegin
mano-wii
noreply at git.blender.org
Sat May 2 15:25:39 CEST 2020
Commit: 7df51ca11a227b5e51290f8dc976972a01db5d81
Author: mano-wii
Date: Sat May 2 10:21:17 2020 -0300
Branches: master
https://developer.blender.org/rB7df51ca11a227b5e51290f8dc976972a01db5d81
Possible fix for T76113: Use GL_STATIC_DRAW in immBegin
This fixes a freeze when closing temporary windows with `AMD Radeon HD 7570M`
The performance is practically the same between calls (with a micro advantage for `GL_STATIC_DRAW`)
I couldn't check the difference in memory usage.
The ideal would be profile in different setups.
But due to the seriousness of the bug, these tests were postponed.
===================================================================
M source/blender/gpu/intern/gpu_immediate.c
===================================================================
diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c
index 5a5dfb3e1e8..f91a13a3b62 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -268,7 +268,8 @@ void immBegin(GPUPrimType prim_type, uint vertex_len)
else {
/* orphan this buffer & start with a fresh one */
/* this method works on all platforms, old & new */
- glBufferData(GL_ARRAY_BUFFER, active_buffer->buffer_size, NULL, GL_DYNAMIC_DRAW);
+ /* `GL_DYNAMIC_DRAW` was causing problems when closing temporary windows on old AMD GPUs. */
+ glBufferData(GL_ARRAY_BUFFER, active_buffer->buffer_size, NULL, GL_STATIC_DRAW);
active_buffer->buffer_offset = 0;
}
More information about the Bf-blender-cvs
mailing list