From 1eea35554c7505dbf521cf9f3cfeeaa0fc7e916f Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sat, 19 Sep 2020 19:46:49 -0300 Subject: Better viewport flipping and depth mode detection method (#1556) * Use a better viewport flipping approach * New approach to detect depth mode * nit: Sort method on the OpenGL backend * Adjust spacing on comment * Unswap near and far parameters based on ScaleZ --- Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Shader') diff --git a/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs b/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs index 03d8d196..fd0a6b0d 100644 --- a/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs +++ b/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs @@ -188,12 +188,6 @@ namespace Ryujinx.Graphics.Gpu.Shader /// True if the GPU and driver supports non-constant texture offsets, false otherwise public bool QuerySupportsNonConstantTextureOffset() => _context.Capabilities.SupportsNonConstantTextureOffset; - /// - /// Queries host GPU viewport swizzle support. - /// - /// True if the GPU and driver supports viewport swizzle, false otherwise - public bool QuerySupportsViewportSwizzle() => _context.Capabilities.SupportsViewportSwizzle; - /// /// Queries texture format information, for shaders using image load or store. /// @@ -257,24 +251,6 @@ namespace Ryujinx.Graphics.Gpu.Shader }; } - public int QueryViewportSwizzle(int component) - { - YControl yControl = _state.Get(MethodOffset.YControl); - - bool flipY = yControl.HasFlag(YControl.NegateY) ^ !yControl.HasFlag(YControl.TriangleRastFlip); - - ViewportTransform transform = _state.Get(MethodOffset.ViewportTransform, 0); - - return component switch - { - 0 => (int)(transform.UnpackSwizzleX() ^ (transform.ScaleX < 0 ? ViewportSwizzle.NegativeFlag : 0)), - 1 => (int)(transform.UnpackSwizzleY() ^ (transform.ScaleY < 0 ? ViewportSwizzle.NegativeFlag : 0) ^ (flipY ? ViewportSwizzle.NegativeFlag : 0)), - 2 => (int)(transform.UnpackSwizzleZ() ^ (transform.ScaleZ < 0 ? ViewportSwizzle.NegativeFlag : 0)), - 3 => (int)transform.UnpackSwizzleW(), - _ => throw new ArgumentOutOfRangeException(nameof(component)) - }; - } - /// /// Gets the texture descriptor for a given texture on the pool. /// -- cgit v1.2.3