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.
This commit is contained in:
mano-wii
2020-05-02 10:21:17 -03:00
parent 5ef94c9c41
commit 7df51ca11a

View File

@@ -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;
}