mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 09:30:44 +00:00
Add a safety barrier between buffer fills and copies
* It's unclear if this should be required as the fills and copies don't overlap, but this is not so perf sensitive that a barrier can't be added for safety.
This commit is contained in:
@@ -2137,8 +2137,25 @@ void WrappedVulkan::Apply_InitialState(WrappedVkRes *live, const VkInitialConten
|
||||
RDCDEBUG("Apply_InitialState (Mem %s): %d fills, %d copies", ToStr(orig).c_str(), fillCount,
|
||||
regions.size());
|
||||
if(regions.size() > 0)
|
||||
{
|
||||
VkBufferMemoryBarrier bufBarrier = {
|
||||
VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
|
||||
NULL,
|
||||
VK_ACCESS_TRANSFER_WRITE_BIT,
|
||||
VK_ACCESS_TRANSFER_WRITE_BIT,
|
||||
VK_QUEUE_FAMILY_IGNORED,
|
||||
VK_QUEUE_FAMILY_IGNORED,
|
||||
Unwrap(dstBuf),
|
||||
0,
|
||||
VK_WHOLE_SIZE,
|
||||
};
|
||||
|
||||
// be conservative about whether or not the above fills overlap with the below copies
|
||||
DoPipelineBarrier(cmd, 1, &bufBarrier);
|
||||
|
||||
ObjDisp(cmd)->CmdCopyBuffer(Unwrap(cmd), Unwrap(srcBuf), Unwrap(dstBuf),
|
||||
(uint32_t)regions.size(), regions.data());
|
||||
}
|
||||
|
||||
VkMarkerRegion::End(cmd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user