| 1 |
/* |
| 2 |
* Copyright 2009 Henri Verbeet 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 |
import "d3d10.idl"; |
| 20 |
|
| 21 |
const unsigned int D3D10_SHADER_DEBUG = 0x00001; |
| 22 |
const unsigned int D3D10_SHADER_SKIP_VALIDATION = 0x00002; |
| 23 |
const unsigned int D3D10_SHADER_SKIP_OPTIMIZATION = 0x00004; |
| 24 |
const unsigned int D3D10_SHADER_PACK_MATRIX_ROW_MAJOR = 0x00008; |
| 25 |
const unsigned int D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR = 0x00010; |
| 26 |
const unsigned int D3D10_SHADER_PARTIAL_PRECISION = 0x00020; |
| 27 |
const unsigned int D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT = 0x00040; |
| 28 |
const unsigned int D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT = 0x00080; |
| 29 |
const unsigned int D3D10_SHADER_NO_PRESHADER = 0x00100; |
| 30 |
const unsigned int D3D10_SHADER_AVOID_FLOW_CONTROL = 0x00200; |
| 31 |
const unsigned int D3D10_SHADER_PREFER_FLOW_CONTROL = 0x00400; |
| 32 |
const unsigned int D3D10_SHADER_ENABLE_STRICTNESS = 0x00800; |
| 33 |
const unsigned int D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY = 0x01000; |
| 34 |
const unsigned int D3D10_SHADER_IEEE_STRICTNESS = 0x02000; |
| 35 |
const unsigned int D3D10_SHADER_WARNINGS_ARE_ERRORS = 0x40000; |
| 36 |
|
| 37 |
const unsigned int D3D10_SHADER_OPTIMIZATION_LEVEL0 = 0x04000; |
| 38 |
const unsigned int D3D10_SHADER_OPTIMIZATION_LEVEL1 = 0x00000; |
| 39 |
const unsigned int D3D10_SHADER_OPTIMIZATION_LEVEL2 = 0x0c000; |
| 40 |
const unsigned int D3D10_SHADER_OPTIMIZATION_LEVEL3 = 0x08000; |
| 41 |
|
| 42 |
typedef D3D_SHADER_MACRO D3D10_SHADER_MACRO; |
| 43 |
typedef D3D_SHADER_MACRO *LPD3D10_SHADER_MACRO; |
| 44 |
|
| 45 |
typedef D3D_SHADER_VARIABLE_CLASS D3D10_SHADER_VARIABLE_CLASS; |
| 46 |
typedef D3D_SHADER_VARIABLE_CLASS *LPD3D10_SHADER_VARIABLE_CLASS; |
| 47 |
|
| 48 |
typedef D3D_CBUFFER_TYPE D3D10_CBUFFER_TYPE; |
| 49 |
typedef D3D_CBUFFER_TYPE *LPD3D10_CBUFFER_TYPE; |
| 50 |
|
| 51 |
typedef D3D_REGISTER_COMPONENT_TYPE D3D10_REGISTER_COMPONENT_TYPE; |
| 52 |
|
| 53 |
typedef D3D_RESOURCE_RETURN_TYPE D3D10_RESOURCE_RETURN_TYPE; |
| 54 |
|
| 55 |
typedef D3D_NAME D3D10_NAME; |
| 56 |
|
| 57 |
typedef D3D_SHADER_INPUT_TYPE D3D10_SHADER_INPUT_TYPE; |
| 58 |
typedef D3D_SHADER_INPUT_TYPE *LPD3D10_SHADER_INPUT_TYPE; |
| 59 |
|
| 60 |
typedef D3D_SHADER_VARIABLE_TYPE D3D10_SHADER_VARIABLE_TYPE; |
| 61 |
typedef D3D_SHADER_VARIABLE_TYPE *LPD3D10_SHADER_VARIABLE_TYPE; |
| 62 |
|
| 63 |
typedef D3D_INCLUDE_TYPE D3D10_INCLUDE_TYPE; |
| 64 |
typedef ID3DInclude ID3D10Include; |
| 65 |
typedef ID3DInclude *LPD3D10INCLUDE; |
| 66 |
cpp_quote("#define IID_ID3D10Include IID_ID3DInclude") |
| 67 |
|
| 68 |
typedef struct _D3D10_SHADER_INPUT_BIND_DESC |
| 69 |
{ |
| 70 |
const char *Name; |
| 71 |
D3D10_SHADER_INPUT_TYPE Type; |
| 72 |
UINT BindPoint; |
| 73 |
UINT BindCount; |
| 74 |
UINT uFlags; |
| 75 |
D3D10_RESOURCE_RETURN_TYPE ReturnType; |
| 76 |
D3D10_SRV_DIMENSION Dimension; |
| 77 |
UINT NumSamples; |
| 78 |
} D3D10_SHADER_INPUT_BIND_DESC; |
| 79 |
|
| 80 |
typedef struct _D3D10_SIGNATURE_PARAMETER_DESC |
| 81 |
{ |
| 82 |
const char *SemanticName; |
| 83 |
UINT SemanticIndex; |
| 84 |
UINT Register; |
| 85 |
D3D10_NAME SystemValueType; |
| 86 |
D3D10_REGISTER_COMPONENT_TYPE ComponentType; |
| 87 |
BYTE Mask; |
| 88 |
BYTE ReadWriteMask; |
| 89 |
} D3D10_SIGNATURE_PARAMETER_DESC; |
| 90 |
|
| 91 |
typedef struct _D3D10_SHADER_DESC |
| 92 |
{ |
| 93 |
UINT Version; |
| 94 |
const char *Creator; |
| 95 |
UINT Flags; |
| 96 |
UINT ConstantBuffers; |
| 97 |
UINT BoundResources; |
| 98 |
UINT InputParameters; |
| 99 |
UINT OutputParameters; |
| 100 |
UINT InstructionCount; |
| 101 |
UINT TempRegisterCount; |
| 102 |
UINT TempArrayCount; |
| 103 |
UINT DefCount; |
| 104 |
UINT DclCount; |
| 105 |
UINT TextureNormalInstructions; |
| 106 |
UINT TextureLoadInstructions; |
| 107 |
UINT TextureCompInstructions; |
| 108 |
UINT TextureBiasInstructions; |
| 109 |
UINT TextureGradientInstructions; |
| 110 |
UINT FloatInstructionCount; |
| 111 |
UINT IntInstructionCount; |
| 112 |
UINT UintInstructionCount; |
| 113 |
UINT StaticFlowControlCount; |
| 114 |
UINT DynamicFlowControlCount; |
| 115 |
UINT MacroInstructionCount; |
| 116 |
UINT ArrayInstructionCount; |
| 117 |
UINT CutInstructionCount; |
| 118 |
UINT EmitInstructionCount; |
| 119 |
D3D10_PRIMITIVE_TOPOLOGY GSOutputTopology; |
| 120 |
UINT GSMaxOutputVertexCount; |
| 121 |
} D3D10_SHADER_DESC; |
| 122 |
|
| 123 |
typedef struct _D3D10_SHADER_BUFFER_DESC |
| 124 |
{ |
| 125 |
const char *Name; |
| 126 |
D3D10_CBUFFER_TYPE Type; |
| 127 |
UINT Variables; |
| 128 |
UINT Size; |
| 129 |
UINT uFlags; |
| 130 |
} D3D10_SHADER_BUFFER_DESC; |
| 131 |
|
| 132 |
typedef struct _D3D10_SHADER_VARIABLE_DESC |
| 133 |
{ |
| 134 |
const char *Name; |
| 135 |
UINT StartOffset; |
| 136 |
UINT Size; |
| 137 |
UINT uFlags; |
| 138 |
void *DefaultValue; |
| 139 |
} D3D10_SHADER_VARIABLE_DESC; |
| 140 |
|
| 141 |
typedef struct _D3D10_SHADER_TYPE_DESC |
| 142 |
{ |
| 143 |
D3D10_SHADER_VARIABLE_CLASS Class; |
| 144 |
D3D10_SHADER_VARIABLE_TYPE Type; |
| 145 |
UINT Rows; |
| 146 |
UINT Columns; |
| 147 |
UINT Elements; |
| 148 |
UINT Members; |
| 149 |
UINT Offset; |
| 150 |
} D3D10_SHADER_TYPE_DESC; |
| 151 |
|
| 152 |
[ |
| 153 |
local, |
| 154 |
object, |
| 155 |
uuid(c530ad7d-9b16-4395-a979-ba2ecff83add), |
| 156 |
] |
| 157 |
interface ID3D10ShaderReflectionType |
| 158 |
{ |
| 159 |
HRESULT GetDesc(D3D10_SHADER_TYPE_DESC *desc); |
| 160 |
ID3D10ShaderReflectionType *GetMemberTypeByIndex(UINT index); |
| 161 |
ID3D10ShaderReflectionType *GetMemberTypeByName(const char *name); |
| 162 |
const char *GetMemberTypeName(UINT index); |
| 163 |
}; |
| 164 |
|
| 165 |
[ |
| 166 |
local, |
| 167 |
object, |
| 168 |
uuid(1bf63c95-2650-405d-99c1-3636bd1da0a1), |
| 169 |
] |
| 170 |
interface ID3D10ShaderReflectionVariable |
| 171 |
{ |
| 172 |
HRESULT GetDesc(D3D10_SHADER_VARIABLE_DESC *desc); |
| 173 |
ID3D10ShaderReflectionType *GetType(); |
| 174 |
}; |
| 175 |
|
| 176 |
[ |
| 177 |
local, |
| 178 |
object, |
| 179 |
uuid(66c66a94-dddd-4b62-a66a-f0da33c2b4d0), |
| 180 |
] |
| 181 |
interface ID3D10ShaderReflectionConstantBuffer |
| 182 |
{ |
| 183 |
HRESULT GetDesc(D3D10_SHADER_BUFFER_DESC *desc); |
| 184 |
ID3D10ShaderReflectionVariable *GetVariableByIndex(UINT index); |
| 185 |
ID3D10ShaderReflectionVariable *GetVariableByName(const char *name); |
| 186 |
}; |
| 187 |
|
| 188 |
[ |
| 189 |
local, |
| 190 |
object, |
| 191 |
uuid(d40e20b6-f8f7-42ad-ab20-4baf8f15dfaa), |
| 192 |
] |
| 193 |
interface ID3D10ShaderReflection : IUnknown |
| 194 |
{ |
| 195 |
HRESULT GetDesc(D3D10_SHADER_DESC *desc); |
| 196 |
ID3D10ShaderReflectionConstantBuffer *GetConstantBufferByIndex(UINT index); |
| 197 |
ID3D10ShaderReflectionConstantBuffer *GetConstantBufferByName(const char *name); |
| 198 |
HRESULT GetResourceBindingDesc(UINT index, D3D10_SHADER_INPUT_BIND_DESC *desc); |
| 199 |
HRESULT GetInputParameterDesc(UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc); |
| 200 |
HRESULT GetOutputParameterDesc(UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc); |
| 201 |
}; |
| 202 |
|
| 203 |
|
| 204 |
HRESULT __stdcall D3D10CompileShader(const char *data, SIZE_T data_size, const char *filename, |
| 205 |
const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entrypoint, |
| 206 |
const char *profile, UINT flags, ID3D10Blob **shader, ID3D10Blob **error_messages); |
| 207 |
HRESULT __stdcall D3D10DisassembleShader(const void *data, SIZE_T data_size, |
| 208 |
BOOL color_code, const char *comments, ID3D10Blob **disassembly); |
| 209 |
const char * __stdcall D3D10GetVertexShaderProfile(ID3D10Device *device); |
| 210 |
const char * __stdcall D3D10GetGeometryShaderProfile(ID3D10Device *device); |
| 211 |
const char * __stdcall D3D10GetPixelShaderProfile(ID3D10Device *device); |
| 212 |
|
| 213 |
HRESULT __stdcall D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector); |
| 214 |
HRESULT __stdcall D3D10GetInputSignatureBlob(const void *data, SIZE_T data_size, ID3D10Blob **blob); |
| 215 |
HRESULT __stdcall D3D10GetOutputSignatureBlob(const void *data, SIZE_T data_size, ID3D10Blob **blob); |
| 216 |
HRESULT __stdcall D3D10GetInputAndOutputSignatureBlob(const void *data, SIZE_T data_size, ID3D10Blob **blob); |
| 217 |
HRESULT __stdcall D3D10GetShaderDebugInfo(const void *data, SIZE_T data_size, ID3D10Blob **blob); |