aboutsummaryrefslogtreecommitdiff
path: root/src/strategies/low_latency2/device_strategy.hh
blob: af1b471829abb091074609435dc1d254fc1b1153 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef STRATEGIES_LOW_LATENCY2_DEVICE_STRATEGY_HH_
#define STRATEGIES_LOW_LATENCY2_DEVICE_STRATEGY_HH_

#include "strategies/device_strategy.hh"
#include "swapchain_monitor.hh"

#include <shared_mutex>
#include <unordered_map>

namespace low_latency {

class DeviceContext;

class LowLatency2DeviceStrategy final : public DeviceStrategy {
  private:
    std::shared_mutex mutex;
    // swapchain -> swapchain monitor
    std::unordered_map<VkSwapchainKHR, SwapchainMonitor> swapchain_monitors;

  public:
    LowLatency2DeviceStrategy(DeviceContext& device);
    virtual ~LowLatency2DeviceStrategy();

  public:
    virtual void
    notify_create_swapchain(const VkSwapchainKHR& swapchain,
                            const VkSwapchainCreateInfoKHR& info) override;
    virtual void
    notify_destroy_swapchain(const VkSwapchainKHR& swapchain) override;
};

} // namespace low_latency

#endif