forked from NVIDIAGameWorks/RTXGI-DDGI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Common.h
161 lines (141 loc) · 6.65 KB
/
Common.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/*
* Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.
*
* NVIDIA CORPORATION and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA CORPORATION is strictly prohibited.
*/
#pragma once
#if __linux__
#include <stddef.h>
#endif
#ifdef RTXGI_EXPORT_DLL
#ifdef _MSC_VER
#define RTXGI_API __declspec(dllexport)
#elif __GNUC__
#define RTXGI_API __attribute__((visibility("default")))
#endif
#else
#define RTXGI_API
#endif
namespace rtxgi
{
struct RTXGI_VERSION
{
static const int major = 1;
static const int minor = 3;
static const int revision = 7;
inline static const char* getVersionString()
{
return "1.3.7";
}
};
struct ShaderBytecode
{
const void* pData = nullptr;
size_t size = 0;
};
#define RTXGI_SAFE_RELEASE(x) { if(x) { x->Release(); x = NULL; } }
#define RTXGI_SAFE_DELETE(x) { if(x) delete x; x = NULL; }
#define RTXGI_SAFE_DELETE_ARRAY(x) { if(x) delete[] x; x = NULL; }
#define RTXGI_ALIGN(_alignment, _val) (((_val + _alignment - 1) / _alignment) * _alignment)
/**
* ERTXGIStatus
* An enumeration for SDK status return codes.
*/
enum ERTXGIStatus
{
OK = 0,
ERROR_DDGI_INVALID_PROBE_COUNTS,
ERROR_DDGI_INVALID_RESOURCE_INDICES_BUFFER,
ERROR_DDGI_INVALID_RESOURCE_INDICES_UPLOAD_BUFFER,
ERROR_DDGI_INVALID_CONSTANTS_BUFFER,
ERROR_DDGI_INVALID_CONSTANTS_UPLOAD_BUFFER,
ERROR_DDGI_INVALID_RESOURCES_DESC,
ERROR_DDGI_MAP_FAILURE_RESOURCE_INDICES_UPLOAD_BUFFER,
ERROR_DDGI_MAP_FAILURE_CONSTANTS_UPLOAD_BUFFER,
ERROR_DDGI_MAP_FAILURE_VARIABILITY_READBACK_BUFFER,
ERROR_DDGI_D3D12_INVALID_RESOURCE_DESCRIPTOR_HEAP,
ERROR_DDGI_VK_INVALID_RESOURCE_INDICES_UPLOAD_MEMORY,
ERROR_DDGI_VK_INVALID_CONSTANTS_UPLOAD_MEMORY,
// --- DDGI Status Codes -----------------------------------------
// Managed Resources Mode (SDK manages volume resources)
ERROR_DDGI_INVALID_BYTECODE_PROBE_BLENDING_IRRADIANCE,
ERROR_DDGI_INVALID_BYTECODE_PROBE_BLENDING_DISTANCE,
ERROR_DDGI_INVALID_BYTECODE_PROBE_RELOCATION,
ERROR_DDGI_INVALID_BYTECODE_PROBE_RELOCATION_RESET,
ERROR_DDGI_INVALID_BYTECODE_PROBE_CLASSIFICATION,
ERROR_DDGI_INVALID_BYTECODE_PROBE_CLASSIFICATION_RESET,
ERROR_DDGI_INVALID_BYTECODE_PROBE_VARIABILITY_REDUCTION,
ERROR_DDGI_INVALID_BYTECODE_PROBE_VARIABILITY_EXTRA_REDUCTION,
ERROR_DDGI_ALLOCATE_FAILURE_TEXTURE_PROBE_RAY_DATA,
ERROR_DDGI_ALLOCATE_FAILURE_TEXTURE_PROBE_IRRADIANCE,
ERROR_DDGI_ALLOCATE_FAILURE_TEXTURE_PROBE_DISTANCE,
ERROR_DDGI_ALLOCATE_FAILURE_TEXTURE_PROBE_DATA,
ERROR_DDGI_ALLOCATE_FAILURE_TEXTURE_PROBE_VARIABILITY,
ERROR_DDGI_ALLOCATE_FAILURE_TEXTURE_PROBE_VARIABILITY_AVERAGE,
ERROR_DDGI_D3D12_INVALID_DEVICE,
ERROR_DDGI_D3D12_CREATE_FAILURE_PSO,
ERROR_DDGI_D3D12_CREATE_FAILURE_ROOT_SIGNATURE,
ERROR_DDGI_D3D12_CREATE_FAILURE_DESCRIPTORS,
ERROR_DDGI_VK_INVALID_DEVICE,
ERROR_DDGI_VK_INVALID_PHYSICAL_DEVICE,
ERROR_DDGI_VK_INVALID_DESCRIPTOR_POOL,
ERROR_DDGI_VK_CREATE_FAILURE_LAYOUTS,
ERROR_DDGI_VK_CREATE_FAILURE_PIPELINE,
ERROR_DDGI_VK_CREATE_FAILURE_DESCRIPTOR_SET,
// Unmanaged Resource Mode (Application manages volume resources)
ERROR_DDGI_INVALID_TEXTURE_PROBE_RAY_DATA,
ERROR_DDGI_INVALID_TEXTURE_PROBE_IRRADIANCE,
ERROR_DDGI_INVALID_TEXTURE_PROBE_DISTANCE,
ERROR_DDGI_INVALID_TEXTURE_PROBE_DATA,
ERROR_DDGI_INVALID_TEXTURE_PROBE_VARIABILITY,
ERROR_DDGI_INVALID_TEXTURE_PROBE_VARIABILITY_AVERAGE,
ERROR_DDGI_INVALID_TEXTURE_PROBE_VARIABILITY_READBACK,
ERROR_DDGI_D3D12_INVALID_ROOT_SIGNATURE,
ERROR_DDGI_D3D12_INVALID_DESCRIPTOR,
ERROR_DDGI_D3D12_INVALID_PSO_PROBE_BLENDING_IRRADIANCE,
ERROR_DDGI_D3D12_INVALID_PSO_PROBE_BLENDING_DISTANCE,
ERROR_DDGI_D3D12_INVALID_PSO_PROBE_RELOCATION,
ERROR_DDGI_D3D12_INVALID_PSO_PROBE_RELOCATION_RESET,
ERROR_DDGI_D3D12_INVALID_PSO_PROBE_CLASSIFICATION,
ERROR_DDGI_D3D12_INVALID_PSO_PROBE_CLASSIFICATION_RESET,
ERROR_DDGI_D3D12_INVALID_PSO_PROBE_REDUCTION,
ERROR_DDGI_D3D12_INVALID_PSO_PROBE_EXTRA_REDUCTION,
ERROR_DDGI_VK_INVALID_DESCRIPTOR_SET,
ERROR_DDGI_VK_INVALID_PIPELINE_LAYOUT,
ERROR_DDGI_VK_INVALID_IMAGE_MEMORY_PROBE_RAY_DATA,
ERROR_DDGI_VK_INVALID_IMAGE_MEMORY_PROBE_IRRADIANCE,
ERROR_DDGI_VK_INVALID_IMAGE_MEMORY_PROBE_DISTANCE,
ERROR_DDGI_VK_INVALID_IMAGE_MEMORY_PROBE_DATA,
ERROR_DDGI_VK_INVALID_IMAGE_MEMORY_PROBE_VARIABILITY,
ERROR_DDGI_VK_INVALID_IMAGE_MEMORY_PROBE_VARIABILITY_AVERAGE,
ERROR_DDGI_VK_INVALID_IMAGE_MEMORY_PROBE_VARIABILITY_READBACK,
ERROR_DDGI_VK_INVALID_IMAGE_VIEW_PROBE_RAY_DATA,
ERROR_DDGI_VK_INVALID_IMAGE_VIEW_PROBE_IRRADIANCE,
ERROR_DDGI_VK_INVALID_IMAGE_VIEW_PROBE_DISTANCE,
ERROR_DDGI_VK_INVALID_IMAGE_VIEW_PROBE_DATA,
ERROR_DDGI_VK_INVALID_IMAGE_VIEW_PROBE_VARIABILITY,
ERROR_DDGI_VK_INVALID_IMAGE_VIEW_PROBE_VARIABILITY_AVERAGE,
ERROR_DDGI_VK_INVALID_IMAGE_VIEW_PROBE_VARIABILITY_READBACK,
ERROR_DDGI_VK_INVALID_SHADER_MODULE_PROBE_BLENDING_IRRADIANCE,
ERROR_DDGI_VK_INVALID_SHADER_MODULE_PROBE_BLENDING_DISTANCE,
ERROR_DDGI_VK_INVALID_SHADER_MODULE_PROBE_RELOCATION,
ERROR_DDGI_VK_INVALID_SHADER_MODULE_PROBE_RELOCATION_RESET,
ERROR_DDGI_VK_INVALID_SHADER_MODULE_PROBE_CLASSIFICATION,
ERROR_DDGI_VK_INVALID_SHADER_MODULE_PROBE_CLASSIFICATION_RESET,
ERROR_DDGI_VK_INVALID_SHADER_MODULE_PROBE_VARIABILITY_REDUCTION,
ERROR_DDGI_VK_INVALID_SHADER_MODULE_PROBE_VARIABILITY_EXTRA_REDUCTION,
ERROR_DDGI_VK_INVALID_PIPELINE_PROBE_BLENDING_IRRADIANCE,
ERROR_DDGI_VK_INVALID_PIPELINE_PROBE_BLENDING_DISTANCE,
ERROR_DDGI_VK_INVALID_PIPELINE_PROBE_RELOCATION,
ERROR_DDGI_VK_INVALID_PIPELINE_PROBE_RELOCATION_RESET,
ERROR_DDGI_VK_INVALID_PIPELINE_PROBE_CLASSIFICATION,
ERROR_DDGI_VK_INVALID_PIPELINE_PROBE_CLASSIFICATION_RESET,
ERROR_DDGI_VK_INVALID_PIPELINE_PROBE_VARIABILITY_REDUCTION,
ERROR_DDGI_VK_INVALID_PIPELINE_PROBE_VARIABILITY_EXTRA_REDUCTION,
// ---------------------------------------------------------------
};
}