mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-22 13:45:55 +00:00
Check for sparse buffer memory requirements when unbinding. Refs #580
* If a buffer is small, its memory requirements might be aligned up to a larger value for sparse binding.
This commit is contained in:
@@ -740,10 +740,14 @@ bool WrappedVulkan::Apply_SparseInitialState(WrappedVkBuffer *buf,
|
||||
|
||||
// unbind the entire buffer so that any new areas that are bound are unbound again
|
||||
|
||||
VkSparseMemoryBind unbind = {0, m_CreationInfo.m_Buffer[buf->id].size, VK_NULL_HANDLE, 0, 0};
|
||||
|
||||
VkQueue q = GetQ();
|
||||
|
||||
VkMemoryRequirements mrq = {};
|
||||
ObjDisp(q)->GetBufferMemoryRequirements(Unwrap(GetDev()), buf->real.As<VkBuffer>(), &mrq);
|
||||
|
||||
VkSparseMemoryBind unbind = {0, RDCMAX(mrq.size, m_CreationInfo.m_Buffer[buf->id].size),
|
||||
VK_NULL_HANDLE, 0, 0};
|
||||
|
||||
VkSparseBufferMemoryBindInfo bufBind = {buf->real.As<VkBuffer>(), 1, &unbind};
|
||||
|
||||
// this semaphore separates the unbind and bind, as there isn't an ordering guarantee
|
||||
|
||||
Reference in New Issue
Block a user