aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.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.Gpu/Image/TextureBindingsManager.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.Gpu/Image/TextureBindingsManager.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs20
1 files changed, 15 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs b/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs
index 18f5a74a..fcd23441 100644
--- a/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs
@@ -792,13 +792,23 @@ namespace Ryujinx.Graphics.Gpu.Image
// turn that into a regular texture access and produce those special handles with values on the higher 16 bits.
if (handleType != TextureHandleType.CombinedSampler)
{
- ulong samplerBufferAddress = _isCompute
- ? _channel.BufferManager.GetComputeUniformBufferAddress(samplerBufferIndex)
- : _channel.BufferManager.GetGraphicsUniformBufferAddress(stageIndex, samplerBufferIndex);
+ int samplerHandle;
- int samplerHandle = _channel.MemoryManager.Physical.Read<int>(samplerBufferAddress + (uint)samplerWordOffset * 4);
+ if (handleType != TextureHandleType.SeparateConstantSamplerHandle)
+ {
+ ulong samplerBufferAddress = _isCompute
+ ? _channel.BufferManager.GetComputeUniformBufferAddress(samplerBufferIndex)
+ : _channel.BufferManager.GetGraphicsUniformBufferAddress(stageIndex, samplerBufferIndex);
+
+ samplerHandle = _channel.MemoryManager.Physical.Read<int>(samplerBufferAddress + (uint)samplerWordOffset * 4);
+ }
+ else
+ {
+ samplerHandle = samplerWordOffset;
+ }
- if (handleType == TextureHandleType.SeparateSamplerId)
+ if (handleType == TextureHandleType.SeparateSamplerId ||
+ handleType == TextureHandleType.SeparateConstantSamplerHandle)
{
samplerHandle <<= 20;
}