summaryrefslogtreecommitdiffstats
path: root/src/libs/dxvk-native-1.9.2a/src/dxvk/dxvk_device_filter.h
blob: 7b411e6ad297370279c8ea25f5c088de8a194297 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once

#include "dxvk_adapter.h"

namespace dxvk {
  
  /**
   * \brief Device filter flags
   * 
   * The device filter flags specify which device
   * properties are considered when testing adapters.
   * If no flags are set, all devices pass the test.
   */
  enum class DxvkDeviceFilterFlag {
    MatchDeviceName   = 0,
    SkipCpuDevices    = 1,
  };
  
  using DxvkDeviceFilterFlags = Flags<DxvkDeviceFilterFlag>;
  
  
  /**
   * \brief DXVK device filter
   * 
   * Used to select specific Vulkan devices to use
   * with DXVK. This may be useful for games which
   * do not offer an option to select the correct
   * device.
   */
  class DxvkDeviceFilter {
    
  public:
    
    DxvkDeviceFilter(DxvkDeviceFilterFlags flags);
    ~DxvkDeviceFilter();
    
    /**
     * \brief Tests an adapter
     * 
     * \param [in] properties Adapter properties
     * \returns \c true if the test passes
     */
    bool testAdapter(
      const VkPhysicalDeviceProperties& properties) const;
    
  private:
    
    DxvkDeviceFilterFlags m_flags;
    
    std::string m_matchDeviceName;
    
  };
  
}