2 * Copyright 2010 Christian Costa
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 #include "wine/port.h"
21 #include "wine/debug.h"
22 #include "wine/unicode.h"
25 #include "d3dx9_36_private.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(d3dx
);
29 static const struct ID3DXEffectVtbl ID3DXEffect_Vtbl
;
30 static const struct ID3DXBaseEffectVtbl ID3DXBaseEffect_Vtbl
;
31 static const struct ID3DXEffectCompilerVtbl ID3DXEffectCompiler_Vtbl
;
33 struct ID3DXBaseEffectImpl
35 ID3DXBaseEffect ID3DXBaseEffect_iface
;
38 struct ID3DXEffectImpl
*effect
;
44 struct ID3DXEffectImpl
46 ID3DXEffect ID3DXEffect_iface
;
49 LPDIRECT3DDEVICE9 device
;
50 LPD3DXEFFECTPOOL pool
;
52 ID3DXBaseEffect
*base_effect
;
55 struct ID3DXEffectCompilerImpl
57 ID3DXEffectCompiler ID3DXEffectCompiler_iface
;
60 ID3DXBaseEffect
*base_effect
;
63 static inline void read_dword(const char **ptr
, DWORD
*d
)
65 memcpy(d
, *ptr
, sizeof(*d
));
69 static void skip_dword_unknown(const char **ptr
, unsigned int count
)
74 FIXME("Skipping %u unknown DWORDs:\n", count
);
75 for (i
= 0; i
< count
; ++i
)
78 FIXME("\t0x%08x\n", d
);
82 static void free_effect(struct ID3DXEffectImpl
*effect
)
84 TRACE("Free effect %p\n", effect
);
86 if (effect
->base_effect
)
88 effect
->base_effect
->lpVtbl
->Release(effect
->base_effect
);
93 effect
->pool
->lpVtbl
->Release(effect
->pool
);
96 IDirect3DDevice9_Release(effect
->device
);
99 static void free_effect_compiler(struct ID3DXEffectCompilerImpl
*compiler
)
101 TRACE("Free effect compiler %p\n", compiler
);
103 if (compiler
->base_effect
)
105 compiler
->base_effect
->lpVtbl
->Release(compiler
->base_effect
);
109 static inline DWORD
d3dx9_effect_version(DWORD major
, DWORD minor
)
111 return (0xfeff0000 | ((major
) << 8) | (minor
));
114 static inline struct ID3DXBaseEffectImpl
*impl_from_ID3DXBaseEffect(ID3DXBaseEffect
*iface
)
116 return CONTAINING_RECORD(iface
, struct ID3DXBaseEffectImpl
, ID3DXBaseEffect_iface
);
119 /*** IUnknown methods ***/
120 static HRESULT WINAPI
ID3DXBaseEffectImpl_QueryInterface(ID3DXBaseEffect
*iface
, REFIID riid
, void **object
)
122 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
124 TRACE("iface %p, riid %s, object %p\n", This
, debugstr_guid(riid
), object
);
126 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
127 IsEqualGUID(riid
, &IID_ID3DXBaseEffect
))
129 This
->ID3DXBaseEffect_iface
.lpVtbl
->AddRef(iface
);
134 ERR("Interface %s not found\n", debugstr_guid(riid
));
136 return E_NOINTERFACE
;
139 static ULONG WINAPI
ID3DXBaseEffectImpl_AddRef(ID3DXBaseEffect
*iface
)
141 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
143 TRACE("iface %p: AddRef from %u\n", iface
, This
->ref
);
145 return InterlockedIncrement(&This
->ref
);
148 static ULONG WINAPI
ID3DXBaseEffectImpl_Release(ID3DXBaseEffect
*iface
)
150 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
151 ULONG ref
= InterlockedDecrement(&This
->ref
);
153 TRACE("iface %p: Release from %u\n", iface
, ref
+ 1);
157 HeapFree(GetProcessHeap(), 0, This
);
163 /*** ID3DXBaseEffect methods ***/
164 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetDesc(ID3DXBaseEffect
*iface
, D3DXEFFECT_DESC
*desc
)
166 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
168 FIXME("iface %p, desc %p stub\n", This
, desc
);
173 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetParameterDesc(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, D3DXPARAMETER_DESC
*desc
)
175 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
177 FIXME("iface %p, parameter %p, desc %p stub\n", This
, parameter
, desc
);
182 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetTechniqueDesc(ID3DXBaseEffect
*iface
, D3DXHANDLE technique
, D3DXTECHNIQUE_DESC
*desc
)
184 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
186 FIXME("iface %p, technique %p, desc %p stub\n", This
, technique
, desc
);
191 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetPassDesc(ID3DXBaseEffect
*iface
, D3DXHANDLE pass
, D3DXPASS_DESC
*desc
)
193 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
195 FIXME("iface %p, pass %p, desc %p stub\n", This
, pass
, desc
);
200 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetFunctionDesc(ID3DXBaseEffect
*iface
, D3DXHANDLE shader
, D3DXFUNCTION_DESC
*desc
)
202 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
204 FIXME("iface %p, shader %p, desc %p stub\n", This
, shader
, desc
);
209 static D3DXHANDLE WINAPI
ID3DXBaseEffectImpl_GetParameter(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, UINT index
)
211 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
213 FIXME("iface %p, parameter %p, index %u stub\n", This
, parameter
, index
);
218 static D3DXHANDLE WINAPI
ID3DXBaseEffectImpl_GetParameterByName(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, LPCSTR name
)
220 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
222 FIXME("iface %p, parameter %p, name %s stub\n", This
, parameter
, debugstr_a(name
));
227 static D3DXHANDLE WINAPI
ID3DXBaseEffectImpl_GetParameterBySemantic(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, LPCSTR semantic
)
229 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
231 FIXME("iface %p, parameter %p, semantic %s stub\n", This
, parameter
, debugstr_a(semantic
));
236 static D3DXHANDLE WINAPI
ID3DXBaseEffectImpl_GetParameterElement(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, UINT index
)
238 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
240 FIXME("iface %p, parameter %p, index %u stub\n", This
, parameter
, index
);
245 static D3DXHANDLE WINAPI
ID3DXBaseEffectImpl_GetTechnique(ID3DXBaseEffect
*iface
, UINT index
)
247 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
249 FIXME("iface %p, index %u stub\n", This
, index
);
254 static D3DXHANDLE WINAPI
ID3DXBaseEffectImpl_GetTechniqueByName(ID3DXBaseEffect
*iface
, LPCSTR name
)
256 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
258 FIXME("iface %p, name %s stub\n", This
, debugstr_a(name
));
263 static D3DXHANDLE WINAPI
ID3DXBaseEffectImpl_GetPass(ID3DXBaseEffect
*iface
, D3DXHANDLE technique
, UINT index
)
265 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
267 FIXME("iface %p, technique %p, index %u stub\n", This
, technique
, index
);
272 static D3DXHANDLE WINAPI
ID3DXBaseEffectImpl_GetPassByName(ID3DXBaseEffect
*iface
, D3DXHANDLE technique
, LPCSTR name
)
274 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
276 FIXME("iface %p, technique %p, name %s stub\n", This
, technique
, debugstr_a(name
));
281 static D3DXHANDLE WINAPI
ID3DXBaseEffectImpl_GetFunction(ID3DXBaseEffect
*iface
, UINT index
)
283 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
285 FIXME("iface %p, index %u stub\n", This
, index
);
290 static D3DXHANDLE WINAPI
ID3DXBaseEffectImpl_GetFunctionByName(ID3DXBaseEffect
*iface
, LPCSTR name
)
292 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
294 FIXME("iface %p, name %s stub\n", This
, debugstr_a(name
));
299 static D3DXHANDLE WINAPI
ID3DXBaseEffectImpl_GetAnnotation(ID3DXBaseEffect
*iface
, D3DXHANDLE object
, UINT index
)
301 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
303 FIXME("iface %p, object %p, index %u stub\n", This
, object
, index
);
308 static D3DXHANDLE WINAPI
ID3DXBaseEffectImpl_GetAnnotationByName(ID3DXBaseEffect
*iface
, D3DXHANDLE object
, LPCSTR name
)
310 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
312 FIXME("iface %p, object %p, name %s stub\n", This
, object
, debugstr_a(name
));
317 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetValue(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, LPCVOID data
, UINT bytes
)
319 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
321 FIXME("iface %p, parameter %p, data %p, bytes %u stub\n", This
, parameter
, data
, bytes
);
326 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetValue(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, LPVOID data
, UINT bytes
)
328 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
330 FIXME("iface %p, parameter %p, data %p, bytes %u stub\n", This
, parameter
, data
, bytes
);
335 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetBool(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, BOOL b
)
337 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
339 FIXME("iface %p, parameter %p, b %u stub\n", This
, parameter
, b
);
344 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetBool(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, BOOL
*b
)
346 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
348 FIXME("iface %p, parameter %p, b %p stub\n", This
, parameter
, b
);
353 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetBoolArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, CONST BOOL
*b
, UINT count
)
355 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
357 FIXME("iface %p, parameter %p, b %p, count %u stub\n", This
, parameter
, b
, count
);
362 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetBoolArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, BOOL
*b
, UINT count
)
364 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
366 FIXME("iface %p, parameter %p, b %p, count %u stub\n", This
, parameter
, b
, count
);
371 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetInt(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, INT n
)
373 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
375 FIXME("iface %p, parameter %p, n %u stub\n", This
, parameter
, n
);
380 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetInt(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, INT
*n
)
382 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
384 FIXME("iface %p, parameter %p, n %p stub\n", This
, parameter
, n
);
389 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetIntArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, CONST INT
*n
, UINT count
)
391 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
393 FIXME("iface %p, parameter %p, n %p, count %u stub\n", This
, parameter
, n
, count
);
398 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetIntArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, INT
*n
, UINT count
)
400 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
402 FIXME("iface %p, parameter %p, n %p, count %u stub\n", This
, parameter
, n
, count
);
407 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetFloat(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, FLOAT f
)
409 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
411 FIXME("iface %p, parameter %p, f %f stub\n", This
, parameter
, f
);
416 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetFloat(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, FLOAT
*f
)
418 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
420 FIXME("iface %p, parameter %p, f %p stub\n", This
, parameter
, f
);
425 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetFloatArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, CONST FLOAT
*f
, UINT count
)
427 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
429 FIXME("iface %p, parameter %p, f %p, count %u stub\n", This
, parameter
, f
, count
);
434 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetFloatArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, FLOAT
*f
, UINT count
)
436 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
438 FIXME("iface %p, parameter %p, f %p, count %u stub\n", This
, parameter
, f
, count
);
443 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetVector(ID3DXBaseEffect
* iface
, D3DXHANDLE parameter
, CONST D3DXVECTOR4
* vector
)
445 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
447 FIXME("iface %p, parameter %p, vector %p stub\n", This
, parameter
, vector
);
452 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetVector(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, D3DXVECTOR4
*vector
)
454 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
456 FIXME("iface %p, parameter %p, vector %p stub\n", This
, parameter
, vector
);
461 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetVectorArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXVECTOR4
*vector
, UINT count
)
463 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
465 FIXME("iface %p, parameter %p, vector %p, count %u stub\n", This
, parameter
, vector
, count
);
470 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetVectorArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, D3DXVECTOR4
*vector
, UINT count
)
472 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
474 FIXME("iface %p, parameter %p, vector %p, count %u stub\n", This
, parameter
, vector
, count
);
479 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetMatrix(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
*matrix
)
481 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
483 FIXME("iface %p, parameter %p, matrix %p stub\n", This
, parameter
, matrix
);
488 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetMatrix(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
*matrix
)
490 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
492 FIXME("iface %p, parameter %p, matrix %p stub\n", This
, parameter
, matrix
);
497 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetMatrixArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
*matrix
, UINT count
)
499 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
501 FIXME("iface %p, parameter %p, matrix %p, count %u stub\n", This
, parameter
, matrix
, count
);
506 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetMatrixArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
*matrix
, UINT count
)
508 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
510 FIXME("iface %p, parameter %p, matrix %p, count %u stub\n", This
, parameter
, matrix
, count
);
515 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetMatrixPointerArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
**matrix
, UINT count
)
517 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
519 FIXME("iface %p, parameter %p, matrix %p, count %u stub\n", This
, parameter
, matrix
, count
);
524 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetMatrixPointerArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
**matrix
, UINT count
)
526 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
528 FIXME("iface %p, parameter %p, matrix %p, count %u stub\n", This
, parameter
, matrix
, count
);
533 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetMatrixTranspose(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
*matrix
)
535 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
537 FIXME("iface %p, parameter %p, matrix %p stub\n", This
, parameter
, matrix
);
542 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetMatrixTranspose(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
*matrix
)
544 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
546 FIXME("iface %p, parameter %p, matrix %p stub\n", This
, parameter
, matrix
);
551 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetMatrixTransposeArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
*matrix
, UINT count
)
553 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
555 FIXME("iface %p, parameter %p, matrix %p, count %u stub\n", This
, parameter
, matrix
, count
);
560 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetMatrixTransposeArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
*matrix
, UINT count
)
562 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
564 FIXME("iface %p, parameter %p, matrix %p, count %u stub\n", This
, parameter
, matrix
, count
);
569 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetMatrixTransposePointerArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
**matrix
, UINT count
)
571 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
573 FIXME("iface %p, parameter %p, matrix %p, count %u stub\n", This
, parameter
, matrix
, count
);
578 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetMatrixTransposePointerArray(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
**matrix
, UINT count
)
580 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
582 FIXME("iface %p, parameter %p, matrix %p, count %u stub\n", This
, parameter
, matrix
, count
);
587 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetString(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, LPCSTR string
)
589 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
591 FIXME("iface %p, parameter %p, string %p stub\n", This
, parameter
, string
);
596 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetString(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, LPCSTR
*string
)
598 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
600 FIXME("iface %p, parameter %p, string %p stub\n", This
, parameter
, string
);
605 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetTexture(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, LPDIRECT3DBASETEXTURE9 texture
)
607 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
609 FIXME("iface %p, parameter %p, texture %p stub\n", This
, parameter
, texture
);
614 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetTexture(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, LPDIRECT3DBASETEXTURE9
*texture
)
616 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
618 FIXME("iface %p, parameter %p, texture %p stub\n", This
, parameter
, texture
);
623 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetPixelShader(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, LPDIRECT3DPIXELSHADER9
*pshader
)
625 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
627 FIXME("iface %p, parameter %p, pshader %p stub\n", This
, parameter
, pshader
);
632 static HRESULT WINAPI
ID3DXBaseEffectImpl_GetVertexShader(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, LPDIRECT3DVERTEXSHADER9
*vshader
)
634 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
636 FIXME("iface %p, parameter %p, vshader %p stub\n", This
, parameter
, vshader
);
641 static HRESULT WINAPI
ID3DXBaseEffectImpl_SetArrayRange(ID3DXBaseEffect
*iface
, D3DXHANDLE parameter
, UINT start
, UINT end
)
643 struct ID3DXBaseEffectImpl
*This
= impl_from_ID3DXBaseEffect(iface
);
645 FIXME("iface %p, parameter %p, start %u, end %u stub\n", This
, parameter
, start
, end
);
650 static const struct ID3DXBaseEffectVtbl ID3DXBaseEffect_Vtbl
=
652 /*** IUnknown methods ***/
653 ID3DXBaseEffectImpl_QueryInterface
,
654 ID3DXBaseEffectImpl_AddRef
,
655 ID3DXBaseEffectImpl_Release
,
656 /*** ID3DXBaseEffect methods ***/
657 ID3DXBaseEffectImpl_GetDesc
,
658 ID3DXBaseEffectImpl_GetParameterDesc
,
659 ID3DXBaseEffectImpl_GetTechniqueDesc
,
660 ID3DXBaseEffectImpl_GetPassDesc
,
661 ID3DXBaseEffectImpl_GetFunctionDesc
,
662 ID3DXBaseEffectImpl_GetParameter
,
663 ID3DXBaseEffectImpl_GetParameterByName
,
664 ID3DXBaseEffectImpl_GetParameterBySemantic
,
665 ID3DXBaseEffectImpl_GetParameterElement
,
666 ID3DXBaseEffectImpl_GetTechnique
,
667 ID3DXBaseEffectImpl_GetTechniqueByName
,
668 ID3DXBaseEffectImpl_GetPass
,
669 ID3DXBaseEffectImpl_GetPassByName
,
670 ID3DXBaseEffectImpl_GetFunction
,
671 ID3DXBaseEffectImpl_GetFunctionByName
,
672 ID3DXBaseEffectImpl_GetAnnotation
,
673 ID3DXBaseEffectImpl_GetAnnotationByName
,
674 ID3DXBaseEffectImpl_SetValue
,
675 ID3DXBaseEffectImpl_GetValue
,
676 ID3DXBaseEffectImpl_SetBool
,
677 ID3DXBaseEffectImpl_GetBool
,
678 ID3DXBaseEffectImpl_SetBoolArray
,
679 ID3DXBaseEffectImpl_GetBoolArray
,
680 ID3DXBaseEffectImpl_SetInt
,
681 ID3DXBaseEffectImpl_GetInt
,
682 ID3DXBaseEffectImpl_SetIntArray
,
683 ID3DXBaseEffectImpl_GetIntArray
,
684 ID3DXBaseEffectImpl_SetFloat
,
685 ID3DXBaseEffectImpl_GetFloat
,
686 ID3DXBaseEffectImpl_SetFloatArray
,
687 ID3DXBaseEffectImpl_GetFloatArray
,
688 ID3DXBaseEffectImpl_SetVector
,
689 ID3DXBaseEffectImpl_GetVector
,
690 ID3DXBaseEffectImpl_SetVectorArray
,
691 ID3DXBaseEffectImpl_GetVectorArray
,
692 ID3DXBaseEffectImpl_SetMatrix
,
693 ID3DXBaseEffectImpl_GetMatrix
,
694 ID3DXBaseEffectImpl_SetMatrixArray
,
695 ID3DXBaseEffectImpl_GetMatrixArray
,
696 ID3DXBaseEffectImpl_SetMatrixPointerArray
,
697 ID3DXBaseEffectImpl_GetMatrixPointerArray
,
698 ID3DXBaseEffectImpl_SetMatrixTranspose
,
699 ID3DXBaseEffectImpl_GetMatrixTranspose
,
700 ID3DXBaseEffectImpl_SetMatrixTransposeArray
,
701 ID3DXBaseEffectImpl_GetMatrixTransposeArray
,
702 ID3DXBaseEffectImpl_SetMatrixTransposePointerArray
,
703 ID3DXBaseEffectImpl_GetMatrixTransposePointerArray
,
704 ID3DXBaseEffectImpl_SetString
,
705 ID3DXBaseEffectImpl_GetString
,
706 ID3DXBaseEffectImpl_SetTexture
,
707 ID3DXBaseEffectImpl_GetTexture
,
708 ID3DXBaseEffectImpl_GetPixelShader
,
709 ID3DXBaseEffectImpl_GetVertexShader
,
710 ID3DXBaseEffectImpl_SetArrayRange
,
713 static inline struct ID3DXEffectImpl
*impl_from_ID3DXEffect(ID3DXEffect
*iface
)
715 return CONTAINING_RECORD(iface
, struct ID3DXEffectImpl
, ID3DXEffect_iface
);
718 /*** IUnknown methods ***/
719 static HRESULT WINAPI
ID3DXEffectImpl_QueryInterface(ID3DXEffect
*iface
, REFIID riid
, void **object
)
721 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
723 TRACE("(%p)->(%s, %p)\n", This
, debugstr_guid(riid
), object
);
725 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
726 IsEqualGUID(riid
, &IID_ID3DXEffect
))
728 This
->ID3DXEffect_iface
.lpVtbl
->AddRef(iface
);
733 ERR("Interface %s not found\n", debugstr_guid(riid
));
735 return E_NOINTERFACE
;
738 static ULONG WINAPI
ID3DXEffectImpl_AddRef(ID3DXEffect
*iface
)
740 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
742 TRACE("(%p)->(): AddRef from %u\n", This
, This
->ref
);
744 return InterlockedIncrement(&This
->ref
);
747 static ULONG WINAPI
ID3DXEffectImpl_Release(ID3DXEffect
*iface
)
749 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
750 ULONG ref
= InterlockedDecrement(&This
->ref
);
752 TRACE("(%p)->(): Release from %u\n", This
, ref
+ 1);
757 HeapFree(GetProcessHeap(), 0, This
);
763 /*** ID3DXBaseEffect methods ***/
764 static HRESULT WINAPI
ID3DXEffectImpl_GetDesc(ID3DXEffect
*iface
, D3DXEFFECT_DESC
*desc
)
766 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
767 ID3DXBaseEffect
*base
= This
->base_effect
;
769 TRACE("Forward iface %p, base %p\n", This
, base
);
771 return ID3DXBaseEffectImpl_GetDesc(base
, desc
);
774 static HRESULT WINAPI
ID3DXEffectImpl_GetParameterDesc(ID3DXEffect
*iface
, D3DXHANDLE parameter
, D3DXPARAMETER_DESC
*desc
)
776 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
777 ID3DXBaseEffect
*base
= This
->base_effect
;
779 TRACE("Forward iface %p, base %p\n", This
, base
);
781 return ID3DXBaseEffectImpl_GetParameterDesc(base
, parameter
, desc
);
784 static HRESULT WINAPI
ID3DXEffectImpl_GetTechniqueDesc(ID3DXEffect
*iface
, D3DXHANDLE technique
, D3DXTECHNIQUE_DESC
*desc
)
786 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
787 ID3DXBaseEffect
*base
= This
->base_effect
;
789 TRACE("Forward iface %p, base %p\n", This
, base
);
791 return ID3DXBaseEffectImpl_GetTechniqueDesc(base
, technique
, desc
);
794 static HRESULT WINAPI
ID3DXEffectImpl_GetPassDesc(ID3DXEffect
*iface
, D3DXHANDLE pass
, D3DXPASS_DESC
*desc
)
796 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
797 ID3DXBaseEffect
*base
= This
->base_effect
;
799 TRACE("Forward iface %p, base %p\n", This
, base
);
801 return ID3DXBaseEffectImpl_GetPassDesc(base
, pass
, desc
);
804 static HRESULT WINAPI
ID3DXEffectImpl_GetFunctionDesc(ID3DXEffect
*iface
, D3DXHANDLE shader
, D3DXFUNCTION_DESC
*desc
)
806 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
807 ID3DXBaseEffect
*base
= This
->base_effect
;
809 TRACE("Forward iface %p, base %p\n", This
, base
);
811 return ID3DXBaseEffectImpl_GetFunctionDesc(base
, shader
, desc
);
814 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetParameter(ID3DXEffect
*iface
, D3DXHANDLE parameter
, UINT index
)
816 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
817 ID3DXBaseEffect
*base
= This
->base_effect
;
819 TRACE("Forward iface %p, base %p\n", This
, base
);
821 return ID3DXBaseEffectImpl_GetParameter(base
, parameter
, index
);
824 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetParameterByName(ID3DXEffect
*iface
, D3DXHANDLE parameter
, LPCSTR name
)
826 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
827 ID3DXBaseEffect
*base
= This
->base_effect
;
829 TRACE("Forward iface %p, base %p\n", This
, base
);
831 return ID3DXBaseEffectImpl_GetParameterByName(base
, parameter
, name
);
834 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetParameterBySemantic(ID3DXEffect
*iface
, D3DXHANDLE parameter
, LPCSTR semantic
)
836 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
837 ID3DXBaseEffect
*base
= This
->base_effect
;
839 TRACE("Forward iface %p, base %p\n", This
, base
);
841 return ID3DXBaseEffectImpl_GetParameterBySemantic(base
, parameter
, semantic
);
844 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetParameterElement(ID3DXEffect
*iface
, D3DXHANDLE parameter
, UINT index
)
846 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
847 ID3DXBaseEffect
*base
= This
->base_effect
;
849 TRACE("Forward iface %p, base %p\n", This
, base
);
851 return ID3DXBaseEffectImpl_GetParameterElement(base
, parameter
, index
);
854 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetTechnique(ID3DXEffect
*iface
, UINT index
)
856 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
857 ID3DXBaseEffect
*base
= This
->base_effect
;
859 TRACE("Forward iface %p, base %p\n", This
, base
);
861 return ID3DXBaseEffectImpl_GetTechnique(base
, index
);
864 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetTechniqueByName(ID3DXEffect
*iface
, LPCSTR name
)
866 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
867 ID3DXBaseEffect
*base
= This
->base_effect
;
869 TRACE("Forward iface %p, base %p\n", This
, base
);
871 return ID3DXBaseEffectImpl_GetTechniqueByName(base
, name
);
874 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetPass(ID3DXEffect
*iface
, D3DXHANDLE technique
, UINT index
)
876 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
877 ID3DXBaseEffect
*base
= This
->base_effect
;
879 TRACE("Forward iface %p, base %p\n", This
, base
);
881 return ID3DXBaseEffectImpl_GetPass(base
, technique
, index
);
884 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetPassByName(ID3DXEffect
*iface
, D3DXHANDLE technique
, LPCSTR name
)
886 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
887 ID3DXBaseEffect
*base
= This
->base_effect
;
889 TRACE("Forward iface %p, base %p\n", This
, base
);
891 return ID3DXBaseEffectImpl_GetPassByName(base
, technique
, name
);
894 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetFunction(ID3DXEffect
*iface
, UINT index
)
896 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
897 ID3DXBaseEffect
*base
= This
->base_effect
;
899 TRACE("Forward iface %p, base %p\n", This
, base
);
901 return ID3DXBaseEffectImpl_GetFunction(base
, index
);
904 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetFunctionByName(ID3DXEffect
*iface
, LPCSTR name
)
906 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
907 ID3DXBaseEffect
*base
= This
->base_effect
;
909 TRACE("Forward iface %p, base %p\n", This
, base
);
911 return ID3DXBaseEffectImpl_GetFunctionByName(base
, name
);
914 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetAnnotation(ID3DXEffect
*iface
, D3DXHANDLE object
, UINT index
)
916 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
917 ID3DXBaseEffect
*base
= This
->base_effect
;
919 TRACE("Forward iface %p, base %p\n", This
, base
);
921 return ID3DXBaseEffectImpl_GetAnnotation(base
, object
, index
);
924 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetAnnotationByName(ID3DXEffect
*iface
, D3DXHANDLE object
, LPCSTR name
)
926 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
927 ID3DXBaseEffect
*base
= This
->base_effect
;
929 TRACE("Forward iface %p, base %p\n", This
, base
);
931 return ID3DXBaseEffectImpl_GetAnnotationByName(base
, object
, name
);
934 static HRESULT WINAPI
ID3DXEffectImpl_SetValue(ID3DXEffect
*iface
, D3DXHANDLE parameter
, LPCVOID data
, UINT bytes
)
936 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
937 ID3DXBaseEffect
*base
= This
->base_effect
;
939 TRACE("Forward iface %p, base %p\n", This
, base
);
941 return ID3DXBaseEffectImpl_SetValue(base
, parameter
, data
, bytes
);
944 static HRESULT WINAPI
ID3DXEffectImpl_GetValue(ID3DXEffect
*iface
, D3DXHANDLE parameter
, LPVOID data
, UINT bytes
)
946 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
947 ID3DXBaseEffect
*base
= This
->base_effect
;
949 TRACE("Forward iface %p, base %p\n", This
, base
);
951 return ID3DXBaseEffectImpl_GetValue(base
, parameter
, data
, bytes
);
954 static HRESULT WINAPI
ID3DXEffectImpl_SetBool(ID3DXEffect
*iface
, D3DXHANDLE parameter
, BOOL b
)
956 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
957 ID3DXBaseEffect
*base
= This
->base_effect
;
959 TRACE("Forward iface %p, base %p\n", This
, base
);
961 return ID3DXBaseEffectImpl_SetBool(base
, parameter
, b
);
964 static HRESULT WINAPI
ID3DXEffectImpl_GetBool(ID3DXEffect
*iface
, D3DXHANDLE parameter
, BOOL
*b
)
966 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
967 ID3DXBaseEffect
*base
= This
->base_effect
;
969 TRACE("Forward iface %p, base %p\n", This
, base
);
971 return ID3DXBaseEffectImpl_GetBool(base
, parameter
, b
);
974 static HRESULT WINAPI
ID3DXEffectImpl_SetBoolArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, CONST BOOL
*b
, UINT count
)
976 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
977 ID3DXBaseEffect
*base
= This
->base_effect
;
979 TRACE("Forward iface %p, base %p\n", This
, base
);
981 return ID3DXBaseEffectImpl_SetBoolArray(base
, parameter
, b
, count
);
984 static HRESULT WINAPI
ID3DXEffectImpl_GetBoolArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, BOOL
*b
, UINT count
)
986 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
987 ID3DXBaseEffect
*base
= This
->base_effect
;
989 TRACE("Forward iface %p, base %p\n", This
, base
);
991 return ID3DXBaseEffectImpl_GetBoolArray(base
, parameter
, b
, count
);
994 static HRESULT WINAPI
ID3DXEffectImpl_SetInt(ID3DXEffect
*iface
, D3DXHANDLE parameter
, INT n
)
996 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
997 ID3DXBaseEffect
*base
= This
->base_effect
;
999 TRACE("Forward iface %p, base %p\n", This
, base
);
1001 return ID3DXBaseEffectImpl_SetInt(base
, parameter
, n
);
1004 static HRESULT WINAPI
ID3DXEffectImpl_GetInt(ID3DXEffect
*iface
, D3DXHANDLE parameter
, INT
*n
)
1006 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1007 ID3DXBaseEffect
*base
= This
->base_effect
;
1009 TRACE("Forward iface %p, base %p\n", This
, base
);
1011 return ID3DXBaseEffectImpl_GetInt(base
, parameter
, n
);
1014 static HRESULT WINAPI
ID3DXEffectImpl_SetIntArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, CONST INT
*n
, UINT count
)
1016 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1017 ID3DXBaseEffect
*base
= This
->base_effect
;
1019 TRACE("Forward iface %p, base %p\n", This
, base
);
1021 return ID3DXBaseEffectImpl_SetIntArray(base
, parameter
, n
, count
);
1024 static HRESULT WINAPI
ID3DXEffectImpl_GetIntArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, INT
*n
, UINT count
)
1026 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1027 ID3DXBaseEffect
*base
= This
->base_effect
;
1029 TRACE("Forward iface %p, base %p\n", This
, base
);
1031 return ID3DXBaseEffectImpl_GetIntArray(base
, parameter
, n
, count
);
1034 static HRESULT WINAPI
ID3DXEffectImpl_SetFloat(ID3DXEffect
*iface
, D3DXHANDLE parameter
, FLOAT f
)
1036 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1037 ID3DXBaseEffect
*base
= This
->base_effect
;
1039 TRACE("Forward iface %p, base %p\n", This
, base
);
1041 return ID3DXBaseEffectImpl_SetFloat(base
, parameter
, f
);
1044 static HRESULT WINAPI
ID3DXEffectImpl_GetFloat(ID3DXEffect
*iface
, D3DXHANDLE parameter
, FLOAT
*f
)
1046 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1047 ID3DXBaseEffect
*base
= This
->base_effect
;
1049 TRACE("Forward iface %p, base %p\n", This
, base
);
1051 return ID3DXBaseEffectImpl_GetFloat(base
, parameter
, f
);
1054 static HRESULT WINAPI
ID3DXEffectImpl_SetFloatArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, CONST FLOAT
*f
, UINT count
)
1056 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1057 ID3DXBaseEffect
*base
= This
->base_effect
;
1059 TRACE("Forward iface %p, base %p\n", This
, base
);
1061 return ID3DXBaseEffectImpl_SetFloatArray(base
, parameter
, f
, count
);
1064 static HRESULT WINAPI
ID3DXEffectImpl_GetFloatArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, FLOAT
*f
, UINT count
)
1066 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1067 ID3DXBaseEffect
*base
= This
->base_effect
;
1069 TRACE("Forward iface %p, base %p\n", This
, base
);
1071 return ID3DXBaseEffectImpl_GetFloatArray(base
, parameter
, f
, count
);
1074 static HRESULT WINAPI
ID3DXEffectImpl_SetVector(ID3DXEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXVECTOR4
*vector
)
1076 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1077 ID3DXBaseEffect
*base
= This
->base_effect
;
1079 TRACE("Forward iface %p, base %p\n", This
, base
);
1081 return ID3DXBaseEffectImpl_SetVector(base
, parameter
, vector
);
1084 static HRESULT WINAPI
ID3DXEffectImpl_GetVector(ID3DXEffect
*iface
, D3DXHANDLE parameter
, D3DXVECTOR4
*vector
)
1086 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1087 ID3DXBaseEffect
*base
= This
->base_effect
;
1089 TRACE("Forward iface %p, base %p\n", This
, base
);
1091 return ID3DXBaseEffectImpl_GetVector(base
, parameter
, vector
);
1094 static HRESULT WINAPI
ID3DXEffectImpl_SetVectorArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXVECTOR4
*vector
, UINT count
)
1096 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1097 ID3DXBaseEffect
*base
= This
->base_effect
;
1099 TRACE("Forward iface %p, base %p\n", This
, base
);
1101 return ID3DXBaseEffectImpl_SetVectorArray(base
, parameter
, vector
, count
);
1104 static HRESULT WINAPI
ID3DXEffectImpl_GetVectorArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, D3DXVECTOR4
*vector
, UINT count
)
1106 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1107 ID3DXBaseEffect
*base
= This
->base_effect
;
1109 TRACE("Forward iface %p, base %p\n", This
, base
);
1111 return ID3DXBaseEffectImpl_SetVectorArray(base
, parameter
, vector
, count
);
1114 static HRESULT WINAPI
ID3DXEffectImpl_SetMatrix(ID3DXEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
*matrix
)
1116 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1117 ID3DXBaseEffect
*base
= This
->base_effect
;
1119 TRACE("Forward iface %p, base %p\n", This
, base
);
1121 return ID3DXBaseEffectImpl_SetMatrix(base
, parameter
, matrix
);
1124 static HRESULT WINAPI
ID3DXEffectImpl_GetMatrix(ID3DXEffect
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
*matrix
)
1126 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1127 ID3DXBaseEffect
*base
= This
->base_effect
;
1129 TRACE("Forward iface %p, base %p\n", This
, base
);
1131 return ID3DXBaseEffectImpl_GetMatrix(base
, parameter
, matrix
);
1134 static HRESULT WINAPI
ID3DXEffectImpl_SetMatrixArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
*matrix
, UINT count
)
1136 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1137 ID3DXBaseEffect
*base
= This
->base_effect
;
1139 TRACE("Forward iface %p, base %p\n", This
, base
);
1141 return ID3DXBaseEffectImpl_SetMatrixArray(base
, parameter
, matrix
, count
);
1144 static HRESULT WINAPI
ID3DXEffectImpl_GetMatrixArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
*matrix
, UINT count
)
1146 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1147 ID3DXBaseEffect
*base
= This
->base_effect
;
1149 TRACE("Forward iface %p, base %p\n", This
, base
);
1151 return ID3DXBaseEffectImpl_GetMatrixArray(base
, parameter
, matrix
, count
);
1154 static HRESULT WINAPI
ID3DXEffectImpl_SetMatrixPointerArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
**matrix
, UINT count
)
1156 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1157 ID3DXBaseEffect
*base
= This
->base_effect
;
1159 TRACE("Forward iface %p, base %p\n", This
, base
);
1161 return ID3DXBaseEffectImpl_SetMatrixPointerArray(base
, parameter
, matrix
, count
);
1164 static HRESULT WINAPI
ID3DXEffectImpl_GetMatrixPointerArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
**matrix
, UINT count
)
1166 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1167 ID3DXBaseEffect
*base
= This
->base_effect
;
1169 TRACE("Forward iface %p, base %p\n", This
, base
);
1171 return ID3DXBaseEffectImpl_GetMatrixPointerArray(base
, parameter
, matrix
, count
);
1174 static HRESULT WINAPI
ID3DXEffectImpl_SetMatrixTranspose(ID3DXEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
*matrix
)
1176 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1177 ID3DXBaseEffect
*base
= This
->base_effect
;
1179 TRACE("Forward iface %p, base %p\n", This
, base
);
1181 return ID3DXBaseEffectImpl_SetMatrixTranspose(base
, parameter
, matrix
);
1184 static HRESULT WINAPI
ID3DXEffectImpl_GetMatrixTranspose(ID3DXEffect
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
*matrix
)
1186 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1187 ID3DXBaseEffect
*base
= This
->base_effect
;
1189 TRACE("Forward iface %p, base %p\n", This
, base
);
1191 return ID3DXBaseEffectImpl_GetMatrixTranspose(base
, parameter
, matrix
);
1194 static HRESULT WINAPI
ID3DXEffectImpl_SetMatrixTransposeArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
*matrix
, UINT count
)
1196 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1197 ID3DXBaseEffect
*base
= This
->base_effect
;
1199 TRACE("Forward iface %p, base %p\n", This
, base
);
1201 return ID3DXBaseEffectImpl_SetMatrixTransposeArray(base
, parameter
, matrix
, count
);
1204 static HRESULT WINAPI
ID3DXEffectImpl_GetMatrixTransposeArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
*matrix
, UINT count
)
1206 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1207 ID3DXBaseEffect
*base
= This
->base_effect
;
1209 TRACE("Forward iface %p, base %p\n", This
, base
);
1211 return ID3DXBaseEffectImpl_GetMatrixTransposeArray(base
, parameter
, matrix
, count
);
1214 static HRESULT WINAPI
ID3DXEffectImpl_SetMatrixTransposePointerArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
**matrix
, UINT count
)
1216 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1217 ID3DXBaseEffect
*base
= This
->base_effect
;
1219 TRACE("Forward iface %p, base %p\n", This
, base
);
1221 return ID3DXBaseEffectImpl_SetMatrixTransposePointerArray(base
, parameter
, matrix
, count
);
1224 static HRESULT WINAPI
ID3DXEffectImpl_GetMatrixTransposePointerArray(ID3DXEffect
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
**matrix
, UINT count
)
1226 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1227 ID3DXBaseEffect
*base
= This
->base_effect
;
1229 TRACE("Forward iface %p, base %p\n", This
, base
);
1231 return ID3DXBaseEffectImpl_GetMatrixTransposePointerArray(base
, parameter
, matrix
, count
);
1234 static HRESULT WINAPI
ID3DXEffectImpl_SetString(ID3DXEffect
*iface
, D3DXHANDLE parameter
, LPCSTR string
)
1236 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1237 ID3DXBaseEffect
*base
= This
->base_effect
;
1239 TRACE("Forward iface %p, base %p\n", This
, base
);
1241 return ID3DXBaseEffectImpl_SetString(base
, parameter
, string
);
1244 static HRESULT WINAPI
ID3DXEffectImpl_GetString(ID3DXEffect
*iface
, D3DXHANDLE parameter
, LPCSTR
*string
)
1246 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1247 ID3DXBaseEffect
*base
= This
->base_effect
;
1249 TRACE("Forward iface %p, base %p\n", This
, base
);
1251 return ID3DXBaseEffectImpl_GetString(base
, parameter
, string
);
1254 static HRESULT WINAPI
ID3DXEffectImpl_SetTexture(ID3DXEffect
*iface
, D3DXHANDLE parameter
, LPDIRECT3DBASETEXTURE9 texture
)
1256 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1257 ID3DXBaseEffect
*base
= This
->base_effect
;
1259 TRACE("Forward iface %p, base %p\n", This
, base
);
1261 return ID3DXBaseEffectImpl_SetTexture(base
, parameter
, texture
);
1264 static HRESULT WINAPI
ID3DXEffectImpl_GetTexture(ID3DXEffect
*iface
, D3DXHANDLE parameter
, LPDIRECT3DBASETEXTURE9
*texture
)
1266 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1267 ID3DXBaseEffect
*base
= This
->base_effect
;
1269 TRACE("Forward iface %p, base %p\n", This
, base
);
1271 return ID3DXBaseEffectImpl_GetTexture(base
, parameter
, texture
);
1274 static HRESULT WINAPI
ID3DXEffectImpl_GetPixelShader(ID3DXEffect
*iface
, D3DXHANDLE parameter
, LPDIRECT3DPIXELSHADER9
*pshader
)
1276 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1277 ID3DXBaseEffect
*base
= This
->base_effect
;
1279 TRACE("Forward iface %p, base %p\n", This
, base
);
1281 return ID3DXBaseEffectImpl_GetPixelShader(base
, parameter
, pshader
);
1284 static HRESULT WINAPI
ID3DXEffectImpl_GetVertexShader(ID3DXEffect
*iface
, D3DXHANDLE parameter
, LPDIRECT3DVERTEXSHADER9
*vshader
)
1286 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1287 ID3DXBaseEffect
*base
= This
->base_effect
;
1289 TRACE("Forward iface %p, base %p\n", This
, base
);
1291 return ID3DXBaseEffectImpl_GetVertexShader(base
, parameter
, vshader
);
1294 static HRESULT WINAPI
ID3DXEffectImpl_SetArrayRange(ID3DXEffect
*iface
, D3DXHANDLE parameter
, UINT start
, UINT end
)
1296 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1297 ID3DXBaseEffect
*base
= This
->base_effect
;
1299 TRACE("Forward iface %p, base %p\n", This
, base
);
1301 return ID3DXBaseEffectImpl_SetArrayRange(base
, parameter
, start
, end
);
1304 /*** ID3DXEffect methods ***/
1305 static HRESULT WINAPI
ID3DXEffectImpl_GetPool(ID3DXEffect
*iface
, LPD3DXEFFECTPOOL
*pool
)
1307 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1309 TRACE("iface %p, pool %p\n", This
, pool
);
1313 WARN("Invalid argument supplied.\n");
1314 return D3DERR_INVALIDCALL
;
1319 This
->pool
->lpVtbl
->AddRef(This
->pool
);
1324 TRACE("Returning pool %p\n", *pool
);
1329 static HRESULT WINAPI
ID3DXEffectImpl_SetTechnique(ID3DXEffect
* iface
, D3DXHANDLE technique
)
1331 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1333 FIXME("(%p)->(%p): stub\n", This
, technique
);
1338 static D3DXHANDLE WINAPI
ID3DXEffectImpl_GetCurrentTechnique(ID3DXEffect
* iface
)
1340 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1342 FIXME("(%p)->(): stub\n", This
);
1347 static HRESULT WINAPI
ID3DXEffectImpl_ValidateTechnique(ID3DXEffect
* iface
, D3DXHANDLE technique
)
1349 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1351 FIXME("(%p)->(%p): stub\n", This
, technique
);
1356 static HRESULT WINAPI
ID3DXEffectImpl_FindNextValidTechnique(ID3DXEffect
* iface
, D3DXHANDLE technique
, D3DXHANDLE
* next_technique
)
1358 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1360 FIXME("(%p)->(%p, %p): stub\n", This
, technique
, next_technique
);
1365 static BOOL WINAPI
ID3DXEffectImpl_IsParameterUsed(ID3DXEffect
* iface
, D3DXHANDLE parameter
, D3DXHANDLE technique
)
1367 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1369 FIXME("(%p)->(%p, %p): stub\n", This
, parameter
, technique
);
1374 static HRESULT WINAPI
ID3DXEffectImpl_Begin(ID3DXEffect
* iface
, UINT
*passes
, DWORD flags
)
1376 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1378 FIXME("(%p)->(%p, %#x): stub\n", This
, passes
, flags
);
1383 static HRESULT WINAPI
ID3DXEffectImpl_BeginPass(ID3DXEffect
* iface
, UINT pass
)
1385 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1387 FIXME("(%p)->(%u): stub\n", This
, pass
);
1392 static HRESULT WINAPI
ID3DXEffectImpl_CommitChanges(ID3DXEffect
* iface
)
1394 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1396 FIXME("(%p)->(): stub\n", This
);
1401 static HRESULT WINAPI
ID3DXEffectImpl_EndPass(ID3DXEffect
* iface
)
1403 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1405 FIXME("(%p)->(): stub\n", This
);
1410 static HRESULT WINAPI
ID3DXEffectImpl_End(ID3DXEffect
* iface
)
1412 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1414 FIXME("(%p)->(): stub\n", This
);
1419 static HRESULT WINAPI
ID3DXEffectImpl_GetDevice(ID3DXEffect
*iface
, LPDIRECT3DDEVICE9
*device
)
1421 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1423 TRACE("iface %p, device %p\n", This
, device
);
1427 WARN("Invalid argument supplied.\n");
1428 return D3DERR_INVALIDCALL
;
1431 IDirect3DDevice9_AddRef(This
->device
);
1433 *device
= This
->device
;
1435 TRACE("Returning device %p\n", *device
);
1440 static HRESULT WINAPI
ID3DXEffectImpl_OnLostDevice(ID3DXEffect
* iface
)
1442 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1444 FIXME("(%p)->(): stub\n", This
);
1449 static HRESULT WINAPI
ID3DXEffectImpl_OnResetDevice(ID3DXEffect
* iface
)
1451 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1453 FIXME("(%p)->(): stub\n", This
);
1458 static HRESULT WINAPI
ID3DXEffectImpl_SetStateManager(ID3DXEffect
* iface
, LPD3DXEFFECTSTATEMANAGER manager
)
1460 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1462 FIXME("(%p)->(%p): stub\n", This
, manager
);
1467 static HRESULT WINAPI
ID3DXEffectImpl_GetStateManager(ID3DXEffect
* iface
, LPD3DXEFFECTSTATEMANAGER
* manager
)
1469 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1471 FIXME("(%p)->(%p): stub\n", This
, manager
);
1476 static HRESULT WINAPI
ID3DXEffectImpl_BeginParameterBlock(ID3DXEffect
* iface
)
1478 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1480 FIXME("(%p)->(): stub\n", This
);
1485 static D3DXHANDLE WINAPI
ID3DXEffectImpl_EndParameterBlock(ID3DXEffect
* iface
)
1487 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1489 FIXME("(%p)->(): stub\n", This
);
1494 static HRESULT WINAPI
ID3DXEffectImpl_ApplyParameterBlock(ID3DXEffect
* iface
, D3DXHANDLE parameter_block
)
1496 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1498 FIXME("(%p)->(%p): stub\n", This
, parameter_block
);
1503 static HRESULT WINAPI
ID3DXEffectImpl_DeleteParameterBlock(ID3DXEffect
* iface
, D3DXHANDLE parameter_block
)
1505 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1507 FIXME("(%p)->(%p): stub\n", This
, parameter_block
);
1512 static HRESULT WINAPI
ID3DXEffectImpl_CloneEffect(ID3DXEffect
* iface
, LPDIRECT3DDEVICE9 device
, LPD3DXEFFECT
* effect
)
1514 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1516 FIXME("(%p)->(%p, %p): stub\n", This
, device
, effect
);
1521 static HRESULT WINAPI
ID3DXEffectImpl_SetRawValue(ID3DXEffect
* iface
, D3DXHANDLE parameter
, LPCVOID data
, UINT byte_offset
, UINT bytes
)
1523 struct ID3DXEffectImpl
*This
= impl_from_ID3DXEffect(iface
);
1525 FIXME("(%p)->(%p, %p, %u, %u): stub\n", This
, parameter
, data
, byte_offset
, bytes
);
1530 static const struct ID3DXEffectVtbl ID3DXEffect_Vtbl
=
1532 /*** IUnknown methods ***/
1533 ID3DXEffectImpl_QueryInterface
,
1534 ID3DXEffectImpl_AddRef
,
1535 ID3DXEffectImpl_Release
,
1536 /*** ID3DXBaseEffect methods ***/
1537 ID3DXEffectImpl_GetDesc
,
1538 ID3DXEffectImpl_GetParameterDesc
,
1539 ID3DXEffectImpl_GetTechniqueDesc
,
1540 ID3DXEffectImpl_GetPassDesc
,
1541 ID3DXEffectImpl_GetFunctionDesc
,
1542 ID3DXEffectImpl_GetParameter
,
1543 ID3DXEffectImpl_GetParameterByName
,
1544 ID3DXEffectImpl_GetParameterBySemantic
,
1545 ID3DXEffectImpl_GetParameterElement
,
1546 ID3DXEffectImpl_GetTechnique
,
1547 ID3DXEffectImpl_GetTechniqueByName
,
1548 ID3DXEffectImpl_GetPass
,
1549 ID3DXEffectImpl_GetPassByName
,
1550 ID3DXEffectImpl_GetFunction
,
1551 ID3DXEffectImpl_GetFunctionByName
,
1552 ID3DXEffectImpl_GetAnnotation
,
1553 ID3DXEffectImpl_GetAnnotationByName
,
1554 ID3DXEffectImpl_SetValue
,
1555 ID3DXEffectImpl_GetValue
,
1556 ID3DXEffectImpl_SetBool
,
1557 ID3DXEffectImpl_GetBool
,
1558 ID3DXEffectImpl_SetBoolArray
,
1559 ID3DXEffectImpl_GetBoolArray
,
1560 ID3DXEffectImpl_SetInt
,
1561 ID3DXEffectImpl_GetInt
,
1562 ID3DXEffectImpl_SetIntArray
,
1563 ID3DXEffectImpl_GetIntArray
,
1564 ID3DXEffectImpl_SetFloat
,
1565 ID3DXEffectImpl_GetFloat
,
1566 ID3DXEffectImpl_SetFloatArray
,
1567 ID3DXEffectImpl_GetFloatArray
,
1568 ID3DXEffectImpl_SetVector
,
1569 ID3DXEffectImpl_GetVector
,
1570 ID3DXEffectImpl_SetVectorArray
,
1571 ID3DXEffectImpl_GetVectorArray
,
1572 ID3DXEffectImpl_SetMatrix
,
1573 ID3DXEffectImpl_GetMatrix
,
1574 ID3DXEffectImpl_SetMatrixArray
,
1575 ID3DXEffectImpl_GetMatrixArray
,
1576 ID3DXEffectImpl_SetMatrixPointerArray
,
1577 ID3DXEffectImpl_GetMatrixPointerArray
,
1578 ID3DXEffectImpl_SetMatrixTranspose
,
1579 ID3DXEffectImpl_GetMatrixTranspose
,
1580 ID3DXEffectImpl_SetMatrixTransposeArray
,
1581 ID3DXEffectImpl_GetMatrixTransposeArray
,
1582 ID3DXEffectImpl_SetMatrixTransposePointerArray
,
1583 ID3DXEffectImpl_GetMatrixTransposePointerArray
,
1584 ID3DXEffectImpl_SetString
,
1585 ID3DXEffectImpl_GetString
,
1586 ID3DXEffectImpl_SetTexture
,
1587 ID3DXEffectImpl_GetTexture
,
1588 ID3DXEffectImpl_GetPixelShader
,
1589 ID3DXEffectImpl_GetVertexShader
,
1590 ID3DXEffectImpl_SetArrayRange
,
1591 /*** ID3DXEffect methods ***/
1592 ID3DXEffectImpl_GetPool
,
1593 ID3DXEffectImpl_SetTechnique
,
1594 ID3DXEffectImpl_GetCurrentTechnique
,
1595 ID3DXEffectImpl_ValidateTechnique
,
1596 ID3DXEffectImpl_FindNextValidTechnique
,
1597 ID3DXEffectImpl_IsParameterUsed
,
1598 ID3DXEffectImpl_Begin
,
1599 ID3DXEffectImpl_BeginPass
,
1600 ID3DXEffectImpl_CommitChanges
,
1601 ID3DXEffectImpl_EndPass
,
1602 ID3DXEffectImpl_End
,
1603 ID3DXEffectImpl_GetDevice
,
1604 ID3DXEffectImpl_OnLostDevice
,
1605 ID3DXEffectImpl_OnResetDevice
,
1606 ID3DXEffectImpl_SetStateManager
,
1607 ID3DXEffectImpl_GetStateManager
,
1608 ID3DXEffectImpl_BeginParameterBlock
,
1609 ID3DXEffectImpl_EndParameterBlock
,
1610 ID3DXEffectImpl_ApplyParameterBlock
,
1611 ID3DXEffectImpl_DeleteParameterBlock
,
1612 ID3DXEffectImpl_CloneEffect
,
1613 ID3DXEffectImpl_SetRawValue
1616 static inline struct ID3DXEffectCompilerImpl
*impl_from_ID3DXEffectCompiler(ID3DXEffectCompiler
*iface
)
1618 return CONTAINING_RECORD(iface
, struct ID3DXEffectCompilerImpl
, ID3DXEffectCompiler_iface
);
1621 /*** IUnknown methods ***/
1622 static HRESULT WINAPI
ID3DXEffectCompilerImpl_QueryInterface(ID3DXEffectCompiler
*iface
, REFIID riid
, void **object
)
1624 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1626 TRACE("iface %p, riid %s, object %p\n", This
, debugstr_guid(riid
), object
);
1628 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
1629 IsEqualGUID(riid
, &IID_ID3DXEffectCompiler
))
1631 This
->ID3DXEffectCompiler_iface
.lpVtbl
->AddRef(iface
);
1636 ERR("Interface %s not found\n", debugstr_guid(riid
));
1638 return E_NOINTERFACE
;
1641 static ULONG WINAPI
ID3DXEffectCompilerImpl_AddRef(ID3DXEffectCompiler
*iface
)
1643 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1645 TRACE("iface %p: AddRef from %u\n", iface
, This
->ref
);
1647 return InterlockedIncrement(&This
->ref
);
1650 static ULONG WINAPI
ID3DXEffectCompilerImpl_Release(ID3DXEffectCompiler
*iface
)
1652 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1653 ULONG ref
= InterlockedDecrement(&This
->ref
);
1655 TRACE("iface %p: Release from %u\n", iface
, ref
+ 1);
1659 free_effect_compiler(This
);
1660 HeapFree(GetProcessHeap(), 0, This
);
1666 /*** ID3DXBaseEffect methods ***/
1667 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetDesc(ID3DXEffectCompiler
*iface
, D3DXEFFECT_DESC
*desc
)
1669 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1670 ID3DXBaseEffect
*base
= This
->base_effect
;
1672 TRACE("Forward iface %p, base %p\n", This
, base
);
1674 return ID3DXBaseEffectImpl_GetDesc(base
, desc
);
1677 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetParameterDesc(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, D3DXPARAMETER_DESC
*desc
)
1679 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1680 ID3DXBaseEffect
*base
= This
->base_effect
;
1682 TRACE("Forward iface %p, base %p\n", This
, base
);
1684 return ID3DXBaseEffectImpl_GetParameterDesc(base
, parameter
, desc
);
1687 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetTechniqueDesc(ID3DXEffectCompiler
*iface
, D3DXHANDLE technique
, D3DXTECHNIQUE_DESC
*desc
)
1689 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1690 ID3DXBaseEffect
*base
= This
->base_effect
;
1692 TRACE("Forward iface %p, base %p\n", This
, base
);
1694 return ID3DXBaseEffectImpl_GetTechniqueDesc(base
, technique
, desc
);
1697 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetPassDesc(ID3DXEffectCompiler
*iface
, D3DXHANDLE pass
, D3DXPASS_DESC
*desc
)
1699 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1700 ID3DXBaseEffect
*base
= This
->base_effect
;
1702 TRACE("Forward iface %p, base %p\n", This
, base
);
1704 return ID3DXBaseEffectImpl_GetPassDesc(base
, pass
, desc
);
1707 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetFunctionDesc(ID3DXEffectCompiler
*iface
, D3DXHANDLE shader
, D3DXFUNCTION_DESC
*desc
)
1709 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1710 ID3DXBaseEffect
*base
= This
->base_effect
;
1712 TRACE("Forward iface %p, base %p\n", This
, base
);
1714 return ID3DXBaseEffectImpl_GetFunctionDesc(base
, shader
, desc
);
1717 static D3DXHANDLE WINAPI
ID3DXEffectCompilerImpl_GetParameter(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, UINT index
)
1719 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1720 ID3DXBaseEffect
*base
= This
->base_effect
;
1722 TRACE("Forward iface %p, base %p\n", This
, base
);
1724 return ID3DXBaseEffectImpl_GetParameter(base
, parameter
, index
);
1727 static D3DXHANDLE WINAPI
ID3DXEffectCompilerImpl_GetParameterByName(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, LPCSTR name
)
1729 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1730 ID3DXBaseEffect
*base
= This
->base_effect
;
1732 TRACE("Forward iface %p, base %p\n", This
, base
);
1734 return ID3DXBaseEffectImpl_GetParameterByName(base
, parameter
, name
);
1737 static D3DXHANDLE WINAPI
ID3DXEffectCompilerImpl_GetParameterBySemantic(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, LPCSTR semantic
)
1739 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1740 ID3DXBaseEffect
*base
= This
->base_effect
;
1742 TRACE("Forward iface %p, base %p\n", This
, base
);
1744 return ID3DXBaseEffectImpl_GetParameterBySemantic(base
, parameter
, semantic
);
1747 static D3DXHANDLE WINAPI
ID3DXEffectCompilerImpl_GetParameterElement(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, UINT index
)
1749 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1750 ID3DXBaseEffect
*base
= This
->base_effect
;
1752 TRACE("Forward iface %p, base %p\n", This
, base
);
1754 return ID3DXBaseEffectImpl_GetParameterElement(base
, parameter
, index
);
1757 static D3DXHANDLE WINAPI
ID3DXEffectCompilerImpl_GetTechnique(ID3DXEffectCompiler
*iface
, UINT index
)
1759 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1760 ID3DXBaseEffect
*base
= This
->base_effect
;
1762 TRACE("Forward iface %p, base %p\n", This
, base
);
1764 return ID3DXBaseEffectImpl_GetTechnique(base
, index
);
1767 static D3DXHANDLE WINAPI
ID3DXEffectCompilerImpl_GetTechniqueByName(ID3DXEffectCompiler
*iface
, LPCSTR name
)
1769 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1770 ID3DXBaseEffect
*base
= This
->base_effect
;
1772 TRACE("Forward iface %p, base %p\n", This
, base
);
1774 return ID3DXBaseEffectImpl_GetTechniqueByName(base
, name
);
1777 static D3DXHANDLE WINAPI
ID3DXEffectCompilerImpl_GetPass(ID3DXEffectCompiler
*iface
, D3DXHANDLE technique
, UINT index
)
1779 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1780 ID3DXBaseEffect
*base
= This
->base_effect
;
1782 TRACE("Forward iface %p, base %p\n", This
, base
);
1784 return ID3DXBaseEffectImpl_GetPass(base
, technique
, index
);
1787 static D3DXHANDLE WINAPI
ID3DXEffectCompilerImpl_GetPassByName(ID3DXEffectCompiler
*iface
, D3DXHANDLE technique
, LPCSTR name
)
1789 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1790 ID3DXBaseEffect
*base
= This
->base_effect
;
1792 TRACE("Forward iface %p, base %p\n", This
, base
);
1794 return ID3DXBaseEffectImpl_GetPassByName(base
, technique
, name
);
1797 static D3DXHANDLE WINAPI
ID3DXEffectCompilerImpl_GetFunction(ID3DXEffectCompiler
*iface
, UINT index
)
1799 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1800 ID3DXBaseEffect
*base
= This
->base_effect
;
1802 TRACE("Forward iface %p, base %p\n", This
, base
);
1804 return ID3DXBaseEffectImpl_GetFunction(base
, index
);
1807 static D3DXHANDLE WINAPI
ID3DXEffectCompilerImpl_GetFunctionByName(ID3DXEffectCompiler
*iface
, LPCSTR name
)
1809 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1810 ID3DXBaseEffect
*base
= This
->base_effect
;
1812 TRACE("Forward iface %p, base %p\n", This
, base
);
1814 return ID3DXBaseEffectImpl_GetFunctionByName(base
, name
);
1817 static D3DXHANDLE WINAPI
ID3DXEffectCompilerImpl_GetAnnotation(ID3DXEffectCompiler
*iface
, D3DXHANDLE object
, UINT index
)
1819 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1820 ID3DXBaseEffect
*base
= This
->base_effect
;
1822 TRACE("Forward iface %p, base %p\n", This
, base
);
1824 return ID3DXBaseEffectImpl_GetAnnotation(base
, object
, index
);
1827 static D3DXHANDLE WINAPI
ID3DXEffectCompilerImpl_GetAnnotationByName(ID3DXEffectCompiler
*iface
, D3DXHANDLE object
, LPCSTR name
)
1829 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1830 ID3DXBaseEffect
*base
= This
->base_effect
;
1832 TRACE("Forward iface %p, base %p\n", This
, base
);
1834 return ID3DXBaseEffectImpl_GetAnnotationByName(base
, object
, name
);
1837 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetValue(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, LPCVOID data
, UINT bytes
)
1839 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1840 ID3DXBaseEffect
*base
= This
->base_effect
;
1842 TRACE("Forward iface %p, base %p\n", This
, base
);
1844 return ID3DXBaseEffectImpl_SetValue(base
, parameter
, data
, bytes
);
1847 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetValue(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, LPVOID data
, UINT bytes
)
1849 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1850 ID3DXBaseEffect
*base
= This
->base_effect
;
1852 TRACE("Forward iface %p, base %p\n", This
, base
);
1854 return ID3DXBaseEffectImpl_GetValue(base
, parameter
, data
, bytes
);
1857 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetBool(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, BOOL b
)
1859 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1860 ID3DXBaseEffect
*base
= This
->base_effect
;
1862 TRACE("Forward iface %p, base %p\n", This
, base
);
1864 return ID3DXBaseEffectImpl_SetBool(base
, parameter
, b
);
1867 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetBool(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, BOOL
*b
)
1869 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1870 ID3DXBaseEffect
*base
= This
->base_effect
;
1872 TRACE("Forward iface %p, base %p\n", This
, base
);
1874 return ID3DXBaseEffectImpl_GetBool(base
, parameter
, b
);
1877 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetBoolArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, CONST BOOL
*b
, UINT count
)
1879 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1880 ID3DXBaseEffect
*base
= This
->base_effect
;
1882 TRACE("Forward iface %p, base %p\n", This
, base
);
1884 return ID3DXBaseEffectImpl_SetBoolArray(base
, parameter
, b
, count
);
1887 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetBoolArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, BOOL
*b
, UINT count
)
1889 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1890 ID3DXBaseEffect
*base
= This
->base_effect
;
1892 TRACE("Forward iface %p, base %p\n", This
, base
);
1894 return ID3DXBaseEffectImpl_GetBoolArray(base
, parameter
, b
, count
);
1897 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetInt(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, INT n
)
1899 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1900 ID3DXBaseEffect
*base
= This
->base_effect
;
1902 TRACE("Forward iface %p, base %p\n", This
, base
);
1904 return ID3DXBaseEffectImpl_SetInt(base
, parameter
, n
);
1907 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetInt(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, INT
*n
)
1909 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1910 ID3DXBaseEffect
*base
= This
->base_effect
;
1912 TRACE("Forward iface %p, base %p\n", This
, base
);
1914 return ID3DXBaseEffectImpl_GetInt(base
, parameter
, n
);
1917 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetIntArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, CONST INT
*n
, UINT count
)
1919 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1920 ID3DXBaseEffect
*base
= This
->base_effect
;
1922 TRACE("Forward iface %p, base %p\n", This
, base
);
1924 return ID3DXBaseEffectImpl_SetIntArray(base
, parameter
, n
, count
);
1927 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetIntArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, INT
*n
, UINT count
)
1929 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1930 ID3DXBaseEffect
*base
= This
->base_effect
;
1932 TRACE("Forward iface %p, base %p\n", This
, base
);
1934 return ID3DXBaseEffectImpl_GetIntArray(base
, parameter
, n
, count
);
1937 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetFloat(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, FLOAT f
)
1939 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1940 ID3DXBaseEffect
*base
= This
->base_effect
;
1942 TRACE("Forward iface %p, base %p\n", This
, base
);
1944 return ID3DXBaseEffectImpl_SetFloat(base
, parameter
, f
);
1947 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetFloat(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, FLOAT
*f
)
1949 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1950 ID3DXBaseEffect
*base
= This
->base_effect
;
1952 TRACE("Forward iface %p, base %p\n", This
, base
);
1954 return ID3DXBaseEffectImpl_GetFloat(base
, parameter
, f
);
1957 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetFloatArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, CONST FLOAT
*f
, UINT count
)
1959 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1960 ID3DXBaseEffect
*base
= This
->base_effect
;
1962 TRACE("Forward iface %p, base %p\n", This
, base
);
1964 return ID3DXBaseEffectImpl_SetFloatArray(base
, parameter
, f
, count
);
1967 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetFloatArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, FLOAT
*f
, UINT count
)
1969 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1970 ID3DXBaseEffect
*base
= This
->base_effect
;
1972 TRACE("Forward iface %p, base %p\n", This
, base
);
1974 return ID3DXBaseEffectImpl_GetFloatArray(base
, parameter
, f
, count
);
1977 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetVector(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, CONST D3DXVECTOR4
*vector
)
1979 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1980 ID3DXBaseEffect
*base
= This
->base_effect
;
1982 TRACE("Forward iface %p, base %p\n", This
, base
);
1984 return ID3DXBaseEffectImpl_SetVector(base
, parameter
, vector
);
1987 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetVector(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, D3DXVECTOR4
*vector
)
1989 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
1990 ID3DXBaseEffect
*base
= This
->base_effect
;
1992 TRACE("Forward iface %p, base %p\n", This
, base
);
1994 return ID3DXBaseEffectImpl_GetVector(base
, parameter
, vector
);
1997 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetVectorArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, CONST D3DXVECTOR4
*vector
, UINT count
)
1999 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2000 ID3DXBaseEffect
*base
= This
->base_effect
;
2002 TRACE("Forward iface %p, base %p\n", This
, base
);
2004 return ID3DXBaseEffectImpl_SetVectorArray(base
, parameter
, vector
, count
);
2007 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetVectorArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, D3DXVECTOR4
*vector
, UINT count
)
2009 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2010 ID3DXBaseEffect
*base
= This
->base_effect
;
2012 TRACE("Forward iface %p, base %p\n", This
, base
);
2014 return ID3DXBaseEffectImpl_SetVectorArray(base
, parameter
, vector
, count
);
2017 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetMatrix(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
*matrix
)
2019 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2020 ID3DXBaseEffect
*base
= This
->base_effect
;
2022 TRACE("Forward iface %p, base %p\n", This
, base
);
2024 return ID3DXBaseEffectImpl_SetMatrix(base
, parameter
, matrix
);
2027 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetMatrix(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
*matrix
)
2029 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2030 ID3DXBaseEffect
*base
= This
->base_effect
;
2032 TRACE("Forward iface %p, base %p\n", This
, base
);
2034 return ID3DXBaseEffectImpl_GetMatrix(base
, parameter
, matrix
);
2037 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetMatrixArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
*matrix
, UINT count
)
2039 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2040 ID3DXBaseEffect
*base
= This
->base_effect
;
2042 TRACE("Forward iface %p, base %p\n", This
, base
);
2044 return ID3DXBaseEffectImpl_SetMatrixArray(base
, parameter
, matrix
, count
);
2047 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetMatrixArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
*matrix
, UINT count
)
2049 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2050 ID3DXBaseEffect
*base
= This
->base_effect
;
2052 TRACE("Forward iface %p, base %p\n", This
, base
);
2054 return ID3DXBaseEffectImpl_GetMatrixArray(base
, parameter
, matrix
, count
);
2057 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetMatrixPointerArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
**matrix
, UINT count
)
2059 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2060 ID3DXBaseEffect
*base
= This
->base_effect
;
2062 TRACE("Forward iface %p, base %p\n", This
, base
);
2064 return ID3DXBaseEffectImpl_SetMatrixPointerArray(base
, parameter
, matrix
, count
);
2067 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetMatrixPointerArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
**matrix
, UINT count
)
2069 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2070 ID3DXBaseEffect
*base
= This
->base_effect
;
2072 TRACE("Forward iface %p, base %p\n", This
, base
);
2074 return ID3DXBaseEffectImpl_GetMatrixPointerArray(base
, parameter
, matrix
, count
);
2077 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetMatrixTranspose(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
*matrix
)
2079 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2080 ID3DXBaseEffect
*base
= This
->base_effect
;
2082 TRACE("Forward iface %p, base %p\n", This
, base
);
2084 return ID3DXBaseEffectImpl_SetMatrixTranspose(base
, parameter
, matrix
);
2087 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetMatrixTranspose(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
*matrix
)
2089 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2090 ID3DXBaseEffect
*base
= This
->base_effect
;
2092 TRACE("Forward iface %p, base %p\n", This
, base
);
2094 return ID3DXBaseEffectImpl_GetMatrixTranspose(base
, parameter
, matrix
);
2097 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetMatrixTransposeArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
*matrix
, UINT count
)
2099 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2100 ID3DXBaseEffect
*base
= This
->base_effect
;
2102 TRACE("Forward iface %p, base %p\n", This
, base
);
2104 return ID3DXBaseEffectImpl_SetMatrixTransposeArray(base
, parameter
, matrix
, count
);
2107 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetMatrixTransposeArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
*matrix
, UINT count
)
2109 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2110 ID3DXBaseEffect
*base
= This
->base_effect
;
2112 TRACE("Forward iface %p, base %p\n", This
, base
);
2114 return ID3DXBaseEffectImpl_GetMatrixTransposeArray(base
, parameter
, matrix
, count
);
2117 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetMatrixTransposePointerArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, CONST D3DXMATRIX
**matrix
, UINT count
)
2119 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2120 ID3DXBaseEffect
*base
= This
->base_effect
;
2122 TRACE("Forward iface %p, base %p\n", This
, base
);
2124 return ID3DXBaseEffectImpl_SetMatrixTransposePointerArray(base
, parameter
, matrix
, count
);
2127 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetMatrixTransposePointerArray(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, D3DXMATRIX
**matrix
, UINT count
)
2129 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2130 ID3DXBaseEffect
*base
= This
->base_effect
;
2132 TRACE("Forward iface %p, base %p\n", This
, base
);
2134 return ID3DXBaseEffectImpl_GetMatrixTransposePointerArray(base
, parameter
, matrix
, count
);
2137 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetString(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, LPCSTR string
)
2139 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2140 ID3DXBaseEffect
*base
= This
->base_effect
;
2142 TRACE("Forward iface %p, base %p\n", This
, base
);
2144 return ID3DXBaseEffectImpl_SetString(base
, parameter
, string
);
2147 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetString(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, LPCSTR
*string
)
2149 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2150 ID3DXBaseEffect
*base
= This
->base_effect
;
2152 TRACE("Forward iface %p, base %p\n", This
, base
);
2154 return ID3DXBaseEffectImpl_GetString(base
, parameter
, string
);
2157 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetTexture(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, LPDIRECT3DBASETEXTURE9 texture
)
2159 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2160 ID3DXBaseEffect
*base
= This
->base_effect
;
2162 TRACE("Forward iface %p, base %p\n", This
, base
);
2164 return ID3DXBaseEffectImpl_SetTexture(base
, parameter
, texture
);
2167 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetTexture(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, LPDIRECT3DBASETEXTURE9
*texture
)
2169 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2170 ID3DXBaseEffect
*base
= This
->base_effect
;
2172 TRACE("Forward iface %p, base %p\n", This
, base
);
2174 return ID3DXBaseEffectImpl_GetTexture(base
, parameter
, texture
);
2177 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetPixelShader(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, LPDIRECT3DPIXELSHADER9
*pshader
)
2179 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2180 ID3DXBaseEffect
*base
= This
->base_effect
;
2182 TRACE("Forward iface %p, base %p\n", This
, base
);
2184 return ID3DXBaseEffectImpl_GetPixelShader(base
, parameter
, pshader
);
2187 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetVertexShader(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, LPDIRECT3DVERTEXSHADER9
*vshader
)
2189 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2190 ID3DXBaseEffect
*base
= This
->base_effect
;
2192 TRACE("Forward iface %p, base %p\n", This
, base
);
2194 return ID3DXBaseEffectImpl_GetVertexShader(base
, parameter
, vshader
);
2197 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetArrayRange(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, UINT start
, UINT end
)
2199 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2200 ID3DXBaseEffect
*base
= This
->base_effect
;
2202 TRACE("Forward iface %p, base %p\n", This
, base
);
2204 return ID3DXBaseEffectImpl_SetArrayRange(base
, parameter
, start
, end
);
2207 /*** ID3DXEffectCompiler methods ***/
2208 static HRESULT WINAPI
ID3DXEffectCompilerImpl_SetLiteral(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, BOOL literal
)
2210 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2212 FIXME("iface %p, parameter %p, literal %u\n", This
, parameter
, literal
);
2217 static HRESULT WINAPI
ID3DXEffectCompilerImpl_GetLiteral(ID3DXEffectCompiler
*iface
, D3DXHANDLE parameter
, BOOL
*literal
)
2219 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2221 FIXME("iface %p, parameter %p, literal %p\n", This
, parameter
, literal
);
2226 static HRESULT WINAPI
ID3DXEffectCompilerImpl_CompileEffect(ID3DXEffectCompiler
*iface
, DWORD flags
,
2227 LPD3DXBUFFER
*effect
, LPD3DXBUFFER
*error_msgs
)
2229 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2231 FIXME("iface %p, flags %#x, effect %p, error_msgs %p stub\n", This
, flags
, effect
, error_msgs
);
2236 static HRESULT WINAPI
ID3DXEffectCompilerImpl_CompileShader(ID3DXEffectCompiler
*iface
, D3DXHANDLE function
,
2237 LPCSTR target
, DWORD flags
, LPD3DXBUFFER
*shader
, LPD3DXBUFFER
*error_msgs
, LPD3DXCONSTANTTABLE
*constant_table
)
2239 struct ID3DXEffectCompilerImpl
*This
= impl_from_ID3DXEffectCompiler(iface
);
2241 FIXME("iface %p, function %p, target %p, flags %#x, shader %p, error_msgs %p, constant_table %p stub\n",
2242 This
, function
, target
, flags
, shader
, error_msgs
, constant_table
);
2247 static const struct ID3DXEffectCompilerVtbl ID3DXEffectCompiler_Vtbl
=
2249 /*** IUnknown methods ***/
2250 ID3DXEffectCompilerImpl_QueryInterface
,
2251 ID3DXEffectCompilerImpl_AddRef
,
2252 ID3DXEffectCompilerImpl_Release
,
2253 /*** ID3DXBaseEffect methods ***/
2254 ID3DXEffectCompilerImpl_GetDesc
,
2255 ID3DXEffectCompilerImpl_GetParameterDesc
,
2256 ID3DXEffectCompilerImpl_GetTechniqueDesc
,
2257 ID3DXEffectCompilerImpl_GetPassDesc
,
2258 ID3DXEffectCompilerImpl_GetFunctionDesc
,
2259 ID3DXEffectCompilerImpl_GetParameter
,
2260 ID3DXEffectCompilerImpl_GetParameterByName
,
2261 ID3DXEffectCompilerImpl_GetParameterBySemantic
,
2262 ID3DXEffectCompilerImpl_GetParameterElement
,
2263 ID3DXEffectCompilerImpl_GetTechnique
,
2264 ID3DXEffectCompilerImpl_GetTechniqueByName
,
2265 ID3DXEffectCompilerImpl_GetPass
,
2266 ID3DXEffectCompilerImpl_GetPassByName
,
2267 ID3DXEffectCompilerImpl_GetFunction
,
2268 ID3DXEffectCompilerImpl_GetFunctionByName
,
2269 ID3DXEffectCompilerImpl_GetAnnotation
,
2270 ID3DXEffectCompilerImpl_GetAnnotationByName
,
2271 ID3DXEffectCompilerImpl_SetValue
,
2272 ID3DXEffectCompilerImpl_GetValue
,
2273 ID3DXEffectCompilerImpl_SetBool
,
2274 ID3DXEffectCompilerImpl_GetBool
,
2275 ID3DXEffectCompilerImpl_SetBoolArray
,
2276 ID3DXEffectCompilerImpl_GetBoolArray
,
2277 ID3DXEffectCompilerImpl_SetInt
,
2278 ID3DXEffectCompilerImpl_GetInt
,
2279 ID3DXEffectCompilerImpl_SetIntArray
,
2280 ID3DXEffectCompilerImpl_GetIntArray
,
2281 ID3DXEffectCompilerImpl_SetFloat
,
2282 ID3DXEffectCompilerImpl_GetFloat
,
2283 ID3DXEffectCompilerImpl_SetFloatArray
,
2284 ID3DXEffectCompilerImpl_GetFloatArray
,
2285 ID3DXEffectCompilerImpl_SetVector
,
2286 ID3DXEffectCompilerImpl_GetVector
,
2287 ID3DXEffectCompilerImpl_SetVectorArray
,
2288 ID3DXEffectCompilerImpl_GetVectorArray
,
2289 ID3DXEffectCompilerImpl_SetMatrix
,
2290 ID3DXEffectCompilerImpl_GetMatrix
,
2291 ID3DXEffectCompilerImpl_SetMatrixArray
,
2292 ID3DXEffectCompilerImpl_GetMatrixArray
,
2293 ID3DXEffectCompilerImpl_SetMatrixPointerArray
,
2294 ID3DXEffectCompilerImpl_GetMatrixPointerArray
,
2295 ID3DXEffectCompilerImpl_SetMatrixTranspose
,
2296 ID3DXEffectCompilerImpl_GetMatrixTranspose
,
2297 ID3DXEffectCompilerImpl_SetMatrixTransposeArray
,
2298 ID3DXEffectCompilerImpl_GetMatrixTransposeArray
,
2299 ID3DXEffectCompilerImpl_SetMatrixTransposePointerArray
,
2300 ID3DXEffectCompilerImpl_GetMatrixTransposePointerArray
,
2301 ID3DXEffectCompilerImpl_SetString
,
2302 ID3DXEffectCompilerImpl_GetString
,
2303 ID3DXEffectCompilerImpl_SetTexture
,
2304 ID3DXEffectCompilerImpl_GetTexture
,
2305 ID3DXEffectCompilerImpl_GetPixelShader
,
2306 ID3DXEffectCompilerImpl_GetVertexShader
,
2307 ID3DXEffectCompilerImpl_SetArrayRange
,
2308 /*** ID3DXEffectCompiler methods ***/
2309 ID3DXEffectCompilerImpl_SetLiteral
,
2310 ID3DXEffectCompilerImpl_GetLiteral
,
2311 ID3DXEffectCompilerImpl_CompileEffect
,
2312 ID3DXEffectCompilerImpl_CompileShader
,
2315 static HRESULT
d3dx9_parse_effect(struct ID3DXBaseEffectImpl
*base
, const char *data
, UINT data_size
, DWORD start
)
2317 const char *ptr
= data
+ start
;
2319 read_dword(&ptr
, &base
->parameter_count
);
2320 TRACE("Parameter count: %u\n", base
->parameter_count
);
2322 read_dword(&ptr
, &base
->technique_count
);
2323 TRACE("Technique count: %u\n", base
->technique_count
);
2325 skip_dword_unknown(&ptr
, 2);
2327 /* todo: Parse parameter */
2329 /* todo: Parse techniques */
2334 static HRESULT
d3dx9_base_effect_init(struct ID3DXBaseEffectImpl
*base
,
2335 const char *data
, SIZE_T data_size
, struct ID3DXEffectImpl
*effect
)
2338 const char *ptr
= data
;
2341 TRACE("base %p, data %p, data_size %lu, effect %p\n", base
, data
, data_size
, effect
);
2343 base
->ID3DXBaseEffect_iface
.lpVtbl
= &ID3DXBaseEffect_Vtbl
;
2345 base
->effect
= effect
;
2347 read_dword(&ptr
, &tag
);
2348 TRACE("Tag: %x\n", tag
);
2350 if (tag
!= d3dx9_effect_version(9, 1))
2352 /* todo: compile hlsl ascii code */
2353 FIXME("HLSL ascii effects not supported, yet\n");
2355 /* Show the start of the shader for debugging info. */
2356 TRACE("effect:\n%s\n", debugstr_an(data
, data_size
> 40 ? 40 : data_size
));
2360 read_dword(&ptr
, &offset
);
2361 TRACE("Offset: %x\n", offset
);
2363 hr
= d3dx9_parse_effect(base
, ptr
, data_size
, offset
);
2366 FIXME("Failed to parse effect.\n");
2374 static HRESULT
d3dx9_effect_init(struct ID3DXEffectImpl
*effect
, LPDIRECT3DDEVICE9 device
,
2375 const char *data
, SIZE_T data_size
, LPD3DXEFFECTPOOL pool
)
2378 struct ID3DXBaseEffectImpl
*object
= NULL
;
2380 TRACE("effect %p, device %p, data %p, data_size %lu, pool %p\n", effect
, device
, data
, data_size
, pool
);
2382 effect
->ID3DXEffect_iface
.lpVtbl
= &ID3DXEffect_Vtbl
;
2385 if (pool
) pool
->lpVtbl
->AddRef(pool
);
2386 effect
->pool
= pool
;
2388 IDirect3DDevice9_AddRef(device
);
2389 effect
->device
= device
;
2391 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
2394 ERR("Out of memory\n");
2399 hr
= d3dx9_base_effect_init(object
, data
, data_size
, effect
);
2402 FIXME("Failed to parse effect.\n");
2406 effect
->base_effect
= &object
->ID3DXBaseEffect_iface
;
2412 HeapFree(GetProcessHeap(), 0, object
);
2413 free_effect(effect
);
2418 HRESULT WINAPI
D3DXCreateEffectEx(LPDIRECT3DDEVICE9 device
,
2421 CONST D3DXMACRO
* defines
,
2422 LPD3DXINCLUDE include
,
2423 LPCSTR skip_constants
,
2425 LPD3DXEFFECTPOOL pool
,
2426 LPD3DXEFFECT
* effect
,
2427 LPD3DXBUFFER
* compilation_errors
)
2429 struct ID3DXEffectImpl
*object
;
2432 FIXME("(%p, %p, %u, %p, %p, %p, %#x, %p, %p, %p): semi-stub\n", device
, srcdata
, srcdatalen
, defines
, include
,
2433 skip_constants
, flags
, pool
, effect
, compilation_errors
);
2435 if (!device
|| !srcdata
)
2436 return D3DERR_INVALIDCALL
;
2441 /* Native dll allows effect to be null so just return D3D_OK after doing basic checks */
2445 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
2448 ERR("Out of memory\n");
2449 return E_OUTOFMEMORY
;
2452 hr
= d3dx9_effect_init(object
, device
, srcdata
, srcdatalen
, pool
);
2455 WARN("Failed to initialize shader reflection\n");
2456 HeapFree(GetProcessHeap(), 0, object
);
2460 *effect
= &object
->ID3DXEffect_iface
;
2462 TRACE("Created ID3DXEffect %p\n", object
);
2467 HRESULT WINAPI
D3DXCreateEffect(LPDIRECT3DDEVICE9 device
,
2470 CONST D3DXMACRO
* defines
,
2471 LPD3DXINCLUDE include
,
2473 LPD3DXEFFECTPOOL pool
,
2474 LPD3DXEFFECT
* effect
,
2475 LPD3DXBUFFER
* compilation_errors
)
2477 TRACE("(%p, %p, %u, %p, %p, %#x, %p, %p, %p): Forwarded to D3DXCreateEffectEx\n", device
, srcdata
, srcdatalen
, defines
,
2478 include
, flags
, pool
, effect
, compilation_errors
);
2480 return D3DXCreateEffectEx(device
, srcdata
, srcdatalen
, defines
, include
, NULL
, flags
, pool
, effect
, compilation_errors
);
2483 static HRESULT
d3dx9_effect_compiler_init(struct ID3DXEffectCompilerImpl
*compiler
, const char *data
, SIZE_T data_size
)
2486 struct ID3DXBaseEffectImpl
*object
= NULL
;
2488 TRACE("effect %p, data %p, data_size %lu\n", compiler
, data
, data_size
);
2490 compiler
->ID3DXEffectCompiler_iface
.lpVtbl
= &ID3DXEffectCompiler_Vtbl
;
2493 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
2496 ERR("Out of memory\n");
2501 hr
= d3dx9_base_effect_init(object
, data
, data_size
, NULL
);
2504 FIXME("Failed to parse effect.\n");
2508 compiler
->base_effect
= &object
->ID3DXBaseEffect_iface
;
2514 HeapFree(GetProcessHeap(), 0, object
);
2515 free_effect_compiler(compiler
);
2520 HRESULT WINAPI
D3DXCreateEffectCompiler(LPCSTR srcdata
,
2522 CONST D3DXMACRO
*defines
,
2523 LPD3DXINCLUDE include
,
2525 LPD3DXEFFECTCOMPILER
*compiler
,
2526 LPD3DXBUFFER
*parse_errors
)
2528 struct ID3DXEffectCompilerImpl
*object
;
2531 TRACE("srcdata %p, srcdatalen %u, defines %p, include %p, flags %#x, compiler %p, parse_errors %p\n",
2532 srcdata
, srcdatalen
, defines
, include
, flags
, compiler
, parse_errors
);
2534 if (!srcdata
|| !compiler
)
2536 WARN("Invalid arguments supplied\n");
2537 return D3DERR_INVALIDCALL
;
2540 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
2543 ERR("Out of memory\n");
2544 return E_OUTOFMEMORY
;
2547 hr
= d3dx9_effect_compiler_init(object
, srcdata
, srcdatalen
);
2550 WARN("Failed to initialize effect compiler\n");
2551 HeapFree(GetProcessHeap(), 0, object
);
2555 *compiler
= &object
->ID3DXEffectCompiler_iface
;
2557 TRACE("Created ID3DXEffectCompiler %p\n", object
);
2562 static const struct ID3DXEffectPoolVtbl ID3DXEffectPool_Vtbl
;
2564 struct ID3DXEffectPoolImpl
2566 ID3DXEffectPool ID3DXEffectPool_iface
;
2570 static inline struct ID3DXEffectPoolImpl
*impl_from_ID3DXEffectPool(ID3DXEffectPool
*iface
)
2572 return CONTAINING_RECORD(iface
, struct ID3DXEffectPoolImpl
, ID3DXEffectPool_iface
);
2575 /*** IUnknown methods ***/
2576 static HRESULT WINAPI
ID3DXEffectPoolImpl_QueryInterface(ID3DXEffectPool
*iface
, REFIID riid
, void **object
)
2578 struct ID3DXEffectPoolImpl
*This
= impl_from_ID3DXEffectPool(iface
);
2580 TRACE("(%p)->(%s, %p)\n", This
, debugstr_guid(riid
), object
);
2582 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
2583 IsEqualGUID(riid
, &IID_ID3DXEffectPool
))
2585 This
->ID3DXEffectPool_iface
.lpVtbl
->AddRef(iface
);
2590 WARN("Interface %s not found\n", debugstr_guid(riid
));
2592 return E_NOINTERFACE
;
2595 static ULONG WINAPI
ID3DXEffectPoolImpl_AddRef(ID3DXEffectPool
*iface
)
2597 struct ID3DXEffectPoolImpl
*This
= impl_from_ID3DXEffectPool(iface
);
2599 TRACE("(%p)->(): AddRef from %u\n", This
, This
->ref
);
2601 return InterlockedIncrement(&This
->ref
);
2604 static ULONG WINAPI
ID3DXEffectPoolImpl_Release(ID3DXEffectPool
*iface
)
2606 struct ID3DXEffectPoolImpl
*This
= impl_from_ID3DXEffectPool(iface
);
2607 ULONG ref
= InterlockedDecrement(&This
->ref
);
2609 TRACE("(%p)->(): Release from %u\n", This
, ref
+ 1);
2612 HeapFree(GetProcessHeap(), 0, This
);
2617 static const struct ID3DXEffectPoolVtbl ID3DXEffectPool_Vtbl
=
2619 /*** IUnknown methods ***/
2620 ID3DXEffectPoolImpl_QueryInterface
,
2621 ID3DXEffectPoolImpl_AddRef
,
2622 ID3DXEffectPoolImpl_Release
2625 HRESULT WINAPI
D3DXCreateEffectPool(LPD3DXEFFECTPOOL
*pool
)
2627 struct ID3DXEffectPoolImpl
*object
;
2629 TRACE("(%p)\n", pool
);
2632 return D3DERR_INVALIDCALL
;
2634 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
));
2637 ERR("Out of memory\n");
2638 return E_OUTOFMEMORY
;
2641 object
->ID3DXEffectPool_iface
.lpVtbl
= &ID3DXEffectPool_Vtbl
;
2644 *pool
= &object
->ID3DXEffectPool_iface
;
2649 HRESULT WINAPI
D3DXCreateEffectFromFileExW(LPDIRECT3DDEVICE9 device
, LPCWSTR srcfile
,
2650 const D3DXMACRO
*defines
, LPD3DXINCLUDE include
, LPCSTR skipconstants
, DWORD flags
,
2651 LPD3DXEFFECTPOOL pool
, LPD3DXEFFECT
*effect
, LPD3DXBUFFER
*compilationerrors
)
2657 TRACE("(%s): relay\n", debugstr_w(srcfile
));
2659 if (!device
|| !srcfile
|| !defines
)
2660 return D3DERR_INVALIDCALL
;
2662 ret
= map_view_of_file(srcfile
, &buffer
, &size
);
2665 return D3DXERR_INVALIDDATA
;
2667 ret
= D3DXCreateEffectEx(device
, buffer
, size
, defines
, include
, skipconstants
, flags
, pool
, effect
, compilationerrors
);
2668 UnmapViewOfFile(buffer
);
2673 HRESULT WINAPI
D3DXCreateEffectFromFileExA(LPDIRECT3DDEVICE9 device
, LPCSTR srcfile
,
2674 const D3DXMACRO
*defines
, LPD3DXINCLUDE include
, LPCSTR skipconstants
, DWORD flags
,
2675 LPD3DXEFFECTPOOL pool
, LPD3DXEFFECT
*effect
, LPD3DXBUFFER
*compilationerrors
)
2681 TRACE("(void): relay\n");
2683 if (!srcfile
|| !defines
)
2684 return D3DERR_INVALIDCALL
;
2686 len
= MultiByteToWideChar(CP_ACP
, 0, srcfile
, -1, NULL
, 0);
2687 srcfileW
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(*srcfileW
));
2688 MultiByteToWideChar(CP_ACP
, 0, srcfile
, -1, srcfileW
, len
);
2690 ret
= D3DXCreateEffectFromFileExW(device
, srcfileW
, defines
, include
, skipconstants
, flags
, pool
, effect
, compilationerrors
);
2691 HeapFree(GetProcessHeap(), 0, srcfileW
);
2696 HRESULT WINAPI
D3DXCreateEffectFromFileW(LPDIRECT3DDEVICE9 device
, LPCWSTR srcfile
,
2697 const D3DXMACRO
*defines
, LPD3DXINCLUDE include
, DWORD flags
, LPD3DXEFFECTPOOL pool
,
2698 LPD3DXEFFECT
*effect
, LPD3DXBUFFER
*compilationerrors
)
2700 TRACE("(void): relay\n");
2701 return D3DXCreateEffectFromFileExW(device
, srcfile
, defines
, include
, NULL
, flags
, pool
, effect
, compilationerrors
);
2704 HRESULT WINAPI
D3DXCreateEffectFromFileA(LPDIRECT3DDEVICE9 device
, LPCSTR srcfile
,
2705 const D3DXMACRO
*defines
, LPD3DXINCLUDE include
, DWORD flags
, LPD3DXEFFECTPOOL pool
,
2706 LPD3DXEFFECT
*effect
, LPD3DXBUFFER
*compilationerrors
)
2708 TRACE("(void): relay\n");
2709 return D3DXCreateEffectFromFileExA(device
, srcfile
, defines
, include
, NULL
, flags
, pool
, effect
, compilationerrors
);
2712 HRESULT WINAPI
D3DXCreateEffectFromResourceExW(LPDIRECT3DDEVICE9 device
, HMODULE srcmodule
, LPCWSTR srcresource
,
2713 const D3DXMACRO
*defines
, LPD3DXINCLUDE include
, LPCSTR skipconstants
, DWORD flags
,
2714 LPD3DXEFFECTPOOL pool
, LPD3DXEFFECT
*effect
, LPD3DXBUFFER
*compilationerrors
)
2718 TRACE("(%p, %s): relay\n", srcmodule
, debugstr_w(srcresource
));
2720 if (!device
|| !defines
)
2721 return D3DERR_INVALIDCALL
;
2723 resinfo
= FindResourceW(srcmodule
, srcresource
, (LPCWSTR
) RT_RCDATA
);
2731 ret
= load_resource_into_memory(srcmodule
, resinfo
, &buffer
, &size
);
2734 return D3DXERR_INVALIDDATA
;
2736 return D3DXCreateEffectEx(device
, buffer
, size
, defines
, include
, skipconstants
, flags
, pool
, effect
, compilationerrors
);
2739 return D3DXERR_INVALIDDATA
;
2742 HRESULT WINAPI
D3DXCreateEffectFromResourceExA(LPDIRECT3DDEVICE9 device
, HMODULE srcmodule
, LPCSTR srcresource
,
2743 const D3DXMACRO
*defines
, LPD3DXINCLUDE include
, LPCSTR skipconstants
, DWORD flags
,
2744 LPD3DXEFFECTPOOL pool
, LPD3DXEFFECT
*effect
, LPD3DXBUFFER
*compilationerrors
)
2748 TRACE("(%p, %s): relay\n", srcmodule
, debugstr_a(srcresource
));
2750 if (!device
|| !defines
)
2751 return D3DERR_INVALIDCALL
;
2753 resinfo
= FindResourceA(srcmodule
, srcresource
, (LPCSTR
) RT_RCDATA
);
2761 ret
= load_resource_into_memory(srcmodule
, resinfo
, &buffer
, &size
);
2764 return D3DXERR_INVALIDDATA
;
2766 return D3DXCreateEffectEx(device
, buffer
, size
, defines
, include
, skipconstants
, flags
, pool
, effect
, compilationerrors
);
2769 return D3DXERR_INVALIDDATA
;
2772 HRESULT WINAPI
D3DXCreateEffectFromResourceW(LPDIRECT3DDEVICE9 device
, HMODULE srcmodule
, LPCWSTR srcresource
,
2773 const D3DXMACRO
*defines
, LPD3DXINCLUDE include
, DWORD flags
, LPD3DXEFFECTPOOL pool
,
2774 LPD3DXEFFECT
*effect
, LPD3DXBUFFER
*compilationerrors
)
2776 TRACE("(void): relay\n");
2777 return D3DXCreateEffectFromResourceExW(device
, srcmodule
, srcresource
, defines
, include
, NULL
, flags
, pool
, effect
, compilationerrors
);
2780 HRESULT WINAPI
D3DXCreateEffectFromResourceA(LPDIRECT3DDEVICE9 device
, HMODULE srcmodule
, LPCSTR srcresource
,
2781 const D3DXMACRO
*defines
, LPD3DXINCLUDE include
, DWORD flags
, LPD3DXEFFECTPOOL pool
,
2782 LPD3DXEFFECT
*effect
, LPD3DXBUFFER
*compilationerrors
)
2784 TRACE("(void): relay\n");
2785 return D3DXCreateEffectFromResourceExA(device
, srcmodule
, srcresource
, defines
, include
, NULL
, flags
, pool
, effect
, compilationerrors
);
2788 HRESULT WINAPI
D3DXCreateEffectCompilerFromFileW(LPCWSTR srcfile
, const D3DXMACRO
*defines
, LPD3DXINCLUDE include
,
2789 DWORD flags
, LPD3DXEFFECTCOMPILER
*effectcompiler
, LPD3DXBUFFER
*parseerrors
)
2795 TRACE("(%s): relay\n", debugstr_w(srcfile
));
2797 if (!srcfile
|| !defines
)
2798 return D3DERR_INVALIDCALL
;
2800 ret
= map_view_of_file(srcfile
, &buffer
, &size
);
2803 return D3DXERR_INVALIDDATA
;
2805 ret
= D3DXCreateEffectCompiler(buffer
, size
, defines
, include
, flags
, effectcompiler
, parseerrors
);
2806 UnmapViewOfFile(buffer
);
2811 HRESULT WINAPI
D3DXCreateEffectCompilerFromFileA(LPCSTR srcfile
, const D3DXMACRO
*defines
, LPD3DXINCLUDE include
,
2812 DWORD flags
, LPD3DXEFFECTCOMPILER
*effectcompiler
, LPD3DXBUFFER
*parseerrors
)
2818 TRACE("(void): relay\n");
2820 if (!srcfile
|| !defines
)
2821 return D3DERR_INVALIDCALL
;
2823 len
= MultiByteToWideChar(CP_ACP
, 0, srcfile
, -1, NULL
, 0);
2824 srcfileW
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(*srcfileW
));
2825 MultiByteToWideChar(CP_ACP
, 0, srcfile
, -1, srcfileW
, len
);
2827 ret
= D3DXCreateEffectCompilerFromFileW(srcfileW
, defines
, include
, flags
, effectcompiler
, parseerrors
);
2828 HeapFree(GetProcessHeap(), 0, srcfileW
);
2833 HRESULT WINAPI
D3DXCreateEffectCompilerFromResourceA(HMODULE srcmodule
, LPCSTR srcresource
, const D3DXMACRO
*defines
,
2834 LPD3DXINCLUDE include
, DWORD flags
, LPD3DXEFFECTCOMPILER
*effectcompiler
, LPD3DXBUFFER
*parseerrors
)
2838 TRACE("(%p, %s): relay\n", srcmodule
, debugstr_a(srcresource
));
2840 resinfo
= FindResourceA(srcmodule
, srcresource
, (LPCSTR
) RT_RCDATA
);
2848 ret
= load_resource_into_memory(srcmodule
, resinfo
, &buffer
, &size
);
2851 return D3DXERR_INVALIDDATA
;
2853 return D3DXCreateEffectCompiler(buffer
, size
, defines
, include
, flags
, effectcompiler
, parseerrors
);
2856 return D3DXERR_INVALIDDATA
;
2859 HRESULT WINAPI
D3DXCreateEffectCompilerFromResourceW(HMODULE srcmodule
, LPCWSTR srcresource
, const D3DXMACRO
*defines
,
2860 LPD3DXINCLUDE include
, DWORD flags
, LPD3DXEFFECTCOMPILER
*effectcompiler
, LPD3DXBUFFER
*parseerrors
)
2864 TRACE("(%p, %s): relay\n", srcmodule
, debugstr_w(srcresource
));
2866 resinfo
= FindResourceW(srcmodule
, srcresource
, (LPCWSTR
) RT_RCDATA
);
2874 ret
= load_resource_into_memory(srcmodule
, resinfo
, &buffer
, &size
);
2877 return D3DXERR_INVALIDDATA
;
2879 return D3DXCreateEffectCompiler(buffer
, size
, defines
, include
, flags
, effectcompiler
, parseerrors
);
2882 return D3DXERR_INVALIDDATA
;