• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**********************************************************
2  * Copyright 2007-2015 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  * svga3d_dx.h --
28  *
29  *       SVGA 3d hardware definitions for DX10 support.
30  */
31 
32 #ifndef _SVGA3D_DX_H_
33 #define _SVGA3D_DX_H_
34 
35 #define INCLUDE_ALLOW_MODULE
36 #define INCLUDE_ALLOW_USERLEVEL
37 #define INCLUDE_ALLOW_VMCORE
38 #include "includeCheck.h"
39 
40 #include "svga3d_limits.h"
41 
42 #define SVGA3D_INPUT_MIN               0
43 #define SVGA3D_INPUT_PER_VERTEX_DATA   0
44 #define SVGA3D_INPUT_PER_INSTANCE_DATA 1
45 #define SVGA3D_INPUT_MAX               2
46 typedef uint32 SVGA3dInputClassification;
47 
48 #define SVGA3D_RESOURCE_TYPE_MIN      1
49 #define SVGA3D_RESOURCE_BUFFER        1
50 #define SVGA3D_RESOURCE_TEXTURE1D     2
51 #define SVGA3D_RESOURCE_TEXTURE2D     3
52 #define SVGA3D_RESOURCE_TEXTURE3D     4
53 #define SVGA3D_RESOURCE_TEXTURECUBE   5
54 #define SVGA3D_RESOURCE_TYPE_DX10_MAX 6
55 #define SVGA3D_RESOURCE_BUFFEREX      6
56 #define SVGA3D_RESOURCE_TYPE_MAX      7
57 typedef uint32 SVGA3dResourceType;
58 
59 #define SVGA3D_DEPTH_WRITE_MASK_ZERO   0
60 #define SVGA3D_DEPTH_WRITE_MASK_ALL    1
61 typedef uint8 SVGA3dDepthWriteMask;
62 
63 #define SVGA3D_FILTER_MIP_LINEAR  (1 << 0)
64 #define SVGA3D_FILTER_MAG_LINEAR  (1 << 2)
65 #define SVGA3D_FILTER_MIN_LINEAR  (1 << 4)
66 #define SVGA3D_FILTER_ANISOTROPIC (1 << 6)
67 #define SVGA3D_FILTER_COMPARE     (1 << 7)
68 typedef uint32 SVGA3dFilter;
69 
70 #define SVGA3D_CULL_INVALID 0
71 #define SVGA3D_CULL_MIN     1
72 #define SVGA3D_CULL_NONE    1
73 #define SVGA3D_CULL_FRONT   2
74 #define SVGA3D_CULL_BACK    3
75 #define SVGA3D_CULL_MAX     4
76 typedef uint8 SVGA3dCullMode;
77 
78 #define SVGA3D_COMPARISON_INVALID         0
79 #define SVGA3D_COMPARISON_MIN             1
80 #define SVGA3D_COMPARISON_NEVER           1
81 #define SVGA3D_COMPARISON_LESS            2
82 #define SVGA3D_COMPARISON_EQUAL           3
83 #define SVGA3D_COMPARISON_LESS_EQUAL      4
84 #define SVGA3D_COMPARISON_GREATER         5
85 #define SVGA3D_COMPARISON_NOT_EQUAL       6
86 #define SVGA3D_COMPARISON_GREATER_EQUAL   7
87 #define SVGA3D_COMPARISON_ALWAYS          8
88 #define SVGA3D_COMPARISON_MAX             9
89 typedef uint8 SVGA3dComparisonFunc;
90 
91 #define SVGA3D_DX_MAX_VERTEXBUFFERS 32
92 #define SVGA3D_DX_MAX_VERTEXINPUTREGISTERS 16
93 #define SVGA3D_DX_MAX_SOTARGETS 4
94 #define SVGA3D_DX_MAX_SRVIEWS 128
95 #define SVGA3D_DX_MAX_CONSTBUFFERS 16
96 #define SVGA3D_DX_MAX_SAMPLERS 16
97 
98 /* Id limits */
99 static const uint32 SVGA3dBlendObjectCountPerContext = 4096;
100 static const uint32 SVGA3dDepthStencilObjectCountPerContext = 4096;
101 
102 typedef uint32 SVGA3dSurfaceId;
103 typedef uint32 SVGA3dShaderResourceViewId;
104 typedef uint32 SVGA3dRenderTargetViewId;
105 typedef uint32 SVGA3dDepthStencilViewId;
106 
107 typedef uint32 SVGA3dShaderId;
108 typedef uint32 SVGA3dElementLayoutId;
109 typedef uint32 SVGA3dSamplerId;
110 typedef uint32 SVGA3dBlendStateId;
111 typedef uint32 SVGA3dDepthStencilStateId;
112 typedef uint32 SVGA3dRasterizerStateId;
113 typedef uint32 SVGA3dQueryId;
114 typedef uint32 SVGA3dStreamOutputId;
115 
116 typedef union {
117    struct {
118       float r;
119       float g;
120       float b;
121       float a;
122    };
123 
124    float value[4];
125 } SVGA3dRGBAFloat;
126 
127 typedef
128 #include "vmware_pack_begin.h"
129 struct {
130    uint32 cid;
131    SVGAMobId mobid;
132 }
133 #include "vmware_pack_end.h"
134 SVGAOTableDXContextEntry;
135 
136 typedef
137 #include "vmware_pack_begin.h"
138 struct SVGA3dCmdDXDefineContext {
139    uint32 cid;
140 }
141 #include "vmware_pack_end.h"
142 SVGA3dCmdDXDefineContext;   /* SVGA_3D_CMD_DX_DEFINE_CONTEXT */
143 
144 typedef
145 #include "vmware_pack_begin.h"
146 struct SVGA3dCmdDXDestroyContext {
147    uint32 cid;
148 }
149 #include "vmware_pack_end.h"
150 SVGA3dCmdDXDestroyContext;   /* SVGA_3D_CMD_DX_DESTROY_CONTEXT */
151 
152 /*
153  * Bind a DX context.
154  *
155  * validContents should be set to 0 for new contexts,
156  * and 1 if this is an old context which is getting paged
157  * back on to the device.
158  *
159  * For new contexts, it is recommended that the driver
160  * issue commands to initialize all interesting state
161  * prior to rendering.
162  */
163 typedef
164 #include "vmware_pack_begin.h"
165 struct SVGA3dCmdDXBindContext {
166    uint32 cid;
167    SVGAMobId mobid;
168    uint32 validContents;
169 }
170 #include "vmware_pack_end.h"
171 SVGA3dCmdDXBindContext;   /* SVGA_3D_CMD_DX_BIND_CONTEXT */
172 
173 /*
174  * Readback a DX context.
175  * (Request that the device flush the contents back into guest memory.)
176  */
177 typedef
178 #include "vmware_pack_begin.h"
179 struct SVGA3dCmdDXReadbackContext {
180    uint32 cid;
181 }
182 #include "vmware_pack_end.h"
183 SVGA3dCmdDXReadbackContext;   /* SVGA_3D_CMD_DX_READBACK_CONTEXT */
184 
185 /*
186  * Invalidate a guest-backed context.
187  */
188 typedef
189 #include "vmware_pack_begin.h"
190 struct SVGA3dCmdDXInvalidateContext {
191    uint32 cid;
192 }
193 #include "vmware_pack_end.h"
194 SVGA3dCmdDXInvalidateContext;   /* SVGA_3D_CMD_DX_INVALIDATE_CONTEXT */
195 
196 typedef
197 #include "vmware_pack_begin.h"
198 struct SVGA3dReplyFormatData {
199    uint32 formatSupport;
200    uint32 msaa2xQualityLevels:5;
201    uint32 msaa4xQualityLevels:5;
202    uint32 msaa8xQualityLevels:5;
203    uint32 msaa16xQualityLevels:5;
204    uint32 msaa32xQualityLevels:5;
205    uint32 pad:7;
206 }
207 #include "vmware_pack_end.h"
208 SVGA3dReplyFormatData;
209 
210 typedef
211 #include "vmware_pack_begin.h"
212 struct SVGA3dCmdDXSetSingleConstantBuffer {
213    uint32 slot;
214    SVGA3dShaderType type;
215    SVGA3dSurfaceId sid;
216    uint32 offsetInBytes;
217    uint32 sizeInBytes;
218 }
219 #include "vmware_pack_end.h"
220 SVGA3dCmdDXSetSingleConstantBuffer;
221 /* SVGA_3D_CMD_DX_SET_SINGLE_CONSTANT_BUFFER */
222 
223 typedef
224 #include "vmware_pack_begin.h"
225 struct SVGA3dCmdDXSetShaderResources {
226    uint32 startView;
227    SVGA3dShaderType type;
228 
229    /*
230     * Followed by a variable number of SVGA3dShaderResourceViewId's.
231     */
232 }
233 #include "vmware_pack_end.h"
234 SVGA3dCmdDXSetShaderResources; /* SVGA_3D_CMD_DX_SET_SHADER_RESOURCES */
235 
236 typedef
237 #include "vmware_pack_begin.h"
238 struct SVGA3dCmdDXSetShader {
239    SVGA3dShaderId shaderId;
240    SVGA3dShaderType type;
241 }
242 #include "vmware_pack_end.h"
243 SVGA3dCmdDXSetShader; /* SVGA_3D_CMD_DX_SET_SHADER */
244 
245 typedef
246 #include "vmware_pack_begin.h"
247 struct SVGA3dCmdDXSetSamplers {
248    uint32 startSampler;
249    SVGA3dShaderType type;
250 
251    /*
252     * Followed by a variable number of SVGA3dSamplerId's.
253     */
254 }
255 #include "vmware_pack_end.h"
256 SVGA3dCmdDXSetSamplers; /* SVGA_3D_CMD_DX_SET_SAMPLERS */
257 
258 typedef
259 #include "vmware_pack_begin.h"
260 struct SVGA3dCmdDXDraw {
261    uint32 vertexCount;
262    uint32 startVertexLocation;
263 }
264 #include "vmware_pack_end.h"
265 SVGA3dCmdDXDraw; /* SVGA_3D_CMD_DX_DRAW */
266 
267 typedef
268 #include "vmware_pack_begin.h"
269 struct SVGA3dCmdDXDrawIndexed {
270    uint32 indexCount;
271    uint32 startIndexLocation;
272    int32  baseVertexLocation;
273 }
274 #include "vmware_pack_end.h"
275 SVGA3dCmdDXDrawIndexed; /* SVGA_3D_CMD_DX_DRAW_INDEXED */
276 
277 typedef
278 #include "vmware_pack_begin.h"
279 struct SVGA3dCmdDXDrawInstanced {
280    uint32 vertexCountPerInstance;
281    uint32 instanceCount;
282    uint32 startVertexLocation;
283    uint32 startInstanceLocation;
284 }
285 #include "vmware_pack_end.h"
286 SVGA3dCmdDXDrawInstanced; /* SVGA_3D_CMD_DX_DRAW_INSTANCED */
287 
288 typedef
289 #include "vmware_pack_begin.h"
290 struct SVGA3dCmdDXDrawIndexedInstanced {
291    uint32 indexCountPerInstance;
292    uint32 instanceCount;
293    uint32 startIndexLocation;
294    int32  baseVertexLocation;
295    uint32 startInstanceLocation;
296 }
297 #include "vmware_pack_end.h"
298 SVGA3dCmdDXDrawIndexedInstanced; /* SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED */
299 
300 typedef
301 #include "vmware_pack_begin.h"
302 struct SVGA3dCmdDXDrawAuto {
303    uint32 pad0;
304 }
305 #include "vmware_pack_end.h"
306 SVGA3dCmdDXDrawAuto; /* SVGA_3D_CMD_DX_DRAW_AUTO */
307 
308 typedef
309 #include "vmware_pack_begin.h"
310 struct SVGA3dCmdDXSetInputLayout {
311    SVGA3dElementLayoutId elementLayoutId;
312 }
313 #include "vmware_pack_end.h"
314 SVGA3dCmdDXSetInputLayout; /* SVGA_3D_CMD_DX_SET_INPUT_LAYOUT */
315 
316 typedef
317 #include "vmware_pack_begin.h"
318 struct SVGA3dVertexBuffer {
319    SVGA3dSurfaceId sid;
320    uint32 stride;
321    uint32 offset;
322 }
323 #include "vmware_pack_end.h"
324 SVGA3dVertexBuffer;
325 
326 typedef
327 #include "vmware_pack_begin.h"
328 struct SVGA3dCmdDXSetVertexBuffers {
329    uint32 startBuffer;
330    /* Followed by a variable number of SVGA3dVertexBuffer's. */
331 }
332 #include "vmware_pack_end.h"
333 SVGA3dCmdDXSetVertexBuffers; /* SVGA_3D_CMD_DX_SET_VERTEX_BUFFERS */
334 
335 typedef
336 #include "vmware_pack_begin.h"
337 struct SVGA3dCmdDXSetIndexBuffer {
338    SVGA3dSurfaceId sid;
339    SVGA3dSurfaceFormat format;
340    uint32 offset;
341 }
342 #include "vmware_pack_end.h"
343 SVGA3dCmdDXSetIndexBuffer; /* SVGA_3D_CMD_DX_SET_INDEX_BUFFER */
344 
345 typedef
346 #include "vmware_pack_begin.h"
347 struct SVGA3dCmdDXSetTopology {
348    SVGA3dPrimitiveType topology;
349 }
350 #include "vmware_pack_end.h"
351 SVGA3dCmdDXSetTopology; /* SVGA_3D_CMD_DX_SET_TOPOLOGY */
352 
353 typedef
354 #include "vmware_pack_begin.h"
355 struct SVGA3dCmdDXSetRenderTargets {
356    SVGA3dDepthStencilViewId depthStencilViewId;
357    /* Followed by a variable number of SVGA3dRenderTargetViewId's. */
358 }
359 #include "vmware_pack_end.h"
360 SVGA3dCmdDXSetRenderTargets; /* SVGA_3D_CMD_DX_SET_RENDERTARGETS */
361 
362 typedef
363 #include "vmware_pack_begin.h"
364 struct SVGA3dCmdDXSetBlendState {
365    SVGA3dBlendStateId blendId;
366    float blendFactor[4];
367    uint32 sampleMask;
368 }
369 #include "vmware_pack_end.h"
370 SVGA3dCmdDXSetBlendState; /* SVGA_3D_CMD_DX_SET_BLEND_STATE */
371 
372 typedef
373 #include "vmware_pack_begin.h"
374 struct SVGA3dCmdDXSetDepthStencilState {
375    SVGA3dDepthStencilStateId depthStencilId;
376    uint32 stencilRef;
377 }
378 #include "vmware_pack_end.h"
379 SVGA3dCmdDXSetDepthStencilState; /* SVGA_3D_CMD_DX_SET_DEPTHSTENCIL_STATE */
380 
381 typedef
382 #include "vmware_pack_begin.h"
383 struct SVGA3dCmdDXSetRasterizerState {
384    SVGA3dRasterizerStateId rasterizerId;
385 }
386 #include "vmware_pack_end.h"
387 SVGA3dCmdDXSetRasterizerState; /* SVGA_3D_CMD_DX_SET_RASTERIZER_STATE */
388 
389 #define SVGA3D_DXQUERY_FLAG_PREDICATEHINT (1 << 0)
390 typedef uint32 SVGA3dDXQueryFlags;
391 
392 /*
393  * The SVGADXQueryDeviceState and SVGADXQueryDeviceBits are used by the device
394  * to track query state transitions, but are not intended to be used by the
395  * driver.
396  */
397 #define SVGADX_QDSTATE_INVALID   ((uint8)-1) /* Query has no state */
398 #define SVGADX_QDSTATE_MIN       0
399 #define SVGADX_QDSTATE_IDLE      0   /* Query hasn't started yet */
400 #define SVGADX_QDSTATE_ACTIVE    1   /* Query is actively gathering data */
401 #define SVGADX_QDSTATE_PENDING   2   /* Query is waiting for results */
402 #define SVGADX_QDSTATE_FINISHED  3   /* Query has completed */
403 #define SVGADX_QDSTATE_MAX       4
404 typedef uint8 SVGADXQueryDeviceState;
405 
406 typedef
407 #include "vmware_pack_begin.h"
408 struct {
409    SVGA3dQueryTypeUint8 type;
410    uint16 pad0;
411    SVGADXQueryDeviceState state;
412    SVGA3dDXQueryFlags flags;
413    SVGAMobId mobid;
414    uint32 offset;
415 }
416 #include "vmware_pack_end.h"
417 SVGACOTableDXQueryEntry;
418 
419 typedef
420 #include "vmware_pack_begin.h"
421 struct SVGA3dCmdDXDefineQuery {
422    SVGA3dQueryId queryId;
423    SVGA3dQueryType type;
424    SVGA3dDXQueryFlags flags;
425 }
426 #include "vmware_pack_end.h"
427 SVGA3dCmdDXDefineQuery; /* SVGA_3D_CMD_DX_DEFINE_QUERY */
428 
429 typedef
430 #include "vmware_pack_begin.h"
431 struct SVGA3dCmdDXDestroyQuery {
432    SVGA3dQueryId queryId;
433 }
434 #include "vmware_pack_end.h"
435 SVGA3dCmdDXDestroyQuery; /* SVGA_3D_CMD_DX_DESTROY_QUERY */
436 
437 typedef
438 #include "vmware_pack_begin.h"
439 struct SVGA3dCmdDXBindQuery {
440    SVGA3dQueryId queryId;
441    SVGAMobId mobid;
442 }
443 #include "vmware_pack_end.h"
444 SVGA3dCmdDXBindQuery; /* SVGA_3D_CMD_DX_BIND_QUERY */
445 
446 typedef
447 #include "vmware_pack_begin.h"
448 struct SVGA3dCmdDXSetQueryOffset {
449    SVGA3dQueryId queryId;
450    uint32 mobOffset;
451 }
452 #include "vmware_pack_end.h"
453 SVGA3dCmdDXSetQueryOffset; /* SVGA_3D_CMD_DX_SET_QUERY_OFFSET */
454 
455 typedef
456 #include "vmware_pack_begin.h"
457 struct SVGA3dCmdDXBeginQuery {
458    SVGA3dQueryId queryId;
459 }
460 #include "vmware_pack_end.h"
461 SVGA3dCmdDXBeginQuery; /* SVGA_3D_CMD_DX_QUERY_BEGIN */
462 
463 typedef
464 #include "vmware_pack_begin.h"
465 struct SVGA3dCmdDXEndQuery {
466    SVGA3dQueryId queryId;
467 }
468 #include "vmware_pack_end.h"
469 SVGA3dCmdDXEndQuery; /* SVGA_3D_CMD_DX_QUERY_END */
470 
471 typedef
472 #include "vmware_pack_begin.h"
473 struct SVGA3dCmdDXReadbackQuery {
474    SVGA3dQueryId queryId;
475 }
476 #include "vmware_pack_end.h"
477 SVGA3dCmdDXReadbackQuery; /* SVGA_3D_CMD_DX_READBACK_QUERY */
478 
479 typedef
480 #include "vmware_pack_begin.h"
481 struct SVGA3dCmdDXMoveQuery {
482    SVGA3dQueryId queryId;
483    SVGAMobId mobid;
484    uint32 mobOffset;
485 }
486 #include "vmware_pack_end.h"
487 SVGA3dCmdDXMoveQuery; /* SVGA_3D_CMD_DX_MOVE_QUERY */
488 
489 typedef
490 #include "vmware_pack_begin.h"
491 struct SVGA3dCmdDXBindAllQuery {
492    uint32 cid;
493    SVGAMobId mobid;
494 }
495 #include "vmware_pack_end.h"
496 SVGA3dCmdDXBindAllQuery; /* SVGA_3D_CMD_DX_BIND_ALL_QUERY */
497 
498 typedef
499 #include "vmware_pack_begin.h"
500 struct SVGA3dCmdDXReadbackAllQuery {
501    uint32 cid;
502 }
503 #include "vmware_pack_end.h"
504 SVGA3dCmdDXReadbackAllQuery; /* SVGA_3D_CMD_DX_READBACK_ALL_QUERY */
505 
506 typedef
507 #include "vmware_pack_begin.h"
508 struct SVGA3dCmdDXSetPredication {
509    SVGA3dQueryId queryId;
510    uint32 predicateValue;
511 }
512 #include "vmware_pack_end.h"
513 SVGA3dCmdDXSetPredication; /* SVGA_3D_CMD_DX_SET_PREDICATION */
514 
515 typedef
516 #include "vmware_pack_begin.h"
517 struct MKS3dDXSOState {
518    uint32 offset;       /* Starting offset */
519    uint32 intOffset;    /* Internal offset */
520    uint32 vertexCount;  /* vertices written */
521    uint32 sizeInBytes;  /* max bytes to write */
522 }
523 #include "vmware_pack_end.h"
524 SVGA3dDXSOState;
525 
526 /* Set the offset field to this value to append SO values to the buffer */
527 #define SVGA3D_DX_SO_OFFSET_APPEND ((uint32) ~0u)
528 
529 typedef
530 #include "vmware_pack_begin.h"
531 struct SVGA3dSoTarget {
532    SVGA3dSurfaceId sid;
533    uint32 offset;
534    uint32 sizeInBytes;
535 }
536 #include "vmware_pack_end.h"
537 SVGA3dSoTarget;
538 
539 typedef
540 #include "vmware_pack_begin.h"
541 struct SVGA3dCmdDXSetSOTargets {
542    uint32 pad0;
543    /* Followed by a variable number of SVGA3dSOTarget's. */
544 }
545 #include "vmware_pack_end.h"
546 SVGA3dCmdDXSetSOTargets; /* SVGA_3D_CMD_DX_SET_SOTARGETS */
547 
548 typedef
549 #include "vmware_pack_begin.h"
550 struct SVGA3dViewport
551 {
552    float x;
553    float y;
554    float width;
555    float height;
556    float minDepth;
557    float maxDepth;
558 }
559 #include "vmware_pack_end.h"
560 SVGA3dViewport;
561 
562 typedef
563 #include "vmware_pack_begin.h"
564 struct SVGA3dCmdDXSetViewports {
565    uint32 pad0;
566    /* Followed by a variable number of SVGA3dViewport's. */
567 }
568 #include "vmware_pack_end.h"
569 SVGA3dCmdDXSetViewports; /* SVGA_3D_CMD_DX_SET_VIEWPORTS */
570 
571 #define SVGA3D_DX_MAX_VIEWPORTS  16
572 
573 typedef
574 #include "vmware_pack_begin.h"
575 struct SVGA3dCmdDXSetScissorRects {
576    uint32 pad0;
577    /* Followed by a variable number of SVGASignedRect's. */
578 }
579 #include "vmware_pack_end.h"
580 SVGA3dCmdDXSetScissorRects; /* SVGA_3D_CMD_DX_SET_SCISSORRECTS */
581 
582 #define SVGA3D_DX_MAX_SCISSORRECTS  16
583 
584 typedef
585 #include "vmware_pack_begin.h"
586 struct SVGA3dCmdDXClearRenderTargetView {
587    SVGA3dRenderTargetViewId renderTargetViewId;
588    SVGA3dRGBAFloat rgba;
589 }
590 #include "vmware_pack_end.h"
591 SVGA3dCmdDXClearRenderTargetView; /* SVGA_3D_CMD_DX_CLEAR_RENDERTARGET_VIEW */
592 
593 typedef
594 #include "vmware_pack_begin.h"
595 struct SVGA3dCmdDXClearDepthStencilView {
596    uint16 flags;
597    uint16 stencil;
598    SVGA3dDepthStencilViewId depthStencilViewId;
599    float depth;
600 }
601 #include "vmware_pack_end.h"
602 SVGA3dCmdDXClearDepthStencilView; /* SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW */
603 
604 typedef
605 #include "vmware_pack_begin.h"
606 struct SVGA3dCmdDXPredCopyRegion {
607    SVGA3dSurfaceId dstSid;
608    uint32 dstSubResource;
609    SVGA3dSurfaceId srcSid;
610    uint32 srcSubResource;
611    SVGA3dCopyBox box;
612 }
613 #include "vmware_pack_end.h"
614 SVGA3dCmdDXPredCopyRegion;
615 /* SVGA_3D_CMD_DX_PRED_COPY_REGION */
616 
617 typedef
618 #include "vmware_pack_begin.h"
619 struct SVGA3dCmdDXPredCopy {
620    SVGA3dSurfaceId dstSid;
621    SVGA3dSurfaceId srcSid;
622 }
623 #include "vmware_pack_end.h"
624 SVGA3dCmdDXPredCopy; /* SVGA_3D_CMD_DX_PRED_COPY */
625 
626 typedef
627 #include "vmware_pack_begin.h"
628 struct SVGA3dCmdDXBufferCopy {
629    SVGA3dSurfaceId dest;
630    SVGA3dSurfaceId src;
631    uint32 destX;
632    uint32 srcX;
633    uint32 width;
634 }
635 #include "vmware_pack_end.h"
636 SVGA3dCmdDXBufferCopy;
637 /* SVGA_3D_CMD_DX_BUFFER_COPY */
638 
639 typedef uint32 SVGA3dDXStretchBltMode;
640 #define SVGADX_STRETCHBLT_LINEAR         (1 << 0)
641 #define SVGADX_STRETCHBLT_FORCE_SRC_SRGB (1 << 1)
642 
643 typedef
644 #include "vmware_pack_begin.h"
645 struct SVGA3dCmdDXStretchBlt {
646    SVGA3dSurfaceId srcSid;
647    uint32 srcSubResource;
648    SVGA3dSurfaceId dstSid;
649    uint32 destSubResource;
650    SVGA3dBox boxSrc;
651    SVGA3dBox boxDest;
652    SVGA3dDXStretchBltMode mode;
653 }
654 #include "vmware_pack_end.h"
655 SVGA3dCmdDXStretchBlt; /* SVGA_3D_CMD_DX_STRETCHBLT */
656 
657 typedef
658 #include "vmware_pack_begin.h"
659 struct SVGA3dCmdDXGenMips {
660    SVGA3dShaderResourceViewId shaderResourceViewId;
661 }
662 #include "vmware_pack_end.h"
663 SVGA3dCmdDXGenMips; /* SVGA_3D_CMD_DX_GENMIPS */
664 
665 /*
666  * Defines a resource/DX surface.  Resources share the surfaceId namespace.
667  *
668  */
669 typedef
670 #include "vmware_pack_begin.h"
671 struct SVGA3dCmdDefineGBSurface_v2 {
672    uint32 sid;
673    SVGA3dSurfaceFlags surfaceFlags;
674    SVGA3dSurfaceFormat format;
675    uint32 numMipLevels;
676    uint32 multisampleCount;
677    SVGA3dTextureFilter autogenFilter;
678    SVGA3dSize size;
679    uint32 arraySize;
680    uint32 pad;
681 }
682 #include "vmware_pack_end.h"
683 SVGA3dCmdDefineGBSurface_v2;   /* SVGA_3D_CMD_DEFINE_GB_SURFACE_V2 */
684 
685 /*
686  * Update a sub-resource in a guest-backed resource.
687  * (Inform the device that the guest-contents have been updated.)
688  */
689 typedef
690 #include "vmware_pack_begin.h"
691 struct SVGA3dCmdDXUpdateSubResource {
692    SVGA3dSurfaceId sid;
693    uint32 subResource;
694    SVGA3dBox box;
695 }
696 #include "vmware_pack_end.h"
697 SVGA3dCmdDXUpdateSubResource;   /* SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE */
698 
699 /*
700  * Readback a subresource in a guest-backed resource.
701  * (Request the device to flush the dirty contents into the guest.)
702  */
703 typedef
704 #include "vmware_pack_begin.h"
705 struct SVGA3dCmdDXReadbackSubResource {
706    SVGA3dSurfaceId sid;
707    uint32 subResource;
708 }
709 #include "vmware_pack_end.h"
710 SVGA3dCmdDXReadbackSubResource;   /* SVGA_3D_CMD_DX_READBACK_SUBRESOURCE */
711 
712 /*
713  * Invalidate an image in a guest-backed surface.
714  * (Notify the device that the contents can be lost.)
715  */
716 typedef
717 #include "vmware_pack_begin.h"
718 struct SVGA3dCmdDXInvalidateSubResource {
719    SVGA3dSurfaceId sid;
720    uint32 subResource;
721 }
722 #include "vmware_pack_end.h"
723 SVGA3dCmdDXInvalidateSubResource;   /* SVGA_3D_CMD_DX_INVALIDATE_SUBRESOURCE */
724 
725 
726 /*
727  * Raw byte wise transfer from a buffer surface into another surface
728  * of the requested box.
729  */
730 typedef
731 #include "vmware_pack_begin.h"
732 struct SVGA3dCmdDXTransferFromBuffer {
733    SVGA3dSurfaceId srcSid;
734    uint32 srcOffset;
735    uint32 srcPitch;
736    uint32 srcSlicePitch;
737    SVGA3dSurfaceId destSid;
738    uint32 destSubResource;
739    SVGA3dBox destBox;
740 }
741 #include "vmware_pack_end.h"
742 SVGA3dCmdDXTransferFromBuffer;   /* SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER */
743 
744 
745 /*
746  * Raw byte wise transfer from a buffer surface into another surface
747  * of the requested box.  Supported if SVGA3D_DEVCAP_DXCONTEXT is set.
748  * The context is implied from the command buffer header.
749  */
750 typedef
751 #include "vmware_pack_begin.h"
752 struct SVGA3dCmdDXPredTransferFromBuffer {
753    SVGA3dSurfaceId srcSid;
754    uint32 srcOffset;
755    uint32 srcPitch;
756    uint32 srcSlicePitch;
757    SVGA3dSurfaceId destSid;
758    uint32 destSubResource;
759    SVGA3dBox destBox;
760 }
761 #include "vmware_pack_end.h"
762 SVGA3dCmdDXPredTransferFromBuffer;
763 /* SVGA_3D_CMD_DX_PRED_TRANSFER_FROM_BUFFER */
764 
765 
766 typedef
767 #include "vmware_pack_begin.h"
768 struct SVGA3dCmdDXSurfaceCopyAndReadback {
769    SVGA3dSurfaceId srcSid;
770    SVGA3dSurfaceId destSid;
771    SVGA3dCopyBox box;
772 }
773 #include "vmware_pack_end.h"
774 SVGA3dCmdDXSurfaceCopyAndReadback;
775 /* SVGA_3D_CMD_DX_SURFACE_COPY_AND_READBACK */
776 
777 typedef
778 #include "vmware_pack_begin.h"
779 struct SVGA3dCmdDXHint {
780    uint32 hintId;
781 
782    /*
783     * Followed by variable sized data depending on the hintId.
784     */
785 }
786 #include "vmware_pack_end.h"
787 SVGA3dCmdDXHint;
788 /* SVGA_3D_CMD_DX_HINT */
789 
790 typedef
791 #include "vmware_pack_begin.h"
792 struct SVGA3dCmdDXBufferUpdate {
793    SVGA3dSurfaceId sid;
794    uint32 x;
795    uint32 width;
796 }
797 #include "vmware_pack_end.h"
798 SVGA3dCmdDXBufferUpdate;
799 /* SVGA_3D_CMD_DX_BUFFER_UPDATE */
800 
801 typedef
802 #include "vmware_pack_begin.h"
803 struct SVGA3dCmdDXSetConstantBufferOffset {
804    uint32 slot;
805    uint32 offsetInBytes;
806 }
807 #include "vmware_pack_end.h"
808 SVGA3dCmdDXSetConstantBufferOffset;
809 
810 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetVSConstantBufferOffset;
811 /* SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET */
812 
813 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetPSConstantBufferOffset;
814 /* SVGA_3D_CMD_DX_SET_PS_CONSTANT_BUFFER_OFFSET */
815 
816 typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetGSConstantBufferOffset;
817 /* SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET */
818 
819 
820 typedef
821 #include "vmware_pack_begin.h"
822 struct {
823    union {
824       struct {
825          uint32 firstElement;
826          uint32 numElements;
827          uint32 pad0;
828          uint32 pad1;
829       } buffer;
830       struct {
831          uint32 mostDetailedMip;
832          uint32 firstArraySlice;
833          uint32 mipLevels;
834          uint32 arraySize;
835       } tex;
836       struct {
837          uint32 firstElement;
838          uint32 numElements;
839          uint32 flags;
840          uint32 pad0;
841       } bufferex;
842    };
843 }
844 #include "vmware_pack_end.h"
845 SVGA3dShaderResourceViewDesc;
846 
847 typedef
848 #include "vmware_pack_begin.h"
849 struct {
850    SVGA3dSurfaceId sid;
851    SVGA3dSurfaceFormat format;
852    SVGA3dResourceType resourceDimension;
853    SVGA3dShaderResourceViewDesc desc;
854    uint32 pad;
855 }
856 #include "vmware_pack_end.h"
857 SVGACOTableDXSRViewEntry;
858 
859 typedef
860 #include "vmware_pack_begin.h"
861 struct SVGA3dCmdDXDefineShaderResourceView {
862    SVGA3dShaderResourceViewId shaderResourceViewId;
863 
864    SVGA3dSurfaceId sid;
865    SVGA3dSurfaceFormat format;
866    SVGA3dResourceType resourceDimension;
867 
868    SVGA3dShaderResourceViewDesc desc;
869 }
870 #include "vmware_pack_end.h"
871 SVGA3dCmdDXDefineShaderResourceView;
872 /* SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW */
873 
874 typedef
875 #include "vmware_pack_begin.h"
876 struct SVGA3dCmdDXDestroyShaderResourceView {
877    SVGA3dShaderResourceViewId shaderResourceViewId;
878 }
879 #include "vmware_pack_end.h"
880 SVGA3dCmdDXDestroyShaderResourceView;
881 /* SVGA_3D_CMD_DX_DESTROY_SHADERRESOURCE_VIEW */
882 
883 typedef
884 #include "vmware_pack_begin.h"
885 struct SVGA3dRenderTargetViewDesc {
886    union {
887       struct {
888          uint32 firstElement;
889          uint32 numElements;
890       } buffer;
891       struct {
892          uint32 mipSlice;
893          uint32 firstArraySlice;
894          uint32 arraySize;
895       } tex;                    /* 1d, 2d, cube */
896       struct {
897          uint32 mipSlice;
898          uint32 firstW;
899          uint32 wSize;
900       } tex3D;
901    };
902 }
903 #include "vmware_pack_end.h"
904 SVGA3dRenderTargetViewDesc;
905 
906 typedef
907 #include "vmware_pack_begin.h"
908 struct {
909    SVGA3dSurfaceId sid;
910    SVGA3dSurfaceFormat format;
911    SVGA3dResourceType resourceDimension;
912    SVGA3dRenderTargetViewDesc desc;
913    uint32 pad[2];
914 }
915 #include "vmware_pack_end.h"
916 SVGACOTableDXRTViewEntry;
917 
918 typedef
919 #include "vmware_pack_begin.h"
920 struct SVGA3dCmdDXDefineRenderTargetView {
921    SVGA3dRenderTargetViewId renderTargetViewId;
922 
923    SVGA3dSurfaceId sid;
924    SVGA3dSurfaceFormat format;
925    SVGA3dResourceType resourceDimension;
926 
927    SVGA3dRenderTargetViewDesc desc;
928 }
929 #include "vmware_pack_end.h"
930 SVGA3dCmdDXDefineRenderTargetView;
931 /* SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW */
932 
933 typedef
934 #include "vmware_pack_begin.h"
935 struct SVGA3dCmdDXDestroyRenderTargetView {
936    SVGA3dRenderTargetViewId renderTargetViewId;
937 }
938 #include "vmware_pack_end.h"
939 SVGA3dCmdDXDestroyRenderTargetView;
940 /* SVGA_3D_CMD_DX_DESTROY_RENDERTARGET_VIEW */
941 
942 /*
943  */
944 #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_DEPTH   0x01
945 #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_STENCIL 0x02
946 #define SVGA3D_DXDSVIEW_CREATE_FLAG_MASK         0x03
947 typedef uint8 SVGA3DCreateDSViewFlags;
948 
949 typedef
950 #include "vmware_pack_begin.h"
951 struct {
952    SVGA3dSurfaceId sid;
953    SVGA3dSurfaceFormat format;
954    SVGA3dResourceType resourceDimension;
955    uint32 mipSlice;
956    uint32 firstArraySlice;
957    uint32 arraySize;
958    SVGA3DCreateDSViewFlags flags;
959    uint8 pad0;
960    uint16 pad1;
961    uint32 pad2;
962 }
963 #include "vmware_pack_end.h"
964 SVGACOTableDXDSViewEntry;
965 
966 typedef
967 #include "vmware_pack_begin.h"
968 struct SVGA3dCmdDXDefineDepthStencilView {
969    SVGA3dDepthStencilViewId depthStencilViewId;
970 
971    SVGA3dSurfaceId sid;
972    SVGA3dSurfaceFormat format;
973    SVGA3dResourceType resourceDimension;
974    uint32 mipSlice;
975    uint32 firstArraySlice;
976    uint32 arraySize;
977    SVGA3DCreateDSViewFlags flags;
978    uint8 pad0;
979    uint16 pad1;
980 }
981 #include "vmware_pack_end.h"
982 SVGA3dCmdDXDefineDepthStencilView;
983 /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW */
984 
985 typedef
986 #include "vmware_pack_begin.h"
987 struct SVGA3dCmdDXDestroyDepthStencilView {
988    SVGA3dDepthStencilViewId depthStencilViewId;
989 }
990 #include "vmware_pack_end.h"
991 SVGA3dCmdDXDestroyDepthStencilView;
992 /* SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW */
993 
994 typedef
995 #include "vmware_pack_begin.h"
996 struct SVGA3dInputElementDesc {
997    uint32 inputSlot;
998    uint32 alignedByteOffset;
999    SVGA3dSurfaceFormat format;
1000    SVGA3dInputClassification inputSlotClass;
1001    uint32 instanceDataStepRate;
1002    uint32 inputRegister;
1003 }
1004 #include "vmware_pack_end.h"
1005 SVGA3dInputElementDesc;
1006 
1007 typedef
1008 #include "vmware_pack_begin.h"
1009 struct {
1010    /*
1011     * XXX: How many of these can there be?
1012     */
1013    uint32 elid;
1014    uint32 numDescs;
1015    SVGA3dInputElementDesc desc[32];
1016    uint32 pad[62];
1017 }
1018 #include "vmware_pack_end.h"
1019 SVGACOTableDXElementLayoutEntry;
1020 
1021 typedef
1022 #include "vmware_pack_begin.h"
1023 struct SVGA3dCmdDXDefineElementLayout {
1024    SVGA3dElementLayoutId elementLayoutId;
1025    /* Followed by a variable number of SVGA3dInputElementDesc's. */
1026 }
1027 #include "vmware_pack_end.h"
1028 SVGA3dCmdDXDefineElementLayout;
1029 /* SVGA_3D_CMD_DX_DEFINE_ELEMENTLAYOUT */
1030 
1031 typedef
1032 #include "vmware_pack_begin.h"
1033 struct SVGA3dCmdDXDestroyElementLayout {
1034    SVGA3dElementLayoutId elementLayoutId;
1035 }
1036 #include "vmware_pack_end.h"
1037 SVGA3dCmdDXDestroyElementLayout;
1038 /* SVGA_3D_CMD_DX_DESTROY_ELEMENTLAYOUT */
1039 
1040 
1041 #define SVGA3D_DX_MAX_RENDER_TARGETS 8
1042 
1043 typedef
1044 #include "vmware_pack_begin.h"
1045 struct SVGA3dDXBlendStatePerRT {
1046       uint8 blendEnable;
1047       uint8 srcBlend;
1048       uint8 destBlend;
1049       uint8 blendOp;
1050       uint8 srcBlendAlpha;
1051       uint8 destBlendAlpha;
1052       uint8 blendOpAlpha;
1053       uint8 renderTargetWriteMask;
1054       uint8 logicOpEnable;
1055       uint8 logicOp;
1056       uint16 pad0;
1057 }
1058 #include "vmware_pack_end.h"
1059 SVGA3dDXBlendStatePerRT;
1060 
1061 typedef
1062 #include "vmware_pack_begin.h"
1063 struct {
1064    uint8 alphaToCoverageEnable;
1065    uint8 independentBlendEnable;
1066    uint16 pad0;
1067    SVGA3dDXBlendStatePerRT perRT[SVGA3D_MAX_RENDER_TARGETS];
1068    uint32 pad1[7];
1069 }
1070 #include "vmware_pack_end.h"
1071 SVGACOTableDXBlendStateEntry;
1072 
1073 /*
1074  */
1075 typedef
1076 #include "vmware_pack_begin.h"
1077 struct SVGA3dCmdDXDefineBlendState {
1078    SVGA3dBlendStateId blendId;
1079    uint8 alphaToCoverageEnable;
1080    uint8 independentBlendEnable;
1081    uint16 pad0;
1082    SVGA3dDXBlendStatePerRT perRT[SVGA3D_MAX_RENDER_TARGETS];
1083 }
1084 #include "vmware_pack_end.h"
1085 SVGA3dCmdDXDefineBlendState; /* SVGA_3D_CMD_DX_DEFINE_BLEND_STATE */
1086 
1087 typedef
1088 #include "vmware_pack_begin.h"
1089 struct SVGA3dCmdDXDestroyBlendState {
1090    SVGA3dBlendStateId blendId;
1091 }
1092 #include "vmware_pack_end.h"
1093 SVGA3dCmdDXDestroyBlendState; /* SVGA_3D_CMD_DX_DESTROY_BLEND_STATE */
1094 
1095 typedef
1096 #include "vmware_pack_begin.h"
1097 struct {
1098    uint8 depthEnable;
1099    SVGA3dDepthWriteMask depthWriteMask;
1100    SVGA3dComparisonFunc depthFunc;
1101    uint8 stencilEnable;
1102    uint8 frontEnable;
1103    uint8 backEnable;
1104    uint8 stencilReadMask;
1105    uint8 stencilWriteMask;
1106 
1107    uint8 frontStencilFailOp;
1108    uint8 frontStencilDepthFailOp;
1109    uint8 frontStencilPassOp;
1110    SVGA3dComparisonFunc frontStencilFunc;
1111 
1112    uint8 backStencilFailOp;
1113    uint8 backStencilDepthFailOp;
1114    uint8 backStencilPassOp;
1115    SVGA3dComparisonFunc backStencilFunc;
1116 }
1117 #include "vmware_pack_end.h"
1118 SVGACOTableDXDepthStencilEntry;
1119 
1120 /*
1121  */
1122 typedef
1123 #include "vmware_pack_begin.h"
1124 struct SVGA3dCmdDXDefineDepthStencilState {
1125    SVGA3dDepthStencilStateId depthStencilId;
1126 
1127    uint8 depthEnable;
1128    SVGA3dDepthWriteMask depthWriteMask;
1129    SVGA3dComparisonFunc depthFunc;
1130    uint8 stencilEnable;
1131    uint8 frontEnable;
1132    uint8 backEnable;
1133    uint8 stencilReadMask;
1134    uint8 stencilWriteMask;
1135 
1136    uint8 frontStencilFailOp;
1137    uint8 frontStencilDepthFailOp;
1138    uint8 frontStencilPassOp;
1139    SVGA3dComparisonFunc frontStencilFunc;
1140 
1141    uint8 backStencilFailOp;
1142    uint8 backStencilDepthFailOp;
1143    uint8 backStencilPassOp;
1144    SVGA3dComparisonFunc backStencilFunc;
1145 }
1146 #include "vmware_pack_end.h"
1147 SVGA3dCmdDXDefineDepthStencilState;
1148 /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_STATE */
1149 
1150 typedef
1151 #include "vmware_pack_begin.h"
1152 struct SVGA3dCmdDXDestroyDepthStencilState {
1153    SVGA3dDepthStencilStateId depthStencilId;
1154 }
1155 #include "vmware_pack_end.h"
1156 SVGA3dCmdDXDestroyDepthStencilState;
1157 /* SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_STATE */
1158 
1159 typedef
1160 #include "vmware_pack_begin.h"
1161 struct {
1162    uint8 fillMode;
1163    SVGA3dCullMode cullMode;
1164    uint8 frontCounterClockwise;
1165    uint8 provokingVertexLast;
1166    int32 depthBias;
1167    float depthBiasClamp;
1168    float slopeScaledDepthBias;
1169    uint8 depthClipEnable;
1170    uint8 scissorEnable;
1171    uint8 multisampleEnable;
1172    uint8 antialiasedLineEnable;
1173    float lineWidth;
1174    uint8 lineStippleEnable;
1175    uint8 lineStippleFactor;
1176    uint16 lineStipplePattern;
1177    uint32 forcedSampleCount;
1178 }
1179 #include "vmware_pack_end.h"
1180 SVGACOTableDXRasterizerStateEntry;
1181 
1182 /*
1183  */
1184 typedef
1185 #include "vmware_pack_begin.h"
1186 struct SVGA3dCmdDXDefineRasterizerState {
1187    SVGA3dRasterizerStateId rasterizerId;
1188 
1189    uint8 fillMode;
1190    SVGA3dCullMode cullMode;
1191    uint8 frontCounterClockwise;
1192    uint8 provokingVertexLast;
1193    int32 depthBias;
1194    float depthBiasClamp;
1195    float slopeScaledDepthBias;
1196    uint8 depthClipEnable;
1197    uint8 scissorEnable;
1198    uint8 multisampleEnable;
1199    uint8 antialiasedLineEnable;
1200    float lineWidth;
1201    uint8 lineStippleEnable;
1202    uint8 lineStippleFactor;
1203    uint16 lineStipplePattern;
1204 }
1205 #include "vmware_pack_end.h"
1206 SVGA3dCmdDXDefineRasterizerState;
1207 /* SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE */
1208 
1209 typedef
1210 #include "vmware_pack_begin.h"
1211 struct SVGA3dCmdDXDestroyRasterizerState {
1212    SVGA3dRasterizerStateId rasterizerId;
1213 }
1214 #include "vmware_pack_end.h"
1215 SVGA3dCmdDXDestroyRasterizerState;
1216 /* SVGA_3D_CMD_DX_DESTROY_RASTERIZER_STATE */
1217 
1218 typedef
1219 #include "vmware_pack_begin.h"
1220 struct {
1221    SVGA3dFilter filter;
1222    uint8 addressU;
1223    uint8 addressV;
1224    uint8 addressW;
1225    uint8 pad0;
1226    float mipLODBias;
1227    uint8 maxAnisotropy;
1228    SVGA3dComparisonFunc comparisonFunc;
1229    uint16 pad1;
1230    SVGA3dRGBAFloat borderColor;
1231    float minLOD;
1232    float maxLOD;
1233    uint32 pad2[6];
1234 }
1235 #include "vmware_pack_end.h"
1236 SVGACOTableDXSamplerEntry;
1237 
1238 /*
1239  */
1240 typedef
1241 #include "vmware_pack_begin.h"
1242 struct SVGA3dCmdDXDefineSamplerState {
1243    SVGA3dSamplerId samplerId;
1244    SVGA3dFilter filter;
1245    uint8 addressU;
1246    uint8 addressV;
1247    uint8 addressW;
1248    uint8 pad0;
1249    float mipLODBias;
1250    uint8 maxAnisotropy;
1251    SVGA3dComparisonFunc comparisonFunc;
1252    uint16 pad1;
1253    SVGA3dRGBAFloat borderColor;
1254    float minLOD;
1255    float maxLOD;
1256 }
1257 #include "vmware_pack_end.h"
1258 SVGA3dCmdDXDefineSamplerState; /* SVGA_3D_CMD_DX_DEFINE_SAMPLER_STATE */
1259 
1260 typedef
1261 #include "vmware_pack_begin.h"
1262 struct SVGA3dCmdDXDestroySamplerState {
1263    SVGA3dSamplerId samplerId;
1264 }
1265 #include "vmware_pack_end.h"
1266 SVGA3dCmdDXDestroySamplerState; /* SVGA_3D_CMD_DX_DESTROY_SAMPLER_STATE */
1267 
1268 typedef
1269 #include "vmware_pack_begin.h"
1270 struct SVGA3dCmdDXDefineShader {
1271    SVGA3dShaderId shaderId;
1272    SVGA3dShaderType type;
1273    uint32 sizeInBytes; /* Number of bytes of shader text. */
1274 }
1275 #include "vmware_pack_end.h"
1276 SVGA3dCmdDXDefineShader; /* SVGA_3D_CMD_DX_DEFINE_SHADER */
1277 
1278 typedef
1279 #include "vmware_pack_begin.h"
1280 struct SVGACOTableDXShaderEntry {
1281    SVGA3dShaderType type;
1282    uint32 sizeInBytes;
1283    uint32 offsetInBytes;
1284    SVGAMobId mobid;
1285    uint32 pad[4];
1286 }
1287 #include "vmware_pack_end.h"
1288 SVGACOTableDXShaderEntry;
1289 
1290 typedef
1291 #include "vmware_pack_begin.h"
1292 struct SVGA3dCmdDXDestroyShader {
1293    SVGA3dShaderId shaderId;
1294 }
1295 #include "vmware_pack_end.h"
1296 SVGA3dCmdDXDestroyShader; /* SVGA_3D_CMD_DX_DESTROY_SHADER */
1297 
1298 typedef
1299 #include "vmware_pack_begin.h"
1300 struct SVGA3dCmdDXBindShader {
1301    uint32 cid;
1302    uint32 shid;
1303    SVGAMobId mobid;
1304    uint32 offsetInBytes;
1305 }
1306 #include "vmware_pack_end.h"
1307 SVGA3dCmdDXBindShader;   /* SVGA_3D_CMD_DX_BIND_SHADER */
1308 
1309 typedef
1310 #include "vmware_pack_begin.h"
1311 struct SVGA3dCmdDXBindAllShader {
1312    uint32 cid;
1313    SVGAMobId mobid;
1314 }
1315 #include "vmware_pack_end.h"
1316 SVGA3dCmdDXBindAllShader;   /* SVGA_3D_CMD_DX_BIND_ALL_SHADER */
1317 
1318 typedef
1319 #include "vmware_pack_begin.h"
1320 struct SVGA3dCmdDXCondBindAllShader {
1321    uint32 cid;
1322    SVGAMobId testMobid;
1323    SVGAMobId mobid;
1324 }
1325 #include "vmware_pack_end.h"
1326 SVGA3dCmdDXCondBindAllShader;   /* SVGA_3D_CMD_DX_COND_BIND_ALL_SHADER */
1327 
1328 /*
1329  * The maximum number of streamout decl's in each streamout entry.
1330  */
1331 #define SVGA3D_MAX_STREAMOUT_DECLS 64
1332 
1333 typedef
1334 #include "vmware_pack_begin.h"
1335 struct SVGA3dStreamOutputDeclarationEntry {
1336    uint32 outputSlot;
1337    uint32 registerIndex;
1338    uint8  registerMask;
1339    uint8  pad0;
1340    uint16 pad1;
1341    uint32 stream;
1342 }
1343 #include "vmware_pack_end.h"
1344 SVGA3dStreamOutputDeclarationEntry;
1345 
1346 typedef
1347 #include "vmware_pack_begin.h"
1348 struct SVGAOTableStreamOutputEntry {
1349    uint32 numOutputStreamEntries;
1350    SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS];
1351    uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
1352    uint32 rasterizedStream;
1353    uint32 pad[250];
1354 }
1355 #include "vmware_pack_end.h"
1356 SVGACOTableDXStreamOutputEntry;
1357 
1358 typedef
1359 #include "vmware_pack_begin.h"
1360 struct SVGA3dCmdDXDefineStreamOutput {
1361    SVGA3dStreamOutputId soid;
1362    uint32 numOutputStreamEntries;
1363    SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS];
1364    uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
1365    uint32 rasterizedStream;
1366 }
1367 #include "vmware_pack_end.h"
1368 SVGA3dCmdDXDefineStreamOutput; /* SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT */
1369 
1370 typedef
1371 #include "vmware_pack_begin.h"
1372 struct SVGA3dCmdDXDestroyStreamOutput {
1373    SVGA3dStreamOutputId soid;
1374 }
1375 #include "vmware_pack_end.h"
1376 SVGA3dCmdDXDestroyStreamOutput; /* SVGA_3D_CMD_DX_DESTROY_STREAMOUTPUT */
1377 
1378 typedef
1379 #include "vmware_pack_begin.h"
1380 struct SVGA3dCmdDXSetStreamOutput {
1381    SVGA3dStreamOutputId soid;
1382 }
1383 #include "vmware_pack_end.h"
1384 SVGA3dCmdDXSetStreamOutput; /* SVGA_3D_CMD_DX_SET_STREAMOUTPUT */
1385 
1386 typedef
1387 #include "vmware_pack_begin.h"
1388 struct {
1389    uint64 value;
1390    uint32 mobId;
1391    uint32 mobOffset;
1392 }
1393 #include "vmware_pack_end.h"
1394 SVGA3dCmdDXMobFence64;  /* SVGA_3D_CMD_DX_MOB_FENCE_64 */
1395 
1396 /*
1397  * SVGA3dCmdSetCOTable --
1398  *
1399  * This command allows the guest to bind a mob to a context-object table.
1400  */
1401 
1402 typedef
1403 #include "vmware_pack_begin.h"
1404 struct SVGA3dCmdDXSetCOTable {
1405    uint32 cid;
1406    uint32 mobid;
1407    SVGACOTableType type;
1408    uint32 validSizeInBytes;
1409 }
1410 #include "vmware_pack_end.h"
1411 SVGA3dCmdDXSetCOTable; /* SVGA_3D_CMD_DX_SET_COTABLE */
1412 
1413 typedef
1414 #include "vmware_pack_begin.h"
1415 struct SVGA3dCmdDXReadbackCOTable {
1416    uint32 cid;
1417    SVGACOTableType type;
1418 }
1419 #include "vmware_pack_end.h"
1420 SVGA3dCmdDXReadbackCOTable; /* SVGA_3D_CMD_DX_READBACK_COTABLE */
1421 
1422 typedef
1423 #include "vmware_pack_begin.h"
1424 struct SVGA3dCOTableData {
1425    uint32 mobid;
1426 }
1427 #include "vmware_pack_end.h"
1428 SVGA3dCOTableData;
1429 
1430 typedef
1431 #include "vmware_pack_begin.h"
1432 struct SVGA3dBufferBinding {
1433    uint32 bufferId;
1434    uint32 stride;
1435    uint32 offset;
1436 }
1437 #include "vmware_pack_end.h"
1438 SVGA3dBufferBinding;
1439 
1440 typedef
1441 #include "vmware_pack_begin.h"
1442 struct SVGA3dConstantBufferBinding {
1443    uint32 sid;
1444    uint32 offsetInBytes;
1445    uint32 sizeInBytes;
1446 }
1447 #include "vmware_pack_end.h"
1448 SVGA3dConstantBufferBinding;
1449 
1450 typedef
1451 #include "vmware_pack_begin.h"
1452 struct SVGADXInputAssemblyMobFormat {
1453    uint32 layoutId;
1454    SVGA3dBufferBinding vertexBuffers[SVGA3D_DX_MAX_VERTEXBUFFERS];
1455    uint32 indexBufferSid;
1456    uint32 pad;
1457    uint32 indexBufferOffset;
1458    uint32 indexBufferFormat;
1459    uint32 topology;
1460 }
1461 #include "vmware_pack_end.h"
1462 SVGADXInputAssemblyMobFormat;
1463 
1464 typedef
1465 #include "vmware_pack_begin.h"
1466 struct SVGADXContextMobFormat {
1467    SVGADXInputAssemblyMobFormat inputAssembly;
1468 
1469    struct {
1470       uint32 blendStateId;
1471       uint32 blendFactor[4];
1472       uint32 sampleMask;
1473       uint32 depthStencilStateId;
1474       uint32 stencilRef;
1475       uint32 rasterizerStateId;
1476       uint32 depthStencilViewId;
1477       uint32 renderTargetViewIds[SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS];
1478       uint32 unorderedAccessViewIds[SVGA3D_MAX_UAVIEWS];
1479    } renderState;
1480 
1481    struct {
1482       uint32 targets[SVGA3D_DX_MAX_SOTARGETS];
1483       uint32 soid;
1484    } streamOut;
1485    uint32 pad0[11];
1486 
1487    uint8 numViewports;
1488    uint8 numScissorRects;
1489    uint16 pad1[1];
1490 
1491    uint32 pad2[3];
1492 
1493    SVGA3dViewport viewports[SVGA3D_DX_MAX_VIEWPORTS];
1494    uint32 pad3[32];
1495 
1496    SVGASignedRect scissorRects[SVGA3D_DX_MAX_SCISSORRECTS];
1497    uint32 pad4[64];
1498 
1499    struct {
1500       uint32 queryID;
1501       uint32 value;
1502    } predication;
1503    uint32 pad5[2];
1504 
1505    struct {
1506       uint32 shaderId;
1507       SVGA3dConstantBufferBinding constantBuffers[SVGA3D_DX_MAX_CONSTBUFFERS];
1508       uint32 shaderResources[SVGA3D_DX_MAX_SRVIEWS];
1509       uint32 samplers[SVGA3D_DX_MAX_SAMPLERS];
1510    } shaderState[SVGA3D_NUM_SHADERTYPE];
1511    uint32 pad6[26];
1512 
1513    SVGA3dQueryId queryID[SVGA3D_MAX_QUERY];
1514 
1515    SVGA3dCOTableData cotables[SVGA_COTABLE_MAX];
1516    uint32 pad7[380];
1517 }
1518 #include "vmware_pack_end.h"
1519 SVGADXContextMobFormat;
1520 
1521 #endif /* _SVGA3D_DX_H_ */
1522