aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/TextureHandle.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-07-02 15:03:35 -0300
committerGitHub <noreply@github.com>2022-07-02 15:03:35 -0300
commit5afd521c5a75da956448df76e415528316ee8a8d (patch)
tree17b069087f83301289f1b0de2d7087690f39d5cd /Ryujinx.Graphics.Shader/TextureHandle.cs
parent0c66d71fe8e1f096a940571b644eca9b5896931d (diff)
Bindless elimination for constant sampler handle (#3424)1.1.161
* Bindless elimination for constant sampler handle * Shader cache version bump * Update TextureHandle.ReadPackedId for new bindless elimination
Diffstat (limited to 'Ryujinx.Graphics.Shader/TextureHandle.cs')
-rw-r--r--Ryujinx.Graphics.Shader/TextureHandle.cs17
1 files changed, 14 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Shader/TextureHandle.cs b/Ryujinx.Graphics.Shader/TextureHandle.cs
index d468188b..a2842bb8 100644
--- a/Ryujinx.Graphics.Shader/TextureHandle.cs
+++ b/Ryujinx.Graphics.Shader/TextureHandle.cs
@@ -7,7 +7,8 @@ namespace Ryujinx.Graphics.Shader
{
CombinedSampler = 0, // Must be 0.
SeparateSamplerHandle = 1,
- SeparateSamplerId = 2
+ SeparateSamplerId = 2,
+ SeparateConstantSamplerHandle = 3
}
public static class TextureHandle
@@ -97,9 +98,19 @@ namespace Ryujinx.Graphics.Shader
// turn that into a regular texture access and produce those special handles with values on the higher 16 bits.
if (handleType != TextureHandleType.CombinedSampler)
{
- int samplerHandle = cachedSamplerBuffer[samplerWordOffset];
+ int samplerHandle;
- if (handleType == TextureHandleType.SeparateSamplerId)
+ if (handleType != TextureHandleType.SeparateConstantSamplerHandle)
+ {
+ samplerHandle = cachedSamplerBuffer[samplerWordOffset];
+ }
+ else
+ {
+ samplerHandle = samplerWordOffset;
+ }
+
+ if (handleType == TextureHandleType.SeparateSamplerId ||
+ handleType == TextureHandleType.SeparateConstantSamplerHandle)
{
samplerHandle <<= 20;
}