2 * Copyright 2010 Matteo Bruni for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __VKD3D_D3DCOMPILER_H
20 #define __VKD3D_D3DCOMPILER_H
21 #ifndef __D3DCOMPILER_H__
23 #include <vkd3d_d3dcompiler_types.h>
25 #define D3DCOMPILE_DEBUG 0x00000001
26 #define D3DCOMPILE_SKIP_VALIDATION 0x00000002
27 #define D3DCOMPILE_SKIP_OPTIMIZATION 0x00000004
28 #define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR 0x00000008
29 #define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR 0x00000010
30 #define D3DCOMPILE_PARTIAL_PRECISION 0x00000020
31 #define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT 0x00000040
32 #define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT 0x00000080
33 #define D3DCOMPILE_NO_PRESHADER 0x00000100
34 #define D3DCOMPILE_AVOID_FLOW_CONTROL 0x00000200
35 #define D3DCOMPILE_PREFER_FLOW_CONTROL 0x00000400
36 #define D3DCOMPILE_ENABLE_STRICTNESS 0x00000800
37 #define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY 0x00001000
38 #define D3DCOMPILE_IEEE_STRICTNESS 0x00002000
39 #define D3DCOMPILE_OPTIMIZATION_LEVEL0 0x00004000
40 #define D3DCOMPILE_OPTIMIZATION_LEVEL1 0x00000000
41 #define D3DCOMPILE_OPTIMIZATION_LEVEL2 0x0000c000
42 #define D3DCOMPILE_OPTIMIZATION_LEVEL3 0x00008000
43 #define D3DCOMPILE_RESERVED16 0x00010000
44 #define D3DCOMPILE_RESERVED17 0x00020000
45 #define D3DCOMPILE_WARNINGS_ARE_ERRORS 0x00040000
46 #define D3DCOMPILE_RESOURCES_MAY_ALIAS 0x00080000
47 #define D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES 0x00100000
48 #define D3DCOMPILE_ALL_RESOURCES_BOUND 0x00200000
49 #define D3DCOMPILE_DEBUG_NAME_FOR_SOURCE 0x00400000
50 #define D3DCOMPILE_DEBUG_NAME_FOR_BINARY 0x00800000
52 #define D3DCOMPILE_EFFECT_CHILD_EFFECT 0x00000001
53 #define D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS 0x00000002
55 #define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_LATEST 0x00000000
56 #define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_1_0 0x00000010
57 #define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_1_1 0x00000020
59 #define D3DCOMPILE_SECDATA_MERGE_UAV_SLOTS 0x00000001
60 #define D3DCOMPILE_SECDATA_PRESERVE_TEMPLATE_SLOTS 0x00000002
61 #define D3DCOMPILE_SECDATA_REQUIRE_TEMPLATE_MATCH 0x00000004
63 typedef enum D3DCOMPILER_STRIP_FLAGS
65 D3DCOMPILER_STRIP_REFLECTION_DATA
= 0x00000001,
66 D3DCOMPILER_STRIP_DEBUG_INFO
= 0x00000002,
67 D3DCOMPILER_STRIP_TEST_BLOBS
= 0x00000004,
68 D3DCOMPILER_STRIP_PRIVATE_DATA
= 0x00000008,
69 D3DCOMPILER_STRIP_ROOT_SIGNATURE
= 0x00000010,
70 D3DCOMPILER_STRIP_FORCE_DWORD
= 0x7fffffff,
71 } D3DCOMPILER_STRIP_FLAGS
;
73 HRESULT WINAPI
D3DCompile(const void *data
, SIZE_T data_size
, const char *filename
,
74 const D3D_SHADER_MACRO
*macros
, ID3DInclude
*include
, const char *entrypoint
,
75 const char *profile
, UINT flags
, UINT effect_flags
, ID3DBlob
**shader
, ID3DBlob
**error_messages
);
76 HRESULT WINAPI
D3DCompile2(const void *data
, SIZE_T data_size
, const char *filename
,
77 const D3D_SHADER_MACRO
*macros
, ID3DInclude
*include
, const char *entrypoint
,
78 const char *profile
, UINT flags
, UINT effect_flags
, UINT secondary_flags
,
79 const void *secondary_data
, SIZE_T secondary_data_size
, ID3DBlob
**shader
,
80 ID3DBlob
**error_messages
);
81 HRESULT WINAPI
D3DCreateBlob(SIZE_T size
, ID3DBlob
**blob
);
82 HRESULT WINAPI
D3DDisassemble(const void *data
, SIZE_T data_size
, UINT flags
, const char *comments
, ID3DBlob
**blob
);
83 HRESULT WINAPI
D3DGetBlobPart(const void *data
, SIZE_T data_size
, D3D_BLOB_PART part
, UINT flags
, ID3DBlob
**blob
);
84 HRESULT WINAPI
D3DGetDebugInfo(const void *data
, SIZE_T data_size
, ID3DBlob
**blob
);
85 HRESULT WINAPI
D3DGetInputAndOutputSignatureBlob(const void *data
, SIZE_T data_size
, ID3DBlob
**blob
);
86 HRESULT WINAPI
D3DGetInputSignatureBlob(const void *data
, SIZE_T data_size
, ID3DBlob
**blob
);
87 HRESULT WINAPI
D3DGetOutputSignatureBlob(const void *data
, SIZE_T data_size
, ID3DBlob
**blob
);
88 HRESULT WINAPI
D3DPreprocess(const void *data
, SIZE_T size
, const char *filename
, const D3D_SHADER_MACRO
*macros
,
89 ID3DInclude
*include
, ID3DBlob
**shader
, ID3DBlob
**error_messages
);
90 HRESULT WINAPI
D3DReflect(const void *data
, SIZE_T data_size
, REFIID iid
, void **reflection
);
91 HRESULT WINAPI
D3DStripShader(const void *data
, SIZE_T data_size
, UINT flags
, ID3DBlob
**blob
);
93 typedef HRESULT (WINAPI
*pD3DDisassemble
)(const void *data
, SIZE_T data_size
,
94 UINT flags
, const char *comments
, ID3DBlob
**blob
);
96 #endif /* __D3DCOMPILER_H__ */
97 #endif /* __VKD3D_D3DCOMPILER_H */