Redoing changes

This commit is contained in:
Darabat 2018-08-06 19:42:34 -03:00 committed by GitHub
parent 9ffbcc4b8c
commit 32abd7cf97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,8 +23,6 @@ namespace Ryujinx.Graphics.Gal.Shader
private const int MaxVertexInput = 3;
private static string[] ElemTypes = new string[] { "float", "vec2", "vec3", "vec4" };
private GlslDecl Decl;
private ShaderHeader Header, HeaderB;
@ -297,7 +295,7 @@ namespace Ryujinx.Graphics.Gal.Shader
{
if (DeclInfo.Index >= 0)
{
SB.AppendLine("layout (location = " + DeclInfo.Index + ") " + InOut + " " + GetDecl(DeclInfo) + ";");
SB.AppendLine("layout (location = " + DeclInfo.Index + ") " + InOut + " vec4 " + DeclInfo.Name + ";");
Count++;
}
@ -331,7 +329,7 @@ namespace Ryujinx.Graphics.Gal.Shader
}
else if (DeclInfo.Name == GlslDecl.FragmentOutputName)
{
Name = "layout (location = 0) out " + GetDecl(DeclInfo) + Suffix + ";" + Environment.NewLine;
Name = "layout (location = 0) out " + "vec4 " + DeclInfo.Name + Suffix + ";" + Environment.NewLine;
}
else
{
@ -354,7 +352,14 @@ namespace Ryujinx.Graphics.Gal.Shader
private string GetDecl(ShaderDeclInfo DeclInfo)
{
return ElemTypes[DeclInfo.Size - 1] + " " + DeclInfo.Name;
if (DeclInfo.Size == 4)
{
return "vec4 " + DeclInfo.Name;
}
else
{
return "float " + DeclInfo.Name;
}
}
private void PrintMain()
@ -370,8 +375,6 @@ namespace Ryujinx.Graphics.Gal.Shader
ShaderDeclInfo DeclInfo = KV.Value;
string Swizzle = ".xyzw".Substring(0, DeclInfo.Size + 1);
if (Decl.ShaderType == GalShaderType.Geometry)
{
for (int Vertex = 0; Vertex < MaxVertexInput; Vertex++)