aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader
diff options
context:
space:
mode:
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);