diff --git a/runtime/RHI/RHI_Implementation.h b/runtime/RHI/RHI_Implementation.h index 2cf69d5a8..27894fbf9 100644 --- a/runtime/RHI/RHI_Implementation.h +++ b/runtime/RHI/RHI_Implementation.h @@ -382,7 +382,7 @@ static const char* vkresult_to_string(const VkResult result) { \ Log::SetLogToFile(true); \ SP_LOG_ERROR("%s", vkresult_to_string(vk_result)); \ - SP_ASSERT(false); \ + SP_ASSERT(false && "Vulkan call failed"); \ } #endif diff --git a/runtime/RHI/RHI_SyncPrimitive.h b/runtime/RHI/RHI_SyncPrimitive.h index 4189d72e9..fe775c1c0 100644 --- a/runtime/RHI/RHI_SyncPrimitive.h +++ b/runtime/RHI/RHI_SyncPrimitive.h @@ -42,7 +42,7 @@ namespace Spartan ~RHI_SyncPrimitive(); // sync - void Wait(const uint64_t value = 0, const uint64_t timeout_nanoseconds = 1000000000 /* 1 second */); + void Wait(const uint64_t value = 0, const uint64_t timeout_nanoseconds = 5000000000 /* 5 seconds */); void Signal(const uint64_t value); // value diff --git a/runtime/RHI/Vulkan/Vulkan_CommandList.cpp b/runtime/RHI/Vulkan/Vulkan_CommandList.cpp index b6f3e8eb3..da6bd59c1 100644 --- a/runtime/RHI/Vulkan/Vulkan_CommandList.cpp +++ b/runtime/RHI/Vulkan/Vulkan_CommandList.cpp @@ -1593,13 +1593,14 @@ namespace Spartan memset(buffer->GetMappedData(), 0, buffer->GetObjectSize()); } - // deduce if the update can be done via vkCmdUpdateBuffer and synchronized with a barrier - bool vkCmdUpdateBuffer_compliant = true; - vkCmdUpdateBuffer_compliant &= (offset % 4 == 0); // offset must be a multiple of 4 - vkCmdUpdateBuffer_compliant &= (size % 4 == 0); // size must be a multiple of 4 - vkCmdUpdateBuffer_compliant &= (size <= 65536); // size must not exceed 65536 bytes - - if (vkCmdUpdateBuffer_compliant) + // check for vkCmdUpdateBuffer compliance to deduce if this is a small and synchronized update + // non-compliant updates are done via a memcpy, and they are there for the big bindless arrays + bool synchronized_update = true; + synchronized_update &= (offset % 4 == 0); // offset must be a multiple of 4 + synchronized_update &= (size % 4 == 0); // size must be a multiple of 4 + synchronized_update &= (size <= 65536); // size must not exceed 65536 bytes + + if (synchronized_update) { RenderPassEnd(); @@ -1651,9 +1652,8 @@ namespace Spartan vkCmdPipelineBarrier2(static_cast(m_rhi_resource), &dependency_info); Profiler::m_rhi_pipeline_barriers++; } - else + else // big bindless arrays (update rarely and don't require synchronization) { - // big bindless arrays will fall into this category, it's okay if they are done asynchronously like that void* mapped_data = static_cast(buffer->GetMappedData()) + offset; memcpy(mapped_data, data, size); }