ReactOS 0.4.17-dev-966-gf06eace
d3dcompiler.h
Go to the documentation of this file.
1/*
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#include "d3d12shader.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#if defined(_MSC_VER) || defined(__MINGW32__)
30#define D3DCOMPILER_DLL_W L"d3dcompiler_47.dll"
31#else
32static const WCHAR D3DCOMPILER_DLL_W[] = {'d','3','d','c','o','m','p','i','l','e','r','_','4','7','.','d','l','l',0};
33#endif
34
35#define D3DCOMPILER_DLL_A "d3dcompiler_47.dll"
36#define D3DCOMPILER_DLL WINELIB_NAME_AW(D3DCOMPILER_DLL_)
37
38#ifndef D3D_COMPILER_VERSION
39#define D3D_COMPILER_VERSION 47
40#endif
41
42#define D3DCOMPILE_DEBUG 0x00000001
43#define D3DCOMPILE_SKIP_VALIDATION 0x00000002
44#define D3DCOMPILE_SKIP_OPTIMIZATION 0x00000004
45#define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR 0x00000008
46#define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR 0x00000010
47#define D3DCOMPILE_PARTIAL_PRECISION 0x00000020
48#define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT 0x00000040
49#define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT 0x00000080
50#define D3DCOMPILE_NO_PRESHADER 0x00000100
51#define D3DCOMPILE_AVOID_FLOW_CONTROL 0x00000200
52#define D3DCOMPILE_PREFER_FLOW_CONTROL 0x00000400
53#define D3DCOMPILE_ENABLE_STRICTNESS 0x00000800
54#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY 0x00001000
55#define D3DCOMPILE_IEEE_STRICTNESS 0x00002000
56#define D3DCOMPILE_OPTIMIZATION_LEVEL0 0x00004000
57#define D3DCOMPILE_OPTIMIZATION_LEVEL1 0x00000000
58#define D3DCOMPILE_OPTIMIZATION_LEVEL2 0x0000c000
59#define D3DCOMPILE_OPTIMIZATION_LEVEL3 0x00008000
60#define D3DCOMPILE_RESERVED16 0x00010000
61#define D3DCOMPILE_RESERVED17 0x00020000
62#define D3DCOMPILE_WARNINGS_ARE_ERRORS 0x00040000
63#define D3DCOMPILE_RESOURCES_MAY_ALIAS 0x00080000
64#define D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES 0x00100000
65#define D3DCOMPILE_ALL_RESOURCES_BOUND 0x00200000
66#define D3DCOMPILE_DEBUG_NAME_FOR_SOURCE 0x00400000
67#define D3DCOMPILE_DEBUG_NAME_FOR_BINARY 0x00800000
68
69#define D3DCOMPILE_EFFECT_CHILD_EFFECT 0x00000001
70#define D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS 0x00000002
71
72#define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_LATEST 0x00000000
73#define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_1_0 0x00000010
74#define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_1_1 0x00000020
75
76#define D3D_DISASM_ENABLE_COLOR_CODE 0x00000001
77#define D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS 0x00000002
78#define D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING 0x00000004
79#define D3D_DISASM_ENABLE_INSTRUCTION_CYCLE 0x00000008
80#define D3D_DISASM_DISABLE_DEBUG_INFO 0x00000010
81#define D3D_DISASM_ENABLE_INSTRUCTION_OFFSET 0x00000020
82#define D3D_DISASM_INSTRUCTION_ONLY 0x00000040
83#define D3D_DISASM_PRINT_HEX_LITERALS 0x00000080
84
85#define D3D_COMPILE_STANDARD_FILE_INCLUDE ((ID3DInclude *)(UINT_PTR)1)
86
87HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename,
88 const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint,
90typedef HRESULT (WINAPI *pD3DCompile)(const void *data, SIZE_T data_size, const char *filename,
91 const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint,
93HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename,
94 const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint,
95 const char *target, UINT sflags, UINT eflags, UINT secondary_flags,
96 const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader,
98
100{
108
109HRESULT WINAPI D3DStripShader(const void *data, SIZE_T data_size, UINT flags, ID3DBlob **blob);
110
111typedef enum D3D_BLOB_PART
112{
131
132HRESULT WINAPI D3DDisassemble(const void *data, SIZE_T data_size,
133 UINT flags, const char *comments, ID3DBlob **disassembly);
134typedef HRESULT (WINAPI *pD3DDisassemble)(const void *data, SIZE_T data_size,
135 UINT flags, const char *comments, ID3DBlob **disassembly);
137 const char *entrypoint, const char *target, UINT flags1, UINT flags2, ID3DBlob **code, ID3DBlob **errors);
138HRESULT WINAPI D3DGetBlobPart(const void *data, SIZE_T data_size, D3D_BLOB_PART part, UINT flags, ID3DBlob **blob);
142HRESULT WINAPI D3DGetDebugInfo(const void *data, SIZE_T data_size, ID3DBlob **blob);
145HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void **reflector);
146
148
149HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename,
152typedef HRESULT (WINAPI *pD3DPreprocess)(const void *data, SIZE_T size, const char *filename,
155
156HRESULT WINAPI D3DCreateLinker(ID3D11Linker **linker);
157HRESULT WINAPI D3DLoadModule(const void *data, SIZE_T size, ID3D11Module **module);
158
159#ifdef __cplusplus
160}
161#endif
162
163#endif
HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: compiler.c:652
HRESULT WINAPI D3DGetInputSignatureBlob(const void *data, SIZE_T data_size, ID3DBlob **blob)
Definition: blob.c:421
HRESULT(WINAPI * pD3DPreprocess)(const void *data, SIZE_T size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: d3dcompiler.h:152
HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: compiler.c:639
HRESULT WINAPI D3DGetBlobPart(const void *data, SIZE_T data_size, D3D_BLOB_PART part, UINT flags, ID3DBlob **blob)
Definition: blob.c:413
HRESULT WINAPI D3DWriteBlobToFile(ID3DBlob *blob, const WCHAR *filename, BOOL overwrite)
Definition: blob.c:509
HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3DBlob **blob)
Definition: blob.c:133
HRESULT WINAPI D3DGetOutputSignatureBlob(const void *data, SIZE_T data_size, ID3DBlob **blob)
Definition: blob.c:428
HRESULT WINAPI D3DGetDebugInfo(const void *data, SIZE_T data_size, ID3DBlob **blob)
Definition: blob.c:442
HRESULT(WINAPI * pD3DDisassemble)(const void *data, SIZE_T data_size, UINT flags, const char *comments, ID3DBlob **disassembly)
Definition: d3dcompiler.h:134
D3D_BLOB_PART
Definition: d3dcompiler.h:112
@ D3D_BLOB_ALL_SIGNATURE_BLOB
Definition: d3dcompiler.h:117
@ D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB
Definition: d3dcompiler.h:115
@ D3D_BLOB_DEBUG_NAME
Definition: d3dcompiler.h:125
@ D3D_BLOB_TEST_COMPILE_PERF
Definition: d3dcompiler.h:128
@ D3D_BLOB_ROOT_SIGNATURE
Definition: d3dcompiler.h:124
@ D3D_BLOB_TEST_ALTERNATE_SHADER
Definition: d3dcompiler.h:126
@ D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB
Definition: d3dcompiler.h:116
@ D3D_BLOB_XNA_SHADER
Definition: d3dcompiler.h:121
@ D3D_BLOB_PRIVATE_DATA
Definition: d3dcompiler.h:123
@ D3D_BLOB_TEST_COMPILE_DETAILS
Definition: d3dcompiler.h:127
@ D3D_BLOB_INPUT_SIGNATURE_BLOB
Definition: d3dcompiler.h:113
@ D3D_BLOB_OUTPUT_SIGNATURE_BLOB
Definition: d3dcompiler.h:114
@ D3D_BLOB_DEBUG_INFO
Definition: d3dcompiler.h:118
@ D3D_BLOB_TEST_COMPILE_REPORT
Definition: d3dcompiler.h:129
@ D3D_BLOB_PDB
Definition: d3dcompiler.h:122
@ D3D_BLOB_XNA_PREPASS_SHADER
Definition: d3dcompiler.h:120
@ D3D_BLOB_LEGACY_SHADER
Definition: d3dcompiler.h:119
HRESULT WINAPI D3DDisassemble(const void *data, SIZE_T data_size, UINT flags, const char *comments, ID3DBlob **disassembly)
Definition: compiler.c:668
HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, UINT secondary_flags, const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: compiler.c:451
HRESULT WINAPI D3DGetInputAndOutputSignatureBlob(const void *data, SIZE_T data_size, ID3DBlob **blob)
Definition: blob.c:435
D3DCOMPILER_STRIP_FLAGS
Definition: d3dcompiler.h:100
@ D3DCOMPILER_STRIP_TEST_BLOBS
Definition: d3dcompiler.h:103
@ D3DCOMPILER_STRIP_DEBUG_INFO
Definition: d3dcompiler.h:102
@ D3DCOMPILER_STRIP_ROOT_SIGNATURE
Definition: d3dcompiler.h:105
@ D3DCOMPILER_STRIP_FORCE_DWORD
Definition: d3dcompiler.h:106
@ D3DCOMPILER_STRIP_PRIVATE_DATA
Definition: d3dcompiler.h:104
@ D3DCOMPILER_STRIP_REFLECTION_DATA
Definition: d3dcompiler.h:101
HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void **reflector)
static const WCHAR D3DCOMPILER_DLL_W[]
Definition: d3dcompiler.h:32
HRESULT(WINAPI * pD3DCompile)(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: d3dcompiler.h:90
HRESULT WINAPI D3DLoadModule(const void *data, SIZE_T size, ID3D11Module **module)
Definition: compiler.c:796
HRESULT WINAPI D3DCompileFromFile(const WCHAR *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *includes, const char *entrypoint, const char *target, UINT flags1, UINT flags2, ID3DBlob **code, ID3DBlob **errors)
Definition: compiler.c:743
HRESULT WINAPI D3DStripShader(const void *data, SIZE_T data_size, UINT flags, ID3DBlob **blob)
Definition: blob.c:449
HRESULT WINAPI D3DCreateLinker(ID3D11Linker **linker)
Definition: compiler.c:790
HRESULT WINAPI D3DReadFileToBlob(const WCHAR *filename, ID3DBlob **contents)
Definition: blob.c:456
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:31
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:32
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:31
char comments[4096]
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLuint shader
Definition: glext.h:6030
GLbitfield flags
Definition: glext.h:7161
unsigned int UINT
Definition: sysinfo.c:13
REFIID riid
Definition: atlbase.h:39
const char * filename
Definition: ioapi.h:137
static const char * contents
Definition: parser.c:511
short WCHAR
Definition: pedump.c:58
#define REFIID
Definition: guiddef.h:118
Definition: image.c:229
Definition: inflate.c:139
Definition: tools.h:99
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
static struct strarray includes
Definition: wpp.c:57