From 7df51ca11a227b5e51290f8dc976972a01db5d81 Mon Sep 17 00:00:00 2001 From: mano-wii Date: Sat, 2 May 2020 10:21:17 -0300 Subject: 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. --- source/blender/gpu/intern/gpu_immediate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3