diff options
author | gdkchan <gab.dark.100@gmail.com> | 2022-09-19 15:35:47 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-19 15:35:47 -0300 |
commit | 0cb1e926b594432134f5d35d02da622cd3fd3458 (patch) | |
tree | 2eeb0fe1cef3305278b1b77f90378a9116d7abcb /Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs | |
parent | 6f0395538b8e8af3bba7536b44780d57e51e8697 (diff) |
Allow bindless textures with handles from unbound constant buffer (#3706)1.1.275
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs b/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs index d87721bf..cd84024b 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs @@ -806,7 +806,9 @@ namespace Ryujinx.Graphics.Gpu.Image ? _channel.BufferManager.GetComputeUniformBufferAddress(textureBufferIndex) : _channel.BufferManager.GetGraphicsUniformBufferAddress(stageIndex, textureBufferIndex); - int handle = _channel.MemoryManager.Physical.Read<int>(textureBufferAddress + (uint)textureWordOffset * 4); + int handle = textureBufferAddress != 0 + ? _channel.MemoryManager.Physical.Read<int>(textureBufferAddress + (uint)textureWordOffset * 4) + : 0; // The "wordOffset" (which is really the immediate value used on texture instructions on the shader) // is a 13-bit value. However, in order to also support separate samplers and textures (which uses @@ -824,7 +826,9 @@ namespace Ryujinx.Graphics.Gpu.Image ? _channel.BufferManager.GetComputeUniformBufferAddress(samplerBufferIndex) : _channel.BufferManager.GetGraphicsUniformBufferAddress(stageIndex, samplerBufferIndex); - samplerHandle = _channel.MemoryManager.Physical.Read<int>(samplerBufferAddress + (uint)samplerWordOffset * 4); + samplerHandle = samplerBufferAddress != 0 + ? _channel.MemoryManager.Physical.Read<int>(samplerBufferAddress + (uint)samplerWordOffset * 4) + : 0; } else { |