mirror of
https://github.com/godotengine/godot
synced 2024-09-05 14:59:59 +00:00
Fix bufSize parameter for glGetSynciv
According to the docs: https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGetSynciv.xhtml Bufsize is in integers, not bytes. The current code overflows data unto other stack variables.
This commit is contained in:
parent
9f68d06ec2
commit
aeab31b13a
|
@ -115,7 +115,7 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_
|
|||
|
||||
if (state.canvas_instance_data_buffers[state.current_data_buffer_index].fence != GLsync()) {
|
||||
GLint syncStatus;
|
||||
glGetSynciv(state.canvas_instance_data_buffers[state.current_data_buffer_index].fence, GL_SYNC_STATUS, sizeof(GLint), nullptr, &syncStatus);
|
||||
glGetSynciv(state.canvas_instance_data_buffers[state.current_data_buffer_index].fence, GL_SYNC_STATUS, 1, nullptr, &syncStatus);
|
||||
if (syncStatus == GL_UNSIGNALED) {
|
||||
// If older than 2 frames, wait for sync OpenGL can have up to 3 frames in flight, any more and we need to sync anyway.
|
||||
if (state.canvas_instance_data_buffers[state.current_data_buffer_index].last_frame_used < RSG::rasterizer->get_frame_number() - 2) {
|
||||
|
|
Loading…
Reference in a new issue