2 * vertex shaders declaration implementation
4 * Copyright 2002 Raphael Junqueira
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #include "wine/debug.h"
32 #include "d3d8_private.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader
);
37 * DirectX9 SDK download
38 * http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp
41 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndrive/html/directx07162002.asp
43 * Using Vertex Shaders
44 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndrive/html/directx02192001.asp
47 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/whatsnew.asp
50 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/Shaders/VertexShader2_0/VertexShader2_0.asp
51 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/Shaders/VertexShader2_0/Instructions/Instructions.asp
52 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/programmingguide/GettingStarted/VertexDeclaration/VertexDeclaration.asp
53 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/Shaders/VertexShader3_0/VertexShader3_0.asp
56 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/programmingguide/advancedtopics/VertexPipe/matrixstack/matrixstack.asp
59 * http://msdn.microsoft.com/library/en-us/directx9_c/directx/graphics/programmingguide/GettingStarted/VertexFormats/vformats.asp
61 * NVIDIA: DX8 Vertex Shader to NV Vertex Program
62 * http://developer.nvidia.com/view.asp?IO=vstovp
64 * NVIDIA: Memory Management with VAR
65 * http://developer.nvidia.com/view.asp?IO=var_memory_management
68 /** Vertex Shader Declaration data types tokens */
69 #define MAX_VSHADER_DECL_TYPES 8
70 static CONST
char* VertexShaderDeclDataTypes
[] = {
82 static CONST
char* VertexShaderDeclRegister
[] = {
84 "D3DVSDE_BLENDWEIGHT",
85 "D3DVSDE_BLENDINDICES",
103 /** todo check decl validity */
104 /*inline static*/ DWORD
Direct3DVextexShaderDeclarationImpl_ParseToken(const DWORD
* pToken
) {
105 const DWORD token
= *pToken
;
108 switch ((token
& D3DVSD_TOKENTYPEMASK
) >> D3DVSD_TOKENTYPESHIFT
) { /* maybe a macro to inverse ... */
109 case D3DVSD_TOKEN_NOP
:
110 TRACE(" 0x%08lx NOP()\n", token
);
112 case D3DVSD_TOKEN_STREAM
:
113 if (token
& D3DVSD_STREAMTESSMASK
) {
114 TRACE(" 0x%08lx STREAM_TESS()\n", token
);
116 TRACE(" 0x%08lx STREAM(%lu)\n", token
, ((token
& D3DVSD_STREAMNUMBERMASK
) >> D3DVSD_STREAMNUMBERSHIFT
));
119 case D3DVSD_TOKEN_STREAMDATA
:
120 if (token
& 0x10000000) {
121 TRACE(" 0x%08lx SKIP(%lu)\n", token
, ((token
& D3DVSD_SKIPCOUNTMASK
) >> D3DVSD_SKIPCOUNTSHIFT
));
123 DWORD type
= ((token
& D3DVSD_DATATYPEMASK
) >> D3DVSD_DATATYPESHIFT
);
124 DWORD reg
= ((token
& D3DVSD_VERTEXREGMASK
) >> D3DVSD_VERTEXREGSHIFT
);
125 TRACE(" 0x%08lx REG(%s, %s)\n", token
, VertexShaderDeclRegister
[reg
], VertexShaderDeclDataTypes
[type
]);
128 case D3DVSD_TOKEN_TESSELLATOR
:
129 if (token
& 0x10000000) {
130 DWORD type
= ((token
& D3DVSD_DATATYPEMASK
) >> D3DVSD_DATATYPESHIFT
);
131 DWORD reg
= ((token
& D3DVSD_VERTEXREGMASK
) >> D3DVSD_VERTEXREGSHIFT
);
132 TRACE(" 0x%08lx TESSUV(%s) as %s\n", token
, VertexShaderDeclRegister
[reg
], VertexShaderDeclDataTypes
[type
]);
134 DWORD type
= ((token
& D3DVSD_DATATYPEMASK
) >> D3DVSD_DATATYPESHIFT
);
135 DWORD regout
= ((token
& D3DVSD_VERTEXREGMASK
) >> D3DVSD_VERTEXREGSHIFT
);
136 DWORD regin
= ((token
& D3DVSD_VERTEXREGINMASK
) >> D3DVSD_VERTEXREGINSHIFT
);
137 TRACE(" 0x%08lx TESSNORMAL(%s, %s) as %s\n", token
, VertexShaderDeclRegister
[regin
], VertexShaderDeclRegister
[regout
], VertexShaderDeclDataTypes
[type
]);
140 case D3DVSD_TOKEN_CONSTMEM
:
143 DWORD count
= ((token
& D3DVSD_CONSTCOUNTMASK
) >> D3DVSD_CONSTCOUNTSHIFT
);
144 DWORD constaddress
= ((token
& D3DVSD_CONSTADDRESSMASK
) >> D3DVSD_CONSTADDRESSSHIFT
);
145 TRACE(" 0x%08lx CONST(%lu, %lu)\n", token
, constaddress
, count
);
147 for (i
= 0; i
< count
; ++i
) {
149 TRACE(" c[%lu] = (0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx)\n",
156 TRACE(" c[%lu] = (%8f, %8f, %8f, %8f)\n",
159 *(float*) (pToken
+ 1),
160 *(float*) (pToken
+ 2),
161 *(float*) (pToken
+ 3));
165 tokenlen
= (4 * count
) + 1;
168 case D3DVSD_TOKEN_EXT
:
170 DWORD count
= ((token
& D3DVSD_CONSTCOUNTMASK
) >> D3DVSD_CONSTCOUNTSHIFT
);
171 DWORD extinfo
= ((token
& D3DVSD_EXTINFOMASK
) >> D3DVSD_EXTINFOSHIFT
);
172 TRACE(" 0x%08lx EXT(%lu, %lu)\n", token
, count
, extinfo
);
173 /* todo ... print extension */
174 tokenlen
= count
+ 1;
177 case D3DVSD_TOKEN_END
:
178 TRACE(" 0x%08lx END()\n", token
);
181 TRACE(" 0x%08lx UNKNOWN\n", token
);
187 HRESULT WINAPI
IDirect3DDeviceImpl_CreateVertexShaderDeclaration8(IDirect3DDevice8Impl
* This
, CONST DWORD
* pDeclaration8
, IDirect3DVertexShaderDeclarationImpl
** ppVertexShaderDecl
) {
189 const DWORD
* pToken
= pDeclaration8
;
196 DWORD tex
= D3DFVF_TEX0
;
197 /** TRUE if declaration can be matched by a fvf */
198 IDirect3DVertexShaderDeclarationImpl
* object
;
199 BOOL invalid_fvf
= FALSE
;
201 TRACE("(%p) : pDeclaration8(%p)\n", This
, pDeclaration8
);
203 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirect3DVertexShaderDeclarationImpl
));
204 /*object->lpVtbl = &Direct3DVextexShaderDeclaration8_Vtbl;*/
205 object
->device
= This
; /* FIXME: AddRef(This) */
209 while (D3DVSD_END() != *pToken
) {
211 tokenlen
= Direct3DVextexShaderDeclarationImpl_ParseToken(pToken
);
212 tokentype
= ((token
& D3DVSD_TOKENTYPEMASK
) >> D3DVSD_TOKENTYPESHIFT
);
214 /** FVF generation block */
215 if (D3DVSD_TOKEN_STREAM
== tokentype
&& 0 == (D3DVSD_STREAMTESSMASK
& token
)) {
217 * how really works streams,
218 * in DolphinVS dx8 dsk sample they seems to decal reg numbers !!!
220 DWORD oldStream
= stream
;
221 stream
= ((token
& D3DVSD_STREAMNUMBERMASK
) >> D3DVSD_STREAMNUMBERSHIFT
);
223 /* copy fvf if valid */
224 if (FALSE
== invalid_fvf
) {
225 fvf
|= tex
<< D3DFVF_TEXCOUNT_SHIFT
;
227 object
->fvf
[oldStream
] = fvf
;
228 object
->allFVF
|= fvf
;
230 object
->fvf
[oldStream
] = 0;
234 /* reset valid/invalid fvf */
238 } else if (D3DVSD_TOKEN_STREAMDATA
== tokentype
&& 0 == (0x10000000 & tokentype
)) {
239 DWORD type
= ((token
& D3DVSD_DATATYPEMASK
) >> D3DVSD_DATATYPESHIFT
);
240 DWORD reg
= ((token
& D3DVSD_VERTEXREGMASK
) >> D3DVSD_VERTEXREGSHIFT
);
243 case D3DVSDE_POSITION
:
245 case D3DVSDT_FLOAT3
: fvf
|= D3DFVF_XYZ
; break;
246 case D3DVSDT_FLOAT4
: fvf
|= D3DFVF_XYZRHW
; break;
248 /** errooooorr mismatched use of a register, invalid fvf computing */
250 if (type
>= MAX_VSHADER_DECL_TYPES
) {
251 TRACE("Mismatched use in VertexShader declaration of D3DVSDE_POSITION register: unsupported and unrecognized type %08lx\n", type
);
253 TRACE("Mismatched use in VertexShader declaration of D3DVSDE_POSITION register: unsupported type %s\n", VertexShaderDeclDataTypes
[type
]);
258 case D3DVSDE_BLENDWEIGHT
:
260 case D3DVSDT_FLOAT1
: fvf
|= D3DFVF_XYZB1
; break;
261 case D3DVSDT_FLOAT2
: fvf
|= D3DFVF_XYZB2
; break;
262 case D3DVSDT_FLOAT3
: fvf
|= D3DFVF_XYZB3
; break;
263 case D3DVSDT_FLOAT4
: fvf
|= D3DFVF_XYZB4
; break;
265 /** errooooorr mismatched use of a register, invalid fvf computing */
267 TRACE("Mismatched use in VertexShader declaration of D3DVSDE_BLENDWEIGHT register: unsupported type %s\n", VertexShaderDeclDataTypes
[type
]);
271 case D3DVSDE_BLENDINDICES
: /* seem to be B5 as said in MSDN Dx9SDK ?? */
273 case D3DVSDT_UBYTE4
: fvf
|= D3DFVF_LASTBETA_UBYTE4
; break;
275 /** errooooorr mismatched use of a register, invalid fvf computing */
277 TRACE("Mismatched use in VertexShader declaration of D3DVSDE_BLENDINDINCES register: unsupported type %s\n", VertexShaderDeclDataTypes
[type
]);
281 case D3DVSDE_NORMAL
: /* TODO: only FLOAT3 supported ... another choice possible ? */
283 case D3DVSDT_FLOAT3
: fvf
|= D3DFVF_NORMAL
; break;
285 /** errooooorr mismatched use of a register, invalid fvf computing */
287 TRACE("Mismatched use in VertexShader declaration of D3DVSDE_NORMAL register: unsupported type %s\n", VertexShaderDeclDataTypes
[type
]);
291 case D3DVSDE_PSIZE
: /* TODO: only FLOAT1 supported ... another choice possible ? */
293 case D3DVSDT_FLOAT1
: fvf
|= D3DFVF_PSIZE
; break;
295 /** errooooorr mismatched use of a register, invalid fvf computing */
297 TRACE("Mismatched use in VertexShader declaration of D3DVSDE_PSIZE register: unsupported type %s\n", VertexShaderDeclDataTypes
[type
]);
301 case D3DVSDE_DIFFUSE
: /* TODO: only D3DCOLOR supported */
303 case D3DVSDT_D3DCOLOR
: fvf
|= D3DFVF_DIFFUSE
; break;
305 /** errooooorr mismatched use of a register, invalid fvf computing */
307 TRACE("Mismatched use in VertexShader declaration of D3DVSDE_DIFFUSE register: unsupported type %s\n", VertexShaderDeclDataTypes
[type
]);
311 case D3DVSDE_SPECULAR
: /* TODO: only D3DCOLOR supported */
313 case D3DVSDT_D3DCOLOR
: fvf
|= D3DFVF_SPECULAR
; break;
315 /** errooooorr mismatched use of a register, invalid fvf computing */
317 TRACE("Mismatched use in VertexShader declaration of D3DVSDE_SPECULAR register: unsupported type %s\n", VertexShaderDeclDataTypes
[type
]);
321 case D3DVSDE_TEXCOORD0
:
322 case D3DVSDE_TEXCOORD1
:
323 case D3DVSDE_TEXCOORD2
:
324 case D3DVSDE_TEXCOORD3
:
325 case D3DVSDE_TEXCOORD4
:
326 case D3DVSDE_TEXCOORD5
:
327 case D3DVSDE_TEXCOORD6
:
328 case D3DVSDE_TEXCOORD7
:
329 /* Fixme? - assume all tex coords in same stream */
331 int texNo
= 1 + (reg
- D3DVSDE_TEXCOORD0
);
332 tex
= max(tex
, texNo
);
334 case D3DVSDT_FLOAT1
: fvf
|= D3DFVF_TEXCOORDSIZE1(texNo
); break;
335 case D3DVSDT_FLOAT2
: fvf
|= D3DFVF_TEXCOORDSIZE2(texNo
); break;
336 case D3DVSDT_FLOAT3
: fvf
|= D3DFVF_TEXCOORDSIZE3(texNo
); break;
337 case D3DVSDT_FLOAT4
: fvf
|= D3DFVF_TEXCOORDSIZE4(texNo
); break;
339 /** errooooorr mismatched use of a register, invalid fvf computing */
341 TRACE("Mismatched use in VertexShader declaration of D3DVSDE_TEXCOORD? register: unsupported type %s\n", VertexShaderDeclDataTypes
[type
]);
346 case D3DVSDE_POSITION2
: /* maybe D3DFVF_XYZRHW instead D3DFVF_XYZ (of D3DVDE_POSITION) ... to see */
347 case D3DVSDE_NORMAL2
: /* FIXME i don't know what to do here ;( */
348 TRACE("[%lu] registers in VertexShader declaration not supported yet (token:0x%08lx)\n", reg
, token
);
351 TRACE("VertexShader declaration define %lx as current FVF\n", fvf
);
356 /* here D3DVSD_END() */
357 len
+= Direct3DVextexShaderDeclarationImpl_ParseToken(pToken
);
359 /* copy fvf if valid */
360 if (FALSE
== invalid_fvf
) {
361 fvf
|= tex
<< D3DFVF_TEXCOUNT_SHIFT
;
362 object
->fvf
[stream
] = fvf
;
363 object
->allFVF
|= fvf
;
365 object
->fvf
[stream
] = 0;
367 TRACE("Completed, allFVF = %lx\n", object
->allFVF
);
370 object
->declaration8Length
= len
* sizeof(DWORD
);
371 /* copy the declaration */
372 object
->pDeclaration8
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, object
->declaration8Length
);
373 memcpy(object
->pDeclaration8
, pDeclaration8
, object
->declaration8Length
);
375 *ppVertexShaderDecl
= object
;
380 HRESULT WINAPI
IDirect3DDeviceImpl_FillVertexShaderInput(IDirect3DDevice8Impl
* This
,
381 IDirect3DVertexShaderImpl
* vshader
,
382 DWORD SkipnStrides
) {
384 const DWORD
* pToken
= This
->UpdateStateBlock
->vertexShaderDecl
->pDeclaration8
;
389 /** for input readers */
390 const char* curPos
= NULL
;
395 TRACE("(%p) - This:%p, skipstrides=%lu\n", vshader
, This
, SkipnStrides
);
397 while (D3DVSD_END() != *pToken
) {
399 tokentype
= ((token
& D3DVSD_TOKENTYPEMASK
) >> D3DVSD_TOKENTYPESHIFT
);
401 /** FVF generation block */
402 if (D3DVSD_TOKEN_STREAM
== tokentype
&& 0 == (D3DVSD_STREAMTESSMASK
& token
)) {
403 IDirect3DVertexBuffer8
* pVB
;
408 * how really works streams,
409 * in DolphinVS dx8 dsk sample use it !!!
411 stream
= ((token
& D3DVSD_STREAMNUMBERMASK
) >> D3DVSD_STREAMNUMBERSHIFT
);
412 skip
= This
->StateBlock
->stream_stride
[stream
];
413 pVB
= This
->StateBlock
->stream_source
[stream
];
416 ERR("using unitialised stream[%lu]\n", stream
);
417 return D3DERR_INVALIDCALL
;
419 if (This
->StateBlock
->streamIsUP
== TRUE
) {
420 curPos
= ((char *) pVB
) + (SkipnStrides
* skip
); /* Not really a VB */
422 curPos
= ((IDirect3DVertexBuffer8Impl
*) pVB
)->allocatedMemory
+ (SkipnStrides
* skip
);
425 TRACE(" using stream[%lu] with %p (%p + (Stride %d * skip %ld))\n", stream
, curPos
,
426 ((IDirect3DVertexBuffer8Impl
*) pVB
)->allocatedMemory
, skip
, SkipnStrides
);
428 } else if (D3DVSD_TOKEN_CONSTMEM
== tokentype
) {
431 DWORD count
= ((token
& D3DVSD_CONSTCOUNTMASK
) >> D3DVSD_CONSTCOUNTSHIFT
);
432 DWORD constaddress
= ((token
& D3DVSD_CONSTADDRESSMASK
) >> D3DVSD_CONSTADDRESSSHIFT
);
434 for (i
= 0; i
< count
; ++i
) {
435 vshader
->data
->C
[constaddress
+ i
].x
= *(float*)pToken
;
436 vshader
->data
->C
[constaddress
+ i
].y
= *(float*)(pToken
+ 1);
437 vshader
->data
->C
[constaddress
+ i
].z
= *(float*)(pToken
+ 2);
438 vshader
->data
->C
[constaddress
+ i
].w
= *(float*)(pToken
+ 3);
442 } else if (D3DVSD_TOKEN_STREAMDATA
== tokentype
&& 0 != (0x10000000 & tokentype
)) {
444 DWORD skipCount
= ((token
& D3DVSD_SKIPCOUNTMASK
) >> D3DVSD_SKIPCOUNTSHIFT
);
445 curPos
= curPos
+ skipCount
* sizeof(DWORD
);
448 } else if (D3DVSD_TOKEN_STREAMDATA
== tokentype
&& 0 == (0x10000000 & tokentype
)) {
449 DWORD type
= ((token
& D3DVSD_DATATYPEMASK
) >> D3DVSD_DATATYPESHIFT
);
450 DWORD reg
= ((token
& D3DVSD_VERTEXREGMASK
) >> D3DVSD_VERTEXREGSHIFT
);
455 x
= *(float*) curPos
;
456 curPos
= curPos
+ sizeof(float);
458 vshader
->input
.V
[reg
].x
= x
;
459 vshader
->input
.V
[reg
].y
= 0.0f
;
460 vshader
->input
.V
[reg
].z
= 0.0f
;
461 vshader
->input
.V
[reg
].w
= 1.0f
;
465 x
= *(float*) curPos
;
466 curPos
= curPos
+ sizeof(float);
467 y
= *(float*) curPos
;
468 curPos
= curPos
+ sizeof(float);
470 vshader
->input
.V
[reg
].x
= x
;
471 vshader
->input
.V
[reg
].y
= y
;
472 vshader
->input
.V
[reg
].z
= 0.0f
;
473 vshader
->input
.V
[reg
].w
= 1.0f
;
477 x
= *(float*) curPos
;
478 curPos
= curPos
+ sizeof(float);
479 y
= *(float*) curPos
;
480 curPos
= curPos
+ sizeof(float);
481 z
= *(float*) curPos
;
482 curPos
= curPos
+ sizeof(float);
484 vshader
->input
.V
[reg
].x
= x
;
485 vshader
->input
.V
[reg
].y
= y
;
486 vshader
->input
.V
[reg
].z
= z
;
487 vshader
->input
.V
[reg
].w
= 1.0f
;
491 x
= *(float*) curPos
;
492 curPos
= curPos
+ sizeof(float);
493 y
= *(float*) curPos
;
494 curPos
= curPos
+ sizeof(float);
495 z
= *(float*) curPos
;
496 curPos
= curPos
+ sizeof(float);
497 w
= *(float*) curPos
;
498 curPos
= curPos
+ sizeof(float);
500 vshader
->input
.V
[reg
].x
= x
;
501 vshader
->input
.V
[reg
].y
= y
;
502 vshader
->input
.V
[reg
].z
= z
;
503 vshader
->input
.V
[reg
].w
= w
;
506 case D3DVSDT_D3DCOLOR
:
507 dw
= *(DWORD
*) curPos
;
508 curPos
= curPos
+ sizeof(DWORD
);
510 vshader
->input
.V
[reg
].x
= (float) (((dw
>> 16) & 0xFF) / 255.0f
);
511 vshader
->input
.V
[reg
].y
= (float) (((dw
>> 8) & 0xFF) / 255.0f
);
512 vshader
->input
.V
[reg
].z
= (float) (((dw
>> 0) & 0xFF) / 255.0f
);
513 vshader
->input
.V
[reg
].w
= (float) (((dw
>> 24) & 0xFF) / 255.0f
);
517 u
= *(SHORT
*) curPos
;
518 curPos
= curPos
+ sizeof(SHORT
);
519 v
= *(SHORT
*) curPos
;
520 curPos
= curPos
+ sizeof(SHORT
);
522 vshader
->input
.V
[reg
].x
= (float) u
;
523 vshader
->input
.V
[reg
].y
= (float) v
;
524 vshader
->input
.V
[reg
].z
= 0.0f
;
525 vshader
->input
.V
[reg
].w
= 1.0f
;
529 u
= *(SHORT
*) curPos
;
530 curPos
= curPos
+ sizeof(SHORT
);
531 v
= *(SHORT
*) curPos
;
532 curPos
= curPos
+ sizeof(SHORT
);
533 r
= *(SHORT
*) curPos
;
534 curPos
= curPos
+ sizeof(SHORT
);
535 t
= *(SHORT
*) curPos
;
536 curPos
= curPos
+ sizeof(SHORT
);
538 vshader
->input
.V
[reg
].x
= (float) u
;
539 vshader
->input
.V
[reg
].y
= (float) v
;
540 vshader
->input
.V
[reg
].z
= (float) r
;
541 vshader
->input
.V
[reg
].w
= (float) t
;
545 dw
= *(DWORD
*) curPos
;
546 curPos
= curPos
+ sizeof(DWORD
);
548 vshader
->input
.V
[reg
].x
= (float) ((dw
& 0x000F) >> 0);
549 vshader
->input
.V
[reg
].y
= (float) ((dw
& 0x00F0) >> 8);
550 vshader
->input
.V
[reg
].z
= (float) ((dw
& 0x0F00) >> 16);
551 vshader
->input
.V
[reg
].w
= (float) ((dw
& 0xF000) >> 24);
555 default: /** errooooorr what to do ? */
556 ERR("Error in VertexShader declaration of %s register: unsupported type %s\n", VertexShaderDeclRegister
[reg
], VertexShaderDeclDataTypes
[type
]);
561 /* here D3DVSD_END() */
565 HRESULT WINAPI
IDirect3DVertexShaderDeclarationImpl_GetDeclaration8(IDirect3DVertexShaderDeclarationImpl
* This
, DWORD
* pData
, UINT
* pSizeOfData
) {
567 *pSizeOfData
= This
->declaration8Length
;
570 if (*pSizeOfData
< This
->declaration8Length
) {
571 *pSizeOfData
= This
->declaration8Length
;
572 return D3DERR_MOREDATA
;
574 TRACE("(%p) : GetVertexShaderDeclaration copying to %p\n", This
, pData
);
575 memcpy(pData
, This
->pDeclaration8
, This
->declaration8Length
);