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