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