Skip to content

Commit

Permalink
fixup! nvapi: Introduce NvapiVulkanLowLatencyDevice
Browse files Browse the repository at this point in the history
Initialize static members out of line.
  • Loading branch information
Saancreed committed Dec 26, 2024
1 parent bc9ac84 commit 641b524
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/nvapi/nvapi_vulkan_low_latency_device.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "./nvapi_vulkan_low_latency_device.h"

namespace dxvk {
std::unordered_map<VkDevice, NvapiVulkanLowLatencyDevice> NvapiVulkanLowLatencyDevice::m_lowLatencyDeviceMap = {};
std::mutex NvapiVulkanLowLatencyDevice::m_lowLatencyDeviceMutex = {};

std::pair<NvapiVulkanLowLatencyDevice*, VkResult> NvapiVulkanLowLatencyDevice::GetOrCreate(VkDevice device, PFN_vkGetDeviceProcAddr pvkGetDeviceProcAddr) {
std::scoped_lock lock{m_lowLatencyDeviceMutex};

Expand Down
4 changes: 2 additions & 2 deletions src/nvapi/nvapi_vulkan_low_latency_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ namespace dxvk {
void QueueNotifyOutOfBand(VkQueue queue, VkOutOfBandQueueTypeNV queueType);

private:
inline static std::unordered_map<VkDevice, NvapiVulkanLowLatencyDevice> m_lowLatencyDeviceMap{};
inline static std::mutex m_lowLatencyDeviceMutex{};
static std::unordered_map<VkDevice, NvapiVulkanLowLatencyDevice> m_lowLatencyDeviceMap;
static std::mutex m_lowLatencyDeviceMutex;

VkDevice m_device{};
VkSemaphore m_semaphore{};
Expand Down

0 comments on commit 641b524

Please sign in to comment.