Rendertarget attachments, texture and image changes (#358)

* Add multiple color outputs for fragment shaders

* Add registers and gal enums

* Use textures for framebuffers and split color and zeta framebuffers

* Abstract texture and framebuffer targets as an image

* Share images between framebuffers and textures

* Unstub formats

* Add some formats

* Disable multiple attachments

* Cache framebuffer attachments

* Handle format types

* Add some rendertarget formats

* Code cleanup

* Fixup half float types

* Address feedback

* Disable multiple attachments in shaders

* Add A4B4G4R4 image format

* Add reversed section for image enums
This commit is contained in:
ReinUsesLisp 2018-08-19 22:25:26 -03:00 committed by gdkchan
parent 056c2840b1
commit 726de8c46a
25 changed files with 1360 additions and 441 deletions

View file

@ -352,9 +352,9 @@ namespace Ryujinx.Graphics.Gal.Shader
{
Name = CustomType + " " + DeclInfo.Name + Suffix + ";";
}
else if (DeclInfo.Name == GlslDecl.FragmentOutputName)
else if (DeclInfo.Name.Contains(GlslDecl.FragmentOutputName))
{
Name = "layout (location = 0) out vec4 " + DeclInfo.Name + Suffix + ";" + Environment.NewLine;
Name = "layout (location = " + DeclInfo.Index / 4 + ") out vec4 " + DeclInfo.Name + Suffix + ";";
}
else
{
@ -829,8 +829,11 @@ namespace Ryujinx.Graphics.Gal.Shader
{
return "gl_PointSize";
}
}
throw new InvalidOperationException();
if (DeclInfo.Index >= 16)
{
throw new InvalidOperationException($"Shader attribute offset {Abuf.Offs} is invalid.");
}
if (Decl.ShaderType == GalShaderType.Geometry)
@ -876,7 +879,7 @@ namespace Ryujinx.Graphics.Gal.Shader
private string GetNameWithSwizzle(IReadOnlyDictionary<int, ShaderDeclInfo> Dict, int Index)
{
int VecIndex = Index >> 2;
int VecIndex = Index & ~3;
if (Dict.TryGetValue(VecIndex, out ShaderDeclInfo DeclInfo))
{