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