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
|
#include "../dxvk/dxvk_instance.h"
#include "d3d9_interface.h"
#include "d3d9_shader_validator.h"
class D3DFE_PROCESSVERTICES;
using PSGPERRORID = UINT;
namespace dxvk {
Logger Logger::s_instance("d3d9.log");
HRESULT CreateD3D9(
bool Extended,
IDirect3D9Ex** ppDirect3D9Ex) {
if (!ppDirect3D9Ex)
return D3DERR_INVALIDCALL;
*ppDirect3D9Ex = ref(new D3D9InterfaceEx( Extended ));
return D3D_OK;
}
}
extern "C" {
DLLEXPORT IDirect3D9* __stdcall Direct3DCreate9(UINT nSDKVersion) {
IDirect3D9Ex* pDirect3D = nullptr;
dxvk::CreateD3D9(false, &pDirect3D);
return pDirect3D;
}
DLLEXPORT HRESULT __stdcall Direct3DCreate9Ex(UINT nSDKVersion, IDirect3D9Ex** ppDirect3D9Ex) {
return dxvk::CreateD3D9(true, ppDirect3D9Ex);
}
DLLEXPORT int __stdcall D3DPERF_BeginEvent(D3DCOLOR col, LPCWSTR wszName) {
return 0;
}
DLLEXPORT int __stdcall D3DPERF_EndEvent(void) {
return 0;
}
DLLEXPORT void __stdcall D3DPERF_SetMarker(D3DCOLOR col, LPCWSTR wszName) {
}
DLLEXPORT void __stdcall D3DPERF_SetRegion(D3DCOLOR col, LPCWSTR wszName) {
}
DLLEXPORT BOOL __stdcall D3DPERF_QueryRepeatFrame(void) {
return FALSE;
}
DLLEXPORT void __stdcall D3DPERF_SetOptions(DWORD dwOptions) {
}
DLLEXPORT DWORD __stdcall D3DPERF_GetStatus(void) {
return 0;
}
DLLEXPORT void __stdcall DebugSetMute(void) {
}
DLLEXPORT int __stdcall DebugSetLevel(void) {
return 0;
}
// Processor Specific Geometry Pipeline
// for P3 SIMD/AMD 3DNow.
DLLEXPORT void __stdcall PSGPError(D3DFE_PROCESSVERTICES* a, PSGPERRORID b, UINT c) {
}
DLLEXPORT void __stdcall PSGPSampleTexture(D3DFE_PROCESSVERTICES* a, UINT b, float(*const c)[4], UINT d, float(*const e)[4]) {
}
DLLEXPORT dxvk::D3D9ShaderValidator* __stdcall Direct3DShaderValidatorCreate9(void) {
return ref(new dxvk::D3D9ShaderValidator());
}
DLLEXPORT int __stdcall Direct3D9EnableMaximizedWindowedModeShim(UINT a) {
return 0;
}
}
|