diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2020-10-20 22:56:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-20 18:56:23 -0300 |
| commit | 08332bdc041a594d389b0b732b3c4b5f8573e3fb (patch) | |
| tree | ce1e733766c5b83b1d0c96404ed5d6cd635f484c | |
| parent | 5264d55b39e15c7236d6114d74a9288fb0d62e3a (diff) | |
Ensure storage is set for Buffer Textures when binding an Image. (#1627)
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs b/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs index 87b0f444..be78c827 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs @@ -290,6 +290,14 @@ namespace Ryujinx.Graphics.Gpu.Image ITexture hostTexture = texture?.GetTargetTexture(binding.Target); + if (hostTexture != null && texture.Info.Target == Target.TextureBuffer) + { + // Ensure that the buffer texture is using the correct buffer as storage. + // Buffers are frequently re-created to accomodate larger data, so we need to re-bind + // to ensure we're not using a old buffer that was already deleted. + _context.Methods.BufferManager.SetBufferTextureStorage(hostTexture, texture.Address, texture.Size, _isCompute); + } + if (_imageState[stageIndex][index].Texture != hostTexture || _rebind) { _imageState[stageIndex][index].Texture = hostTexture; |
