Skip to content

Commit

Permalink
fixup! nvapi-vulkan: Log unsupported latency marker types only once (…
Browse files Browse the repository at this point in the history
…per thread)
  • Loading branch information
Saancreed committed Dec 27, 2024
1 parent 641b524 commit 553c86b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/nvapi_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,15 @@ extern "C" {
auto markerType = pSetLatencyMarkerParams->markerType;
auto marker = NvapiVulkanLowLatencyDevice::ToVkLatencyMarkerNV(markerType);

if (marker == VK_LATENCY_MARKER_MAX_ENUM_NV) {
if (marker != VK_LATENCY_MARKER_MAX_ENUM_NV) {
lowLatencyDevice->SetLatencyMarker(pSetLatencyMarkerParams->frameID, marker);
} else {
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);
}

lowLatencyDevice->SetLatencyMarker(pSetLatencyMarkerParams->frameID, marker);

return Ok(n, alreadyLoggedOk);
}

Expand Down

0 comments on commit 553c86b

Please sign in to comment.