From 9bfb373bdf85178ef319fa4d107ae20d0a2d4a04 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 31 Dec 2019 19:22:45 -0300 Subject: Remove more unused code --- Ryujinx.Graphics.Gpu/Engine/Methods.cs | 47 ++++------------------------------ 1 file changed, 5 insertions(+), 42 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Engine/Methods.cs') diff --git a/Ryujinx.Graphics.Gpu/Engine/Methods.cs b/Ryujinx.Graphics.Gpu/Engine/Methods.cs index 12a9744c..6dce61f2 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Methods.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Methods.cs @@ -336,8 +336,6 @@ namespace Ryujinx.Graphics.Gpu.Engine _context.Renderer.Pipeline.SetDepthMode(depthMode); - bool transformEnable = GetViewportTransformEnable(state); - bool flipY = (state.Get(MethodOffset.YControl) & 1) != 0; float yFlip = flipY ? -1 : 1; @@ -349,35 +347,13 @@ namespace Ryujinx.Graphics.Gpu.Engine var transform = state.Get(MethodOffset.ViewportTransform, index); var extents = state.Get (MethodOffset.ViewportExtents, index); - RectangleF region; - - if (transformEnable) - { - float x = transform.TranslateX - MathF.Abs(transform.ScaleX); - float y = transform.TranslateY - MathF.Abs(transform.ScaleY); + float x = transform.TranslateX - MathF.Abs(transform.ScaleX); + float y = transform.TranslateY - MathF.Abs(transform.ScaleY); - float width = transform.ScaleX * 2; - float height = transform.ScaleY * 2 * yFlip; + float width = transform.ScaleX * 2; + float height = transform.ScaleY * 2 * yFlip; - region = new RectangleF(x, y, width, height); - } - else - { - // It's not possible to fully disable viewport transform, at least with the most - // common graphics APIs, but we can effectively disable it with a dummy transform. - // The transform is defined as: xw = (width / 2) * xndc + x + (width / 2) - // By setting x to -(width / 2), we effectively remove the translation. - // By setting the width to 2, we remove the scale since 2 / 2 = 1. - // Now, the only problem is the viewport clipping, that we also can't disable. - // To prevent the values from being clipped, we multiply (-1, -1, 2, 2) by - // the maximum supported viewport dimensions. - // This must be compensated on the shader, by dividing the vertex position - // by the maximum viewport dimensions. - float maxSize = _context.Capabilities.MaximumViewportDimensions; - float halfMaxSize = _context.Capabilities.MaximumViewportDimensions * 0.5f; - - region = new RectangleF(-halfMaxSize, -halfMaxSize, maxSize, maxSize * yFlip); - } + RectangleF region = new RectangleF(x, y, width, height); viewports[index] = new Viewport( region, @@ -827,19 +803,6 @@ namespace Ryujinx.Graphics.Gpu.Engine _context.Renderer.Pipeline.SetProgram(gs.HostProgram); } - /// - /// Gets viewport transform enable. - /// - /// Current GPU state - /// Viewport transform enable - public bool GetViewportTransformEnable(GpuState state) - { - // FIXME: We should read ViewportTransformEnable, but it seems that some games writes 0 there? - // return state.Get(MethodOffset.ViewportTransformEnable) != 0; - - return true; - } - /// /// Gets texture target from a sampler type. /// -- cgit v1.2.3