Limit compute storage buffer size (#5028)
This commit is contained in:
parent
69a9de33d3
commit
fb27042e01
4 changed files with 40 additions and 24 deletions
|
@ -162,7 +162,19 @@ namespace Ryujinx.Graphics.Gpu.Engine.Compute
|
|||
|
||||
SbDescriptor sbDescriptor = _channel.MemoryManager.Physical.Read<SbDescriptor>(sbDescAddress);
|
||||
|
||||
_channel.BufferManager.SetComputeStorageBuffer(sb.Slot, sbDescriptor.PackAddress(), (uint)sbDescriptor.Size, sb.Flags);
|
||||
uint size;
|
||||
if (sb.SbCbSlot == Constants.DriverReservedUniformBuffer)
|
||||
{
|
||||
// Only trust the SbDescriptor size if it comes from slot 0.
|
||||
size = (uint)sbDescriptor.Size;
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Use full mapped size and somehow speed up buffer sync.
|
||||
size = (uint)_channel.MemoryManager.GetMappedSize(sbDescriptor.PackAddress(), Constants.MaxUnknownStorageSize);
|
||||
}
|
||||
|
||||
_channel.BufferManager.SetComputeStorageBuffer(sb.Slot, sbDescriptor.PackAddress(), size, sb.Flags);
|
||||
}
|
||||
|
||||
if ((_channel.BufferManager.HasUnalignedStorageBuffers) != hasUnaligned)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue