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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
// This code contains NVIDIA Confidential Information and is disclosed
// under the Mutual Non-Disclosure Agreement.
//
// Notice
// ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
// NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
// THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
// MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
//
// NVIDIA Corporation assumes no responsibility for the consequences of use of such
// information or for any infringement of patents or other rights of third parties that may
// result from its use. No license is granted by implication or otherwise under any patent
// or patent rights of NVIDIA Corporation. No third party distribution is allowed unless
// expressly authorized by NVIDIA. Details are subject to change without notice.
// This code supersedes and replaces all information previously supplied.
// NVIDIA Corporation products are not authorized for use as critical
// components in life support devices or systems without express written approval of
// NVIDIA Corporation.
//
// Copyright � 2008- 2013 NVIDIA Corporation. All rights reserved.
//
// NVIDIA Corporation and its licensors retain all intellectual property and proprietary
// rights in and to this software and 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.
//
/*===========================================================================
GFSDK_WaveWorks_Common.h
GFSDK_Common defines common macros, types and structs used generally by
all NVIDIA TECH Libraries. You won't find anything particularly interesting
here.
For any issues with this particular header please contact:
[email protected]
For any issues with the specific FX library you are using, see the header
file for that library for contact information.
===========================================================================*/
#include <cstdlib>
#pragma pack(push,8) // Make sure we have consistent structure packings
#ifdef __cplusplus
extern "C" {
#endif
/*===========================================================================
AUTO CONFIG
===========================================================================*/
#ifndef __GFSDK_COMMON_AUTOCONFIG
#define __GFSDK_COMMON_AUTOCONFIG
#if defined(__GNUC__) //|| defined (__ANDROID__)
#define __GFSDK_CC_GNU__ 1
#define __GFSDK_CC_MSVC__ 0
#else
#define __GFSDK_CC_GNU__ 0
#define __GFSDK_CC_MSVC__ 1
#endif
#endif
/*===========================================================================
FORWARD DECLARATIONS
===========================================================================*/
#ifndef __GFSDK_COMMON_FORWARDDECLS
#define __GFSDK_COMMON_FORWARDDECLS
#if __GFSDK_GL__
// $ TODO Add common fwd decls for OGL
#endif
/*-------------------------------------------------------------------------*/
#if __GFSDK_DX11__
// $ TODO Add common fwd decls for D3D11
#endif
#endif // __GFSDK_COMMON_FORWARDDECLS
/*===========================================================================
TYPES
===========================================================================*/
#ifndef __GFSDK_COMMON_TYPES
#define __GFSDK_COMMON_TYPES
typedef unsigned char gfsdk_U8;
typedef unsigned short gfsdk_U16;
typedef signed int gfsdk_S32;
typedef signed long long gfsdk_S64;
typedef unsigned int gfsdk_U32;
typedef unsigned long long gfsdk_U64;
typedef float gfsdk_F32;
typedef void gfsdk_void;
typedef struct {
gfsdk_F32 x;
gfsdk_F32 y;
} gfsdk_float2;
typedef struct {
gfsdk_F32 x;
gfsdk_F32 y;
gfsdk_F32 z;
} gfsdk_float3;
typedef struct {
gfsdk_F32 x;
gfsdk_F32 y;
gfsdk_F32 z;
gfsdk_F32 w;
} gfsdk_float4;
// implicit row major
typedef struct {
gfsdk_F32 _11, _12, _13, _14;
gfsdk_F32 _21, _22, _23, _24;
gfsdk_F32 _31, _32, _33, _34;
gfsdk_F32 _41, _42, _43, _44;
} gfsdk_float4x4;
typedef bool gfsdk_bool;
typedef char gfsdk_char;
typedef const gfsdk_char* gfsdk_cstr;
typedef double gfsdk_F64;
#endif // __GFSDK_COMMON_TYPES
/*===========================================================================
MACROS
===========================================================================*/
#ifndef __GFSDK_COMMON_MACROS
#define __GFSDK_COMMON_MACROS
// GNU
#if __GFSDK_CC_GNU__
#define __GFSDK_ALIGN__(bytes) __attribute__((aligned (bytes)))
#define __GFSDK_EXPECT__(exp,tf) __builtin_expect(exp, tf)
#define __GFSDK_INLINE__ __attribute__((always_inline))
#define __GFSDK_NOLINE__ __attribute__((noinline))
#define __GFSDK_RESTRICT__ __restrict
/*-------------------------------------------------------------------------*/
#define __GFSDK_CDECL__
#define __GFSDK_IMPORT__ __declspec(dllimport)
#define __GFSDK_EXPORT__ __declspec(dllexport)
#define __GFSDK_STDCALL__
#endif
// MSVC
#if __GFSDK_CC_MSVC__
#define __GFSDK_ALIGN__(bytes) __declspec(align(bytes))
#define __GFSDK_EXPECT__(exp, tf) (exp)
#define __GFSDK_INLINE__ __forceinline
#define __GFSDK_NOINLINE__
#define __GFSDK_RESTRICT__ __restrict
/*-------------------------------------------------------------------------*/
#define __GFSDK_CDECL__ __cdecl
#define __GFSDK_IMPORT__ __declspec(dllimport)
#define __GFSDK_EXPORT__ __declspec(dllexport)
#define __GFSDK_STDCALL__ __stdcall
#endif
#endif // __GFSDK_COMMON_MACROS
/*===========================================================================
RETURN CODES
===========================================================================*/
#ifndef __GFSDK_COMMON_RETURNCODES
#define __GFSDK_COMMON_RETURNCODES
#define GFSDK_RETURN_OK 0
#define GFSDK_RETURN_FAIL 1
#define GFSDK_RETURN_EMULATION 2
#endif // __GFSDK_COMMON_RETURNCODES
/*===========================================================================
CUSTOM HEAP
===========================================================================*/
#ifndef __GFSDK_COMMON_CUSTOMHEAP
#define __GFSDK_COMMON_CUSTOMHEAP
typedef struct {
void* (*new_)(size_t);
void (*delete_)(void*);
} gfsdk_new_delete_t;
#endif // __GFSDK_COMMON_CUSTOMHEAP
#ifdef __cplusplus
}; //extern "C" {
#endif
#pragma pack(pop)
|