Implement GPU scissors (#1058)

* Implement GPU scissors

* Remove unused using

* Add missing changes for Clear
This commit is contained in:
gdkchan 2020-03-29 00:02:58 -03:00 committed by GitHub
parent 06bf25521f
commit ab4867505e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 107 additions and 7 deletions

View file

@ -6,9 +6,16 @@ namespace Ryujinx.Graphics.OpenGL
{
class TextureCopy : IDisposable
{
private readonly Renderer _renderer;
private int _srcFramebuffer;
private int _dstFramebuffer;
public TextureCopy(Renderer renderer)
{
_renderer = renderer;
}
public void Copy(
TextureView src,
TextureView dst,
@ -34,6 +41,8 @@ namespace Ryujinx.Graphics.OpenGL
GL.ReadBuffer(ReadBufferMode.ColorAttachment0);
GL.DrawBuffer(DrawBufferMode.ColorAttachment0);
GL.Disable(EnableCap.ScissorTest);
GL.BlitFramebuffer(
srcRegion.X1,
srcRegion.Y1,
@ -48,6 +57,8 @@ namespace Ryujinx.Graphics.OpenGL
GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, oldReadFramebufferHandle);
GL.BindFramebuffer(FramebufferTarget.DrawFramebuffer, oldDrawFramebufferHandle);
((Pipeline)_renderer.Pipeline).RestoreScissorEnable();
}
private static void Attach(FramebufferTarget target, Format format, int handle)