aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-07-03 20:48:44 -0300
committerGitHub <noreply@github.com>2020-07-04 01:48:44 +0200
commite13154c83d52d9e1c26c55bc5655a5df641e26a9 (patch)
tree302fcc3171027124bec9cc154ef482fd491cf7e9 /Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs
parent76e5af967a39879187214f0973d226eba126e93f (diff)
Implement shader LEA instruction and improve bindless image load/store (#1355)
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs')
-rw-r--r--Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs25
1 files changed, 2 insertions, 23 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs
index 43e5822e..304906d0 100644
--- a/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs
+++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs
@@ -99,7 +99,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
if (!op.IsBindless)
{
- operation.Format = GetTextureFormat(context, handle);
+ operation.Format = context.Config.GetTextureFormat(handle);
}
context.Add(operation);
@@ -228,7 +228,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
if (!op.IsBindless)
{
- format = GetTextureFormat(context, op.Immediate);
+ format = context.Config.GetTextureFormat(op.Immediate);
}
}
else
@@ -1223,27 +1223,6 @@ namespace Ryujinx.Graphics.Shader.Instructions
};
}
- private static TextureFormat GetTextureFormat(EmitterContext context, int handle)
- {
- // When the formatted load extension is supported, we don't need to
- // specify a format, we can just declare it without a format and the GPU will handle it.
- if (context.Config.GpuAccessor.QuerySupportsImageLoadFormatted())
- {
- return TextureFormat.Unknown;
- }
-
- var format = context.Config.GpuAccessor.QueryTextureFormat(handle);
-
- if (format == TextureFormat.Unknown)
- {
- context.Config.GpuAccessor.Log($"Unknown format for texture {handle}.");
-
- format = TextureFormat.R8G8B8A8Unorm;
- }
-
- return format;
- }
-
private static TextureFormat GetTextureFormat(IntegerSize size)
{
return size switch