Skip to content

Instantly share code, notes, and snippets.

@Milek7

Milek7/fix2.diff Secret

Created May 19, 2021 12:32
Show Gist options
  • Save Milek7/07fff2b2760c5f42ce21f297261bbe6e to your computer and use it in GitHub Desktop.
Save Milek7/07fff2b2760c5f42ce21f297261bbe6e to your computer and use it in GitHub Desktop.
diff --git a/src/video/opengl.cpp b/src/video/opengl.cpp
index ecafeb613..c96e5109c 100644
--- a/src/video/opengl.cpp
+++ b/src/video/opengl.cpp
@@ -1223,11 +1223,11 @@ void OpenGLBackend::ReleaseVideoBuffer(const Rect &update_rect)
_glTexSubImage2D(GL_TEXTURE_2D, 0, update_rect.left, update_rect.top, update_rect.right - update_rect.left, update_rect.bottom - update_rect.top, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, (GLvoid *)(size_t)(update_rect.top * _screen.pitch * 4 + update_rect.left * 4));
break;
}
+ }
#ifndef NO_GL_BUFFER_SYNC
- if (this->persistent_mapping_supported) this->sync_vid_mapping = _glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
+ if (this->persistent_mapping_supported) this->sync_vid_mapping = _glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
#endif
- }
}
/**
@@ -1257,11 +1257,11 @@ void OpenGLBackend::ReleaseAnimBuffer(const Rect &update_rect)
_glBindTexture(GL_TEXTURE_2D, this->anim_texture);
_glPixelStorei(GL_UNPACK_ROW_LENGTH, _screen.pitch);
_glTexSubImage2D(GL_TEXTURE_2D, 0, update_rect.left, update_rect.top, update_rect.right - update_rect.left, update_rect.bottom - update_rect.top, GL_RED, GL_UNSIGNED_BYTE, (GLvoid *)(size_t)(update_rect.top * _screen.pitch + update_rect.left));
+ }
#ifndef NO_GL_BUFFER_SYNC
- if (this->persistent_mapping_supported) this->sync_anim_mapping = _glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
+ if (this->persistent_mapping_supported) this->sync_anim_mapping = _glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
#endif
- }
}
/* virtual */ Sprite *OpenGLBackend::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment