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