diff options
author | mano-wii <germano.costa@ig.com.br> | 2020-05-02 16:21:17 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2020-05-02 16:21:38 +0300 |
commit | 7df51ca11a227b5e51290f8dc976972a01db5d81 (patch) | |
tree | eae327a702a5abe14efcd6adc0bf157741cf6f25 /source/blender/gpu | |
parent | 5ef94c9c41e770bb0d18ebe30f836b8c6c476673 (diff) |
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.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_immediate.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; } |