2 * Copyright 2009 Henri Verbeet for CodeWeavers
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.
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.
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
20 import
"d3d10shader.idl";
22 interface ID3D10EffectConstantBuffer
;
23 interface ID3D10EffectBlendVariable
;
24 interface ID3D10EffectDepthStencilVariable
;
25 interface ID3D10EffectDepthStencilViewVariable
;
26 interface ID3D10EffectMatrixVariable
;
27 interface ID3D10EffectPass
;
28 interface ID3D10EffectRasterizerVariable
;
29 interface ID3D10EffectRenderTargetViewVariable
;
30 interface ID3D10EffectSamplerVariable
;
31 interface ID3D10EffectScalarVariable
;
32 interface ID3D10EffectShaderVariable
;
33 interface ID3D10EffectShaderResourceVariable
;
34 interface ID3D10EffectStringVariable
;
35 interface ID3D10EffectVectorVariable
;
37 #ifndef D3D10_BYTES_FROM_BITS
38 #define D3D10_BYTES_FROM_BITS
(x
) (((x
) + 7) >> 3)
40 cpp_quote
("#ifndef D3D10_BYTES_FROM_BITS")
41 cpp_quote
("#define D3D10_BYTES_FROM_BITS(x) (((x) + 7) >> 3)")
44 const unsigned int D3D10_EFFECT_VARIABLE_POOLED
= 0x1;
45 const unsigned int D3D10_EFFECT_VARIABLE_ANNOTATION
= 0x2;
46 const unsigned int D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT
= 0x4;
48 typedef enum _D3D10_DEVICE_STATE_TYPES
50 D3D10_DST_SO_BUFFERS
= 1,
51 D3D10_DST_OM_RENDER_TARGETS
,
52 D3D10_DST_OM_DEPTH_STENCIL_STATE
,
53 D3D10_DST_OM_BLEND_STATE
,
55 D3D10_DST_VS_SAMPLERS
,
56 D3D10_DST_VS_SHADER_RESOURCES
,
57 D3D10_DST_VS_CONSTANT_BUFFERS
,
59 D3D10_DST_GS_SAMPLERS
,
60 D3D10_DST_GS_SHADER_RESOURCES
,
61 D3D10_DST_GS_CONSTANT_BUFFERS
,
63 D3D10_DST_PS_SAMPLERS
,
64 D3D10_DST_PS_SHADER_RESOURCES
,
65 D3D10_DST_PS_CONSTANT_BUFFERS
,
66 D3D10_DST_IA_VERTEX_BUFFERS
,
67 D3D10_DST_IA_INDEX_BUFFER
,
68 D3D10_DST_IA_INPUT_LAYOUT
,
69 D3D10_DST_IA_PRIMITIVE_TOPOLOGY
,
70 D3D10_DST_RS_VIEWPORTS
,
71 D3D10_DST_RS_SCISSOR_RECTS
,
72 D3D10_DST_RS_RASTERIZER_STATE
,
73 D3D10_DST_PREDICATION
,
74 } D3D10_DEVICE_STATE_TYPES
;
76 typedef struct _D3D10_EFFECT_TYPE_DESC
79 D3D10_SHADER_VARIABLE_CLASS Class
;
80 D3D10_SHADER_VARIABLE_TYPE Type
;
88 } D3D10_EFFECT_TYPE_DESC
;
90 typedef struct _D3D10_EFFECT_VARIABLE_DESC
97 UINT ExplicitBindPoint
;
98 } D3D10_EFFECT_VARIABLE_DESC
;
100 typedef struct _D3D10_TECHNIQUE_DESC
105 } D3D10_TECHNIQUE_DESC
;
107 typedef struct _D3D10_STATE_BLOCK_MASK
110 BYTE VSSamplers
[D3D10_BYTES_FROM_BITS
(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT
)];
111 BYTE VSShaderResources
[D3D10_BYTES_FROM_BITS
(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
)];
112 BYTE VSConstantBuffers
[D3D10_BYTES_FROM_BITS
(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT
)];
114 BYTE GSSamplers
[D3D10_BYTES_FROM_BITS
(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT
)];
115 BYTE GSShaderResources
[D3D10_BYTES_FROM_BITS
(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
)];
116 BYTE GSConstantBuffers
[D3D10_BYTES_FROM_BITS
(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT
)];
118 BYTE PSSamplers
[D3D10_BYTES_FROM_BITS
(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT
)];
119 BYTE PSShaderResources
[D3D10_BYTES_FROM_BITS
(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
)];
120 BYTE PSConstantBuffers
[D3D10_BYTES_FROM_BITS
(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT
)];
121 BYTE IAVertexBuffers
[D3D10_BYTES_FROM_BITS
(D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT
)];
124 BYTE IAPrimitiveTopology
;
125 BYTE OMRenderTargets
;
126 BYTE OMDepthStencilState
;
130 BYTE RSRasterizerState
;
133 } D3D10_STATE_BLOCK_MASK
;
135 typedef struct _D3D10_EFFECT_DESC
138 UINT ConstantBuffers
;
139 UINT SharedConstantBuffers
;
140 UINT GlobalVariables
;
141 UINT SharedGlobalVariables
;
145 typedef struct _D3D10_EFFECT_SHADER_DESC
147 const BYTE *pInputSignature
;
149 const BYTE *pBytecode
;
152 UINT NumInputSignatureEntries
;
153 UINT NumOutputSignatureEntries
;
154 } D3D10_EFFECT_SHADER_DESC
;
156 typedef struct _D3D10_PASS_DESC
160 BYTE *pIAInputSignature
;
161 SIZE_T IAInputSignatureSize
;
164 FLOAT BlendFactor
[4];
167 typedef struct _D3D10_PASS_SHADER_DESC
169 ID3D10EffectShaderVariable
*pShaderVariable
;
171 } D3D10_PASS_SHADER_DESC
;
173 const unsigned int D3D10_EFFECT_COMPILE_CHILD_EFFECT
= 0x0001;
174 const unsigned int D3D10_EFFECT_COMPILE_ALLOW_SLOW_OPS
= 0x0002;
175 const unsigned int D3D10_EFFECT_SINGLE_THREADED
= 0x0008;
180 uuid(4e9e1ddc
-cd9d
-4772-a837
-00180b9b88fd
),
182 interface ID3D10EffectType
185 HRESULT GetDesc
(D3D10_EFFECT_TYPE_DESC
*desc
);
186 ID3D10EffectType
*GetMemberTypeByIndex
(UINT index
);
187 ID3D10EffectType
*GetMemberTypeByName
(const char *name
);
188 ID3D10EffectType
*GetMemberTypeBySemantic
(const char *semantic
);
189 const char *GetMemberName
(UINT index
);
190 const char *GetMemberSemantic
(UINT index
);
196 uuid(ae897105
-00e6
-45bf
-bb8e
-281dd6db8e1b
),
198 interface ID3D10EffectVariable
201 ID3D10EffectType
*GetType
();
202 HRESULT GetDesc
(D3D10_EFFECT_VARIABLE_DESC
*desc
);
203 ID3D10EffectVariable
*GetAnnotationByIndex
(UINT index
);
204 ID3D10EffectVariable
*GetAnnotationByName
(const char *name
);
205 ID3D10EffectVariable
*GetMemberByIndex
(UINT index
);
206 ID3D10EffectVariable
*GetMemberByName
(const char *name
);
207 ID3D10EffectVariable
*GetMemberBySemantic
(const char *semantic
);
208 ID3D10EffectVariable
*GetElement
(UINT index
);
209 ID3D10EffectConstantBuffer
*GetParentConstantBuffer
();
210 ID3D10EffectScalarVariable
*AsScalar
();
211 ID3D10EffectVectorVariable
*AsVector
();
212 ID3D10EffectMatrixVariable
*AsMatrix
();
213 ID3D10EffectStringVariable
*AsString
();
214 ID3D10EffectShaderResourceVariable
*AsShaderResource
();
215 ID3D10EffectRenderTargetViewVariable
*AsRenderTargetView
();
216 ID3D10EffectDepthStencilViewVariable
*AsDepthStencilView
();
217 ID3D10EffectConstantBuffer
*AsConstantBuffer
();
218 ID3D10EffectShaderVariable
*AsShader
();
219 ID3D10EffectBlendVariable
*AsBlend
();
220 ID3D10EffectDepthStencilVariable
*AsDepthStencil
();
221 ID3D10EffectRasterizerVariable
*AsRasterizer
();
222 ID3D10EffectSamplerVariable
*AsSampler
();
223 HRESULT SetRawValue
(void *data
, UINT offset
, UINT count
);
224 HRESULT GetRawValue
(void *data
, UINT offset
, UINT count
);
230 uuid(56648f4d
-cc8b
-4444-a5ad
-b5a3d76e91b3
),
232 interface ID3D10EffectConstantBuffer
: ID3D10EffectVariable
234 HRESULT SetConstantBuffer
(ID3D10Buffer
*buffer
);
235 HRESULT GetConstantBuffer
(ID3D10Buffer
**buffer
);
236 HRESULT SetTextureBuffer
(ID3D10ShaderResourceView
*view
);
237 HRESULT GetTextureBuffer
(ID3D10ShaderResourceView
**view
);
243 uuid(00e48f7b
-d2c8
-49e8
-a86c
-022dee53431f
),
245 interface ID3D10EffectScalarVariable
: ID3D10EffectVariable
247 HRESULT SetFloat
(float value
);
248 HRESULT GetFloat
(float *value
);
249 HRESULT SetFloatArray
(float *values
, UINT offset
, UINT count
);
250 HRESULT GetFloatArray
(float *values
, UINT offset
, UINT count
);
251 HRESULT SetInt
(int value
);
252 HRESULT GetInt
(int *value
);
253 HRESULT SetIntArray
(int *values
, UINT offset
, UINT count
);
254 HRESULT GetIntArray
(int *values
, UINT offset
, UINT count
);
255 HRESULT SetBool
(BOOL value
);
256 HRESULT GetBool
(BOOL
*value
);
257 HRESULT SetBoolArray
(BOOL
*values
, UINT offset
, UINT count
);
258 HRESULT GetBoolArray
(BOOL
*values
, UINT offset
, UINT count
);
264 uuid(62b98c44
-1f82
-4c67
-bcd0
-72cf8f217e81
),
266 interface ID3D10EffectVectorVariable
: ID3D10EffectVariable
268 HRESULT SetBoolVector
(BOOL
*value
);
269 HRESULT SetIntVector
(int *value
);
270 HRESULT SetFloatVector
(float *value
);
271 HRESULT GetBoolVector
(BOOL
*value
);
272 HRESULT GetIntVector
(int *value
);
273 HRESULT GetFloatVector
(float *value
);
274 HRESULT SetBoolVectorArray
(BOOL
*values
, UINT offset
, UINT count
);
275 HRESULT SetIntVectorArray
(int *values
, UINT offset
, UINT count
);
276 HRESULT SetFloatVectorArray
(float *values
, UINT offset
, UINT count
);
277 HRESULT GetBoolVectorArray
(BOOL
*values
, UINT offset
, UINT count
);
278 HRESULT GetIntVectorArray
(int *values
, UINT offset
, UINT count
);
279 HRESULT GetFloatVectorArray
(float *values
, UINT offset
, UINT count
);
285 uuid(50666c24
-b82f
-4eed
-a172
-5b6e7e8522e0
),
287 interface ID3D10EffectMatrixVariable
: ID3D10EffectVariable
289 HRESULT SetMatrix
(float *data
);
290 HRESULT GetMatrix
(float *data
);
291 HRESULT SetMatrixArray
(float *data
, UINT offset
, UINT count
);
292 HRESULT GetMatrixArray
(float *data
, UINT offset
, UINT count
);
293 HRESULT SetMatrixTranspose
(float *data
);
294 HRESULT GetMatrixTranspose
(float *data
);
295 HRESULT SetMatrixTransposeArray
(float *data
, UINT offset
, UINT count
);
296 HRESULT GetMatrixTransposeArray
(float *data
, UINT offset
, UINT count
);
302 uuid(71417501-8df9
-4e0a
-a78a
-255f9756baff
),
304 interface ID3D10EffectStringVariable
: ID3D10EffectVariable
306 HRESULT GetString
(const char **str
);
307 HRESULT GetStringArray
(const char **strs
, UINT offset
, UINT count
);
313 uuid(c0a7157b
-d872
-4b1d
-8073-efc2acd4b1fc
),
315 interface ID3D10EffectShaderResourceVariable
: ID3D10EffectVariable
317 HRESULT SetResource
(ID3D10ShaderResourceView
*resource
);
318 HRESULT GetResource
(ID3D10ShaderResourceView
**resource
);
319 HRESULT SetResourceArray
(ID3D10ShaderResourceView
**resources
, UINT offset
, UINT count
);
320 HRESULT GetResourceArray
(ID3D10ShaderResourceView
**resources
, UINT offset
, UINT count
);
326 uuid(28ca0cc3
-c2c9
-40bb
-b57f
-67b737122b17
),
328 interface ID3D10EffectRenderTargetViewVariable
: ID3D10EffectVariable
330 HRESULT SetRenderTarget
(ID3D10RenderTargetView
*view
);
331 HRESULT GetRenderTarget
(ID3D10RenderTargetView
**view
);
332 HRESULT SetRenderTargetArray
(ID3D10RenderTargetView
**views
, UINT offset
, UINT count
);
333 HRESULT GetRenderTargetArray
(ID3D10RenderTargetView
**views
, UINT offset
, UINT count
);
339 uuid(3e02c918
-cc79
-4985-b622
-2d92ad701623
),
341 interface ID3D10EffectDepthStencilViewVariable
: ID3D10EffectVariable
343 HRESULT SetDepthStencil
(ID3D10DepthStencilView
*view
);
344 HRESULT GetDepthStencil
(ID3D10DepthStencilView
**view
);
345 HRESULT SetDepthStencilArray
(ID3D10DepthStencilView
**views
, UINT offset
, UINT count
);
346 HRESULT GetDepthStencilArray
(ID3D10DepthStencilView
**views
, UINT offset
, UINT count
);
352 uuid(80849279-c799
-4797-8c33
-0407a07d9e06
),
354 interface ID3D10EffectShaderVariable
: ID3D10EffectVariable
356 HRESULT GetShaderDesc
(UINT index
, D3D10_EFFECT_SHADER_DESC
*desc
);
357 HRESULT GetVertexShader
(UINT index
, ID3D10VertexShader
**shader
);
358 HRESULT GetGeometryShader
(UINT index
, ID3D10GeometryShader
**shader
);
359 HRESULT GetPixelShader
(UINT index
, ID3D10PixelShader
**shader
);
360 HRESULT GetInputSignatureElementDesc
(UINT shader_index
, UINT element_index
,
361 D3D10_SIGNATURE_PARAMETER_DESC
*desc
);
362 HRESULT GetOutputSignatureElementDesc
(UINT shader_index
, UINT element_index
,
363 D3D10_SIGNATURE_PARAMETER_DESC
*desc
);
369 uuid(1fcd2294
-df6d
-4eae
-86b3
-0e9160cfb07b
),
371 interface ID3D10EffectBlendVariable
: ID3D10EffectVariable
373 HRESULT GetBlendState
(UINT index
, ID3D10BlendState
**blend_state
);
374 HRESULT GetBackingStore
(UINT index
, D3D10_BLEND_DESC
*desc
);
380 uuid(af482368
-330a
-46a5
-9a5c
-01c71af24c8d
),
382 interface ID3D10EffectDepthStencilVariable
: ID3D10EffectVariable
384 HRESULT GetDepthStencilState
(UINT index
, ID3D10DepthStencilState
**depth_stencil_state
);
385 HRESULT GetBackingStore
(UINT index
, D3D10_DEPTH_STENCIL_DESC
*desc
);
391 uuid(21af9f0e
-4d94
-4ea9
-9785-2cb76b8c0b34
),
393 interface ID3D10EffectRasterizerVariable
: ID3D10EffectVariable
395 HRESULT GetRasterizerState
(UINT index
, ID3D10RasterizerState
**rasterizer_state
);
396 HRESULT GetBackingStore
(UINT index
, D3D10_RASTERIZER_DESC
*desc
);
402 uuid(6530d5c7
-07e9
-4271-a418
-e7ce4bd1e480
),
404 interface ID3D10EffectSamplerVariable
: ID3D10EffectVariable
406 HRESULT GetSampler
(UINT index
, ID3D10SamplerState
**sampler
);
407 HRESULT GetBackingStore
(UINT index
, D3D10_SAMPLER_DESC
*desc
);
413 uuid(db122ce8
-d1c9
-4292-b237
-24ed3de8b175
),
415 interface ID3D10EffectTechnique
418 HRESULT GetDesc
(D3D10_TECHNIQUE_DESC
*desc
);
419 ID3D10EffectVariable
*GetAnnotationByIndex
(UINT index
);
420 ID3D10EffectVariable
*GetAnnotationByName
(const char *name
);
421 ID3D10EffectPass
*GetPassByIndex
(UINT index
);
422 ID3D10EffectPass
*GetPassByName
(const char *name
);
423 HRESULT ComputeStateBlockMask
(D3D10_STATE_BLOCK_MASK
*mask
);
429 uuid(51b0ca8b
-ec0b
-4519-870d
-8ee1cb5017c7
),
431 interface ID3D10Effect
: IUnknown
435 HRESULT GetDevice
(ID3D10Device
**device
);
436 HRESULT GetDesc
(D3D10_EFFECT_DESC
*desc
);
437 ID3D10EffectConstantBuffer
*GetConstantBufferByIndex
(UINT index
);
438 ID3D10EffectConstantBuffer
*GetConstantBufferByName
(const char *name
);
439 ID3D10EffectVariable
*GetVariableByIndex
(UINT index
);
440 ID3D10EffectVariable
*GetVariableByName
(const char *name
);
441 ID3D10EffectVariable
*GetVariableBySemantic
(const char *semantic
);
442 ID3D10EffectTechnique
*GetTechniqueByIndex
(UINT index
);
443 ID3D10EffectTechnique
*GetTechniqueByName
(const char *name
);
451 uuid(9537ab04
-3250-412e-8213-fcd2f8677933
),
453 interface ID3D10EffectPool
: IUnknown
455 ID3D10Effect
*AsEffect
();
461 uuid(5cfbeb89
-1a06
-46e0
-b282
-e3f9bfa36a54
),
463 interface ID3D10EffectPass
466 HRESULT GetDesc
(D3D10_PASS_DESC
*desc
);
467 HRESULT GetVertexShaderDesc
(D3D10_PASS_SHADER_DESC
*desc
);
468 HRESULT GetGeometryShaderDesc
(D3D10_PASS_SHADER_DESC
*desc
);
469 HRESULT GetPixelShaderDesc
(D3D10_PASS_SHADER_DESC
*desc
);
470 ID3D10EffectVariable
*GetAnnotationByIndex
(UINT index
);
471 ID3D10EffectVariable
*GetAnnotationByName
(const char *name
);
472 HRESULT Apply
(UINT flags
);
473 HRESULT ComputeStateBlockMask
(D3D10_STATE_BLOCK_MASK
*mask
);
479 uuid(0803425a
-57f5
-4dd6
-9465-a87570834a08
),
481 interface ID3D10StateBlock
: IUnknown
485 HRESULT ReleaseAllDeviceObjects
();
486 HRESULT GetDevice
(ID3D10Device
**device
);
489 HRESULT __stdcall D3D10CompileEffectFromMemory
(void *data
, SIZE_T data_size
, const char *filename
,
490 const D3D10_SHADER_MACRO
*defines
, ID3D10Include
*include
, UINT hlsl_flags
, UINT fx_flags
,
491 ID3D10Blob
**effect
, ID3D10Blob
**errors
);
492 HRESULT __stdcall D3D10CreateEffectFromMemory
(void *data
, SIZE_T data_size
, UINT flags
,
493 ID3D10Device
*device
, ID3D10EffectPool
*effect_pool
, ID3D10Effect
**effect
);
494 HRESULT __stdcall D3D10CreateEffectPoolFromMemory
(void *data
, SIZE_T data_size
, UINT fx_flags
,
495 ID3D10Device
*device
, ID3D10EffectPool
**effect_pool
);
496 HRESULT __stdcall D3D10CreateStateBlock
(ID3D10Device
*device
,
497 D3D10_STATE_BLOCK_MASK
*mask
, ID3D10StateBlock
**stateblock
);
499 HRESULT __stdcall D3D10StateBlockMaskDifference
(D3D10_STATE_BLOCK_MASK
*mask_x
,
500 D3D10_STATE_BLOCK_MASK
*mask_y
, D3D10_STATE_BLOCK_MASK
*result
);
501 HRESULT __stdcall D3D10StateBlockMaskDisableAll
(D3D10_STATE_BLOCK_MASK
*mask
);
502 HRESULT __stdcall D3D10StateBlockMaskDisableCapture
(D3D10_STATE_BLOCK_MASK
*mask
,
503 D3D10_DEVICE_STATE_TYPES state_type
, UINT start_idx
, UINT count
);
504 HRESULT __stdcall D3D10StateBlockMaskEnableAll
(D3D10_STATE_BLOCK_MASK
*mask
);
505 HRESULT __stdcall D3D10StateBlockMaskEnableCapture
(D3D10_STATE_BLOCK_MASK
*mask
,
506 D3D10_DEVICE_STATE_TYPES state_type
, UINT start_idx
, UINT count
);
507 BOOL __stdcall D3D10StateBlockMaskGetSetting
(D3D10_STATE_BLOCK_MASK
*mask
,
508 D3D10_DEVICE_STATE_TYPES state_type
, UINT idx
);
509 HRESULT __stdcall D3D10StateBlockMaskIntersect
(D3D10_STATE_BLOCK_MASK
*mask_x
,
510 D3D10_STATE_BLOCK_MASK
*mask_y
, D3D10_STATE_BLOCK_MASK
*result
);
511 HRESULT __stdcall D3D10StateBlockMaskUnion
(D3D10_STATE_BLOCK_MASK
*mask_x
,
512 D3D10_STATE_BLOCK_MASK
*mask_y
, D3D10_STATE_BLOCK_MASK
*result
);