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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user