Disable resource record chunk locking for command buffers

* The API user is supposed to lock this for us, so don't waste time locking
  ourselves.
This commit is contained in:
baldurk committed 2020-08-26 19:27:42 +01:00
1 parent 1b844d1498
commit 51b228b042
3 files changed
+7

No files matched your search

+1
View File
@@ -327,6 +327,7 @@ struct ResourceRecord
m_ChunkLock = new Threading::CriticalSection();
}
void DisableChunkLocking() { SAFE_DELETE(m_ChunkLock); }
~ResourceRecord() { SAFE_DELETE(m_ChunkLock); }
void AddParent(ResourceRecord *r)
{
@@ -404,6 +404,8 @@ HRESULT WrappedID3D12GraphicsCommandList::Reset(ID3D12CommandAllocator *pAllocat
{
bool firstTime = false;
m_ListRecord->DisableChunkLocking();
// reset for new recording
m_ListRecord->DeleteChunks();
m_ListRecord->ContainsExecuteIndirect = false;
@@ -422,6 +424,7 @@ HRESULT WrappedID3D12GraphicsCommandList::Reset(ID3D12CommandAllocator *pAllocat
m_ListRecord->bakedCommands =
GetResourceManager()->AddResourceRecord(ResourceIDGen::GetNewUniqueID());
m_ListRecord->bakedCommands->DisableChunkLocking();
m_ListRecord->bakedCommands->type = Resource_GraphicsCommandList;
m_ListRecord->bakedCommands->InternalResource = true;
m_ListRecord->bakedCommands->cmdInfo = new CmdListRecordingInfo();
@@ -633,6 +633,8 @@ VkResult WrappedVulkan::vkAllocateCommandBuffers(VkDevice device,
{
VkResourceRecord *record = GetResourceManager()->AddResourceRecord(pCommandBuffers[i]);
record->DisableChunkLocking();
Chunk *chunk = NULL;
{
@@ -1009,6 +1011,7 @@ VkResult WrappedVulkan::vkBeginCommandBuffer(VkCommandBuffer commandBuffer,
record->bakedCommands->Delete(GetResourceManager());
record->bakedCommands = GetResourceManager()->AddResourceRecord(ResourceIDGen::GetNewUniqueID());
record->bakedCommands->DisableChunkLocking();
record->bakedCommands->InternalResource = true;
record->bakedCommands->Resource = (WrappedVkRes *)commandBuffer;
record->bakedCommands->cmdInfo = new CmdBufferRecordingInfo();