1 /**********************************************************
2 * Copyright 2008-2009 VMware, Inc. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 *
24 **********************************************************/
25
26 /*
27 * svga_cmd.h --
28 *
29 * Command construction utility for the SVGA3D protocol used by
30 * the VMware SVGA device, based on the svgautil library.
31 */
32
33 #ifndef __SVGA3D_H__
34 #define __SVGA3D_H__
35
36
37 #include "svga_types.h"
38 #include "svga_winsys.h"
39 #include "svga_reg.h"
40 #include "svga3d_reg.h"
41
42 #include "pipe/p_defines.h"
43
44
45 struct pipe_surface;
46 struct svga_transfer;
47 struct svga_winsys_context;
48 struct svga_winsys_buffer;
49 struct svga_winsys_surface;
50 struct svga_winsys_gb_shader;
51 struct svga_winsys_gb_query;
52
53
54 /*
55 * SVGA Device Interoperability
56 */
57
58 void *
59 SVGA3D_FIFOReserve(struct svga_winsys_context *swc, uint32 cmd, uint32 cmdSize, uint32 nr_relocs);
60
61 void
62 SVGA_FIFOCommitAll(struct svga_winsys_context *swc);
63
64 /**
65 * Return the last command id put in the command buffer.
66 */
67 static inline SVGAFifo3dCmdId
SVGA3D_GetLastCommand(const struct svga_winsys_context * swc)68 SVGA3D_GetLastCommand(const struct svga_winsys_context *swc)
69 {
70 return swc->last_command;
71 }
72
73 /**
74 * Reset/clear the last command put in the command buffer.
75 * To be called when buffer is flushed.
76 */
77 static inline void
SVGA3D_ResetLastCommand(struct svga_winsys_context * swc)78 SVGA3D_ResetLastCommand(struct svga_winsys_context *swc)
79 {
80 swc->last_command = 0;
81 }
82
83
84 /*
85 * Context Management
86 */
87
88 enum pipe_error
89 SVGA3D_DefineContext(struct svga_winsys_context *swc);
90
91 enum pipe_error
92 SVGA3D_DestroyContext(struct svga_winsys_context *swc);
93
94
95 /*
96 * Surface Management
97 */
98
99 enum pipe_error
100 SVGA3D_BeginDefineSurface(struct svga_winsys_context *swc,
101 struct svga_winsys_surface *sid,
102 SVGA3dSurface1Flags flags,
103 SVGA3dSurfaceFormat format,
104 SVGA3dSurfaceFace **faces,
105 SVGA3dSize **mipSizes,
106 uint32 numMipSizes);
107 enum pipe_error
108 SVGA3D_DefineSurface2D(struct svga_winsys_context *swc,
109 struct svga_winsys_surface *sid,
110 uint32 width,
111 uint32 height,
112 SVGA3dSurfaceFormat format);
113 enum pipe_error
114 SVGA3D_DestroySurface(struct svga_winsys_context *swc,
115 struct svga_winsys_surface *sid);
116
117
118 /*
119 * Surface Operations
120 */
121
122 enum pipe_error
123 SVGA3D_SurfaceDMA(struct svga_winsys_context *swc,
124 struct svga_transfer *st,
125 SVGA3dTransferType transfer,
126 const SVGA3dCopyBox *boxes,
127 uint32 numBoxes,
128 SVGA3dSurfaceDMAFlags flags);
129
130 enum pipe_error
131 SVGA3D_BufferDMA(struct svga_winsys_context *swc,
132 struct svga_winsys_buffer *guest,
133 struct svga_winsys_surface *host,
134 SVGA3dTransferType transfer,
135 uint32 size,
136 uint32 guest_offset,
137 uint32 host_offset,
138 SVGA3dSurfaceDMAFlags flags);
139
140 /*
141 * Drawing Operations
142 */
143
144
145 enum pipe_error
146 SVGA3D_BeginClear(struct svga_winsys_context *swc,
147 SVGA3dClearFlag flags,
148 uint32 color, float depth, uint32 stencil,
149 SVGA3dRect **rects, uint32 numRects);
150
151 enum pipe_error
152 SVGA3D_ClearRect(struct svga_winsys_context *swc,
153 SVGA3dClearFlag flags, uint32 color, float depth,
154 uint32 stencil, uint32 x, uint32 y, uint32 w, uint32 h);
155
156 enum pipe_error
157 SVGA3D_BeginDrawPrimitives(struct svga_winsys_context *swc,
158 SVGA3dVertexDecl **decls,
159 uint32 numVertexDecls,
160 SVGA3dPrimitiveRange **ranges,
161 uint32 numRanges);
162
163 /*
164 * Blits
165 */
166
167 enum pipe_error
168 SVGA3D_BeginSurfaceCopy(struct svga_winsys_context *swc,
169 struct pipe_surface *src,
170 struct pipe_surface *dest,
171 SVGA3dCopyBox **boxes, uint32 numBoxes);
172
173
174 enum pipe_error
175 SVGA3D_SurfaceStretchBlt(struct svga_winsys_context *swc,
176 struct pipe_surface *src,
177 struct pipe_surface *dest,
178 SVGA3dBox *boxSrc, SVGA3dBox *boxDest,
179 SVGA3dStretchBltMode mode);
180
181 /*
182 * Shared FFP/Shader Render State
183 */
184
185 enum pipe_error
186 SVGA3D_SetRenderTarget(struct svga_winsys_context *swc,
187 SVGA3dRenderTargetType type,
188 struct pipe_surface *surface);
189
190 enum pipe_error
191 SVGA3D_SetZRange(struct svga_winsys_context *swc,
192 float zMin, float zMax);
193
194 enum pipe_error
195 SVGA3D_SetViewport(struct svga_winsys_context *swc,
196 SVGA3dRect *rect);
197
198 enum pipe_error
199 SVGA3D_SetScissorRect(struct svga_winsys_context *swc,
200 SVGA3dRect *rect);
201
202 enum pipe_error
203 SVGA3D_SetClipPlane(struct svga_winsys_context *swc,
204 uint32 index, const float *plane);
205
206 enum pipe_error
207 SVGA3D_BeginSetTextureState(struct svga_winsys_context *swc,
208 SVGA3dTextureState **states,
209 uint32 numStates);
210
211 enum pipe_error
212 SVGA3D_BeginSetRenderState(struct svga_winsys_context *swc,
213 SVGA3dRenderState **states,
214 uint32 numStates);
215
216
217 /*
218 * Shaders
219 */
220
221 enum pipe_error
222 SVGA3D_DefineShader(struct svga_winsys_context *swc,
223 uint32 shid, SVGA3dShaderType type,
224 const uint32 *bytecode, uint32 bytecodeLen);
225
226 enum pipe_error
227 SVGA3D_DestroyShader(struct svga_winsys_context *swc,
228 uint32 shid, SVGA3dShaderType type);
229
230 enum pipe_error
231 SVGA3D_SetShaderConst(struct svga_winsys_context *swc,
232 uint32 reg, SVGA3dShaderType type,
233 SVGA3dShaderConstType ctype, const void *value);
234
235 enum pipe_error
236 SVGA3D_SetShaderConsts(struct svga_winsys_context *swc,
237 uint32 reg,
238 uint32 numRegs,
239 SVGA3dShaderType type,
240 SVGA3dShaderConstType ctype,
241 const void *values);
242
243 enum pipe_error
244 SVGA3D_SetShader(struct svga_winsys_context *swc,
245 SVGA3dShaderType type, uint32 shid);
246
247
248 /*
249 * Guest-backed surface functions
250 */
251
252 enum pipe_error
253 SVGA3D_BindGBShader(struct svga_winsys_context *swc,
254 struct svga_winsys_gb_shader *gbshader);
255
256 enum pipe_error
257 SVGA3D_SetGBShader(struct svga_winsys_context *swc,
258 SVGA3dShaderType type,
259 struct svga_winsys_gb_shader *gbshader);
260
261 enum pipe_error
262 SVGA3D_BindGBSurface(struct svga_winsys_context *swc,
263 struct svga_winsys_surface *surface);
264
265 enum pipe_error
266 SVGA3D_UpdateGBImage(struct svga_winsys_context *swc,
267 struct svga_winsys_surface *surface,
268 const SVGA3dBox *box,
269 unsigned face, unsigned mipLevel);
270
271 enum pipe_error
272 SVGA3D_UpdateGBSurface(struct svga_winsys_context *swc,
273 struct svga_winsys_surface *surface);
274
275
276 enum pipe_error
277 SVGA3D_ReadbackGBImage(struct svga_winsys_context *swc,
278 struct svga_winsys_surface *surface,
279 unsigned face, unsigned mipLevel);
280
281
282 enum pipe_error
283 SVGA3D_ReadbackGBSurface(struct svga_winsys_context *swc,
284 struct svga_winsys_surface *surface);
285
286
287 enum pipe_error
288 SVGA3D_ReadbackGBImagePartial(struct svga_winsys_context *swc,
289 struct svga_winsys_surface *surface,
290 unsigned face, unsigned mipLevel,
291 const SVGA3dBox *box,
292 bool invertBox);
293
294
295 enum pipe_error
296 SVGA3D_InvalidateGBImagePartial(struct svga_winsys_context *swc,
297 struct svga_winsys_surface *surface,
298 unsigned face, unsigned mipLevel,
299 const SVGA3dBox *box,
300 bool invertBox);
301
302 enum pipe_error
303 SVGA3D_InvalidateGBSurface(struct svga_winsys_context *swc,
304 struct svga_winsys_surface *surface);
305
306
307 enum pipe_error
308 SVGA3D_SetGBShaderConstsInline(struct svga_winsys_context *swc,
309 unsigned regStart,
310 unsigned numRegs,
311 SVGA3dShaderType shaderType,
312 SVGA3dShaderConstType constType,
313 const void *values);
314
315 /*
316 * Queries
317 */
318
319 enum pipe_error
320 SVGA3D_BeginQuery(struct svga_winsys_context *swc,
321 SVGA3dQueryType type);
322
323 enum pipe_error
324 SVGA3D_EndQuery(struct svga_winsys_context *swc,
325 SVGA3dQueryType type,
326 struct svga_winsys_buffer *buffer);
327
328 enum pipe_error
329 SVGA3D_WaitForQuery(struct svga_winsys_context *swc,
330 SVGA3dQueryType type,
331 struct svga_winsys_buffer *buffer);
332
333
334
335 /*
336 * VGPU10 commands
337 */
338
339 enum pipe_error
340 SVGA3D_vgpu10_PredCopyRegion(struct svga_winsys_context *swc,
341 struct svga_winsys_surface *dstSurf,
342 uint32 dstSubResource,
343 struct svga_winsys_surface *srcSurf,
344 uint32 srcSubResource,
345 const SVGA3dCopyBox *box);
346
347 enum pipe_error
348 SVGA3D_vgpu10_PredCopy(struct svga_winsys_context *swc,
349 struct svga_winsys_surface *dstSurf,
350 struct svga_winsys_surface *srcSurf);
351
352 enum pipe_error
353 SVGA3D_vgpu10_SetViewports(struct svga_winsys_context *swc,
354 unsigned count, const SVGA3dViewport *viewports);
355
356 enum pipe_error
357 SVGA3D_vgpu10_SetShader(struct svga_winsys_context *swc,
358 SVGA3dShaderType type,
359 struct svga_winsys_gb_shader *gbshader,
360 SVGA3dShaderId shaderId);
361
362 enum pipe_error
363 SVGA3D_vgpu10_SetShaderResources(struct svga_winsys_context *swc,
364 SVGA3dShaderType type,
365 uint32 startView,
366 unsigned count,
367 const SVGA3dShaderResourceViewId ids[],
368 struct svga_winsys_surface **views);
369
370 enum pipe_error
371 SVGA3D_vgpu10_SetSamplers(struct svga_winsys_context *swc,
372 unsigned count,
373 uint32 startSampler,
374 SVGA3dShaderType type,
375 const SVGA3dSamplerId *samplerIds);
376
377 enum pipe_error
378 SVGA3D_vgpu10_SetRenderTargets(struct svga_winsys_context *swc,
379 unsigned color_count,
380 struct pipe_surface **color_surfs,
381 struct pipe_surface *depth_stencil_surf);
382
383 enum pipe_error
384 SVGA3D_vgpu10_SetBlendState(struct svga_winsys_context *swc,
385 SVGA3dBlendStateId blendId,
386 const float *blendFactor, uint32 sampleMask);
387
388 enum pipe_error
389 SVGA3D_vgpu10_SetDepthStencilState(struct svga_winsys_context *swc,
390 SVGA3dDepthStencilStateId depthStencilId,
391 uint32 stencilRef);
392
393 enum pipe_error
394 SVGA3D_vgpu10_SetRasterizerState(struct svga_winsys_context *swc,
395 SVGA3dRasterizerStateId rasterizerId);
396
397 enum pipe_error
398 SVGA3D_vgpu10_SetPredication(struct svga_winsys_context *swc,
399 SVGA3dQueryId queryId,
400 uint32 predicateValue);
401
402 enum pipe_error
403 SVGA3D_vgpu10_SetSOTargets(struct svga_winsys_context *swc,
404 unsigned count, const SVGA3dSoTarget *targets,
405 struct svga_winsys_surface **surfaces);
406
407 enum pipe_error
408 SVGA3D_vgpu10_SetScissorRects(struct svga_winsys_context *swc,
409 unsigned count,
410 const SVGASignedRect *rects);
411
412 enum pipe_error
413 SVGA3D_vgpu10_SetStreamOutput(struct svga_winsys_context *swc,
414 SVGA3dStreamOutputId soid);
415
416 enum pipe_error
417 SVGA3D_vgpu10_Draw(struct svga_winsys_context *swc,
418 uint32 vertexCount, uint32 startVertexLocation);
419
420 enum pipe_error
421 SVGA3D_vgpu10_DrawIndexed(struct svga_winsys_context *swc,
422 uint32 indexCount, uint32 startIndexLocation,
423 int32 baseVertexLocation);
424
425 enum pipe_error
426 SVGA3D_vgpu10_DrawInstanced(struct svga_winsys_context *swc,
427 uint32 vertexCountPerInstance,
428 uint32 instanceCount,
429 uint32 startVertexLocation,
430 uint32 startInstanceLocation);
431
432 enum pipe_error
433 SVGA3D_vgpu10_DrawIndexedInstanced(struct svga_winsys_context *swc,
434 uint32 indexCountPerInstance,
435 uint32 instanceCount,
436 uint32 startIndexLocation,
437 int32 baseVertexLocation,
438 uint32 startInstanceLocation);
439
440 enum pipe_error
441 SVGA3D_vgpu10_DrawAuto(struct svga_winsys_context *swc);
442
443 enum pipe_error
444 SVGA3D_vgpu10_DefineQuery(struct svga_winsys_context *swc,
445 SVGA3dQueryId queryId,
446 SVGA3dQueryType type,
447 SVGA3dDXQueryFlags flags);
448
449 enum pipe_error
450 SVGA3D_vgpu10_DestroyQuery(struct svga_winsys_context *swc,
451 SVGA3dQueryId queryId);
452
453 enum pipe_error
454 SVGA3D_vgpu10_BindQuery(struct svga_winsys_context *swc,
455 struct svga_winsys_gb_query *gbQuery,
456 SVGA3dQueryId queryId);
457
458 enum pipe_error
459 SVGA3D_vgpu10_SetQueryOffset(struct svga_winsys_context *swc,
460 SVGA3dQueryId queryId,
461 uint32 mobOffset);
462
463 enum pipe_error
464 SVGA3D_vgpu10_BeginQuery(struct svga_winsys_context *swc,
465 SVGA3dQueryId queryId);
466
467 enum pipe_error
468 SVGA3D_vgpu10_EndQuery(struct svga_winsys_context *swc,
469 SVGA3dQueryId queryId);
470
471 enum pipe_error
472 SVGA3D_vgpu10_ClearRenderTargetView(struct svga_winsys_context *swc,
473 struct pipe_surface *color_surf,
474 const float *rgba);
475
476 enum pipe_error
477 SVGA3D_vgpu10_ClearDepthStencilView(struct svga_winsys_context *swc,
478 struct pipe_surface *ds_surf,
479 uint16 flags, uint16 stencil, float depth);
480
481 enum pipe_error
482 SVGA3D_vgpu10_DefineShaderResourceView(struct svga_winsys_context *swc,
483 SVGA3dShaderResourceViewId shaderResourceViewId,
484 struct svga_winsys_surface *surf,
485 SVGA3dSurfaceFormat format,
486 SVGA3dResourceType resourceDimension,
487 const SVGA3dShaderResourceViewDesc *desc);
488
489 enum pipe_error
490 SVGA3D_vgpu10_DestroyShaderResourceView(struct svga_winsys_context *swc,
491 SVGA3dShaderResourceViewId shaderResourceViewId);
492
493 enum pipe_error
494 SVGA3D_vgpu10_DefineRenderTargetView(struct svga_winsys_context *swc,
495 SVGA3dRenderTargetViewId renderTargetViewId,
496 struct svga_winsys_surface *surface,
497 SVGA3dSurfaceFormat format,
498 SVGA3dResourceType resourceDimension,
499 const SVGA3dRenderTargetViewDesc *desc);
500
501 enum pipe_error
502 SVGA3D_vgpu10_DestroyRenderTargetView(struct svga_winsys_context *swc,
503 SVGA3dRenderTargetViewId renderTargetViewId);
504
505 enum pipe_error
506 SVGA3D_vgpu10_DefineDepthStencilView(struct svga_winsys_context *swc,
507 SVGA3dDepthStencilViewId depthStencilViewId,
508 struct svga_winsys_surface *surface,
509 SVGA3dSurfaceFormat format,
510 SVGA3dResourceType resourceDimension,
511 const SVGA3dRenderTargetViewDesc *desc);
512
513
514 enum pipe_error
515 SVGA3D_vgpu10_DestroyDepthStencilView(struct svga_winsys_context *swc,
516 SVGA3dDepthStencilViewId depthStencilViewId);
517
518 enum pipe_error
519 SVGA3D_vgpu10_DefineElementLayout(struct svga_winsys_context *swc,
520 unsigned count,
521 SVGA3dElementLayoutId elementLayoutId,
522 const SVGA3dInputElementDesc *elements);
523
524 enum pipe_error
525 SVGA3D_vgpu10_DestroyElementLayout(struct svga_winsys_context *swc,
526 SVGA3dElementLayoutId elementLayoutId);
527
528 enum pipe_error
529 SVGA3D_vgpu10_DefineBlendState(struct svga_winsys_context *swc,
530 SVGA3dBlendStateId blendId,
531 uint8 alphaToCoverageEnable,
532 uint8 independentBlendEnable,
533 const SVGA3dDXBlendStatePerRT *perRT);
534
535 enum pipe_error
536 SVGA3D_vgpu10_DestroyBlendState(struct svga_winsys_context *swc,
537 SVGA3dBlendStateId blendId);
538
539 enum pipe_error
540 SVGA3D_vgpu10_DefineDepthStencilState(struct svga_winsys_context *swc,
541 SVGA3dDepthStencilStateId depthStencilId,
542 uint8 depthEnable,
543 SVGA3dDepthWriteMask depthWriteMask,
544 SVGA3dComparisonFunc depthFunc,
545 uint8 stencilEnable,
546 uint8 frontEnable,
547 uint8 backEnable,
548 uint8 stencilReadMask,
549 uint8 stencilWriteMask,
550 uint8 frontStencilFailOp,
551 uint8 frontStencilDepthFailOp,
552 uint8 frontStencilPassOp,
553 SVGA3dComparisonFunc frontStencilFunc,
554 uint8 backStencilFailOp,
555 uint8 backStencilDepthFailOp,
556 uint8 backStencilPassOp,
557 SVGA3dComparisonFunc backStencilFunc);
558
559 enum pipe_error
560 SVGA3D_vgpu10_DestroyDepthStencilState(struct svga_winsys_context *swc,
561 SVGA3dDepthStencilStateId depthStencilId);
562
563 enum pipe_error
564 SVGA3D_vgpu10_DefineRasterizerState(struct svga_winsys_context *swc,
565 SVGA3dRasterizerStateId rasterizerId,
566 uint8 fillMode,
567 SVGA3dCullMode cullMode,
568 uint8 frontCounterClockwise,
569 int32 depthBias,
570 float depthBiasClamp,
571 float slopeScaledDepthBias,
572 uint8 depthClipEnable,
573 uint8 scissorEnable,
574 uint8 multisampleEnable,
575 uint8 antialiasedLineEnable,
576 float lineWidth,
577 uint8 lineStippleEnable,
578 uint8 lineStippleFactor,
579 uint16 lineStipplePattern,
580 uint8 provokingVertexLast);
581
582 enum pipe_error
583 SVGA3D_vgpu10_DestroyRasterizerState(struct svga_winsys_context *swc,
584 SVGA3dRasterizerStateId rasterizerId);
585
586 enum pipe_error
587 SVGA3D_vgpu10_DefineSamplerState(struct svga_winsys_context *swc,
588 SVGA3dSamplerId samplerId,
589 SVGA3dFilter filter,
590 uint8 addressU,
591 uint8 addressV,
592 uint8 addressW,
593 float mipLODBias,
594 uint8 maxAnisotropy,
595 uint8 comparisonFunc,
596 SVGA3dRGBAFloat borderColor,
597 float minLOD,
598 float maxLOD);
599
600 enum pipe_error
601 SVGA3D_vgpu10_DestroySamplerState(struct svga_winsys_context *swc,
602 SVGA3dSamplerId samplerId);
603
604 enum pipe_error
605 SVGA3D_vgpu10_DestroyShader(struct svga_winsys_context *swc,
606 SVGA3dShaderId shaderId);
607
608 enum pipe_error
609 SVGA3D_vgpu10_DefineAndBindShader(struct svga_winsys_context *swc,
610 struct svga_winsys_gb_shader *gbshader,
611 SVGA3dShaderId shaderId,
612 SVGA3dShaderType type,
613 uint32 sizeInBytes);
614
615 enum pipe_error
616 SVGA3D_vgpu10_DefineStreamOutput(struct svga_winsys_context *swc,
617 SVGA3dStreamOutputId soid,
618 uint32 numOutputStreamEntries,
619 uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS],
620 const SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS]);
621
622 enum pipe_error
623 SVGA3D_vgpu10_DestroyStreamOutput(struct svga_winsys_context *swc,
624 SVGA3dStreamOutputId soid);
625
626 enum pipe_error
627 SVGA3D_vgpu10_ReadbackSubResource(struct svga_winsys_context *swc,
628 struct svga_winsys_surface *surface,
629 unsigned subResource);
630
631 enum pipe_error
632 SVGA3D_vgpu10_SetInputLayout(struct svga_winsys_context *swc,
633 SVGA3dElementLayoutId elementLayoutId);
634
635 enum pipe_error
636 SVGA3D_vgpu10_SetVertexBuffers(struct svga_winsys_context *swc,
637 unsigned count,
638 uint32 startBuffer,
639 const SVGA3dVertexBuffer_v2 *bufferInfo,
640 struct svga_winsys_surface **surfaces);
641
642 enum pipe_error
643 SVGA3D_vgpu10_SetVertexBuffers_v2(struct svga_winsys_context *swc,
644 unsigned count,
645 uint32 startBuffer,
646 const SVGA3dVertexBuffer_v2 *bufferInfo,
647 struct svga_winsys_surface **surfaces);
648
649 enum pipe_error
650 SVGA3D_vgpu10_SetVertexBuffersOffsetAndSize(struct svga_winsys_context *swc,
651 unsigned count,
652 uint32 startBuffer,
653 const SVGA3dVertexBuffer_v2 *bufferInfo);
654
655 enum pipe_error
656 SVGA3D_vgpu10_SetTopology(struct svga_winsys_context *swc,
657 SVGA3dPrimitiveType topology);
658
659 enum pipe_error
660 SVGA3D_vgpu10_SetIndexBuffer(struct svga_winsys_context *swc,
661 struct svga_winsys_surface *indexes,
662 SVGA3dSurfaceFormat format, uint32 offset);
663
664 enum pipe_error
665 SVGA3D_vgpu10_SetIndexBuffer_v2(struct svga_winsys_context *swc,
666 struct svga_winsys_surface *indexes,
667 SVGA3dSurfaceFormat format, uint32 offset,
668 uint32 sizeInBytes);
669
670 enum pipe_error
671 SVGA3D_vgpu10_SetIndexBufferOffsetAndSize(struct svga_winsys_context *swc,
672 SVGA3dSurfaceFormat format, uint32 offset,
673 uint32 sizeInBytes);
674
675 enum pipe_error
676 SVGA3D_vgpu10_SetSingleConstantBuffer(struct svga_winsys_context *swc,
677 unsigned slot,
678 SVGA3dShaderType type,
679 struct svga_winsys_surface *surface,
680 uint32 offsetInBytes,
681 uint32 sizeInBytes);
682
683 enum pipe_error
684 SVGA3D_vgpu10_SetConstantBufferOffset(struct svga_winsys_context *swc,
685 unsigned command,
686 unsigned slot,
687 uint32 offsetInBytes);
688
689 enum pipe_error
690 SVGA3D_vgpu10_UpdateSubResource(struct svga_winsys_context *swc,
691 struct svga_winsys_surface *surface,
692 const SVGA3dBox *box,
693 unsigned subResource);
694
695 enum pipe_error
696 SVGA3D_vgpu10_GenMips(struct svga_winsys_context *swc,
697 SVGA3dShaderResourceViewId shaderResourceViewId,
698 struct svga_winsys_surface *view);
699
700 enum pipe_error
701 SVGA3D_vgpu10_BufferCopy(struct svga_winsys_context *swc,
702 struct svga_winsys_surface *src,
703 struct svga_winsys_surface *dst,
704 unsigned srcx, unsigned dstx, unsigned width);
705
706 enum pipe_error
707 SVGA3D_vgpu10_TransferFromBuffer(struct svga_winsys_context *swc,
708 struct svga_winsys_surface *src,
709 unsigned srcOffset, unsigned srcPitch,
710 unsigned srcSlicePitch,
711 struct svga_winsys_surface *dst,
712 unsigned dstSubResource,
713 SVGA3dBox *dstBox);
714
715 /*Cap2 commands*/
716 enum pipe_error
717 SVGA3D_vgpu10_IntraSurfaceCopy(struct svga_winsys_context *swc,
718 struct svga_winsys_surface *src,
719 unsigned level, unsigned face,
720 const SVGA3dCopyBox *box);
721
722 enum pipe_error
723 SVGA3D_vgpu10_ResolveCopy(struct svga_winsys_context *swc,
724 unsigned dstSubResource,
725 struct svga_winsys_surface *dst,
726 unsigned srcSubResource,
727 struct svga_winsys_surface *src,
728 const SVGA3dSurfaceFormat copyFormat);
729
730 enum pipe_error
731 SVGA3D_sm5_DrawIndexedInstancedIndirect(struct svga_winsys_context *swc,
732 struct svga_winsys_surface *argBuffer,
733 unsigned argOffset);
734
735 enum pipe_error
736 SVGA3D_sm5_DrawInstancedIndirect(struct svga_winsys_context *swc,
737 struct svga_winsys_surface *argBuffer,
738 unsigned argOffset);
739
740 enum pipe_error
741 SVGA3D_sm5_DefineUAView(struct svga_winsys_context *swc,
742 SVGA3dUAViewId uaViewId,
743 struct svga_winsys_surface *surface,
744 SVGA3dSurfaceFormat format,
745 SVGA3dResourceType resourceDimension,
746 const SVGA3dUAViewDesc *desc);
747
748 enum pipe_error
749 SVGA3D_sm5_DestroyUAView(struct svga_winsys_context *swc,
750 SVGA3dUAViewId uaViewId);
751
752 enum pipe_error
753 SVGA3D_sm5_SetUAViews(struct svga_winsys_context *swc,
754 uint32 uavSpliceIndex,
755 unsigned count,
756 const SVGA3dUAViewId ids[],
757 struct svga_winsys_surface **uaViews);
758
759 enum pipe_error
760 SVGA3D_sm5_SetCSUAViews(struct svga_winsys_context *swc,
761 unsigned count,
762 const SVGA3dUAViewId ids[],
763 struct svga_winsys_surface **uaViews);
764
765 enum pipe_error
766 SVGA3D_sm5_Dispatch(struct svga_winsys_context *swc,
767 const uint32 threadGroupCount[3]);
768
769 enum pipe_error
770 SVGA3D_sm5_DispatchIndirect(struct svga_winsys_context *swc,
771 struct svga_winsys_surface *argBuffer,
772 uint32 argOffset);
773
774 enum pipe_error
775 SVGA3D_sm5_DefineAndBindStreamOutput(struct svga_winsys_context *swc,
776 SVGA3dStreamOutputId soid,
777 uint32 numOutputStreamEntries,
778 uint32 numOutputStreamStrides,
779 uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS],
780 struct svga_winsys_buffer *declBuf,
781 uint32 rasterizedStream,
782 uint32 sizeInBytes);
783
784 enum pipe_error
785 SVGA3D_sm5_DefineRasterizerState_v2(struct svga_winsys_context *swc,
786 SVGA3dRasterizerStateId rasterizerId,
787 uint8 fillMode,
788 SVGA3dCullMode cullMode,
789 uint8 frontCounterClockwise,
790 int32 depthBias,
791 float depthBiasClamp,
792 float slopeScaledDepthBias,
793 uint8 depthClipEnable,
794 uint8 scissorEnable,
795 uint8 multisampleEnable,
796 uint8 antialiasedLineEnable,
797 float lineWidth,
798 uint8 lineStippleEnable,
799 uint8 lineStippleFactor,
800 uint16 lineStipplePattern,
801 uint8 provokingVertexLast,
802 uint32 forcedSampleCount);
803 #endif /* __SVGA3D_H__ */
804