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