diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2023-05-20 13:15:07 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-20 16:15:07 +0000 |
| commit | fb27042e01b0fa110184673d436ec96ec8cf20c7 (patch) | |
| tree | 7b36f237e5b022b41a48e352074e9cdc6651e785 /src/Ryujinx.Graphics.Vulkan/BufferManager.cs | |
| parent | 69a9de33d37de03693a4a4f6f51aead63b0c6334 (diff) | |
Limit compute storage buffer size (#5028)
Diffstat (limited to 'src/Ryujinx.Graphics.Vulkan/BufferManager.cs')
| -rw-r--r-- | src/Ryujinx.Graphics.Vulkan/BufferManager.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/BufferManager.cs b/src/Ryujinx.Graphics.Vulkan/BufferManager.cs index 27678ed5..e046bf89 100644 --- a/src/Ryujinx.Graphics.Vulkan/BufferManager.cs +++ b/src/Ryujinx.Graphics.Vulkan/BufferManager.cs @@ -1,4 +1,5 @@ -using Ryujinx.Graphics.GAL; +using Ryujinx.Common.Logging; +using Ryujinx.Graphics.GAL; using Silk.NET.Vulkan; using System; using System.Runtime.CompilerServices; @@ -95,16 +96,27 @@ namespace Ryujinx.Graphics.Vulkan return Unsafe.As<ulong, BufferHandle>(ref handle64); } - public BufferHandle CreateWithHandle(VulkanRenderer gd, int size, BufferAllocationType baseType = BufferAllocationType.HostMapped, BufferHandle storageHint = default) + public BufferHandle CreateWithHandle( + VulkanRenderer gd, + int size, + BufferAllocationType baseType = BufferAllocationType.HostMapped, + BufferHandle storageHint = default) { return CreateWithHandle(gd, size, out _, baseType, storageHint); } - public BufferHandle CreateWithHandle(VulkanRenderer gd, int size, out BufferHolder holder, BufferAllocationType baseType = BufferAllocationType.HostMapped, BufferHandle storageHint = default) + public BufferHandle CreateWithHandle( + VulkanRenderer gd, + int size, + out BufferHolder holder, + BufferAllocationType baseType = BufferAllocationType.HostMapped, + BufferHandle storageHint = default) { holder = Create(gd, size, baseType: baseType, storageHint: storageHint); if (holder == null) { + Logger.Error?.Print(LogClass.Gpu, $"Failed to create buffer with size 0x{size:X} and type \"{baseType}\"."); + return BufferHandle.Null; } |
