-
Notifications
You must be signed in to change notification settings - Fork 10
/
gpu.h
70 lines (63 loc) · 1.45 KB
/
gpu.h
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
struct GPUState
{
struct
{
VkBuffer buffer;
VkDeviceSize offset;
VkIndexType indexType;
} ib;
struct
{
VkBuffer buffer;
VkDeviceSize offset;
VkDeviceSize stride;
} vbs[4];
VkViewport view;
VkImage col[8];
VkImage depth;
VkPipeline pipeline;
VkDescriptorSet sets[8];
byte pushconsts[128];
};
__declspec(align(16)) struct int4
{
int4() {}
int4(int X, int Y, int Z, int W) : x(X), y(Y), z(Z), w(W) {}
union
{
struct
{
int x, y, z, w;
};
int v[4];
};
};
__declspec(align(16)) struct float4
{
float4() {}
float4(float X, float Y, float Z, float W) : x(X), y(Y), z(Z), w(W) {}
union
{
struct
{
float x, y, z, w;
};
float v[4];
};
};
struct VertexCacheEntry
{
float4 position;
float4 interps[10];
};
void ClearTarget(VkImage target, const VkClearColorValue &col);
void ClearTarget(VkImage target, const VkClearDepthStencilValue &col);
void DrawTriangles(const GPUState &state, int numVerts, uint32_t first, bool indexed);
void InitTextureCache();
extern "C" __declspec(dllexport) void sample_tex_wrapped(float u, float v, VkImage tex,
VkDeviceSize byteOffs, float4 &out);
extern "C" __declspec(dllexport) void sample_cube_wrapped(float x, float y, float z, VkImage tex,
float4 &out);
void InitRasterThreads();
void ShutdownRasterThreads();