aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/CodeGen
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-08-20 16:20:27 -0300
committerGitHub <noreply@github.com>2022-08-20 16:20:27 -0300
commit88a0e720cbe567aff67b6124aa9e6cfc17599739 (patch)
tree8ba359b84ae70da47eb17792369760f8f0db94de /Ryujinx.Graphics.Shader/CodeGen
parent53cc9e0561bcbe7779b12c9e03d93078da2bb2c7 (diff)
Use RGBA16 vertex format if RGB16 is not supported on Vulkan (#3552)
* Use RGBA16 vertex format if RGB16 is not supported on Vulkan * Catch all shader compilation exceptions
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen')
-rw-r--r--Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs4
-rw-r--r--Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs7
2 files changed, 3 insertions, 8 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs
index f9dfb839..65e78121 100644
--- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs
+++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs
@@ -553,11 +553,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
if (context.Config.Stage == ShaderStage.Vertex)
{
- type = context.Config.GpuAccessor.QueryAttributeType(attr).GetVec4Type();
+ type = context.Config.GpuAccessor.QueryAttributeType(attr).ToVec4Type();
}
else
{
- type = AttributeType.Float.GetVec4Type();
+ type = AttributeType.Float.ToVec4Type();
}
context.AppendLine($"layout ({pass}location = {attr}) {iq}in {type} {name}{suffix};");
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
index da720f4d..1ab91f77 100644
--- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
+++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
@@ -454,12 +454,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
AttributeType type = context.Config.GpuAccessor.QueryAttributeType(location);
- return type switch
- {
- AttributeType.Sint => VariableType.S32,
- AttributeType.Uint => VariableType.U32,
- _ => VariableType.F32
- };
+ return type.ToVariableType();
}
}