aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-01-20 08:37:21 -0300
committerGitHub <noreply@github.com>2022-01-20 08:37:21 -0300
commit0e59573f2b55420c2c3fcfc3aaad56dba70e1492 (patch)
tree4364a01b9cb9d0b4e417a4a631d4ea36862a4e49 /Ryujinx.Graphics.Shader
parent60f7cba30abb69e9c197f1def10c102f0c19758b (diff)
Add capability for BGRA formats (#3011)
Diffstat (limited to 'Ryujinx.Graphics.Shader')
-rw-r--r--Ryujinx.Graphics.Shader/IGpuAccessor.cs5
-rw-r--r--Ryujinx.Graphics.Shader/Translation/EmitterContext.cs3
2 files changed, 7 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Shader/IGpuAccessor.cs b/Ryujinx.Graphics.Shader/IGpuAccessor.cs
index a6ccdedd..27f6f53b 100644
--- a/Ryujinx.Graphics.Shader/IGpuAccessor.cs
+++ b/Ryujinx.Graphics.Shader/IGpuAccessor.cs
@@ -61,6 +61,11 @@ namespace Ryujinx.Graphics.Shader
return 16;
}
+ bool QueryHostSupportsBgraFormat()
+ {
+ return true;
+ }
+
bool QueryHostSupportsFragmentShaderInterlock()
{
return true;
diff --git a/Ryujinx.Graphics.Shader/Translation/EmitterContext.cs b/Ryujinx.Graphics.Shader/Translation/EmitterContext.cs
index 2f839b7a..3dcb04ad 100644
--- a/Ryujinx.Graphics.Shader/Translation/EmitterContext.cs
+++ b/Ryujinx.Graphics.Shader/Translation/EmitterContext.cs
@@ -167,6 +167,7 @@ namespace Ryujinx.Graphics.Shader.Translation
this.Copy(dest, src);
}
+ bool supportsBgra = Config.GpuAccessor.QueryHostSupportsBgraFormat();
int regIndexBase = 0;
for (int rtIndex = 0; rtIndex < 8; rtIndex++)
@@ -185,7 +186,7 @@ namespace Ryujinx.Graphics.Shader.Translation
Operand src = Register(regIndexBase + component, RegisterType.Gpr);
// Perform B <-> R swap if needed, for BGRA formats (not supported on OpenGL).
- if (component == 0 || component == 2)
+ if (!supportsBgra && (component == 0 || component == 2))
{
Operand isBgra = Attribute(AttributeConsts.FragmentOutputIsBgraBase + rtIndex * 4);