| 1 |
/* |
| 2 |
* Copyright 2020 Paul Gofman 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 "oaidl.idl"; |
| 20 |
import "ocidl.idl"; |
| 21 |
import "d3dcommon.idl"; |
| 22 |
|
| 23 |
typedef enum D3D12_SHADER_VERSION_TYPE |
| 24 |
{ |
| 25 |
D3D12_SHVER_PIXEL_SHADER = 0x0, |
| 26 |
D3D12_SHVER_VERTEX_SHADER = 0x1, |
| 27 |
D3D12_SHVER_GEOMETRY_SHADER = 0x2, |
| 28 |
D3D12_SHVER_HULL_SHADER = 0x3, |
| 29 |
D3D12_SHVER_DOMAIN_SHADER = 0x4, |
| 30 |
D3D12_SHVER_COMPUTE_SHADER = 0x5, |
| 31 |
D3D12_SHVER_RESERVED0 = 0xfff0, |
| 32 |
} D3D12_SHADER_VERSION_TYPE; |
| 33 |
|
| 34 |
typedef struct _D3D12_SHADER_DESC |
| 35 |
{ |
| 36 |
UINT Version; |
| 37 |
const char *Creator; |
| 38 |
UINT Flags; |
| 39 |
UINT ConstantBuffers; |
| 40 |
UINT BoundResources; |
| 41 |
UINT InputParameters; |
| 42 |
UINT OutputParameters; |
| 43 |
UINT InstructionCount; |
| 44 |
UINT TempRegisterCount; |
| 45 |
UINT TempArrayCount; |
| 46 |
UINT DefCount; |
| 47 |
UINT DclCount; |
| 48 |
UINT TextureNormalInstructions; |
| 49 |
UINT TextureLoadInstructions; |
| 50 |
UINT TextureCompInstructions; |
| 51 |
UINT TextureBiasInstructions; |
| 52 |
UINT TextureGradientInstructions; |
| 53 |
UINT FloatInstructionCount; |
| 54 |
UINT IntInstructionCount; |
| 55 |
UINT UintInstructionCount; |
| 56 |
UINT StaticFlowControlCount; |
| 57 |
UINT DynamicFlowControlCount; |
| 58 |
UINT MacroInstructionCount; |
| 59 |
UINT ArrayInstructionCount; |
| 60 |
UINT CutInstructionCount; |
| 61 |
UINT EmitInstructionCount; |
| 62 |
D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; |
| 63 |
UINT GSMaxOutputVertexCount; |
| 64 |
D3D_PRIMITIVE InputPrimitive; |
| 65 |
UINT PatchConstantParameters; |
| 66 |
UINT cGSInstanceCount; |
| 67 |
UINT cControlPoints; |
| 68 |
D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; |
| 69 |
D3D_TESSELLATOR_PARTITIONING HSPartitioning; |
| 70 |
D3D_TESSELLATOR_DOMAIN TessellatorDomain; |
| 71 |
UINT cBarrierInstructions; |
| 72 |
UINT cInterlockedInstructions; |
| 73 |
UINT cTextureStoreInstructions; |
| 74 |
} D3D12_SHADER_DESC; |
| 75 |
|
| 76 |
typedef struct _D3D12_SHADER_VARIABLE_DESC |
| 77 |
{ |
| 78 |
const char *Name; |
| 79 |
UINT StartOffset; |
| 80 |
UINT Size; |
| 81 |
UINT uFlags; |
| 82 |
void *DefaultValue; |
| 83 |
UINT StartTexture; |
| 84 |
UINT TextureSize; |
| 85 |
UINT StartSampler; |
| 86 |
UINT SamplerSize; |
| 87 |
} D3D12_SHADER_VARIABLE_DESC; |
| 88 |
|
| 89 |
typedef struct _D3D12_SHADER_TYPE_DESC |
| 90 |
{ |
| 91 |
D3D_SHADER_VARIABLE_CLASS Class; |
| 92 |
D3D_SHADER_VARIABLE_TYPE Type; |
| 93 |
UINT Rows; |
| 94 |
UINT Columns; |
| 95 |
UINT Elements; |
| 96 |
UINT Members; |
| 97 |
UINT Offset; |
| 98 |
const char *Name; |
| 99 |
} D3D12_SHADER_TYPE_DESC; |
| 100 |
|
| 101 |
typedef struct _D3D12_SHADER_BUFFER_DESC |
| 102 |
{ |
| 103 |
const char *Name; |
| 104 |
D3D_CBUFFER_TYPE Type; |
| 105 |
UINT Variables; |
| 106 |
UINT Size; |
| 107 |
UINT uFlags; |
| 108 |
} D3D12_SHADER_BUFFER_DESC; |
| 109 |
|
| 110 |
typedef struct _D3D12_SHADER_INPUT_BIND_DESC |
| 111 |
{ |
| 112 |
const char *Name; |
| 113 |
D3D_SHADER_INPUT_TYPE Type; |
| 114 |
UINT BindPoint; |
| 115 |
UINT BindCount; |
| 116 |
UINT uFlags; |
| 117 |
D3D_RESOURCE_RETURN_TYPE ReturnType; |
| 118 |
D3D_SRV_DIMENSION Dimension; |
| 119 |
UINT NumSamples; |
| 120 |
UINT Space; |
| 121 |
UINT uID; |
| 122 |
} D3D12_SHADER_INPUT_BIND_DESC; |
| 123 |
|
| 124 |
typedef struct _D3D12_SIGNATURE_PARAMETER_DESC |
| 125 |
{ |
| 126 |
const char *SemanticName; |
| 127 |
UINT SemanticIndex; |
| 128 |
UINT Register; |
| 129 |
D3D_NAME SystemValueType; |
| 130 |
D3D_REGISTER_COMPONENT_TYPE ComponentType; |
| 131 |
BYTE Mask; |
| 132 |
BYTE ReadWriteMask; |
| 133 |
UINT Stream; |
| 134 |
D3D_MIN_PRECISION MinPrecision; |
| 135 |
} D3D12_SIGNATURE_PARAMETER_DESC; |
| 136 |
|
| 137 |
typedef struct _D3D12_PARAMETER_DESC |
| 138 |
{ |
| 139 |
const char *Name; |
| 140 |
const char *SemanticName; |
| 141 |
D3D_SHADER_VARIABLE_TYPE Type; |
| 142 |
D3D_SHADER_VARIABLE_CLASS Class; |
| 143 |
UINT Rows; |
| 144 |
UINT Columns; |
| 145 |
D3D_INTERPOLATION_MODE InterpolationMode; |
| 146 |
D3D_PARAMETER_FLAGS Flags; |
| 147 |
UINT FirstInRegister; |
| 148 |
UINT FirstInComponent; |
| 149 |
UINT FirstOutRegister; |
| 150 |
UINT FirstOutComponent; |
| 151 |
} D3D12_PARAMETER_DESC; |
| 152 |
|
| 153 |
typedef struct _D3D12_FUNCTION_DESC |
| 154 |
{ |
| 155 |
UINT Version; |
| 156 |
const char *Creator; |
| 157 |
UINT Flags; |
| 158 |
UINT ConstantBuffers; |
| 159 |
UINT BoundResources; |
| 160 |
UINT InstructionCount; |
| 161 |
UINT TempRegisterCount; |
| 162 |
UINT TempArrayCount; |
| 163 |
UINT DefCount; |
| 164 |
UINT DclCount; |
| 165 |
UINT TextureNormalInstructions; |
| 166 |
UINT TextureLoadInstructions; |
| 167 |
UINT TextureCompInstructions; |
| 168 |
UINT TextureBiasInstructions; |
| 169 |
UINT TextureGradientInstructions; |
| 170 |
UINT FloatInstructionCount; |
| 171 |
UINT IntInstructionCount; |
| 172 |
UINT UintInstructionCount; |
| 173 |
UINT StaticFlowControlCount; |
| 174 |
UINT DynamicFlowControlCount; |
| 175 |
UINT MacroInstructionCount; |
| 176 |
UINT ArrayInstructionCount; |
| 177 |
UINT MovInstructionCount; |
| 178 |
UINT MovcInstructionCount; |
| 179 |
UINT ConversionInstructionCount; |
| 180 |
UINT BitwiseInstructionCount; |
| 181 |
D3D_FEATURE_LEVEL MinFeatureLevel; |
| 182 |
UINT64 RequiredFeatureFlags; |
| 183 |
const char *Name; |
| 184 |
INT FunctionParameterCount; |
| 185 |
BOOL HasReturn; |
| 186 |
BOOL Has10Level9VertexShader; |
| 187 |
BOOL Has10Level9PixelShader; |
| 188 |
} D3D12_FUNCTION_DESC; |
| 189 |
|
| 190 |
typedef struct _D3D12_LIBRARY_DESC |
| 191 |
{ |
| 192 |
const char *Creator; |
| 193 |
UINT Flags; |
| 194 |
UINT FunctionCount; |
| 195 |
} D3D12_LIBRARY_DESC; |
| 196 |
|
| 197 |
interface ID3D12ShaderReflectionConstantBuffer; |
| 198 |
|
| 199 |
[ |
| 200 |
uuid(e913c351-783d-48ca-a1d1-4f306284ad56), |
| 201 |
object, |
| 202 |
local, |
| 203 |
] |
| 204 |
interface ID3D12ShaderReflectionType |
| 205 |
{ |
| 206 |
HRESULT GetDesc(D3D12_SHADER_TYPE_DESC *desc); |
| 207 |
ID3D12ShaderReflectionType *GetMemberTypeByIndex(UINT index); |
| 208 |
ID3D12ShaderReflectionType *GetMemberTypeByName(const char *name); |
| 209 |
const char *GetMemberTypeName(UINT index); |
| 210 |
HRESULT IsEqual(ID3D12ShaderReflectionType *type); |
| 211 |
ID3D12ShaderReflectionType *GetSubType(); |
| 212 |
ID3D12ShaderReflectionType *GetBaseClass(); |
| 213 |
UINT GetNumInterfaces(); |
| 214 |
ID3D12ShaderReflectionType *GetInterfaceByIndex(UINT index); |
| 215 |
HRESULT IsOfType(ID3D12ShaderReflectionType *type); |
| 216 |
HRESULT ImplementsInterface(ID3D12ShaderReflectionType *base); |
| 217 |
} |
| 218 |
|
| 219 |
[ |
| 220 |
uuid(8337a8a6-a216-444a-b2f4-314733a73aea), |
| 221 |
object, |
| 222 |
local, |
| 223 |
] |
| 224 |
interface ID3D12ShaderReflectionVariable |
| 225 |
{ |
| 226 |
HRESULT GetDesc(D3D12_SHADER_VARIABLE_DESC *desc); |
| 227 |
ID3D12ShaderReflectionType *GetType(); |
| 228 |
ID3D12ShaderReflectionConstantBuffer *GetBuffer(); |
| 229 |
UINT GetInterfaceSlot(UINT index); |
| 230 |
} |
| 231 |
|
| 232 |
[ |
| 233 |
uuid(c59598b4-48b3-4869-b9b1-b1618b14a8b7), |
| 234 |
object, |
| 235 |
local, |
| 236 |
] |
| 237 |
interface ID3D12ShaderReflectionConstantBuffer |
| 238 |
{ |
| 239 |
HRESULT GetDesc(D3D12_SHADER_BUFFER_DESC *desc); |
| 240 |
ID3D12ShaderReflectionVariable *GetVariableByIndex(UINT index); |
| 241 |
ID3D12ShaderReflectionVariable *GetVariableByName(const char *name); |
| 242 |
} |
| 243 |
|
| 244 |
[ |
| 245 |
uuid(5a58797d-a72c-478d-8ba2-efc6b0efe88e), |
| 246 |
object, |
| 247 |
local, |
| 248 |
] |
| 249 |
interface ID3D12ShaderReflection : IUnknown |
| 250 |
{ |
| 251 |
HRESULT GetDesc(D3D12_SHADER_DESC *desc); |
| 252 |
ID3D12ShaderReflectionConstantBuffer *GetConstantBufferByIndex(UINT index); |
| 253 |
ID3D12ShaderReflectionConstantBuffer *GetConstantBufferByName(const char *name); |
| 254 |
HRESULT GetResourceBindingDesc(UINT index, D3D12_SHADER_INPUT_BIND_DESC *desc); |
| 255 |
HRESULT GetInputParameterDesc(UINT index, D3D12_SIGNATURE_PARAMETER_DESC *desc); |
| 256 |
HRESULT GetOutputParameterDesc(UINT index, D3D12_SIGNATURE_PARAMETER_DESC *desc); |
| 257 |
HRESULT GetPatchConstantParameterDesc(UINT index, D3D12_SIGNATURE_PARAMETER_DESC *desc); |
| 258 |
ID3D12ShaderReflectionVariable *GetVariableByName(const char *name); |
| 259 |
HRESULT GetResourceBindingDescByName(const char *name, D3D12_SHADER_INPUT_BIND_DESC *desc); |
| 260 |
UINT GetMovInstructionCount(); |
| 261 |
UINT GetMovcInstructionCount(); |
| 262 |
UINT GetConversionInstructionCount(); |
| 263 |
UINT GetBitwiseInstructionCount(); |
| 264 |
D3D_PRIMITIVE GetGSInputPrimitive(); |
| 265 |
BOOL IsSampleFrequencyShader(); |
| 266 |
UINT GetNumInterfaceSlots(); |
| 267 |
HRESULT GetMinFeatureLevel(D3D_FEATURE_LEVEL *level); |
| 268 |
UINT GetThreadGroupSize(UINT *sizex, UINT *sizey, UINT *sizez); |
| 269 |
UINT64 GetRequiresFlags(); |
| 270 |
} |
| 271 |
|
| 272 |
[ |
| 273 |
uuid(ec25f42d-7006-4f2b-b33e-02cc3375733f), |
| 274 |
object, |
| 275 |
local, |
| 276 |
] |
| 277 |
interface ID3D12FunctionParameterReflection |
| 278 |
{ |
| 279 |
HRESULT GetDesc(D3D12_PARAMETER_DESC *desc); |
| 280 |
} |
| 281 |
|
| 282 |
[ |
| 283 |
uuid(1108795c-2772-4ba9-b2a8-d464dc7e2799), |
| 284 |
object, |
| 285 |
local, |
| 286 |
] |
| 287 |
interface ID3D12FunctionReflection |
| 288 |
{ |
| 289 |
HRESULT GetDesc(D3D12_FUNCTION_DESC *desc); |
| 290 |
ID3D12ShaderReflectionConstantBuffer *GetConstantBufferByIndex(UINT index); |
| 291 |
ID3D12ShaderReflectionConstantBuffer *GetConstantBufferByName(const char *name); |
| 292 |
HRESULT GetResourceBindingDesc(UINT index, D3D12_SHADER_INPUT_BIND_DESC *desc); |
| 293 |
ID3D12ShaderReflectionVariable *GetVariableByName(const char *name); |
| 294 |
HRESULT GetResourceBindingDescByName(const char *name, D3D12_SHADER_INPUT_BIND_DESC *desc); |
| 295 |
ID3D12FunctionParameterReflection *GetFunctionParameter(INT index); |
| 296 |
} |
| 297 |
|
| 298 |
[ |
| 299 |
uuid(8e349d19-54db-4a56-9dc9-119d87bdb804), |
| 300 |
object, |
| 301 |
local, |
| 302 |
] |
| 303 |
interface ID3D12LibraryReflection : IUnknown |
| 304 |
{ |
| 305 |
HRESULT GetDesc(D3D12_LIBRARY_DESC *desc); |
| 306 |
ID3D12FunctionReflection *GetFunctionByIndex(INT index); |
| 307 |
} |