diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2020-07-03 20:48:44 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-04 01:48:44 +0200 |
| commit | e13154c83d52d9e1c26c55bc5655a5df641e26a9 (patch) | |
| tree | 302fcc3171027124bec9cc154ef482fd491cf7e9 /Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs | |
| parent | 76e5af967a39879187214f0973d226eba126e93f (diff) | |
Implement shader LEA instruction and improve bindless image load/store (#1355)
Diffstat (limited to 'Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs')
| -rw-r--r-- | Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs b/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs index 9e8329de..8b38afb9 100644 --- a/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs +++ b/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs @@ -68,5 +68,26 @@ namespace Ryujinx.Graphics.Shader.Translation // The depth register is always two registers after the last color output. return count + 1; } + + public TextureFormat GetTextureFormat(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 (GpuAccessor.QuerySupportsImageLoadFormatted()) + { + return TextureFormat.Unknown; + } + + var format = GpuAccessor.QueryTextureFormat(handle); + + if (format == TextureFormat.Unknown) + { + GpuAccessor.Log($"Unknown format for texture {handle}."); + + format = TextureFormat.R8G8B8A8Unorm; + } + + return format; + } } }
\ No newline at end of file |
