blob: 43af26495824d836c9768e4d9209e4115f1d5233 [file] [log] [blame]
Matteo Bruni2d143352010-08-03 18:44:25 +02001/*
2 * Copyright 2010 Matteo Bruni for CodeWeavers
3 *
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.
8 *
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.
13 *
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
17 */
18
19#ifndef __D3DCOMPILER_H__
20#define __D3DCOMPILER_H__
21
22#include "d3d11shader.h"
23
24#define D3DCOMPILE_DEBUG 0x0001
25#define D3DCOMPILE_SKIP_VALIDATION 0x0002
26#define D3DCOMPILE_SKIP_OPTIMIZATION 0x0004
27#define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR 0x0008
28#define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR 0x0010
29#define D3DCOMPILE_PARTIAL_PRECISION 0x0020
30#define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT 0x0040
31#define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT 0x0080
32#define D3DCOMPILE_NO_PRESHADER 0x0100
33#define D3DCOMPILE_AVOID_FLOW_CONTROL 0x0200
34#define D3DCOMPILE_PREFER_FLOW_CONTROL 0x0400
35#define D3DCOMPILE_ENABLE_STRICTNESS 0x0800
36#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY 0x1000
37#define D3DCOMPILE_IEEE_STRICTNESS 0x2000
38#define D3DCOMPILE_OPTIMIZATION_LEVEL0 0x4000
39#define D3DCOMPILE_OPTIMIZATION_LEVEL1 0x0000
40#define D3DCOMPILE_OPTIMIZATION_LEVEL2 0xC000
41#define D3DCOMPILE_OPTIMIZATION_LEVEL3 0x8000
42#define D3DCOMPILE_WARNINGS_ARE_ERRORS 0x40000
43
Matteo Bruni390b4802010-08-21 03:00:47 +020044HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename,
45 const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint,
46 const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages);
47
Rico Schüller2c9b24b2010-10-12 19:25:26 +020048typedef enum D3DCOMPILER_STRIP_FLAGS
49{
50 D3DCOMPILER_STRIP_REFLECTION_DATA = 1,
51 D3DCOMPILER_STRIP_DEBUG_INFO = 2,
52 D3DCOMPILER_STRIP_TEST_BLOBS = 4,
53 D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff
54} D3DCOMPILER_STRIP_FLAGS;
55
56HRESULT WINAPI D3DStripShader(const void *data, SIZE_T data_size, UINT flags, ID3DBlob **blob);
57
Rico Schüller033fd442010-10-03 15:11:47 +020058typedef enum D3D_BLOB_PART
59{
60 D3D_BLOB_INPUT_SIGNATURE_BLOB,
61 D3D_BLOB_OUTPUT_SIGNATURE_BLOB,
62 D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB,
63 D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB,
64 D3D_BLOB_ALL_SIGNATURE_BLOB,
65 D3D_BLOB_DEBUG_INFO,
66 D3D_BLOB_LEGACY_SHADER,
67 D3D_BLOB_XNA_PREPASS_SHADER,
68 D3D_BLOB_XNA_SHADER,
69 D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000,
70 D3D_BLOB_TEST_COMPILE_DETAILS,
71 D3D_BLOB_TEST_COMPILE_PERF
72} D3D_BLOB_PART;
73
74HRESULT WINAPI D3DGetBlobPart(const void *data, SIZE_T data_size, D3D_BLOB_PART part, UINT flags, ID3DBlob **blob);
Rico Schüller59462012010-10-03 15:12:00 +020075HRESULT WINAPI D3DGetInputSignatureBlob(const void *data, SIZE_T data_size, ID3DBlob **blob);
Rico Schüller164dcc72010-10-03 15:12:06 +020076HRESULT WINAPI D3DGetOutputSignatureBlob(const void *data, SIZE_T data_size, ID3DBlob **blob);
Rico Schüller44679012010-10-03 15:12:12 +020077HRESULT WINAPI D3DGetInputAndOutputSignatureBlob(const void *data, SIZE_T data_size, ID3DBlob **blob);
Rico Schüllerd52f2b62010-10-03 15:12:17 +020078HRESULT WINAPI D3DGetDebugInfo(const void *data, SIZE_T data_size, ID3DBlob **blob);
Rico Schüller033fd442010-10-03 15:11:47 +020079
Rico Schüller02264a72010-11-01 22:18:24 +010080HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void **reflector);
81
Rico Schüller12d14c62010-08-19 21:33:32 +020082HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3DBlob **blob);
83
Matteo Bruni55043952010-09-09 18:41:39 +020084HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename,
85 const D3D_SHADER_MACRO *defines, ID3DInclude *include,
86 ID3DBlob **shader, ID3DBlob **error_messages);
87
Matteo Bruni2d143352010-08-03 18:44:25 +020088#endif