vk: DOuble general-purpose heap allocation to 128M and add a better diagnostic message for OOM

This commit is contained in:
kd-11 2019-05-18 10:23:28 +03:00 committed by kd-11
parent 0ef7b2aaff
commit a245d9fb24
2 changed files with 2 additions and 2 deletions

View File

@ -208,7 +208,7 @@ namespace vk
if (!g_scratch_buffer)
{
// 32M disposable scratch memory
g_scratch_buffer = std::make_unique<vk::buffer>(*g_current_renderer, 64 * 0x100000,
g_scratch_buffer = std::make_unique<vk::buffer>(*g_current_renderer, 128 * 0x100000,
g_current_renderer->get_memory_mapping().device_local, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, 0);
}

View File

@ -143,7 +143,7 @@ namespace vk
const u32 in_stencil_size = out_w * out_h;
const auto allocation_end = region.bufferOffset + packed_length + in_depth_size + in_stencil_size;
verify(HERE), src->size() >= allocation_end;
verify("Out of memory (compute heap). Lower your resolution scale setting." HERE), src->size() >= allocation_end;
const VkDeviceSize z_offset = align<VkDeviceSize>(region.bufferOffset + packed_length, 256);
const VkDeviceSize s_offset = align<VkDeviceSize>(z_offset + in_depth_size, 256);