diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Memory')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Memory/BufferManager.cs | 14 | ||||
-rw-r--r-- | Ryujinx.Graphics.Gpu/Memory/BufferTextureBinding.cs | 17 |
2 files changed, 27 insertions, 4 deletions
diff --git a/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs b/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs index 9f5f39a9..9f1f88b1 100644 --- a/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs +++ b/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs @@ -435,7 +435,7 @@ namespace Ryujinx.Graphics.Gpu.Memory } else { - _context.Renderer.Pipeline.SetTexture(binding.BindingInfo.Binding, binding.Texture); + _context.Renderer.Pipeline.SetTextureAndSampler(binding.Stage, binding.BindingInfo.Binding, binding.Texture, null); } } @@ -719,17 +719,25 @@ namespace Ryujinx.Graphics.Gpu.Memory /// <summary> /// Sets the buffer storage of a buffer texture. This will be bound when the buffer manager commits bindings. /// </summary> + /// <param name="stage">Shader stage accessing the texture</param> /// <param name="texture">Buffer texture</param> /// <param name="address">Address of the buffer in memory</param> /// <param name="size">Size of the buffer in bytes</param> /// <param name="bindingInfo">Binding info for the buffer texture</param> /// <param name="format">Format of the buffer texture</param> /// <param name="isImage">Whether the binding is for an image or a sampler</param> - public void SetBufferTextureStorage(ITexture texture, ulong address, ulong size, TextureBindingInfo bindingInfo, Format format, bool isImage) + public void SetBufferTextureStorage( + ShaderStage stage, + ITexture texture, + ulong address, + ulong size, + TextureBindingInfo bindingInfo, + Format format, + bool isImage) { _channel.MemoryManager.Physical.BufferCache.CreateBuffer(address, size); - _bufferTextures.Add(new BufferTextureBinding(texture, address, size, bindingInfo, format, isImage)); + _bufferTextures.Add(new BufferTextureBinding(stage, texture, address, size, bindingInfo, format, isImage)); } /// <summary> diff --git a/Ryujinx.Graphics.Gpu/Memory/BufferTextureBinding.cs b/Ryujinx.Graphics.Gpu/Memory/BufferTextureBinding.cs index cf0d225e..2a140870 100644 --- a/Ryujinx.Graphics.Gpu/Memory/BufferTextureBinding.cs +++ b/Ryujinx.Graphics.Gpu/Memory/BufferTextureBinding.cs @@ -1,5 +1,6 @@ using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.Gpu.Image; +using Ryujinx.Graphics.Shader; namespace Ryujinx.Graphics.Gpu.Memory { @@ -9,6 +10,11 @@ namespace Ryujinx.Graphics.Gpu.Memory struct BufferTextureBinding { /// <summary> + /// Shader stage accessing the texture. + /// </summary> + public ShaderStage Stage { get; } + + /// <summary> /// The buffer texture. /// </summary> public ITexture Texture { get; } @@ -41,14 +47,23 @@ namespace Ryujinx.Graphics.Gpu.Memory /// <summary> /// Create a new buffer texture binding. /// </summary> + /// <param name="stage">Shader stage accessing the texture</param> /// <param name="texture">Buffer texture</param> /// <param name="address">Base address</param> /// <param name="size">Size in bytes</param> /// <param name="bindingInfo">Binding info</param> /// <param name="format">Binding format</param> /// <param name="isImage">Whether the binding is for an image or a sampler</param> - public BufferTextureBinding(ITexture texture, ulong address, ulong size, TextureBindingInfo bindingInfo, Format format, bool isImage) + public BufferTextureBinding( + ShaderStage stage, + ITexture texture, + ulong address, + ulong size, + TextureBindingInfo bindingInfo, + Format format, + bool isImage) { + Stage = stage; Texture = texture; Address = address; Size = size; |