st/nine: Initial mixed vertex processing support
[mesa.git] / src / gallium / state_trackers / nine / device9.h
1 /*
2 * Copyright 2011 Joakim Sindholt <opensource@zhasha.com>
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE. */
22
23 #ifndef _NINE_DEVICE9_H_
24 #define _NINE_DEVICE9_H_
25
26 #include "d3dadapter/d3dadapter9.h"
27
28 #include "iunknown.h"
29 #include "adapter9.h"
30
31 #include "nine_helpers.h"
32 #include "nine_state.h"
33
34 struct gen_mipmap_state;
35 struct util_hash_table;
36 struct pipe_screen;
37 struct pipe_context;
38 struct cso_context;
39 struct hud_context;
40 struct u_upload_mgr;
41
42 struct NineSwapChain9;
43 struct NineStateBlock9;
44
45 #include "util/list.h"
46
47 struct NineDevice9
48 {
49 struct NineUnknown base;
50 boolean ex;
51
52 /* G3D context */
53 struct pipe_screen *screen;
54 struct pipe_context *pipe;
55 struct cso_context *cso;
56
57 /* creation parameters */
58 D3DCAPS9 caps;
59 D3DDEVICE_CREATION_PARAMETERS params;
60 IDirect3D9 *d3d9;
61
62 /* swapchain stuff */
63 ID3DPresentGroup *present;
64 struct NineSwapChain9 **swapchains;
65 unsigned nswapchains;
66
67 struct NineStateBlock9 *record;
68 struct nine_state *update; /* state to update (&state / &record->state) */
69 struct nine_state state; /* device state */
70
71 struct list_head update_buffers;
72 struct list_head update_textures;
73 struct list_head managed_buffers;
74 struct list_head managed_textures;
75
76 boolean is_recording;
77 boolean in_scene;
78
79 boolean prefer_user_constbuf;
80
81 struct pipe_resource *constbuf_vs;
82 struct pipe_resource *constbuf_ps;
83 uint16_t vs_const_size;
84 uint16_t ps_const_size;
85 uint16_t max_vs_const_f;
86 uint16_t max_ps_const_f;
87
88 struct pipe_resource *dummy_texture;
89 struct pipe_sampler_view *dummy_sampler_view;
90 struct pipe_sampler_state dummy_sampler_state;
91
92 struct gen_mipmap_state *gen_mipmap;
93
94 struct {
95 struct util_hash_table *ht_vs;
96 struct util_hash_table *ht_ps;
97 struct NineVertexShader9 *vs;
98 struct NinePixelShader9 *ps;
99 unsigned num_vs;
100 unsigned num_ps;
101 float *vs_const;
102 float *ps_const;
103
104 struct util_hash_table *ht_fvf;
105 } ff;
106
107 struct {
108 struct pipe_resource *image;
109 unsigned w;
110 unsigned h;
111 POINT hotspot; /* -1, -1 if no cursor image set */
112 POINT pos;
113 BOOL visible;
114 boolean software;
115 } cursor;
116
117 struct {
118 boolean user_vbufs;
119 boolean user_ibufs;
120 boolean user_cbufs;
121 boolean window_space_position_support;
122 boolean vs_integer;
123 boolean ps_integer;
124 boolean offset_units_unscaled;
125 } driver_caps;
126
127 struct {
128 boolean buggy_barycentrics;
129 } driver_bugs;
130
131 struct u_upload_mgr *vertex_uploader;
132 struct u_upload_mgr *index_uploader;
133 struct u_upload_mgr *constbuf_uploader;
134 unsigned constbuf_alignment;
135
136 struct nine_range_pool range_pool;
137
138 struct hud_context *hud; /* NULL if hud is disabled */
139
140 /* dummy vbo (containing 0 0 0 0) to bind if vertex shader input
141 * is not bound to anything by the vertex declaration */
142 struct pipe_resource *dummy_vbo;
143 BOOL device_needs_reset;
144 int minor_version_num;
145 long long available_texture_mem;
146 long long available_texture_limit;
147
148 /* software vertex processing */
149 boolean swvp;
150 };
151 static inline struct NineDevice9 *
152 NineDevice9( void *data )
153 {
154 return (struct NineDevice9 *)data;
155 }
156
157 HRESULT
158 NineDevice9_new( struct pipe_screen *pScreen,
159 D3DDEVICE_CREATION_PARAMETERS *pCreationParameters,
160 D3DCAPS9 *pCaps,
161 D3DPRESENT_PARAMETERS *pPresentationParameters,
162 IDirect3D9 *pD3D9,
163 ID3DPresentGroup *pPresentationGroup,
164 struct d3dadapter9_context *pCTX,
165 boolean ex,
166 D3DDISPLAYMODEEX *pFullscreenDisplayMode,
167 struct NineDevice9 **ppOut,
168 int minorVersionNum );
169
170 HRESULT
171 NineDevice9_ctor( struct NineDevice9 *This,
172 struct NineUnknownParams *pParams,
173 struct pipe_screen *pScreen,
174 D3DDEVICE_CREATION_PARAMETERS *pCreationParameters,
175 D3DCAPS9 *pCaps,
176 D3DPRESENT_PARAMETERS *pPresentationParameters,
177 IDirect3D9 *pD3D9,
178 ID3DPresentGroup *pPresentationGroup,
179 struct d3dadapter9_context *pCTX,
180 boolean ex,
181 D3DDISPLAYMODEEX *pFullscreenDisplayMode,
182 int minorVersionNum );
183
184 void
185 NineDevice9_dtor( struct NineDevice9 *This );
186
187 /*** Nine private ***/
188 void
189 NineDevice9_SetDefaultState( struct NineDevice9 *This, boolean is_reset );
190
191 struct pipe_screen *
192 NineDevice9_GetScreen( struct NineDevice9 *This );
193
194 struct pipe_context *
195 NineDevice9_GetPipe( struct NineDevice9 *This );
196
197 struct cso_context *
198 NineDevice9_GetCSO( struct NineDevice9 *This );
199
200 const D3DCAPS9 *
201 NineDevice9_GetCaps( struct NineDevice9 *This );
202
203 /*** Direct3D public ***/
204
205 HRESULT NINE_WINAPI
206 NineDevice9_TestCooperativeLevel( struct NineDevice9 *This );
207
208 UINT NINE_WINAPI
209 NineDevice9_GetAvailableTextureMem( struct NineDevice9 *This );
210
211 HRESULT NINE_WINAPI
212 NineDevice9_EvictManagedResources( struct NineDevice9 *This );
213
214 HRESULT NINE_WINAPI
215 NineDevice9_GetDirect3D( struct NineDevice9 *This,
216 IDirect3D9 **ppD3D9 );
217
218 HRESULT NINE_WINAPI
219 NineDevice9_GetDeviceCaps( struct NineDevice9 *This,
220 D3DCAPS9 *pCaps );
221
222 HRESULT NINE_WINAPI
223 NineDevice9_GetDisplayMode( struct NineDevice9 *This,
224 UINT iSwapChain,
225 D3DDISPLAYMODE *pMode );
226
227 HRESULT NINE_WINAPI
228 NineDevice9_GetCreationParameters( struct NineDevice9 *This,
229 D3DDEVICE_CREATION_PARAMETERS *pParameters );
230
231 HRESULT NINE_WINAPI
232 NineDevice9_SetCursorProperties( struct NineDevice9 *This,
233 UINT XHotSpot,
234 UINT YHotSpot,
235 IDirect3DSurface9 *pCursorBitmap );
236
237 void NINE_WINAPI
238 NineDevice9_SetCursorPosition( struct NineDevice9 *This,
239 int X,
240 int Y,
241 DWORD Flags );
242
243 BOOL NINE_WINAPI
244 NineDevice9_ShowCursor( struct NineDevice9 *This,
245 BOOL bShow );
246
247 HRESULT NINE_WINAPI
248 NineDevice9_CreateAdditionalSwapChain( struct NineDevice9 *This,
249 D3DPRESENT_PARAMETERS *pPresentationParameters,
250 IDirect3DSwapChain9 **pSwapChain );
251
252 HRESULT NINE_WINAPI
253 NineDevice9_GetSwapChain( struct NineDevice9 *This,
254 UINT iSwapChain,
255 IDirect3DSwapChain9 **pSwapChain );
256
257 UINT NINE_WINAPI
258 NineDevice9_GetNumberOfSwapChains( struct NineDevice9 *This );
259
260 HRESULT NINE_WINAPI
261 NineDevice9_Reset( struct NineDevice9 *This,
262 D3DPRESENT_PARAMETERS *pPresentationParameters );
263
264 HRESULT NINE_WINAPI
265 NineDevice9_Present( struct NineDevice9 *This,
266 const RECT *pSourceRect,
267 const RECT *pDestRect,
268 HWND hDestWindowOverride,
269 const RGNDATA *pDirtyRegion );
270
271 HRESULT NINE_WINAPI
272 NineDevice9_GetBackBuffer( struct NineDevice9 *This,
273 UINT iSwapChain,
274 UINT iBackBuffer,
275 D3DBACKBUFFER_TYPE Type,
276 IDirect3DSurface9 **ppBackBuffer );
277
278 HRESULT NINE_WINAPI
279 NineDevice9_GetRasterStatus( struct NineDevice9 *This,
280 UINT iSwapChain,
281 D3DRASTER_STATUS *pRasterStatus );
282
283 HRESULT NINE_WINAPI
284 NineDevice9_SetDialogBoxMode( struct NineDevice9 *This,
285 BOOL bEnableDialogs );
286
287 void NINE_WINAPI
288 NineDevice9_SetGammaRamp( struct NineDevice9 *This,
289 UINT iSwapChain,
290 DWORD Flags,
291 const D3DGAMMARAMP *pRamp );
292
293 void NINE_WINAPI
294 NineDevice9_GetGammaRamp( struct NineDevice9 *This,
295 UINT iSwapChain,
296 D3DGAMMARAMP *pRamp );
297
298 HRESULT NINE_WINAPI
299 NineDevice9_CreateTexture( struct NineDevice9 *This,
300 UINT Width,
301 UINT Height,
302 UINT Levels,
303 DWORD Usage,
304 D3DFORMAT Format,
305 D3DPOOL Pool,
306 IDirect3DTexture9 **ppTexture,
307 HANDLE *pSharedHandle );
308
309 HRESULT NINE_WINAPI
310 NineDevice9_CreateVolumeTexture( struct NineDevice9 *This,
311 UINT Width,
312 UINT Height,
313 UINT Depth,
314 UINT Levels,
315 DWORD Usage,
316 D3DFORMAT Format,
317 D3DPOOL Pool,
318 IDirect3DVolumeTexture9 **ppVolumeTexture,
319 HANDLE *pSharedHandle );
320
321 HRESULT NINE_WINAPI
322 NineDevice9_CreateCubeTexture( struct NineDevice9 *This,
323 UINT EdgeLength,
324 UINT Levels,
325 DWORD Usage,
326 D3DFORMAT Format,
327 D3DPOOL Pool,
328 IDirect3DCubeTexture9 **ppCubeTexture,
329 HANDLE *pSharedHandle );
330
331 HRESULT NINE_WINAPI
332 NineDevice9_CreateVertexBuffer( struct NineDevice9 *This,
333 UINT Length,
334 DWORD Usage,
335 DWORD FVF,
336 D3DPOOL Pool,
337 IDirect3DVertexBuffer9 **ppVertexBuffer,
338 HANDLE *pSharedHandle );
339
340 HRESULT NINE_WINAPI
341 NineDevice9_CreateIndexBuffer( struct NineDevice9 *This,
342 UINT Length,
343 DWORD Usage,
344 D3DFORMAT Format,
345 D3DPOOL Pool,
346 IDirect3DIndexBuffer9 **ppIndexBuffer,
347 HANDLE *pSharedHandle );
348
349 HRESULT NINE_WINAPI
350 NineDevice9_CreateRenderTarget( struct NineDevice9 *This,
351 UINT Width,
352 UINT Height,
353 D3DFORMAT Format,
354 D3DMULTISAMPLE_TYPE MultiSample,
355 DWORD MultisampleQuality,
356 BOOL Lockable,
357 IDirect3DSurface9 **ppSurface,
358 HANDLE *pSharedHandle );
359
360 HRESULT NINE_WINAPI
361 NineDevice9_CreateDepthStencilSurface( struct NineDevice9 *This,
362 UINT Width,
363 UINT Height,
364 D3DFORMAT Format,
365 D3DMULTISAMPLE_TYPE MultiSample,
366 DWORD MultisampleQuality,
367 BOOL Discard,
368 IDirect3DSurface9 **ppSurface,
369 HANDLE *pSharedHandle );
370
371 HRESULT NINE_WINAPI
372 NineDevice9_UpdateSurface( struct NineDevice9 *This,
373 IDirect3DSurface9 *pSourceSurface,
374 const RECT *pSourceRect,
375 IDirect3DSurface9 *pDestinationSurface,
376 const POINT *pDestPoint );
377
378 HRESULT NINE_WINAPI
379 NineDevice9_UpdateTexture( struct NineDevice9 *This,
380 IDirect3DBaseTexture9 *pSourceTexture,
381 IDirect3DBaseTexture9 *pDestinationTexture );
382
383 HRESULT NINE_WINAPI
384 NineDevice9_GetRenderTargetData( struct NineDevice9 *This,
385 IDirect3DSurface9 *pRenderTarget,
386 IDirect3DSurface9 *pDestSurface );
387
388 HRESULT NINE_WINAPI
389 NineDevice9_GetFrontBufferData( struct NineDevice9 *This,
390 UINT iSwapChain,
391 IDirect3DSurface9 *pDestSurface );
392
393 HRESULT NINE_WINAPI
394 NineDevice9_StretchRect( struct NineDevice9 *This,
395 IDirect3DSurface9 *pSourceSurface,
396 const RECT *pSourceRect,
397 IDirect3DSurface9 *pDestSurface,
398 const RECT *pDestRect,
399 D3DTEXTUREFILTERTYPE Filter );
400
401 HRESULT NINE_WINAPI
402 NineDevice9_ColorFill( struct NineDevice9 *This,
403 IDirect3DSurface9 *pSurface,
404 const RECT *pRect,
405 D3DCOLOR color );
406
407 HRESULT NINE_WINAPI
408 NineDevice9_CreateOffscreenPlainSurface( struct NineDevice9 *This,
409 UINT Width,
410 UINT Height,
411 D3DFORMAT Format,
412 D3DPOOL Pool,
413 IDirect3DSurface9 **ppSurface,
414 HANDLE *pSharedHandle );
415
416 HRESULT NINE_WINAPI
417 NineDevice9_SetRenderTarget( struct NineDevice9 *This,
418 DWORD RenderTargetIndex,
419 IDirect3DSurface9 *pRenderTarget );
420
421 HRESULT NINE_WINAPI
422 NineDevice9_GetRenderTarget( struct NineDevice9 *This,
423 DWORD RenderTargetIndex,
424 IDirect3DSurface9 **ppRenderTarget );
425
426 HRESULT NINE_WINAPI
427 NineDevice9_SetDepthStencilSurface( struct NineDevice9 *This,
428 IDirect3DSurface9 *pNewZStencil );
429
430 HRESULT NINE_WINAPI
431 NineDevice9_GetDepthStencilSurface( struct NineDevice9 *This,
432 IDirect3DSurface9 **ppZStencilSurface );
433
434 HRESULT NINE_WINAPI
435 NineDevice9_BeginScene( struct NineDevice9 *This );
436
437 HRESULT NINE_WINAPI
438 NineDevice9_EndScene( struct NineDevice9 *This );
439
440 HRESULT NINE_WINAPI
441 NineDevice9_Clear( struct NineDevice9 *This,
442 DWORD Count,
443 const D3DRECT *pRects,
444 DWORD Flags,
445 D3DCOLOR Color,
446 float Z,
447 DWORD Stencil );
448
449 HRESULT NINE_WINAPI
450 NineDevice9_SetTransform( struct NineDevice9 *This,
451 D3DTRANSFORMSTATETYPE State,
452 const D3DMATRIX *pMatrix );
453
454 HRESULT NINE_WINAPI
455 NineDevice9_GetTransform( struct NineDevice9 *This,
456 D3DTRANSFORMSTATETYPE State,
457 D3DMATRIX *pMatrix );
458
459 HRESULT NINE_WINAPI
460 NineDevice9_MultiplyTransform( struct NineDevice9 *This,
461 D3DTRANSFORMSTATETYPE State,
462 const D3DMATRIX *pMatrix );
463
464 HRESULT NINE_WINAPI
465 NineDevice9_SetViewport( struct NineDevice9 *This,
466 const D3DVIEWPORT9 *pViewport );
467
468 HRESULT NINE_WINAPI
469 NineDevice9_GetViewport( struct NineDevice9 *This,
470 D3DVIEWPORT9 *pViewport );
471
472 HRESULT NINE_WINAPI
473 NineDevice9_SetMaterial( struct NineDevice9 *This,
474 const D3DMATERIAL9 *pMaterial );
475
476 HRESULT NINE_WINAPI
477 NineDevice9_GetMaterial( struct NineDevice9 *This,
478 D3DMATERIAL9 *pMaterial );
479
480 HRESULT NINE_WINAPI
481 NineDevice9_SetLight( struct NineDevice9 *This,
482 DWORD Index,
483 const D3DLIGHT9 *pLight );
484
485 HRESULT NINE_WINAPI
486 NineDevice9_GetLight( struct NineDevice9 *This,
487 DWORD Index,
488 D3DLIGHT9 *pLight );
489
490 HRESULT NINE_WINAPI
491 NineDevice9_LightEnable( struct NineDevice9 *This,
492 DWORD Index,
493 BOOL Enable );
494
495 HRESULT NINE_WINAPI
496 NineDevice9_GetLightEnable( struct NineDevice9 *This,
497 DWORD Index,
498 BOOL *pEnable );
499
500 HRESULT NINE_WINAPI
501 NineDevice9_SetClipPlane( struct NineDevice9 *This,
502 DWORD Index,
503 const float *pPlane );
504
505 HRESULT NINE_WINAPI
506 NineDevice9_GetClipPlane( struct NineDevice9 *This,
507 DWORD Index,
508 float *pPlane );
509
510 HRESULT NINE_WINAPI
511 NineDevice9_SetRenderState( struct NineDevice9 *This,
512 D3DRENDERSTATETYPE State,
513 DWORD Value );
514
515 HRESULT NINE_WINAPI
516 NineDevice9_GetRenderState( struct NineDevice9 *This,
517 D3DRENDERSTATETYPE State,
518 DWORD *pValue );
519
520 HRESULT NINE_WINAPI
521 NineDevice9_CreateStateBlock( struct NineDevice9 *This,
522 D3DSTATEBLOCKTYPE Type,
523 IDirect3DStateBlock9 **ppSB );
524
525 HRESULT NINE_WINAPI
526 NineDevice9_BeginStateBlock( struct NineDevice9 *This );
527
528 HRESULT NINE_WINAPI
529 NineDevice9_EndStateBlock( struct NineDevice9 *This,
530 IDirect3DStateBlock9 **ppSB );
531
532 HRESULT NINE_WINAPI
533 NineDevice9_SetClipStatus( struct NineDevice9 *This,
534 const D3DCLIPSTATUS9 *pClipStatus );
535
536 HRESULT NINE_WINAPI
537 NineDevice9_GetClipStatus( struct NineDevice9 *This,
538 D3DCLIPSTATUS9 *pClipStatus );
539
540 HRESULT NINE_WINAPI
541 NineDevice9_GetTexture( struct NineDevice9 *This,
542 DWORD Stage,
543 IDirect3DBaseTexture9 **ppTexture );
544
545 HRESULT NINE_WINAPI
546 NineDevice9_SetTexture( struct NineDevice9 *This,
547 DWORD Stage,
548 IDirect3DBaseTexture9 *pTexture );
549
550 HRESULT NINE_WINAPI
551 NineDevice9_GetTextureStageState( struct NineDevice9 *This,
552 DWORD Stage,
553 D3DTEXTURESTAGESTATETYPE Type,
554 DWORD *pValue );
555
556 HRESULT NINE_WINAPI
557 NineDevice9_SetTextureStageState( struct NineDevice9 *This,
558 DWORD Stage,
559 D3DTEXTURESTAGESTATETYPE Type,
560 DWORD Value );
561
562 HRESULT NINE_WINAPI
563 NineDevice9_GetSamplerState( struct NineDevice9 *This,
564 DWORD Sampler,
565 D3DSAMPLERSTATETYPE Type,
566 DWORD *pValue );
567
568 HRESULT NINE_WINAPI
569 NineDevice9_SetSamplerState( struct NineDevice9 *This,
570 DWORD Sampler,
571 D3DSAMPLERSTATETYPE Type,
572 DWORD Value );
573
574 HRESULT NINE_WINAPI
575 NineDevice9_ValidateDevice( struct NineDevice9 *This,
576 DWORD *pNumPasses );
577
578 HRESULT NINE_WINAPI
579 NineDevice9_SetPaletteEntries( struct NineDevice9 *This,
580 UINT PaletteNumber,
581 const PALETTEENTRY *pEntries );
582
583 HRESULT NINE_WINAPI
584 NineDevice9_GetPaletteEntries( struct NineDevice9 *This,
585 UINT PaletteNumber,
586 PALETTEENTRY *pEntries );
587
588 HRESULT NINE_WINAPI
589 NineDevice9_SetCurrentTexturePalette( struct NineDevice9 *This,
590 UINT PaletteNumber );
591
592 HRESULT NINE_WINAPI
593 NineDevice9_GetCurrentTexturePalette( struct NineDevice9 *This,
594 UINT *PaletteNumber );
595
596 HRESULT NINE_WINAPI
597 NineDevice9_SetScissorRect( struct NineDevice9 *This,
598 const RECT *pRect );
599
600 HRESULT NINE_WINAPI
601 NineDevice9_GetScissorRect( struct NineDevice9 *This,
602 RECT *pRect );
603
604 HRESULT NINE_WINAPI
605 NineDevice9_SetSoftwareVertexProcessing( struct NineDevice9 *This,
606 BOOL bSoftware );
607
608 BOOL NINE_WINAPI
609 NineDevice9_GetSoftwareVertexProcessing( struct NineDevice9 *This );
610
611 HRESULT NINE_WINAPI
612 NineDevice9_SetNPatchMode( struct NineDevice9 *This,
613 float nSegments );
614
615 float NINE_WINAPI
616 NineDevice9_GetNPatchMode( struct NineDevice9 *This );
617
618 HRESULT NINE_WINAPI
619 NineDevice9_DrawPrimitive( struct NineDevice9 *This,
620 D3DPRIMITIVETYPE PrimitiveType,
621 UINT StartVertex,
622 UINT PrimitiveCount );
623
624 HRESULT NINE_WINAPI
625 NineDevice9_DrawIndexedPrimitive( struct NineDevice9 *This,
626 D3DPRIMITIVETYPE PrimitiveType,
627 INT BaseVertexIndex,
628 UINT MinVertexIndex,
629 UINT NumVertices,
630 UINT startIndex,
631 UINT primCount );
632
633 HRESULT NINE_WINAPI
634 NineDevice9_DrawPrimitiveUP( struct NineDevice9 *This,
635 D3DPRIMITIVETYPE PrimitiveType,
636 UINT PrimitiveCount,
637 const void *pVertexStreamZeroData,
638 UINT VertexStreamZeroStride );
639
640 HRESULT NINE_WINAPI
641 NineDevice9_DrawIndexedPrimitiveUP( struct NineDevice9 *This,
642 D3DPRIMITIVETYPE PrimitiveType,
643 UINT MinVertexIndex,
644 UINT NumVertices,
645 UINT PrimitiveCount,
646 const void *pIndexData,
647 D3DFORMAT IndexDataFormat,
648 const void *pVertexStreamZeroData,
649 UINT VertexStreamZeroStride );
650
651 HRESULT NINE_WINAPI
652 NineDevice9_ProcessVertices( struct NineDevice9 *This,
653 UINT SrcStartIndex,
654 UINT DestIndex,
655 UINT VertexCount,
656 IDirect3DVertexBuffer9 *pDestBuffer,
657 IDirect3DVertexDeclaration9 *pVertexDecl,
658 DWORD Flags );
659
660 HRESULT NINE_WINAPI
661 NineDevice9_CreateVertexDeclaration( struct NineDevice9 *This,
662 const D3DVERTEXELEMENT9 *pVertexElements,
663 IDirect3DVertexDeclaration9 **ppDecl );
664
665 HRESULT NINE_WINAPI
666 NineDevice9_SetVertexDeclaration( struct NineDevice9 *This,
667 IDirect3DVertexDeclaration9 *pDecl );
668
669 HRESULT NINE_WINAPI
670 NineDevice9_GetVertexDeclaration( struct NineDevice9 *This,
671 IDirect3DVertexDeclaration9 **ppDecl );
672
673 HRESULT NINE_WINAPI
674 NineDevice9_SetFVF( struct NineDevice9 *This,
675 DWORD FVF );
676
677 HRESULT NINE_WINAPI
678 NineDevice9_GetFVF( struct NineDevice9 *This,
679 DWORD *pFVF );
680
681 HRESULT NINE_WINAPI
682 NineDevice9_CreateVertexShader( struct NineDevice9 *This,
683 const DWORD *pFunction,
684 IDirect3DVertexShader9 **ppShader );
685
686 HRESULT NINE_WINAPI
687 NineDevice9_SetVertexShader( struct NineDevice9 *This,
688 IDirect3DVertexShader9 *pShader );
689
690 HRESULT NINE_WINAPI
691 NineDevice9_GetVertexShader( struct NineDevice9 *This,
692 IDirect3DVertexShader9 **ppShader );
693
694 HRESULT NINE_WINAPI
695 NineDevice9_SetVertexShaderConstantF( struct NineDevice9 *This,
696 UINT StartRegister,
697 const float *pConstantData,
698 UINT Vector4fCount );
699
700 HRESULT NINE_WINAPI
701 NineDevice9_GetVertexShaderConstantF( struct NineDevice9 *This,
702 UINT StartRegister,
703 float *pConstantData,
704 UINT Vector4fCount );
705
706 HRESULT NINE_WINAPI
707 NineDevice9_SetVertexShaderConstantI( struct NineDevice9 *This,
708 UINT StartRegister,
709 const int *pConstantData,
710 UINT Vector4iCount );
711
712 HRESULT NINE_WINAPI
713 NineDevice9_GetVertexShaderConstantI( struct NineDevice9 *This,
714 UINT StartRegister,
715 int *pConstantData,
716 UINT Vector4iCount );
717
718 HRESULT NINE_WINAPI
719 NineDevice9_SetVertexShaderConstantB( struct NineDevice9 *This,
720 UINT StartRegister,
721 const BOOL *pConstantData,
722 UINT BoolCount );
723
724 HRESULT NINE_WINAPI
725 NineDevice9_GetVertexShaderConstantB( struct NineDevice9 *This,
726 UINT StartRegister,
727 BOOL *pConstantData,
728 UINT BoolCount );
729
730 HRESULT NINE_WINAPI
731 NineDevice9_SetStreamSource( struct NineDevice9 *This,
732 UINT StreamNumber,
733 IDirect3DVertexBuffer9 *pStreamData,
734 UINT OffsetInBytes,
735 UINT Stride );
736
737 HRESULT NINE_WINAPI
738 NineDevice9_GetStreamSource( struct NineDevice9 *This,
739 UINT StreamNumber,
740 IDirect3DVertexBuffer9 **ppStreamData,
741 UINT *pOffsetInBytes,
742 UINT *pStride );
743
744 HRESULT NINE_WINAPI
745 NineDevice9_SetStreamSourceFreq( struct NineDevice9 *This,
746 UINT StreamNumber,
747 UINT Setting );
748
749 HRESULT NINE_WINAPI
750 NineDevice9_GetStreamSourceFreq( struct NineDevice9 *This,
751 UINT StreamNumber,
752 UINT *pSetting );
753
754 HRESULT NINE_WINAPI
755 NineDevice9_SetIndices( struct NineDevice9 *This,
756 IDirect3DIndexBuffer9 *pIndexData );
757
758 HRESULT NINE_WINAPI
759 NineDevice9_GetIndices( struct NineDevice9 *This,
760 IDirect3DIndexBuffer9 **ppIndexData /*,
761 UINT *pBaseVertexIndex */ );
762
763 HRESULT NINE_WINAPI
764 NineDevice9_CreatePixelShader( struct NineDevice9 *This,
765 const DWORD *pFunction,
766 IDirect3DPixelShader9 **ppShader );
767
768 HRESULT NINE_WINAPI
769 NineDevice9_SetPixelShader( struct NineDevice9 *This,
770 IDirect3DPixelShader9 *pShader );
771
772 HRESULT NINE_WINAPI
773 NineDevice9_GetPixelShader( struct NineDevice9 *This,
774 IDirect3DPixelShader9 **ppShader );
775
776 HRESULT NINE_WINAPI
777 NineDevice9_SetPixelShaderConstantF( struct NineDevice9 *This,
778 UINT StartRegister,
779 const float *pConstantData,
780 UINT Vector4fCount );
781
782 HRESULT NINE_WINAPI
783 NineDevice9_GetPixelShaderConstantF( struct NineDevice9 *This,
784 UINT StartRegister,
785 float *pConstantData,
786 UINT Vector4fCount );
787
788 HRESULT NINE_WINAPI
789 NineDevice9_SetPixelShaderConstantI( struct NineDevice9 *This,
790 UINT StartRegister,
791 const int *pConstantData,
792 UINT Vector4iCount );
793
794 HRESULT NINE_WINAPI
795 NineDevice9_GetPixelShaderConstantI( struct NineDevice9 *This,
796 UINT StartRegister,
797 int *pConstantData,
798 UINT Vector4iCount );
799
800 HRESULT NINE_WINAPI
801 NineDevice9_SetPixelShaderConstantB( struct NineDevice9 *This,
802 UINT StartRegister,
803 const BOOL *pConstantData,
804 UINT BoolCount );
805
806 HRESULT NINE_WINAPI
807 NineDevice9_GetPixelShaderConstantB( struct NineDevice9 *This,
808 UINT StartRegister,
809 BOOL *pConstantData,
810 UINT BoolCount );
811
812 HRESULT NINE_WINAPI
813 NineDevice9_DrawRectPatch( struct NineDevice9 *This,
814 UINT Handle,
815 const float *pNumSegs,
816 const D3DRECTPATCH_INFO *pRectPatchInfo );
817
818 HRESULT NINE_WINAPI
819 NineDevice9_DrawTriPatch( struct NineDevice9 *This,
820 UINT Handle,
821 const float *pNumSegs,
822 const D3DTRIPATCH_INFO *pTriPatchInfo );
823
824 HRESULT NINE_WINAPI
825 NineDevice9_DeletePatch( struct NineDevice9 *This,
826 UINT Handle );
827
828 HRESULT NINE_WINAPI
829 NineDevice9_CreateQuery( struct NineDevice9 *This,
830 D3DQUERYTYPE Type,
831 IDirect3DQuery9 **ppQuery );
832
833 #endif /* _NINE_DEVICE9_H_ */