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