diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2022-12-04 15:36:03 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-04 15:36:03 -0300 |
| commit | 17a1cab5d29787f3b41f40a69b530dae4e3cb25f (patch) | |
| tree | 25f72e40e08c851b80dea2ee2e184ddb3ba1d479 /Ryujinx.Graphics.Shader | |
| parent | 73aed239c356c4c573819eb6ee1e2d414d2d5579 (diff) | |
Allow SNorm buffer texture formats on Vulkan (#3957)
* Allow SNorm buffer texture formats on Vulkan
* Shader cache version bump
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); } |
