-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathperframe.h
More file actions
64 lines (52 loc) · 1.19 KB
/
perframe.h
File metadata and controls
64 lines (52 loc) · 1.19 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
#ifndef __PERFRAME_H__
#define __PERFRAME_H__
#include "vulkan/vulkan.h"
#include "math/math.h"
#include "pipelines/skybox.h"
#include "pipelines/shadow.h"
typedef struct
{
matrix HMD;
matrix projection;
matrix modelView;
matrix lightMVP[NUM_CASCADES];
vec4 lightColor;
vec4 lightDirection;
// Ugh, stupid alignment requirements
struct
{
float x;
float padding[3];
} cascadeSplits[NUM_CASCADES+1];
} Main_UBO_t;
typedef struct
{
// Skybox per-frame, per-eye data
Skybox_UBO_t *skyboxUBO[2];
VkuBuffer_t skyboxUBOBuffer[2];
//////
// Main render per-frame, per-eye data
Main_UBO_t *mainUBO[2];
VkuBuffer_t mainUBOBuffer[2];
//////
// Model instance per-frame data
VkuBuffer_t asteroidInstance;
matrix *asteroidInstancePtr;
VkuBuffer_t fighterInstance;
matrix *fighterInstancePtr;
VkuBuffer_t cubeInstance;
matrix *cubeInstancePtr;
//////
// Descriptor pool
VkDescriptorPool descriptorPool;
// Command buffer
VkCommandPool commandPool;
VkCommandBuffer commandBuffer;
VkCommandBuffer secCommandBuffer[2];
// Fences/semaphores
VkFence frameFence;
VkSemaphore completeSemaphore;
} PerFrame_t;
#define FRAMES_IN_FLIGHT 3
extern PerFrame_t perFrame[FRAMES_IN_FLIGHT];
#endif