Browse Source

[TEST] Hunting down recursive mutex 2

(cherry picked from commit f532357793)
vk-experiments8
CamilleLaVey 2 weeks ago
parent
commit
a8f4fdd20f
  1. 5
      src/video_core/renderer_vulkan/vk_query_cache.cpp
  2. 4
      src/video_core/renderer_vulkan/vk_rasterizer.cpp
  3. 2
      src/video_core/texture_cache/texture_cache_base.h

5
src/video_core/renderer_vulkan/vk_query_cache.cpp

@ -236,7 +236,8 @@ public:
} }
PauseCounter(); PauseCounter();
const auto driver_id = device.GetDriverID(); const auto driver_id = device.GetDriverID();
if (driver_id == VK_DRIVER_ID_ARM_PROPRIETARY || driver_id == VK_DRIVER_ID_MESA_TURNIP) {
if (driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY ||
driver_id == VK_DRIVER_ID_ARM_PROPRIETARY || driver_id == VK_DRIVER_ID_MESA_TURNIP) {
pending_sync.clear(); pending_sync.clear();
sync_values_stash.clear(); sync_values_stash.clear();
return; return;
@ -1520,7 +1521,7 @@ bool QueryCacheRuntime::HostConditionalRenderingCompareValues(VideoCommon::Looku
auto driver_id = impl->device.GetDriverID(); auto driver_id = impl->device.GetDriverID();
const bool is_gpu_high = Settings::IsGPULevelHigh(); const bool is_gpu_high = Settings::IsGPULevelHigh();
if ((!is_gpu_high && driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) || driver_id == VK_DRIVER_ID_ARM_PROPRIETARY || driver_id == VK_DRIVER_ID_MESA_TURNIP) {
if ((!is_gpu_high && driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) || driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY || driver_id == VK_DRIVER_ID_ARM_PROPRIETARY || driver_id == VK_DRIVER_ID_MESA_TURNIP) {
EndHostConditionalRendering(); EndHostConditionalRendering();
return true; return true;
} }

4
src/video_core/renderer_vulkan/vk_rasterizer.cpp

@ -242,11 +242,7 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, Func&& draw_func) {
return; return;
} }
{ {
// Only resource binding/upload needs the cache locks held. The query-cache calls and the
// deferred draw recording below acquire their own locks, so keeping them outside this scope
// avoids re-entrant locking of buffer_cache.mutex and shrinks the serialized region.
std::scoped_lock lock{buffer_cache.mutex, texture_cache.mutex}; std::scoped_lock lock{buffer_cache.mutex, texture_cache.mutex};
// update engine as channel may be different.
pipeline->SetEngine(maxwell3d, gpu_memory); pipeline->SetEngine(maxwell3d, gpu_memory);
if (!pipeline->Configure(is_indexed)) { if (!pipeline->Configure(is_indexed)) {
return; return;

2
src/video_core/texture_cache/texture_cache_base.h

@ -257,7 +257,7 @@ public:
/// Prepare an image to be used /// Prepare an image to be used
void PrepareImage(ImageId image_id, bool is_modification, bool invalidate); void PrepareImage(ImageId image_id, bool is_modification, bool invalidate);
std::recursive_mutex mutex;
std::mutex mutex;
private: private:
/// Iterate over all page indices in a range /// Iterate over all page indices in a range

Loading…
Cancel
Save