message: If sync primitive queries are called in a loop don't serialise each call
diff: @@ -205,6 +205,18 @@ VkResult WrappedVulkan::vkGetFenceStatus(VkDevice device, VkFence fence)
  SERIALISE_TIME_CALL(ret = ObjDisp(device)->GetFenceStatus(Unwrap(device), Unwrap(fence)));
  if(IsActiveCapturing(m_State))
  + {
  + bool alreadySerialised = false;
  +
  + {
  + m_FrameCaptureRecord->LockChunks();
  + alreadySerialised = (m_FrameCaptureRecord->NumChunks() > 0 &&
  + m_FrameCaptureRecord->GetLastChunk()->GetChunkType<VulkanChunk>() ==
  + VulkanChunk::vkGetFenceStatus);
  + m_FrameCaptureRecord->UnlockChunks();
  + }
  +
  + if(!alreadySerialised)
  {
  CACHE_THREAD_SERIALISER();
  @@ -214,6 +226,7 @@ VkResult WrappedVulkan::vkGetFenceStatus(VkDevice device, VkFence fence)
  m_FrameCaptureRecord->AddChunk(scope.Get());
  GetResourceManager()->MarkResourceFrameReferenced(GetResID(fence), eFrameRef_Read);
  }
  + }
  return ret;
  }
  @@ -491,6 +504,18 @@ VkResult WrappedVulkan::vkGetEventStatus(VkDevice device, VkEvent event)
  SERIALISE_TIME_CALL(ret = ObjDisp(device)->GetEventStatus(Unwrap(device), Unwrap(event)));
  if(IsActiveCapturing(m_State))
  + {
  + bool alreadySerialised = false;
  +
  + {
  + m_FrameCaptureRecord->LockChunks();
  + alreadySerialised = (m_FrameCaptureRecord->NumChunks() > 0 &&
  + m_FrameCaptureRecord->GetLastChunk()->GetChunkType<VulkanChunk>() ==
  + VulkanChunk::vkGetEventStatus);
  + m_FrameCaptureRecord->UnlockChunks();
  + }
  +
  + if(!alreadySerialised)
  {
  CACHE_THREAD_SERIALISER();
  @@ -499,6 +524,7 @@ VkResult WrappedVulkan::vkGetEventStatus(VkDevice device, VkEvent event)
  m_FrameCaptureRecord->AddChunk(scope.Get());
  }
  + }
  return ret;
  }
  @@ -967,6 +993,18 @@ VkResult WrappedVulkan::vkGetSemaphoreCounterValueKHR(VkDevice device, VkSemapho
  Unwrap(device), Unwrap(semaphore), pValue));
  if(IsActiveCapturing(m_State))
  + {
  + bool alreadySerialised = false;
  +
  + {
  + m_FrameCaptureRecord->LockChunks();
  + alreadySerialised = (m_FrameCaptureRecord->NumChunks() > 0 &&
  + m_FrameCaptureRecord->GetLastChunk()->GetChunkType<VulkanChunk>() ==
  + VulkanChunk::vkGetSemaphoreCounterValueKHR);
  + m_FrameCaptureRecord->UnlockChunks();
  + }
  +
  + if(!alreadySerialised)
  {
  CACHE_THREAD_SERIALISER();
  @@ -976,6 +1014,7 @@ VkResult WrappedVulkan::vkGetSemaphoreCounterValueKHR(VkDevice device, VkSemapho
  m_FrameCaptureRecord->AddChunk(scope.Get());
  GetResourceManager()->MarkResourceFrameReferenced(GetResID(semaphore), eFrameRef_Read);
  }
  + }
  return ret;
  }
  