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