diff options
| author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2018-09-25 19:55:30 -0300 |
|---|---|---|
| committer | Ac_K <Acoustik666@gmail.com> | 2018-09-26 00:55:30 +0200 |
| commit | 2562ca6c3fe6ef328e0926c9cbcd6bb52abb328f (patch) | |
| tree | d4719ba44b7094cf4e8cf11db858b323644fd44a /Ryujinx.Graphics/NvGpuEngine3d.cs | |
| parent | 7de7b559adc1924d3ff31cc58b281f70e468155f (diff) | |
Fix multiple rendertargets (#427)
* Simplify render target bindings
* Implement multiple viewports
* Pack glViewportIndexed calls into a single glViewportArray
* Use ARB_viewport_array when available
* Cache framebuffer attachments
* Use get accessors in OGLExtension
* Address feedback
Diffstat (limited to 'Ryujinx.Graphics/NvGpuEngine3d.cs')
| -rw-r--r-- | Ryujinx.Graphics/NvGpuEngine3d.cs | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/Ryujinx.Graphics/NvGpuEngine3d.cs b/Ryujinx.Graphics/NvGpuEngine3d.cs index b19f3063..22c09377 100644 --- a/Ryujinx.Graphics/NvGpuEngine3d.cs +++ b/Ryujinx.Graphics/NvGpuEngine3d.cs @@ -100,7 +100,10 @@ namespace Ryujinx.Graphics SetAlphaBlending(State); SetPrimitiveRestart(State); - SetFrameBuffer(Vmm, 0); + for (int FbIndex = 0; FbIndex < 8; FbIndex++) + { + SetFrameBuffer(Vmm, FbIndex); + } SetZeta(Vmm); @@ -154,6 +157,10 @@ namespace Ryujinx.Graphics SetZeta(Vmm); + SetRenderTargets(); + + Gpu.Renderer.RenderTarget.Bind(); + Gpu.Renderer.Rasterizer.ClearBuffers( Flags, FbIndex, @@ -204,7 +211,7 @@ namespace Ryujinx.Graphics Gpu.ResourceManager.SendColorBuffer(Vmm, Key, FbIndex, Image); - Gpu.Renderer.RenderTarget.SetViewport(VpX, VpY, VpW, VpH); + Gpu.Renderer.RenderTarget.SetViewport(FbIndex, VpX, VpY, VpW, VpH); } private void SetFrameBuffer(GalPipelineState State) @@ -426,14 +433,15 @@ namespace Ryujinx.Graphics private void SetRenderTargets() { - bool SeparateFragData = ReadRegisterBool(NvGpuEngine3dReg.RTSeparateFragData); + //Commercial games do not seem to + //bool SeparateFragData = ReadRegisterBool(NvGpuEngine3dReg.RTSeparateFragData); - if (SeparateFragData) - { - uint Control = (uint)(ReadRegister(NvGpuEngine3dReg.RTControl)); + uint Control = (uint)(ReadRegister(NvGpuEngine3dReg.RTControl)); - uint Count = Control & 0xf; + uint Count = Control & 0xf; + if (Count > 0) + { int[] Map = new int[Count]; for (int i = 0; i < Count; i++) @@ -702,6 +710,8 @@ namespace Ryujinx.Graphics Gpu.Renderer.Pipeline.Bind(State); + Gpu.Renderer.RenderTarget.Bind(); + if (IndexCount != 0) { int IndexEntryFmt = ReadRegister(NvGpuEngine3dReg.IndexArrayFormat); |
