diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-02-27 15:42:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-27 15:42:15 +0100 |
commit | 6948ac8c1622ebb3f9da065d3678e571b7ff726e (patch) | |
tree | 1cfed7dc79952d21efc54a265988fd0a4e225230 /src/video_core/renderer_vulkan/vk_query_cache.cpp | |
parent | vk_rasterizer: flip scissor y on lower left origin mode (#13122) (diff) | |
download | yuzu-6948ac8c1622ebb3f9da065d3678e571b7ff726e.tar yuzu-6948ac8c1622ebb3f9da065d3678e571b7ff726e.tar.gz yuzu-6948ac8c1622ebb3f9da065d3678e571b7ff726e.tar.bz2 yuzu-6948ac8c1622ebb3f9da065d3678e571b7ff726e.tar.lz yuzu-6948ac8c1622ebb3f9da065d3678e571b7ff726e.tar.xz yuzu-6948ac8c1622ebb3f9da065d3678e571b7ff726e.tar.zst yuzu-6948ac8c1622ebb3f9da065d3678e571b7ff726e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_query_cache.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 7cbc9c73c..a28296bda 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -1064,8 +1064,6 @@ public: } }); } - auto* ptr = device_memory.GetPointer<u8>(new_query->dependant_address); - ASSERT(ptr != nullptr); new_query->dependant_manage = must_manage_dependance; pending_flush_queries.push_back(index); @@ -1104,9 +1102,11 @@ public: tfb_streamer.Free(query->dependant_index); } else { u8* pointer = device_memory.GetPointer<u8>(query->dependant_address); - u32 result; - std::memcpy(&result, pointer, sizeof(u32)); - num_vertices = static_cast<u64>(result) / query->stride; + if (pointer != nullptr) { + u32 result; + std::memcpy(&result, pointer, sizeof(u32)); + num_vertices = static_cast<u64>(result) / query->stride; + } } query->value = [&]() -> u64 { switch (query->topology) { @@ -1360,7 +1360,9 @@ bool QueryCacheRuntime::HostConditionalRenderingCompareValues(VideoCommon::Looku const auto check_value = [&](DAddr address) { u8* ptr = impl->device_memory.GetPointer<u8>(address); u64 value{}; - std::memcpy(&value, ptr, sizeof(value)); + if (ptr != nullptr) { + std::memcpy(&value, ptr, sizeof(value)); + } return value == 0; }; std::array<VideoCommon::LookupData*, 2> objects{&object_1, &object_2}; |