aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.GAL
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-05-27 20:03:07 -0300
committerGitHub <noreply@github.com>2020-05-28 09:03:07 +1000
commita15b951721d7c52c30a8e8864e91353ec6fc65f4 (patch)
treedaba23b1f6a22f4c72faa5268a73029e9fc665f7 /Ryujinx.Graphics.GAL
parent83d94b21d077e2d31faee74711ff38e0c0499afa (diff)
Fix wrong face culling once and for all (#1277)
* Viewport swizzle support on NV and clip origin * Initialize default viewport swizzle state, emulate viewport swizzle on shaders when not supported * Address PR feedback
Diffstat (limited to 'Ryujinx.Graphics.GAL')
-rw-r--r--Ryujinx.Graphics.GAL/Capabilities.cs16
-rw-r--r--Ryujinx.Graphics.GAL/IPipeline.cs2
-rw-r--r--Ryujinx.Graphics.GAL/Origin.cs8
-rw-r--r--Ryujinx.Graphics.GAL/ViewportSwizzle.cs18
4 files changed, 29 insertions, 15 deletions
diff --git a/Ryujinx.Graphics.GAL/Capabilities.cs b/Ryujinx.Graphics.GAL/Capabilities.cs
index a42cbb07..d496de67 100644
--- a/Ryujinx.Graphics.GAL/Capabilities.cs
+++ b/Ryujinx.Graphics.GAL/Capabilities.cs
@@ -5,26 +5,28 @@ namespace Ryujinx.Graphics.GAL
public bool SupportsAstcCompression { get; }
public bool SupportsImageLoadFormatted { get; }
public bool SupportsNonConstantTextureOffset { get; }
+ public bool SupportsViewportSwizzle { get; }
- public int MaximumComputeSharedMemorySize { get; }
- public int StorageBufferOffsetAlignment { get; }
-
- public float MaxSupportedAnisotropy { get; }
+ public int MaximumComputeSharedMemorySize { get; }
+ public float MaximumSupportedAnisotropy { get; }
+ public int StorageBufferOffsetAlignment { get; }
public Capabilities(
bool supportsAstcCompression,
bool supportsImageLoadFormatted,
bool supportsNonConstantTextureOffset,
+ bool supportsViewportSwizzle,
int maximumComputeSharedMemorySize,
- int storageBufferOffsetAlignment,
- float maxSupportedAnisotropy)
+ float maximumSupportedAnisotropy,
+ int storageBufferOffsetAlignment)
{
SupportsAstcCompression = supportsAstcCompression;
SupportsImageLoadFormatted = supportsImageLoadFormatted;
SupportsNonConstantTextureOffset = supportsNonConstantTextureOffset;
+ SupportsViewportSwizzle = supportsViewportSwizzle;
MaximumComputeSharedMemorySize = maximumComputeSharedMemorySize;
+ MaximumSupportedAnisotropy = maximumSupportedAnisotropy;
StorageBufferOffsetAlignment = storageBufferOffsetAlignment;
- MaxSupportedAnisotropy = maxSupportedAnisotropy;
}
}
} \ No newline at end of file
diff --git a/Ryujinx.Graphics.GAL/IPipeline.cs b/Ryujinx.Graphics.GAL/IPipeline.cs
index 22e4e9e2..aa59713d 100644
--- a/Ryujinx.Graphics.GAL/IPipeline.cs
+++ b/Ryujinx.Graphics.GAL/IPipeline.cs
@@ -42,6 +42,8 @@ namespace Ryujinx.Graphics.GAL
void SetImage(int index, ShaderStage stage, ITexture texture);
+ void SetOrigin(Origin origin);
+
void SetPointSize(float size);
void SetPrimitiveRestart(bool enable, int index);
diff --git a/Ryujinx.Graphics.GAL/Origin.cs b/Ryujinx.Graphics.GAL/Origin.cs
new file mode 100644
index 00000000..d1b69cfd
--- /dev/null
+++ b/Ryujinx.Graphics.GAL/Origin.cs
@@ -0,0 +1,8 @@
+namespace Ryujinx.Graphics.GAL
+{
+ public enum Origin
+ {
+ UpperLeft,
+ LowerLeft
+ }
+}
diff --git a/Ryujinx.Graphics.GAL/ViewportSwizzle.cs b/Ryujinx.Graphics.GAL/ViewportSwizzle.cs
index 5f04bf87..c24a2246 100644
--- a/Ryujinx.Graphics.GAL/ViewportSwizzle.cs
+++ b/Ryujinx.Graphics.GAL/ViewportSwizzle.cs
@@ -2,13 +2,15 @@ namespace Ryujinx.Graphics.GAL
{
public enum ViewportSwizzle
{
- PositiveX,
- NegativeX,
- PositiveY,
- NegativeY,
- PositiveZ,
- NegativeZ,
- PositiveW,
- NegativeW
+ PositiveX = 0,
+ NegativeX = 1,
+ PositiveY = 2,
+ NegativeY = 3,
+ PositiveZ = 4,
+ NegativeZ = 5,
+ PositiveW = 6,
+ NegativeW = 7,
+
+ NegativeFlag = 1
}
}