Remember bound framebuffer to avoid glGetInteger use. (#1273)

glGetInteger seems to sync with GPU which is less than ideal, and slowing down texture copies.
This commit is contained in:
riperiperi 2020-05-24 14:44:12 +01:00 committed by GitHub
parent 6416bc1938
commit d941f4c070
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 6 deletions

View file

@ -28,6 +28,9 @@ namespace Ryujinx.Graphics.OpenGL
private bool _depthTest;
private bool _hasDepthBuffer;
private int _boundDrawFramebuffer;
private int _boundReadFramebuffer;
private TextureBase _unit0Texture;
private ClipOrigin _clipOrigin;
@ -956,12 +959,18 @@ namespace Ryujinx.Graphics.OpenGL
{
_framebuffer = new Framebuffer();
_framebuffer.Bind();
int boundHandle = _framebuffer.Bind();
_boundDrawFramebuffer = _boundReadFramebuffer = boundHandle;
GL.Enable(EnableCap.FramebufferSrgb);
}
}
internal (int drawHandle, int readHandle) GetBoundFramebuffers()
{
return (_boundDrawFramebuffer, _boundReadFramebuffer);
}
private void UpdateDepthTest()
{
// Enabling depth operations is only valid when we have