Allow SNorm buffer texture formats on Vulkan (#3957)
* Allow SNorm buffer texture formats on Vulkan * Shader cache version bump
This commit is contained in:
parent
73aed239c3
commit
17a1cab5d2
8 changed files with 21 additions and 5 deletions
|
@ -285,6 +285,15 @@ namespace Ryujinx.Graphics.Shader
|
|||
return true;
|
||||
}
|
||||
|
||||
/// <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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue