1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-10 21:06:39 +00:00

Ensure storage is set for Buffer Textures when binding an Image. (#1627)

This commit is contained in:
riperiperi 2020-10-20 22:56:23 +01:00 committed by GitHub
parent 5264d55b39
commit 08332bdc04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -290,6 +290,14 @@ namespace Ryujinx.Graphics.Gpu.Image
ITexture hostTexture = texture?.GetTargetTexture(binding.Target); 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) if (_imageState[stageIndex][index].Texture != hostTexture || _rebind)
{ {
_imageState[stageIndex][index].Texture = hostTexture; _imageState[stageIndex][index].Texture = hostTexture;