diff options
Diffstat (limited to 'Ryujinx.Graphics.Shader')
| -rw-r--r-- | Ryujinx.Graphics.Shader/IGpuAccessor.cs | 9 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Shader/Translation/Rewriter.cs | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Shader/IGpuAccessor.cs b/Ryujinx.Graphics.Shader/IGpuAccessor.cs index cc690eed..337bd314 100644 --- a/Ryujinx.Graphics.Shader/IGpuAccessor.cs +++ b/Ryujinx.Graphics.Shader/IGpuAccessor.cs @@ -286,6 +286,15 @@ namespace Ryujinx.Graphics.Shader } /// <summary> + /// Queries host GPU support for signed normalized buffer texture formats. + /// </summary> + /// <returns>True if the GPU and driver supports the formats, false otherwise</returns> + bool QueryHostSupportsSnormBufferTextureFormat() + { + return true; + } + + /// <summary> /// Queries host GPU texture shadow LOD support. /// </summary> /// <returns>True if the GPU and driver supports texture shadow LOD, false otherwise</returns> diff --git a/Ryujinx.Graphics.Shader/Translation/Rewriter.cs b/Ryujinx.Graphics.Shader/Translation/Rewriter.cs index 640717f9..bdd9b791 100644 --- a/Ryujinx.Graphics.Shader/Translation/Rewriter.cs +++ b/Ryujinx.Graphics.Shader/Translation/Rewriter.cs @@ -14,6 +14,7 @@ namespace Ryujinx.Graphics.Shader.Translation { bool isVertexShader = config.Stage == ShaderStage.Vertex; bool hasConstantBufferDrawParameters = config.GpuAccessor.QueryHasConstantBufferDrawParameters(); + bool supportsSnormBufferTextureFormat = config.GpuAccessor.QueryHostSupportsSnormBufferTextureFormat(); for (int blkIndex = 0; blkIndex < blocks.Length; blkIndex++) { @@ -52,7 +53,7 @@ namespace Ryujinx.Graphics.Shader.Translation { node = RewriteTextureSample(node, config); - if (texOp.Type == SamplerType.TextureBuffer) + if (texOp.Type == SamplerType.TextureBuffer && !supportsSnormBufferTextureFormat) { node = InsertSnormNormalization(node, config); } |
