forked from kirides/GD3D11
-
Notifications
You must be signed in to change notification settings - Fork 18
/
pch.h
77 lines (61 loc) · 2.02 KB
/
pch.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
#pragma once
#pragma warning(disable: 4731) // Change of ebp from inline assembly
#pragma warning(disable: 4244) // Loss of data during conversion
#include <Windows.h>
#include <wrl/client.h>
#include <chrono>
#include <d3d11_4.h>
#include <DirectXMath.h>
#include <future>
#include <list>
#include <map>
#include <array>
#include <mmsystem.h>
#include <set>
#include <signal.h>
#include <unordered_map>
#include <unordered_set>
#include <filesystem>
#include "Logger.h"
#include "Types.h"
#include "VertexTypes.h"
using namespace DirectX;
#if _MSC_VER < 1900
;
#else
#define stdext std
#endif
#define ENABLE_TESSELATION 0
#ifndef VERSION_NUMBER
#define VERSION_NUMBER "17.8-dev12"
#endif
__declspec(selectany) const char* VERSION_NUMBER_STR = VERSION_NUMBER;
extern bool FeatureLevel10Compatibility;
extern bool GMPModeActive;
/** D3D7-Call logging */
#define DebugWriteValue(value, check) if (value == check) { LogInfo() << " - " << #check; }
#define DebugWriteFlag(value, check) if ((value & check) == check) { LogInfo() << " - " << #check; }
#define DebugWrite(debugMessage) DebugWrite_i(debugMessage, (void *) this);
/** Debugging */
#define SAFE_RELEASE(x) if (x) { x->Release(); x = nullptr; }
#define SAFE_DELETE(x) delete x; x = nullptr;
//#define V(x) x
/** zCObject Managing */
void zCObject_AddRef( void* o );
void zCObject_Release( void* o );
/** Writes a string of the D3D7-Call log */
void DebugWrite_i( LPCSTR lpDebugMessage, void* thisptr );
/** Computes the size in bytes of the given FVF */
int ComputeFVFSize( DWORD fvf );
inline unsigned short quantizeHalfFloat( float v )
{
union { float f; unsigned int ui; } u = { v };
unsigned int ui = u.ui;
int s = ( ui >> 16 ) & 0x8000;
int em = ui & 0x7fffffff;
int h = ( em - ( 112 << 23 ) + ( 1 << 12 ) ) >> 13;
h = ( em < ( 113 << 23 ) ) ? 0 : h;
h = ( em >= ( 143 << 23 ) ) ? 0x7c00 : h;
h = ( em > ( 255 << 23 ) ) ? 0x7e00 : h;
return static_cast<unsigned short>(s | h);
}