1 // Copyright © 2016, Peter Atashian
2 // Licensed under the MIT License <LICENSE.md>
4 ENUM
!{enum D3D11_SHADER_VERSION_TYPE
{
5 D3D11_SHVER_PIXEL_SHADER
= 0,
6 D3D11_SHVER_VERTEX_SHADER
= 1,
7 D3D11_SHVER_GEOMETRY_SHADER
= 2,
8 D3D11_SHVER_HULL_SHADER
= 3,
9 D3D11_SHVER_DOMAIN_SHADER
= 4,
10 D3D11_SHVER_COMPUTE_SHADER
= 5,
11 D3D11_SHVER_RESERVED0
= 0xFFF0,
13 pub const D3D_RETURN_PARAMETER_INDEX
: c_int
= -1;
14 pub type D3D11_RESOURCE_RETURN_TYPE
= D3D_RESOURCE_RETURN_TYPE
;
15 pub type D3D11_CBUFFER_TYPE
= D3D_CBUFFER_TYPE
;
16 STRUCT
!{struct D3D11_SIGNATURE_PARAMETER_DESC
{
20 SystemValueType
: D3D_NAME
,
21 ComponentType
: D3D_REGISTER_COMPONENT_TYPE
,
25 MinPrecision
: D3D_MIN_PRECISION
,
27 STRUCT
!{struct D3D11_SHADER_BUFFER_DESC
{
29 Type
: D3D_CBUFFER_TYPE
,
34 STRUCT
!{struct D3D11_SHADER_VARIABLE_DESC
{
45 STRUCT
!{struct D3D11_SHADER_TYPE_DESC
{
46 Class
: D3D_SHADER_VARIABLE_CLASS
,
47 Type
: D3D_SHADER_VARIABLE_TYPE
,
55 pub type D3D11_TESSELLATOR_DOMAIN
= D3D_TESSELLATOR_DOMAIN
;
56 pub type D3D11_TESSELLATOR_PARTITIONING
= D3D_TESSELLATOR_PARTITIONING
;
57 pub type D3D11_TESSELLATOR_OUTPUT_PRIMITIVE
= D3D_TESSELLATOR_OUTPUT_PRIMITIVE
;
58 STRUCT
!{struct D3D11_SHADER_DESC
{
62 ConstantBuffers
: UINT
,
64 InputParameters
: UINT
,
65 OutputParameters
: UINT
,
66 InstructionCount
: UINT
,
67 TempRegisterCount
: UINT
,
71 TextureNormalInstructions
: UINT
,
72 TextureLoadInstructions
: UINT
,
73 TextureCompInstructions
: UINT
,
74 TextureBiasInstructions
: UINT
,
75 TextureGradientInstructions
: UINT
,
76 FloatInstructionCount
: UINT
,
77 IntInstructionCount
: UINT
,
78 UintInstructionCount
: UINT
,
79 StaticFlowControlCount
: UINT
,
80 DynamicFlowControlCount
: UINT
,
81 MacroInstructionCount
: UINT
,
82 ArrayInstructionCount
: UINT
,
83 CutInstructionCount
: UINT
,
84 EmitInstructionCount
: UINT
,
85 GSOutputTopology
: D3D_PRIMITIVE_TOPOLOGY
,
86 GSMaxOutputVertexCount
: UINT
,
87 InputPrimitive
: D3D_PRIMITIVE
,
88 PatchConstantParameters
: UINT
,
89 cGSInstanceCount
: UINT
,
91 HSOutputPrimitive
: D3D_TESSELLATOR_OUTPUT_PRIMITIVE
,
92 HSPartitioning
: D3D_TESSELLATOR_PARTITIONING
,
93 TessellatorDomain
: D3D_TESSELLATOR_DOMAIN
,
94 cBarrierInstructions
: UINT
,
95 cInterlockedInstructions
: UINT
,
96 cTextureStoreInstructions
: UINT
,
98 STRUCT
!{struct D3D11_SHADER_INPUT_BIND_DESC
{
100 Type
: D3D_SHADER_INPUT_TYPE
,
104 ReturnType
: D3D_RESOURCE_RETURN_TYPE
,
105 Dimension
: D3D_SRV_DIMENSION
,
108 pub const D3D_SHADER_REQUIRES_DOUBLES
: UINT64
= 0x00000001;
109 pub const D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL
: UINT64
= 0x00000002;
110 pub const D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE
: UINT64
= 0x00000004;
111 pub const D3D_SHADER_REQUIRES_64_UAVS
: UINT64
= 0x00000008;
112 pub const D3D_SHADER_REQUIRES_MINIMUM_PRECISION
: UINT64
= 0x00000010;
113 pub const D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS
: UINT64
= 0x00000020;
114 pub const D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS
: UINT64
= 0x00000040;
115 pub const D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING
: UINT64
= 0x00000080;
116 pub const D3D_SHADER_REQUIRES_TILED_RESOURCES
: UINT64
= 0x00000100;
117 STRUCT
!{struct D3D11_LIBRARY_DESC
{
122 STRUCT
!{struct D3D11_FUNCTION_DESC
{
126 ConstantBuffers
: UINT
,
127 BoundResources
: UINT
,
128 InstructionCount
: UINT
,
129 TempRegisterCount
: UINT
,
130 TempArrayCount
: UINT
,
133 TextureNormalInstructions
: UINT
,
134 TextureLoadInstructions
: UINT
,
135 TextureCompInstructions
: UINT
,
136 TextureBiasInstructions
: UINT
,
137 TextureGradientInstructions
: UINT
,
138 FloatInstructionCount
: UINT
,
139 IntInstructionCount
: UINT
,
140 UintInstructionCount
: UINT
,
141 StaticFlowControlCount
: UINT
,
142 DynamicFlowControlCount
: UINT
,
143 MacroInstructionCount
: UINT
,
144 ArrayInstructionCount
: UINT
,
145 MovInstructionCount
: UINT
,
146 MovcInstructionCount
: UINT
,
147 ConversionInstructionCount
: UINT
,
148 BitwiseInstructionCount
: UINT
,
149 MinFeatureLevel
: D3D_FEATURE_LEVEL
,
150 RequiredFeatureFlags
: UINT64
,
152 FunctionParameterCount
: INT
,
154 Has10Level9VertexShader
: BOOL
,
155 Has10Level9PixelShader
: BOOL
,
157 STRUCT
!{struct D3D11_PARAMETER_DESC
{
159 SemanticName
: LPCSTR
,
160 Type
: D3D_SHADER_VARIABLE_TYPE
,
161 Class
: D3D_SHADER_VARIABLE_CLASS
,
164 InterpolationMode
: D3D_INTERPOLATION_MODE
,
165 Flags
: D3D_PARAMETER_FLAGS
,
166 FirstInRegister
: UINT
,
167 FirstInComponent
: UINT
,
168 FirstOutRegister
: UINT
,
169 FirstOutComponent
: UINT
,
171 RIDL
!{interface
ID3D11ShaderReflectionType(ID3D11ShaderReflectionTypeVtbl
) {
172 fn GetDesc(&mut self, pDesc
: *mut D3D11_SHADER_TYPE_DESC
) -> HRESULT
,
173 fn GetMemberTypeByIndex(&mut self, Index
: UINT
) -> *mut ID3D11ShaderReflectionType
,
174 fn GetMemberTypeByName(&mut self, Name
: LPCSTR
) -> *mut ID3D11ShaderReflectionType
,
175 fn GetMemberTypeName(&mut self, Index
: UINT
) -> LPCSTR
,
176 fn IsEqual(&mut self, pType
: *mut ID3D11ShaderReflectionType
) -> HRESULT
,
177 fn GetSubType(&mut self) -> *mut ID3D11ShaderReflectionType
,
178 fn GetBaseClass(&mut self) -> *mut ID3D11ShaderReflectionType
,
179 fn GetNumInterfaces(&mut self) -> UINT
,
180 fn GetInterfaceByIndex(&mut self, uIndex
: UINT
) -> *mut ID3D11ShaderReflectionType
,
181 fn IsOfType(&mut self, pType
: *mut ID3D11ShaderReflectionType
) -> HRESULT
,
182 fn ImplementsInterface(&mut self, pBase
: *mut ID3D11ShaderReflectionType
) -> HRESULT
184 RIDL
!{interface
ID3D11ShaderReflectionVariable(ID3D11ShaderReflectionVariableVtbl
) {
185 fn GetDesc(&mut self, pDesc
: *mut D3D11_SHADER_VARIABLE_DESC
) -> HRESULT
,
186 fn GetType(&mut self) -> *mut ID3D11ShaderReflectionType
,
187 fn GetBuffer(&mut self) -> *mut ID3D11ShaderReflectionConstantBuffer
,
188 fn GetInterfaceSlot(&mut self, uArrayIndex
: UINT
) -> UINT
190 RIDL
!{interface
ID3D11ShaderReflectionConstantBuffer(ID3D11ShaderReflectionConstantBufferVtbl
) {
191 fn GetDesc(&mut self, pDesc
: *mut D3D11_SHADER_BUFFER_DESC
) -> HRESULT
,
192 fn GetVariableByIndex(&mut self, Index
: UINT
) -> *mut ID3D11ShaderReflectionVariable
,
193 fn GetVariableByName(&mut self, Name
: LPCSTR
) -> *mut ID3D11ShaderReflectionVariable
195 RIDL
!{interface
ID3D11ShaderReflection(ID3D11ShaderReflectionVtbl
): IUnknown(IUnknownVtbl
) {
196 fn GetDesc(&mut self, pDesc
: *mut D3D11_SHADER_DESC
) -> HRESULT
,
197 fn GetConstantBufferByIndex(
198 &mut self, Index
: UINT
199 ) -> *mut ID3D11ShaderReflectionConstantBuffer
,
200 fn GetConstantBufferByName(
201 &mut self, Name
: LPCSTR
202 ) -> *mut ID3D11ShaderReflectionConstantBuffer
,
203 fn GetResourceBindingDesc(
204 &mut self, ResourceIndex
: UINT
, pDesc
: *mut D3D11_SHADER_INPUT_BIND_DESC
206 fn GetInputParameterDesc(
207 &mut self, ParameterIndex
: UINT
, pDesc
: *mut D3D11_SIGNATURE_PARAMETER_DESC
209 fn GetOutputParameterDesc(
210 &mut self, ParameterIndex
: UINT
, pDesc
: *mut D3D11_SIGNATURE_PARAMETER_DESC
212 fn GetPatchConstantParameterDesc(
213 &mut self, ParameterIndex
: UINT
, pDesc
: *mut D3D11_SIGNATURE_PARAMETER_DESC
215 fn GetVariableByName(&mut self, Name
: LPCSTR
) -> *mut ID3D11ShaderReflectionVariable
,
216 fn GetResourceBindingDescByName(
217 &mut self, Name
: LPCSTR
, pDesc
: *mut D3D11_SHADER_INPUT_BIND_DESC
219 fn GetMovInstructionCount(&mut self) -> UINT
,
220 fn GetMovcInstructionCount(&mut self) -> UINT
,
221 fn GetConversionInstructionCount(&mut self) -> UINT
,
222 fn GetBitwiseInstructionCount(&mut self) -> UINT
,
223 fn GetGSInputPrimitive(&mut self) -> D3D_PRIMITIVE
,
224 fn IsSampleFrequencyShader(&mut self) -> BOOL
,
225 fn GetNumInterfaceSlots(&mut self) -> UINT
,
226 fn GetMinFeatureLevel(&mut self, pLevel
: *mut D3D_FEATURE_LEVEL
) -> HRESULT
,
227 fn GetThreadGroupSize(
228 &mut self, pSizeX
: *mut UINT
, pSizeY
: *mut UINT
, pSizeZ
: *mut UINT
230 fn GetRequiresFlags(&mut self) -> UINT64
232 RIDL
!{interface
ID3D11LibraryReflection(ID3D11LibraryReflectionVtbl
): IUnknown(IUnknownVtbl
) {
233 fn GetDesc(&mut self, pDesc
: *mut D3D11_LIBRARY_DESC
) -> HRESULT
,
234 fn GetFunctionByIndex(&mut self, FunctionIndex
: INT
) -> *mut ID3D11FunctionReflection
236 RIDL
!{interface
ID3D11FunctionReflection(ID3D11FunctionReflectionVtbl
) {
237 fn GetDesc(&mut self, pDesc
: *mut D3D11_FUNCTION_DESC
) -> HRESULT
,
238 fn GetConstantBufferByIndex(
239 &mut self, BufferIndex
: UINT
240 ) -> *mut ID3D11ShaderReflectionConstantBuffer
,
241 fn GetConstantBufferByName(
242 &mut self, Name
: LPCSTR
243 ) -> *mut ID3D11ShaderReflectionConstantBuffer
,
244 fn GetResourceBindingDesc(
245 &mut self, ResourceIndex
: UINT
, pDesc
: *mut D3D11_SHADER_INPUT_BIND_DESC
247 fn GetVariableByName(&mut self, Name
: LPCSTR
) -> *mut ID3D11ShaderReflectionVariable
,
248 fn GetResourceBindingDescByName(
249 &mut self, Name
: LPCSTR
, pDesc
: *mut D3D11_SHADER_INPUT_BIND_DESC
251 fn GetFunctionParameter(
252 &mut self, ParameterIndex
: INT
253 ) -> *mut ID3D11FunctionParameterReflection
255 RIDL
!{interface
ID3D11FunctionParameterReflection(ID3D11FunctionParameterReflectionVtbl
) {
256 fn GetDesc(&mut self, pDesc
: *mut D3D11_PARAMETER_DESC
) -> HRESULT
258 RIDL
!{interface
ID3D11Module(ID3D11ModuleVtbl
): IUnknown(IUnknownVtbl
) {
260 &mut self, pNamespace
: LPCSTR
, ppModuleInstance
: *mut *mut ID3D11ModuleInstance
263 RIDL
!{interface
ID3D11ModuleInstance(ID3D11ModuleInstanceVtbl
): IUnknown(IUnknownVtbl
) {
264 fn BindConstantBuffer(&mut self, uSrcSlot
: UINT
, uDstSlot
: UINT
, cbDstOffset
: UINT
) -> HRESULT
,
265 fn BindConstantBufferByName(
266 &mut self, pName
: LPCSTR
, uDstSlot
: UINT
, cbDstOffset
: UINT
268 fn BindResource(&mut self, uSrcSlot
: UINT
, uDstSlot
: UINT
, uCount
: UINT
) -> HRESULT
,
269 fn BindResourceByName(&mut self, pName
: LPCSTR
, uDstSlot
: UINT
, uCount
: UINT
) -> HRESULT
,
270 fn BindSampler(&mut self, uSrcSlot
: UINT
, uDstSlot
: UINT
, uCount
: UINT
) -> HRESULT
,
271 fn BindSamplerByName(&mut self, pName
: LPCSTR
, uDstSlot
: UINT
, uCount
: UINT
) -> HRESULT
,
272 fn BindUnorderedAccessView(&mut self, uSrcSlot
: UINT
, uDstSlot
: UINT
, uCount
: UINT
) -> HRESULT
,
273 fn BindUnorderedAccessViewByName(
274 &mut self, pName
: LPCSTR
, uDstSlot
: UINT
, uCount
: UINT
276 fn BindResourceAsUnorderedAccessView(
277 &mut self, uSrcSrvSlot
: UINT
, uDstUavSlot
: UINT
, uCount
: UINT
279 fn BindResourceAsUnorderedAccessViewByName(
280 &mut self, pSrvName
: LPCSTR
, uDstUavSlot
: UINT
, uCount
: UINT
283 RIDL
!{interface
ID3D11Linker(ID3D11LinkerVtbl
): IUnknown(IUnknownVtbl
) {
285 &mut self, pEntry
: *mut ID3D11ModuleInstance
, pEntryName
: LPCSTR
, pTargetName
: LPCSTR
,
286 uFlags
: UINT
, ppShaderBlob
: *mut *mut ID3DBlob
, ppErrorBuffer
: *mut *mut ID3DBlob
288 fn UseLibrary(&mut self, pLibraryMI
: *mut ID3D11ModuleInstance
) -> HRESULT
,
289 fn AddClipPlaneFromCBuffer(&mut self, uCBufferSlot
: UINT
, uCBufferEntry
: UINT
) -> HRESULT
291 RIDL
!{interface ID3D11LinkingNode(ID3D11LinkingNodeVtbl): IUnknown(IUnknownVtbl) {}
}
292 RIDL
!{interface
ID3D11FunctionLinkingGraph(ID3D11FunctionLinkingGraphVtbl
): IUnknown(IUnknownVtbl
) {
293 fn CreateModuleInstance(
294 &mut self, ppModuleInstance
: *mut *mut ID3D11ModuleInstance
,
295 ppErrorBuffer
: *mut *mut ID3DBlob
297 fn SetInputSignature(
298 &mut self, pInputParameters
: *const D3D11_PARAMETER_DESC
, cInputParameters
: UINT
,
299 ppInputNode
: *mut *mut ID3D11LinkingNode
301 fn SetOutputSignature(
302 &mut self, pOutputParameters
: *const D3D11_PARAMETER_DESC
, cOutputParameters
: UINT
,
303 ppOutputNode
: *mut *mut ID3D11LinkingNode
306 &mut self, pModuleInstanceNamespace
: LPCSTR
,
307 pModuleWithFunctionPrototype
: *mut ID3D11Module
, pFunctionName
: LPCSTR
,
308 ppCallNode
: *mut *mut ID3D11LinkingNode
311 &mut self, pSrcNode
: *mut ID3D11LinkingNode
, SrcParameterIndex
: INT
,
312 pDstNode
: *mut ID3D11LinkingNode
, DstParameterIndex
: INT
314 fn PassValueWithSwizzle(
315 &mut self, pSrcNode
: *mut ID3D11LinkingNode
, SrcParameterIndex
: INT
, pSrcSwizzle
: LPCSTR
,
316 pDstNode
: *mut ID3D11LinkingNode
, DstParameterIndex
: INT
, pDstSwizzle
: LPCSTR
318 fn GetLastError(&mut self, ppErrorBuffer
: *mut *mut ID3DBlob
) -> HRESULT
,
319 fn GenerateHlsl(&mut self, uFlags
: UINT
, ppBuffer
: *mut *mut ID3DBlob
) -> HRESULT