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