Skip to content

Commit

Permalink
nvapi-vulkan: Log unsupported latency marker types only once (per thr…
Browse files Browse the repository at this point in the history
…ead)
  • Loading branch information
Saancreed committed Dec 26, 2024
1 parent 30a741b commit bc9ac84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/nvapi_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <string_view>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

Expand Down
9 changes: 7 additions & 2 deletions src/nvapi_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,15 @@ extern "C" {
if (!lowLatencyDevice)
return HandleInvalidated(n);

auto marker = NvapiVulkanLowLatencyDevice::ToVkLatencyMarkerNV(pSetLatencyMarkerParams->markerType);
auto markerType = pSetLatencyMarkerParams->markerType;
auto marker = NvapiVulkanLowLatencyDevice::ToVkLatencyMarkerNV(markerType);

if (marker == VK_LATENCY_MARKER_MAX_ENUM_NV) {
log::info(str::format("unsupported NV_VULKAN_LATENCY_MARKER_TYPE (", pSetLatencyMarkerParams->markerType, "), frameID = ", pSetLatencyMarkerParams->frameID, ", ignoring"));
thread_local std::unordered_set<NV_VULKAN_LATENCY_MARKER_TYPE> unsupportedMarkerTypes{};

if (auto [it, inserted] = unsupportedMarkerTypes.insert(markerType); inserted)
log::info(str::format("unsupported NV_VULKAN_LATENCY_MARKER_TYPE (", markerType, "), ignoring"));

return Ok(n);
}

Expand Down

0 comments on commit bc9ac84

Please sign in to comment.