mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-08 06:53:41 +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:
1 parent
af40baca4e
commit
9278af463a
1 file changed
+6
-2
@@ -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