-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhda_instancegpu.hpp
More file actions
70 lines (48 loc) · 1.78 KB
/
Copy pathhda_instancegpu.hpp
File metadata and controls
70 lines (48 loc) · 1.78 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#include "hda_window.hpp"
#include "hda_model.hpp"
/*
*
* A class representing a logical device.
*
*/
using namespace std;
class HdaInstanceGpu { //device instance
public:
HdaInstanceGpu(HdaWindow& window);
~HdaInstanceGpu();
void initGpu();
inline vk::Instance getInstance() { return instance; }
inline vk::Device getDevice() { return device; }
inline vk::PhysicalDevice getPhysDevice() { return physDevice; }
inline vk::SurfaceKHR getWinSurface() { return winSurface; }
inline vk::SurfaceFormatKHR getSurfaceFormat() { return surfaceFormat; }
inline uint32_t getGraphicsQueueFamily() { return graphicsQueueFamily; }
inline uint32_t getPresentQueueFamily() { return presentationQueueFamily; }
inline vk::Format getFindFormatFunc(vk::ImageTiling t) { return findFormat(t); }
inline vk::RenderPass getRenderpass() { return renderpass; }
inline vk::Queue getGraphicsQueue() { return graphicsQueue; }
inline vk::Queue getPresentationQueue() { return presentationQueue; }
private:
void instanceInit();
void findPhysDevice();
bool isSuitable(vk::PhysicalDevice physdev);
void deviceInit();
void createWinSurface();
void checkExtensionSupport(const char **, uint32_t);
vk::Format findFormat(vk::ImageTiling);
void renderpassInit();
int eCh = 0;
HdaWindow& window;
vk::SurfaceKHR winSurface;
vk::RenderPass renderpass;
vk::Instance instance;
vk::Device device;
vector<tuple<vk::PhysicalDevice, uint32_t, uint32_t, uint32_t, vk::SurfaceFormatKHR>> suitablePhysDevices{};
vk::PhysicalDevice physDevice;
uint32_t graphicsQueueFamily = UINT32_MAX;
uint32_t presentationQueueFamily = UINT32_MAX;
vk::Queue graphicsQueue;
vk::Queue presentationQueue;
vk::SurfaceFormatKHR surfaceFormat;
};