mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Switch descriptor refs lock back to normal lock
* Unfortunately some programs have extreme contention on this lock due to multithreaded descriptor set writes enabled by UPDATE_AFTER_BIND.
This commit is contained in:
@@ -1060,7 +1060,7 @@ void DescriptorSetSlotImageInfo::SetFrom(const VkDescriptorImageInfo &imInfo, bo
|
||||
void DescriptorSetSlot::RemoveBindRefs(rdcarray<ResourceId> &ids, VulkanResourceManager *rm,
|
||||
VkResourceRecord *record)
|
||||
{
|
||||
SCOPED_SPINLOCK(record->descInfo->refLock);
|
||||
SCOPED_LOCK(record->descInfo->refLock);
|
||||
|
||||
if(texelBufferView != ResourceId())
|
||||
{
|
||||
@@ -1109,7 +1109,7 @@ void DescriptorSetSlot::AddBindRefs(rdcarray<ResourceId> &ids, VkResourceRecord
|
||||
VkResourceRecord *imgView, VkResourceRecord *buffer,
|
||||
VkResourceRecord *descSetRecord, FrameRefType ref)
|
||||
{
|
||||
SCOPED_SPINLOCK(descSetRecord->descInfo->refLock);
|
||||
SCOPED_LOCK(descSetRecord->descInfo->refLock);
|
||||
|
||||
if(bufView)
|
||||
{
|
||||
@@ -1156,7 +1156,7 @@ void DescriptorSetSlot::AddBindRefs(rdcarray<ResourceId> &ids, VulkanResourceMan
|
||||
|
||||
void DescriptorSetData::UpdateBackgroundRefCache(const rdcarray<ResourceId> &ids)
|
||||
{
|
||||
SCOPED_SPINLOCK(refLock);
|
||||
SCOPED_LOCK(refLock);
|
||||
|
||||
if(backgroundFrameRefs.empty())
|
||||
{
|
||||
|
||||
@@ -1059,7 +1059,7 @@ struct DescriptorSetData
|
||||
BindingStorage data;
|
||||
|
||||
// lock protecting bindFrameRefs and bindMemRefs
|
||||
Threading::SpinLock refLock;
|
||||
Threading::CriticalSection refLock;
|
||||
|
||||
// contains the framerefs (ref counted) for the bound resources
|
||||
// in the binding slots. Updated when updating descriptor sets
|
||||
|
||||
@@ -1178,7 +1178,7 @@ void WrappedVulkan::vkUpdateDescriptorSets(VkDevice device, uint32_t writeCount,
|
||||
|
||||
VkResourceRecord *setrecord = GetRecord(pDescriptorCopies[i].srcSet);
|
||||
|
||||
SCOPED_SPINLOCK(setrecord->descInfo->refLock);
|
||||
SCOPED_LOCK(setrecord->descInfo->refLock);
|
||||
|
||||
for(auto refit = setrecord->descInfo->bindFrameRefs.begin();
|
||||
refit != setrecord->descInfo->bindFrameRefs.end(); ++refit)
|
||||
|
||||
@@ -877,7 +877,7 @@ VkResult WrappedVulkan::vkQueueSubmit(VkQueue queue, uint32_t submitCount,
|
||||
|
||||
VkResourceRecord *setrecord = GetRecord(*it);
|
||||
|
||||
SCOPED_SPINLOCK(setrecord->descInfo->refLock);
|
||||
SCOPED_LOCK(setrecord->descInfo->refLock);
|
||||
|
||||
for(auto refit = setrecord->descInfo->bindFrameRefs.begin();
|
||||
refit != setrecord->descInfo->bindFrameRefs.end(); ++refit)
|
||||
@@ -965,7 +965,7 @@ VkResult WrappedVulkan::vkQueueSubmit(VkQueue queue, uint32_t submitCount,
|
||||
{
|
||||
VkResourceRecord *setrecord = GetRecord(*it);
|
||||
|
||||
SCOPED_SPINLOCK(setrecord->descInfo->refLock);
|
||||
SCOPED_LOCK(setrecord->descInfo->refLock);
|
||||
|
||||
GetResourceManager()->MarkBackgroundFrameReferenced(
|
||||
setrecord->descInfo->backgroundFrameRefs);
|
||||
|
||||
Reference in New Issue
Block a user