• 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_types.h --
28  *
29  *       SVGA 3d hardware definitions for basic types
30  */
31 
32 #ifndef _SVGA3D_TYPES_H_
33 #define _SVGA3D_TYPES_H_
34 
35 #define INCLUDE_ALLOW_MODULE
36 #define INCLUDE_ALLOW_USERLEVEL
37 #define INCLUDE_ALLOW_VMCORE
38 
39 #include "includeCheck.h"
40 
41 /*
42  * Suffix for 64-bit constants.  Use it like this:
43  *    CONST64(0x7fffffffffffffff) for signed or
44  *    CONST64U(0x7fffffffffffffff) for unsigned.
45  *
46  * 2004.08.30(thutt):
47  *   The vmcore/asm64/gen* programs are compiled as 32-bit
48  *   applications, but must handle 64 bit constants.  If the
49  *   64-bit-constant defining macros are already defined, the
50  *   definition will not be overwritten.
51  */
52 
53 #if !defined(CONST64) || !defined(CONST64U)
54 #ifdef _MSC_VER
55 #define CONST64(c) c##I64
56 #define CONST64U(c) c##uI64
57 #elif defined __APPLE__
58 #define CONST64(c) c##LL
59 #define CONST64U(c) c##uLL
60 #elif __GNUC__
61 #if defined(VM_X86_64) || defined(VM_ARM_64)
62 #define CONST64(c) c##L
63 #define CONST64U(c) c##uL
64 #else
65 #define CONST64(c) c##LL
66 #define CONST64U(c) c##uLL
67 #endif
68 #else
69 #error - Need compiler define for CONST64
70 #endif
71 #endif
72 
73 #define MIN_UINT64 (CONST64U(0))
74 #define MAX_UINT64 (CONST64U(0xffffffffffffffff))
75 
76 /*
77  * Generic Types
78  */
79 
80 #define SVGA3D_INVALID_ID         ((uint32)-1)
81 
82 typedef uint8 SVGABool8;   /* 8-bit Bool definition */
83 typedef uint32 SVGA3dBool; /* 32-bit Bool definition */
84 typedef uint32 SVGA3dColor; /* a, r, g, b */
85 
86 typedef uint32 SVGA3dSurfaceId;
87 
88 typedef
89 #include "vmware_pack_begin.h"
90 struct {
91    uint32 numerator;
92    uint32 denominator;
93 }
94 #include "vmware_pack_end.h"
95 SVGA3dFraction64;
96 
97 typedef
98 #include "vmware_pack_begin.h"
99 struct SVGA3dCopyRect {
100    uint32               x;
101    uint32               y;
102    uint32               w;
103    uint32               h;
104    uint32               srcx;
105    uint32               srcy;
106 }
107 #include "vmware_pack_end.h"
108 SVGA3dCopyRect;
109 
110 typedef
111 #include "vmware_pack_begin.h"
112 struct SVGA3dCopyBox {
113    uint32               x;
114    uint32               y;
115    uint32               z;
116    uint32               w;
117    uint32               h;
118    uint32               d;
119    uint32               srcx;
120    uint32               srcy;
121    uint32               srcz;
122 }
123 #include "vmware_pack_end.h"
124 SVGA3dCopyBox;
125 
126 typedef
127 #include "vmware_pack_begin.h"
128 struct SVGA3dRect {
129    uint32               x;
130    uint32               y;
131    uint32               w;
132    uint32               h;
133 }
134 #include "vmware_pack_end.h"
135 SVGA3dRect;
136 
137 typedef
138 #include "vmware_pack_begin.h"
139 struct {
140    uint32               x;
141    uint32               y;
142    uint32               z;
143    uint32               w;
144    uint32               h;
145    uint32               d;
146 }
147 #include "vmware_pack_end.h"
148 SVGA3dBox;
149 
150 typedef
151 #include "vmware_pack_begin.h"
152 struct {
153    uint32               x;
154    uint32               y;
155    uint32               z;
156 }
157 #include "vmware_pack_end.h"
158 SVGA3dPoint;
159 
160 /*
161  * Surface formats.
162  */
163 typedef enum SVGA3dSurfaceFormat {
164    SVGA3D_FORMAT_INVALID               = 0,
165 
166    SVGA3D_X8R8G8B8                     = 1,
167    SVGA3D_FORMAT_MIN                   = 1,
168 
169    SVGA3D_A8R8G8B8                     = 2,
170 
171    SVGA3D_R5G6B5                       = 3,
172    SVGA3D_X1R5G5B5                     = 4,
173    SVGA3D_A1R5G5B5                     = 5,
174    SVGA3D_A4R4G4B4                     = 6,
175 
176    SVGA3D_Z_D32                        = 7,
177    SVGA3D_Z_D16                        = 8,
178    SVGA3D_Z_D24S8                      = 9,
179    SVGA3D_Z_D15S1                      = 10,
180 
181    SVGA3D_LUMINANCE8                   = 11,
182    SVGA3D_LUMINANCE4_ALPHA4            = 12,
183    SVGA3D_LUMINANCE16                  = 13,
184    SVGA3D_LUMINANCE8_ALPHA8            = 14,
185 
186    SVGA3D_DXT1                         = 15,
187    SVGA3D_DXT2                         = 16,
188    SVGA3D_DXT3                         = 17,
189    SVGA3D_DXT4                         = 18,
190    SVGA3D_DXT5                         = 19,
191 
192    SVGA3D_BUMPU8V8                     = 20,
193    SVGA3D_BUMPL6V5U5                   = 21,
194    SVGA3D_BUMPX8L8V8U8                 = 22,
195    SVGA3D_FORMAT_DEAD1                 = 23,
196 
197    SVGA3D_ARGB_S10E5                   = 24,   /* 16-bit floating-point ARGB */
198    SVGA3D_ARGB_S23E8                   = 25,   /* 32-bit floating-point ARGB */
199 
200    SVGA3D_A2R10G10B10                  = 26,
201 
202    /* signed formats */
203    SVGA3D_V8U8                         = 27,
204    SVGA3D_Q8W8V8U8                     = 28,
205    SVGA3D_CxV8U8                       = 29,
206 
207    /* mixed formats */
208    SVGA3D_X8L8V8U8                     = 30,
209    SVGA3D_A2W10V10U10                  = 31,
210 
211    SVGA3D_ALPHA8                       = 32,
212 
213    /* Single- and dual-component floating point formats */
214    SVGA3D_R_S10E5                      = 33,
215    SVGA3D_R_S23E8                      = 34,
216    SVGA3D_RG_S10E5                     = 35,
217    SVGA3D_RG_S23E8                     = 36,
218 
219    SVGA3D_BUFFER                       = 37,
220 
221    SVGA3D_Z_D24X8                      = 38,
222 
223    SVGA3D_V16U16                       = 39,
224 
225    SVGA3D_G16R16                       = 40,
226    SVGA3D_A16B16G16R16                 = 41,
227 
228    /* Packed Video formats */
229    SVGA3D_UYVY                         = 42,
230    SVGA3D_YUY2                         = 43,
231 
232    /* Planar video formats */
233    SVGA3D_NV12                         = 44,
234 
235    /* Video format with alpha */
236    SVGA3D_AYUV                         = 45,
237 
238    SVGA3D_R32G32B32A32_TYPELESS        = 46,
239    SVGA3D_R32G32B32A32_UINT            = 47,
240    SVGA3D_R32G32B32A32_SINT            = 48,
241    SVGA3D_R32G32B32_TYPELESS           = 49,
242    SVGA3D_R32G32B32_FLOAT              = 50,
243    SVGA3D_R32G32B32_UINT               = 51,
244    SVGA3D_R32G32B32_SINT               = 52,
245    SVGA3D_R16G16B16A16_TYPELESS        = 53,
246    SVGA3D_R16G16B16A16_UINT            = 54,
247    SVGA3D_R16G16B16A16_SNORM           = 55,
248    SVGA3D_R16G16B16A16_SINT            = 56,
249    SVGA3D_R32G32_TYPELESS              = 57,
250    SVGA3D_R32G32_UINT                  = 58,
251    SVGA3D_R32G32_SINT                  = 59,
252    SVGA3D_R32G8X24_TYPELESS            = 60,
253    SVGA3D_D32_FLOAT_S8X24_UINT         = 61,
254    SVGA3D_R32_FLOAT_X8X24              = 62,
255    SVGA3D_X32_G8X24_UINT               = 63,
256    SVGA3D_R10G10B10A2_TYPELESS         = 64,
257    SVGA3D_R10G10B10A2_UINT             = 65,
258    SVGA3D_R11G11B10_FLOAT              = 66,
259    SVGA3D_R8G8B8A8_TYPELESS            = 67,
260    SVGA3D_R8G8B8A8_UNORM               = 68,
261    SVGA3D_R8G8B8A8_UNORM_SRGB          = 69,
262    SVGA3D_R8G8B8A8_UINT                = 70,
263    SVGA3D_R8G8B8A8_SINT                = 71,
264    SVGA3D_R16G16_TYPELESS              = 72,
265    SVGA3D_R16G16_UINT                  = 73,
266    SVGA3D_R16G16_SINT                  = 74,
267    SVGA3D_R32_TYPELESS                 = 75,
268    SVGA3D_D32_FLOAT                    = 76,
269    SVGA3D_R32_UINT                     = 77,
270    SVGA3D_R32_SINT                     = 78,
271    SVGA3D_R24G8_TYPELESS               = 79,
272    SVGA3D_D24_UNORM_S8_UINT            = 80,
273    SVGA3D_R24_UNORM_X8                 = 81,
274    SVGA3D_X24_G8_UINT                  = 82,
275    SVGA3D_R8G8_TYPELESS                = 83,
276    SVGA3D_R8G8_UNORM                   = 84,
277    SVGA3D_R8G8_UINT                    = 85,
278    SVGA3D_R8G8_SINT                    = 86,
279    SVGA3D_R16_TYPELESS                 = 87,
280    SVGA3D_R16_UNORM                    = 88,
281    SVGA3D_R16_UINT                     = 89,
282    SVGA3D_R16_SNORM                    = 90,
283    SVGA3D_R16_SINT                     = 91,
284    SVGA3D_R8_TYPELESS                  = 92,
285    SVGA3D_R8_UNORM                     = 93,
286    SVGA3D_R8_UINT                      = 94,
287    SVGA3D_R8_SNORM                     = 95,
288    SVGA3D_R8_SINT                      = 96,
289    SVGA3D_P8                           = 97,
290    SVGA3D_R9G9B9E5_SHAREDEXP           = 98,
291    SVGA3D_R8G8_B8G8_UNORM              = 99,
292    SVGA3D_G8R8_G8B8_UNORM              = 100,
293    SVGA3D_BC1_TYPELESS                 = 101,
294    SVGA3D_BC1_UNORM_SRGB               = 102,
295    SVGA3D_BC2_TYPELESS                 = 103,
296    SVGA3D_BC2_UNORM_SRGB               = 104,
297    SVGA3D_BC3_TYPELESS                 = 105,
298    SVGA3D_BC3_UNORM_SRGB               = 106,
299    SVGA3D_BC4_TYPELESS                 = 107,
300    SVGA3D_ATI1                         = 108,   /* DX9-specific BC4_UNORM */
301    SVGA3D_BC4_SNORM                    = 109,
302    SVGA3D_BC5_TYPELESS                 = 110,
303    SVGA3D_ATI2                         = 111,   /* DX9-specific BC5_UNORM */
304    SVGA3D_BC5_SNORM                    = 112,
305    SVGA3D_R10G10B10_XR_BIAS_A2_UNORM   = 113,
306    SVGA3D_B8G8R8A8_TYPELESS            = 114,
307    SVGA3D_B8G8R8A8_UNORM_SRGB          = 115,
308    SVGA3D_B8G8R8X8_TYPELESS            = 116,
309    SVGA3D_B8G8R8X8_UNORM_SRGB          = 117,
310 
311    /* Advanced depth formats. */
312    SVGA3D_Z_DF16                       = 118,
313    SVGA3D_Z_DF24                       = 119,
314    SVGA3D_Z_D24S8_INT                  = 120,
315 
316    /* Planar video formats. */
317    SVGA3D_YV12                         = 121,
318 
319    SVGA3D_R32G32B32A32_FLOAT           = 122,
320    SVGA3D_R16G16B16A16_FLOAT           = 123,
321    SVGA3D_R16G16B16A16_UNORM           = 124,
322    SVGA3D_R32G32_FLOAT                 = 125,
323    SVGA3D_R10G10B10A2_UNORM            = 126,
324    SVGA3D_R8G8B8A8_SNORM               = 127,
325    SVGA3D_R16G16_FLOAT                 = 128,
326    SVGA3D_R16G16_UNORM                 = 129,
327    SVGA3D_R16G16_SNORM                 = 130,
328    SVGA3D_R32_FLOAT                    = 131,
329    SVGA3D_R8G8_SNORM                   = 132,
330    SVGA3D_R16_FLOAT                    = 133,
331    SVGA3D_D16_UNORM                    = 134,
332    SVGA3D_A8_UNORM                     = 135,
333    SVGA3D_BC1_UNORM                    = 136,
334    SVGA3D_BC2_UNORM                    = 137,
335    SVGA3D_BC3_UNORM                    = 138,
336    SVGA3D_B5G6R5_UNORM                 = 139,
337    SVGA3D_B5G5R5A1_UNORM               = 140,
338    SVGA3D_B8G8R8A8_UNORM               = 141,
339    SVGA3D_B8G8R8X8_UNORM               = 142,
340    SVGA3D_BC4_UNORM                    = 143,
341    SVGA3D_BC5_UNORM                    = 144,
342 
343    SVGA3D_FORMAT_MAX
344 } SVGA3dSurfaceFormat;
345 
346 typedef uint32 SVGA3dSurfaceFlags;
347 /*
348  * SVGA3d Surface Flags --
349  */
350 #define SVGA3D_SURFACE_CUBEMAP                (1 << 0)
351 
352 /*
353  * HINT flags are not enforced by the device but are useful for
354  * performance.
355  */
356 #define SVGA3D_SURFACE_HINT_STATIC            (CONST64U(1) << 1)
357 #define SVGA3D_SURFACE_HINT_DYNAMIC           (CONST64U(1) << 2)
358 #define SVGA3D_SURFACE_HINT_INDEXBUFFER       (CONST64U(1) << 3)
359 #define SVGA3D_SURFACE_HINT_VERTEXBUFFER      (CONST64U(1) << 4)
360 #define SVGA3D_SURFACE_HINT_TEXTURE           (CONST64U(1) << 5)
361 #define SVGA3D_SURFACE_HINT_RENDERTARGET      (CONST64U(1) << 6)
362 #define SVGA3D_SURFACE_HINT_DEPTHSTENCIL      (CONST64U(1) << 7)
363 #define SVGA3D_SURFACE_HINT_WRITEONLY         (CONST64U(1) << 8)
364 #define SVGA3D_SURFACE_DEAD2                  (CONST64U(1) << 9)
365 #define SVGA3D_SURFACE_AUTOGENMIPMAPS         (CONST64U(1) << 10)
366 
367 #define SVGA3D_SURFACE_DEAD1                  (CONST64U(1) << 11)
368 
369 /*
370  * Is this surface using a base-level pitch for it's mob backing?
371  *
372  * This flag is not intended to be set by guest-drivers, but is instead
373  * set by the device when the surface is bound to a mob with a specified
374  * pitch.
375  */
376 #define SVGA3D_SURFACE_MOB_PITCH              (CONST64U(1) << 12)
377 
378 #define SVGA3D_SURFACE_INACTIVE               (CONST64U(1) << 13)
379 #define SVGA3D_SURFACE_HINT_RT_LOCKABLE       (CONST64U(1) << 14)
380 #define SVGA3D_SURFACE_VOLUME                 (CONST64U(1) << 15)
381 
382 /*
383  * Required to be set on a surface to bind it to a screen target.
384  */
385 #define SVGA3D_SURFACE_SCREENTARGET           (CONST64U(1) << 16)
386 
387 /*
388  * Align images in the guest-backing mob to 16-bytes.
389  */
390 #define SVGA3D_SURFACE_ALIGN16                (CONST64U(1) << 17)
391 
392 #define SVGA3D_SURFACE_1D                     (CONST64U(1) << 18)
393 #define SVGA3D_SURFACE_ARRAY                  (CONST64U(1) << 19)
394 
395 /*
396  * Bind flags.
397  * These are enforced for any surface defined with DefineGBSurface_v2.
398  */
399 #define SVGA3D_SURFACE_BIND_VERTEX_BUFFER     (CONST64U(1) << 20)
400 #define SVGA3D_SURFACE_BIND_INDEX_BUFFER      (CONST64U(1) << 21)
401 #define SVGA3D_SURFACE_BIND_CONSTANT_BUFFER   (CONST64U(1) << 22)
402 #define SVGA3D_SURFACE_BIND_SHADER_RESOURCE   (CONST64U(1) << 23)
403 #define SVGA3D_SURFACE_BIND_RENDER_TARGET     (CONST64U(1) << 24)
404 #define SVGA3D_SURFACE_BIND_DEPTH_STENCIL     (CONST64U(1) << 25)
405 #define SVGA3D_SURFACE_BIND_STREAM_OUTPUT     (CONST64U(1) << 26)
406 
407 /*
408  * The STAGING flags notes that the surface will not be used directly by the
409  * drawing pipeline, i.e. that it will not be bound to any bind point.
410  * Staging surfaces may be used by copy operations to move data in and out
411  * of other surfaces.  No bind flags may be set on surfaces with this flag.
412  *
413  * The HINT_INDIRECT_UPDATE flag suggests that the surface will receive
414  * updates indirectly, i.e. the surface will not be updated directly, but
415  * will receive copies from staging surfaces.
416  */
417 #define SVGA3D_SURFACE_STAGING_UPLOAD         (CONST64U(1) << 27)
418 #define SVGA3D_SURFACE_STAGING_DOWNLOAD       (CONST64U(1) << 28)
419 #define SVGA3D_SURFACE_HINT_INDIRECT_UPDATE   (CONST64U(1) << 29)
420 
421 /*
422  * Setting this flag allow this surface to be used with the
423  * SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER command.  It is only valid for
424  * buffer surfaces, and no bind flags are allowed to be set on surfaces
425  * with this flag.
426  */
427 #define SVGA3D_SURFACE_TRANSFER_FROM_BUFFER   (CONST64U(1) << 30)
428 
429 /*
430  * Marker for the last defined bit in SVGA3dSurfaceFlags.
431  */
432 #define SVGA3D_SURFACE_VADECODE               (CONST64U(1) << 31)
433 
434 /*
435  * Specifies that a surface is multisample, and therefore requires the full
436  * mob-backing to store all the samples.
437  */
438 #define SVGA3D_SURFACE_MULTISAMPLE            (CONST64U(1) << 32)
439 #define SVGA3D_SURFACE_DRAWINDIRECT_ARGS      (CONST64U(1) << 38)
440 
441 #define SVGA3D_SURFACE_FLAG_MAX               (CONST64U(1) << 42)
442 
443 /*
444  * Surface flags types:
445  *
446  * SVGA3dSurface1Flags:  Lower 32-bits of flags.
447  * SVGA3dSurface2Flags:  Upper 32-bits of flags.
448  * SVGA3dSurfaceAllFlags: Full 64-bits of flags.
449  */
450 typedef uint32 SVGA3dSurface1Flags;
451 typedef uint32 SVGA3dSurface2Flags;
452 typedef uint64 SVGA3dSurfaceAllFlags;
453 
454 #define SVGA3D_SURFACE_FLAGS1_MASK ((uint64)MAX_UINT32)
455 #define SVGA3D_SURFACE_FLAGS2_MASK (MAX_UINT64 & ~SVGA3D_SURFACE_FLAGS1_MASK)
456 
457 #define SVGA3D_SURFACE_HB_DISALLOWED_MASK        \
458         (  SVGA3D_SURFACE_MOB_PITCH    |         \
459            SVGA3D_SURFACE_SCREENTARGET |         \
460            SVGA3D_SURFACE_ALIGN16 |              \
461            SVGA3D_SURFACE_BIND_CONSTANT_BUFFER | \
462            SVGA3D_SURFACE_BIND_STREAM_OUTPUT |   \
463            SVGA3D_SURFACE_STAGING_UPLOAD |       \
464            SVGA3D_SURFACE_STAGING_DOWNLOAD |     \
465            SVGA3D_SURFACE_HINT_INDIRECT_UPDATE | \
466            SVGA3D_SURFACE_TRANSFER_FROM_BUFFER | \
467            SVGA3D_SURFACE_VADECODE |             \
468            SVGA3D_SURFACE_MULTISAMPLE |          \
469            SVGA3D_SURFACE_DRAWINDIRECT_ARGS      \
470         )
471 
472 #define SVGA3D_SURFACE_2D_DISALLOWED_MASK           \
473         (  SVGA3D_SURFACE_CUBEMAP |                 \
474            SVGA3D_SURFACE_DEAD2 |                   \
475            SVGA3D_SURFACE_AUTOGENMIPMAPS |          \
476            SVGA3D_SURFACE_VOLUME |                  \
477            SVGA3D_SURFACE_1D |                      \
478            SVGA3D_SURFACE_BIND_VERTEX_BUFFER |      \
479            SVGA3D_SURFACE_BIND_INDEX_BUFFER |       \
480            SVGA3D_SURFACE_BIND_CONSTANT_BUFFER |    \
481            SVGA3D_SURFACE_BIND_DEPTH_STENCIL |      \
482            SVGA3D_SURFACE_BIND_STREAM_OUTPUT |      \
483            SVGA3D_SURFACE_TRANSFER_FROM_BUFFER |    \
484            SVGA3D_SURFACE_VADECODE |                \
485            SVGA3D_SURFACE_MULTISAMPLE |             \
486            SVGA3D_SURFACE_DRAWINDIRECT_ARGS         \
487         )
488 
489 #define SVGA3D_SURFACE_BASICOPS_DISALLOWED_MASK     \
490         (  SVGA3D_SURFACE_CUBEMAP |                 \
491            SVGA3D_SURFACE_AUTOGENMIPMAPS |          \
492            SVGA3D_SURFACE_VOLUME |                  \
493            SVGA3D_SURFACE_1D |                      \
494            SVGA3D_SURFACE_VADECODE |                \
495            SVGA3D_SURFACE_MULTISAMPLE               \
496         )
497 
498 #define SVGA3D_SURFACE_SCREENTARGET_DISALLOWED_MASK \
499         (  SVGA3D_SURFACE_CUBEMAP |                 \
500            SVGA3D_SURFACE_AUTOGENMIPMAPS |          \
501            SVGA3D_SURFACE_VOLUME |                  \
502            SVGA3D_SURFACE_1D |                      \
503            SVGA3D_SURFACE_BIND_VERTEX_BUFFER |      \
504            SVGA3D_SURFACE_BIND_INDEX_BUFFER |       \
505            SVGA3D_SURFACE_BIND_CONSTANT_BUFFER |    \
506            SVGA3D_SURFACE_BIND_DEPTH_STENCIL |      \
507            SVGA3D_SURFACE_BIND_STREAM_OUTPUT |      \
508            SVGA3D_SURFACE_INACTIVE |                \
509            SVGA3D_SURFACE_STAGING_UPLOAD |          \
510            SVGA3D_SURFACE_STAGING_DOWNLOAD |        \
511            SVGA3D_SURFACE_HINT_INDIRECT_UPDATE |    \
512            SVGA3D_SURFACE_TRANSFER_FROM_BUFFER |    \
513            SVGA3D_SURFACE_VADECODE |                \
514            SVGA3D_SURFACE_MULTISAMPLE |             \
515            SVGA3D_SURFACE_DRAWINDIRECT_ARGS         \
516         )
517 
518 #define SVGA3D_SURFACE_BUFFER_DISALLOWED_MASK       \
519         (  SVGA3D_SURFACE_CUBEMAP |                 \
520            SVGA3D_SURFACE_AUTOGENMIPMAPS |          \
521            SVGA3D_SURFACE_VOLUME |                  \
522            SVGA3D_SURFACE_1D |                      \
523            SVGA3D_SURFACE_DEAD2 |                   \
524            SVGA3D_SURFACE_ARRAY |                   \
525            SVGA3D_SURFACE_MULTISAMPLE |             \
526            SVGA3D_SURFACE_MOB_PITCH                 \
527         )
528 
529 #define SVGA3D_SURFACE_MULTISAMPLE_DISALLOWED_MASK  \
530         (  SVGA3D_SURFACE_AUTOGENMIPMAPS |          \
531            SVGA3D_SURFACE_VOLUME |                  \
532            SVGA3D_SURFACE_1D |                      \
533            SVGA3D_SURFACE_SCREENTARGET |            \
534            SVGA3D_SURFACE_MOB_PITCH |               \
535            SVGA3D_SURFACE_DRAWINDIRECT_ARGS         \
536         )
537 
538 #define SVGA3D_SURFACE_DX_ONLY_MASK             \
539         (  SVGA3D_SURFACE_BIND_STREAM_OUTPUT |  \
540            SVGA3D_SURFACE_STAGING_UPLOAD |      \
541            SVGA3D_SURFACE_STAGING_DOWNLOAD |    \
542            SVGA3D_SURFACE_TRANSFER_FROM_BUFFER  \
543         )
544 
545 #define SVGA3D_SURFACE_STAGING_MASK             \
546         (  SVGA3D_SURFACE_STAGING_UPLOAD |      \
547            SVGA3D_SURFACE_STAGING_DOWNLOAD      \
548         )
549 
550 #define SVGA3D_SURFACE_BIND_MASK                  \
551         (  SVGA3D_SURFACE_BIND_VERTEX_BUFFER   |  \
552            SVGA3D_SURFACE_BIND_INDEX_BUFFER    |  \
553            SVGA3D_SURFACE_BIND_CONSTANT_BUFFER |  \
554            SVGA3D_SURFACE_BIND_SHADER_RESOURCE |  \
555            SVGA3D_SURFACE_BIND_RENDER_TARGET   |  \
556            SVGA3D_SURFACE_BIND_DEPTH_STENCIL   |  \
557            SVGA3D_SURFACE_BIND_STREAM_OUTPUT      \
558         )
559 
560 #define SVGA3D_SURFACE_VADECODE_DISALLOWED_MASK     \
561         (  SVGA3D_SURFACE_CUBEMAP |                 \
562            SVGA3D_SURFACE_HINT_STATIC |             \
563            SVGA3D_SURFACE_HINT_DYNAMIC |            \
564            SVGA3D_SURFACE_HINT_INDEXBUFFER |        \
565            SVGA3D_SURFACE_HINT_VERTEXBUFFER |       \
566            SVGA3D_SURFACE_HINT_TEXTURE |            \
567            SVGA3D_SURFACE_HINT_RENDERTARGET |       \
568            SVGA3D_SURFACE_HINT_DEPTHSTENCIL |       \
569            SVGA3D_SURFACE_HINT_WRITEONLY |          \
570            SVGA3D_SURFACE_DEAD2 |                   \
571            SVGA3D_SURFACE_AUTOGENMIPMAPS |          \
572            SVGA3D_SURFACE_HINT_RT_LOCKABLE |        \
573            SVGA3D_SURFACE_VOLUME |                  \
574            SVGA3D_SURFACE_SCREENTARGET |            \
575            SVGA3D_SURFACE_1D |                      \
576            SVGA3D_SURFACE_BIND_VERTEX_BUFFER |      \
577            SVGA3D_SURFACE_BIND_INDEX_BUFFER |       \
578            SVGA3D_SURFACE_BIND_CONSTANT_BUFFER |    \
579            SVGA3D_SURFACE_BIND_RENDER_TARGET |      \
580            SVGA3D_SURFACE_BIND_SHADER_RESOURCE |    \
581            SVGA3D_SURFACE_BIND_DEPTH_STENCIL |      \
582            SVGA3D_SURFACE_BIND_STREAM_OUTPUT |      \
583            SVGA3D_SURFACE_INACTIVE |                \
584            SVGA3D_SURFACE_STAGING_UPLOAD |          \
585            SVGA3D_SURFACE_STAGING_DOWNLOAD |        \
586            SVGA3D_SURFACE_HINT_INDIRECT_UPDATE |    \
587            SVGA3D_SURFACE_TRANSFER_FROM_BUFFER  |   \
588            SVGA3D_SURFACE_MULTISAMPLE               \
589         )
590 
591 #define SVGA3D_SURFACE_VAPROCESSFRAME_OUTPUT_DISALLOWED_MASK     \
592         (  SVGA3D_SURFACE_HINT_INDEXBUFFER |                     \
593            SVGA3D_SURFACE_HINT_VERTEXBUFFER |                    \
594            SVGA3D_SURFACE_HINT_DEPTHSTENCIL |                    \
595            SVGA3D_SURFACE_DEAD2 |                                \
596            SVGA3D_SURFACE_VOLUME |                               \
597            SVGA3D_SURFACE_1D |                                   \
598            SVGA3D_SURFACE_BIND_VERTEX_BUFFER |                   \
599            SVGA3D_SURFACE_BIND_INDEX_BUFFER |                    \
600            SVGA3D_SURFACE_BIND_CONSTANT_BUFFER |                 \
601            SVGA3D_SURFACE_BIND_DEPTH_STENCIL |                   \
602            SVGA3D_SURFACE_BIND_STREAM_OUTPUT |                   \
603            SVGA3D_SURFACE_INACTIVE |                             \
604            SVGA3D_SURFACE_STAGING_UPLOAD |                       \
605            SVGA3D_SURFACE_STAGING_DOWNLOAD |                     \
606            SVGA3D_SURFACE_TRANSFER_FROM_BUFFER |                 \
607            SVGA3D_SURFACE_VADECODE |                             \
608            SVGA3D_SURFACE_MULTISAMPLE                            \
609         )
610 
611 #define SVGA3D_SURFACE_VAPROCESSFRAME_INPUT_DISALLOWED_MASK     \
612         ( SVGA3D_SURFACE_CUBEMAP |                              \
613           SVGA3D_SURFACE_HINT_INDEXBUFFER |                     \
614           SVGA3D_SURFACE_HINT_VERTEXBUFFER |                    \
615           SVGA3D_SURFACE_HINT_DEPTHSTENCIL |                    \
616           SVGA3D_SURFACE_DEAD2 |                                \
617           SVGA3D_SURFACE_VOLUME |                               \
618           SVGA3D_SURFACE_SCREENTARGET |                         \
619           SVGA3D_SURFACE_1D |                                   \
620           SVGA3D_SURFACE_BIND_VERTEX_BUFFER |                   \
621           SVGA3D_SURFACE_BIND_INDEX_BUFFER |                    \
622           SVGA3D_SURFACE_BIND_CONSTANT_BUFFER |                 \
623           SVGA3D_SURFACE_BIND_DEPTH_STENCIL |                   \
624           SVGA3D_SURFACE_BIND_STREAM_OUTPUT |                   \
625           SVGA3D_SURFACE_STAGING_UPLOAD |                       \
626           SVGA3D_SURFACE_STAGING_DOWNLOAD |                     \
627           SVGA3D_SURFACE_TRANSFER_FROM_BUFFER |                 \
628           SVGA3D_SURFACE_MULTISAMPLE                            \
629         )
630 
631 #define SVGA3D_SURFACE_LOGICOPS_DISALLOWED_MASK     \
632         (  SVGA3D_SURFACE_CUBEMAP |                 \
633            SVGA3D_SURFACE_DEAD2 |                   \
634            SVGA3D_SURFACE_AUTOGENMIPMAPS |          \
635            SVGA3D_SURFACE_VOLUME |                  \
636            SVGA3D_SURFACE_1D |                      \
637            SVGA3D_SURFACE_BIND_VERTEX_BUFFER |      \
638            SVGA3D_SURFACE_BIND_INDEX_BUFFER |       \
639            SVGA3D_SURFACE_BIND_CONSTANT_BUFFER |    \
640            SVGA3D_SURFACE_BIND_DEPTH_STENCIL |      \
641            SVGA3D_SURFACE_BIND_STREAM_OUTPUT |      \
642            SVGA3D_SURFACE_TRANSFER_FROM_BUFFER |    \
643            SVGA3D_SURFACE_VADECODE |                \
644            SVGA3D_SURFACE_MULTISAMPLE |             \
645            SVGA3D_SURFACE_DRAWINDIRECT_ARGS         \
646         )
647 
648 
649 /*
650  * These are really the D3DFORMAT_OP defines from the wdk. We need
651  * them so that we can query the host for what the supported surface
652  * operations are (when we're using the D3D backend, in particular),
653  * and so we can send those operations to the guest.
654  */
655 typedef enum {
656    SVGA3DFORMAT_OP_TEXTURE                               = 0x00000001,
657    SVGA3DFORMAT_OP_VOLUMETEXTURE                         = 0x00000002,
658    SVGA3DFORMAT_OP_CUBETEXTURE                           = 0x00000004,
659    SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET                = 0x00000008,
660    SVGA3DFORMAT_OP_SAME_FORMAT_RENDERTARGET              = 0x00000010,
661    SVGA3DFORMAT_OP_ZSTENCIL                              = 0x00000040,
662    SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH   = 0x00000080,
663 
664 /*
665  * This format can be used as a render target if the current display mode
666  * is the same depth if the alpha channel is ignored. e.g. if the device
667  * can render to A8R8G8B8 when the display mode is X8R8G8B8, then the
668  * format op list entry for A8R8G8B8 should have this cap.
669  */
670    SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET  = 0x00000100,
671 
672 /*
673  * This format contains DirectDraw support (including Flip).  This flag
674  * should not to be set on alpha formats.
675  */
676    SVGA3DFORMAT_OP_DISPLAYMODE                           = 0x00000400,
677 
678 /*
679  * The rasterizer can support some level of Direct3D support in this format
680  * and implies that the driver can create a Context in this mode (for some
681  * render target format).  When this flag is set, the SVGA3DFORMAT_OP_DISPLAYMODE
682  * flag must also be set.
683  */
684    SVGA3DFORMAT_OP_3DACCELERATION                        = 0x00000800,
685 
686 /*
687  * This is set for a private format when the driver has put the bpp in
688  * the structure.
689  */
690    SVGA3DFORMAT_OP_PIXELSIZE                             = 0x00001000,
691 
692 /*
693  * Indicates that this format can be converted to any RGB format for which
694  * SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB is specified.
695  */
696    SVGA3DFORMAT_OP_CONVERT_TO_ARGB                       = 0x00002000,
697 
698 /*
699  * Indicates that this format can be used to create offscreen plain surfaces.
700  */
701    SVGA3DFORMAT_OP_OFFSCREENPLAIN                        = 0x00004000,
702 
703 /*
704  * Indicated that this format can be read as an SRGB texture (meaning that the
705  * sampler will linearize the looked up data).
706  */
707    SVGA3DFORMAT_OP_SRGBREAD                              = 0x00008000,
708 
709 /*
710  * Indicates that this format can be used in the bumpmap instructions.
711  */
712    SVGA3DFORMAT_OP_BUMPMAP                               = 0x00010000,
713 
714 /*
715  * Indicates that this format can be sampled by the displacement map sampler.
716  */
717    SVGA3DFORMAT_OP_DMAP                                  = 0x00020000,
718 
719 /*
720  * Indicates that this format cannot be used with texture filtering.
721  */
722    SVGA3DFORMAT_OP_NOFILTER                              = 0x00040000,
723 
724 /*
725  * Indicates that format conversions are supported to this RGB format if
726  * SVGA3DFORMAT_OP_CONVERT_TO_ARGB is specified in the source format.
727  */
728    SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB                    = 0x00080000,
729 
730 /*
731  * Indicated that this format can be written as an SRGB target
732  * (meaning that the pixel pipe will DE-linearize data on output to format)
733  */
734    SVGA3DFORMAT_OP_SRGBWRITE                             = 0x00100000,
735 
736 /*
737  * Indicates that this format cannot be used with alpha blending.
738  */
739    SVGA3DFORMAT_OP_NOALPHABLEND                          = 0x00200000,
740 
741 /*
742  * Indicates that the device can auto-generated sublevels for resources
743  * of this format.
744  */
745    SVGA3DFORMAT_OP_AUTOGENMIPMAP                         = 0x00400000,
746 
747 /*
748  * Indicates that this format can be used by vertex texture sampler.
749  */
750    SVGA3DFORMAT_OP_VERTEXTEXTURE                         = 0x00800000,
751 
752 /*
753  * Indicates that this format supports neither texture coordinate
754  * wrap modes, nor mipmapping.
755  */
756    SVGA3DFORMAT_OP_NOTEXCOORDWRAPNORMIP                  = 0x01000000
757 } SVGA3dFormatOp;
758 
759 #define SVGA3D_FORMAT_POSITIVE                             \
760    (SVGA3DFORMAT_OP_TEXTURE                              | \
761     SVGA3DFORMAT_OP_VOLUMETEXTURE                        | \
762     SVGA3DFORMAT_OP_CUBETEXTURE                          | \
763     SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET               | \
764     SVGA3DFORMAT_OP_SAME_FORMAT_RENDERTARGET             | \
765     SVGA3DFORMAT_OP_ZSTENCIL                             | \
766     SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH  | \
767     SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET | \
768     SVGA3DFORMAT_OP_DISPLAYMODE                          | \
769     SVGA3DFORMAT_OP_3DACCELERATION                       | \
770     SVGA3DFORMAT_OP_PIXELSIZE                            | \
771     SVGA3DFORMAT_OP_CONVERT_TO_ARGB                      | \
772     SVGA3DFORMAT_OP_OFFSCREENPLAIN                       | \
773     SVGA3DFORMAT_OP_SRGBREAD                             | \
774     SVGA3DFORMAT_OP_BUMPMAP                              | \
775     SVGA3DFORMAT_OP_DMAP                                 | \
776     SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB                   | \
777     SVGA3DFORMAT_OP_SRGBWRITE                            | \
778     SVGA3DFORMAT_OP_AUTOGENMIPMAP                        | \
779     SVGA3DFORMAT_OP_VERTEXTEXTURE)
780 
781 #define SVGA3D_FORMAT_NEGATIVE               \
782    (SVGA3DFORMAT_OP_NOFILTER               | \
783     SVGA3DFORMAT_OP_NOALPHABLEND           | \
784     SVGA3DFORMAT_OP_NOTEXCOORDWRAPNORMIP)
785 
786 /*
787  * This structure is a conversion of SVGA3DFORMAT_OP_*
788  * Entries must be located at the same position.
789  */
790 typedef union {
791    uint32 value;
792    struct {
793       uint32 texture : 1;
794       uint32 volumeTexture : 1;
795       uint32 cubeTexture : 1;
796       uint32 offscreenRenderTarget : 1;
797       uint32 sameFormatRenderTarget : 1;
798       uint32 unknown1 : 1;
799       uint32 zStencil : 1;
800       uint32 zStencilArbitraryDepth : 1;
801       uint32 sameFormatUpToAlpha : 1;
802       uint32 unknown2 : 1;
803       uint32 displayMode : 1;
804       uint32 acceleration3d : 1;
805       uint32 pixelSize : 1;
806       uint32 convertToARGB : 1;
807       uint32 offscreenPlain : 1;
808       uint32 sRGBRead : 1;
809       uint32 bumpMap : 1;
810       uint32 dmap : 1;
811       uint32 noFilter : 1;
812       uint32 memberOfGroupARGB : 1;
813       uint32 sRGBWrite : 1;
814       uint32 noAlphaBlend : 1;
815       uint32 autoGenMipMap : 1;
816       uint32 vertexTexture : 1;
817       uint32 noTexCoordWrapNorMip : 1;
818    };
819 } SVGA3dSurfaceFormatCaps;
820 
821 /*
822  * SVGA_3D_CMD_SETRENDERSTATE Types.  All value types
823  * must fit in a uint32.
824  */
825 
826 typedef enum {
827    SVGA3D_RS_INVALID                   = 0,
828    SVGA3D_RS_MIN                       = 1,
829    SVGA3D_RS_ZENABLE                   = 1,     /* SVGA3dBool */
830    SVGA3D_RS_ZWRITEENABLE              = 2,     /* SVGA3dBool */
831    SVGA3D_RS_ALPHATESTENABLE           = 3,     /* SVGA3dBool */
832    SVGA3D_RS_DITHERENABLE              = 4,     /* SVGA3dBool */
833    SVGA3D_RS_BLENDENABLE               = 5,     /* SVGA3dBool */
834    SVGA3D_RS_FOGENABLE                 = 6,     /* SVGA3dBool */
835    SVGA3D_RS_SPECULARENABLE            = 7,     /* SVGA3dBool */
836    SVGA3D_RS_STENCILENABLE             = 8,     /* SVGA3dBool */
837    SVGA3D_RS_LIGHTINGENABLE            = 9,     /* SVGA3dBool */
838    SVGA3D_RS_NORMALIZENORMALS          = 10,    /* SVGA3dBool */
839    SVGA3D_RS_POINTSPRITEENABLE         = 11,    /* SVGA3dBool */
840    SVGA3D_RS_POINTSCALEENABLE          = 12,    /* SVGA3dBool */
841    SVGA3D_RS_STENCILREF                = 13,    /* uint32 */
842    SVGA3D_RS_STENCILMASK               = 14,    /* uint32 */
843    SVGA3D_RS_STENCILWRITEMASK          = 15,    /* uint32 */
844    SVGA3D_RS_FOGSTART                  = 16,    /* float */
845    SVGA3D_RS_FOGEND                    = 17,    /* float */
846    SVGA3D_RS_FOGDENSITY                = 18,    /* float */
847    SVGA3D_RS_POINTSIZE                 = 19,    /* float */
848    SVGA3D_RS_POINTSIZEMIN              = 20,    /* float */
849    SVGA3D_RS_POINTSIZEMAX              = 21,    /* float */
850    SVGA3D_RS_POINTSCALE_A              = 22,    /* float */
851    SVGA3D_RS_POINTSCALE_B              = 23,    /* float */
852    SVGA3D_RS_POINTSCALE_C              = 24,    /* float */
853    SVGA3D_RS_FOGCOLOR                  = 25,    /* SVGA3dColor */
854    SVGA3D_RS_AMBIENT                   = 26,    /* SVGA3dColor */
855    SVGA3D_RS_CLIPPLANEENABLE           = 27,    /* SVGA3dClipPlanes */
856    SVGA3D_RS_FOGMODE                   = 28,    /* SVGA3dFogMode */
857    SVGA3D_RS_FILLMODE                  = 29,    /* SVGA3dFillMode */
858    SVGA3D_RS_SHADEMODE                 = 30,    /* SVGA3dShadeMode */
859    SVGA3D_RS_LINEPATTERN               = 31,    /* SVGA3dLinePattern */
860    SVGA3D_RS_SRCBLEND                  = 32,    /* SVGA3dBlendOp */
861    SVGA3D_RS_DSTBLEND                  = 33,    /* SVGA3dBlendOp */
862    SVGA3D_RS_BLENDEQUATION             = 34,    /* SVGA3dBlendEquation */
863    SVGA3D_RS_CULLMODE                  = 35,    /* SVGA3dFace */
864    SVGA3D_RS_ZFUNC                     = 36,    /* SVGA3dCmpFunc */
865    SVGA3D_RS_ALPHAFUNC                 = 37,    /* SVGA3dCmpFunc */
866    SVGA3D_RS_STENCILFUNC               = 38,    /* SVGA3dCmpFunc */
867    SVGA3D_RS_STENCILFAIL               = 39,    /* SVGA3dStencilOp */
868    SVGA3D_RS_STENCILZFAIL              = 40,    /* SVGA3dStencilOp */
869    SVGA3D_RS_STENCILPASS               = 41,    /* SVGA3dStencilOp */
870    SVGA3D_RS_ALPHAREF                  = 42,    /* float (0.0 .. 1.0) */
871    SVGA3D_RS_FRONTWINDING              = 43,    /* SVGA3dFrontWinding */
872    SVGA3D_RS_COORDINATETYPE            = 44,    /* SVGA3dCoordinateType */
873    SVGA3D_RS_ZBIAS                     = 45,    /* float */
874    SVGA3D_RS_RANGEFOGENABLE            = 46,    /* SVGA3dBool */
875    SVGA3D_RS_COLORWRITEENABLE          = 47,    /* SVGA3dColorMask */
876    SVGA3D_RS_VERTEXMATERIALENABLE      = 48,    /* SVGA3dBool */
877    SVGA3D_RS_DIFFUSEMATERIALSOURCE     = 49,    /* SVGA3dVertexMaterial */
878    SVGA3D_RS_SPECULARMATERIALSOURCE    = 50,    /* SVGA3dVertexMaterial */
879    SVGA3D_RS_AMBIENTMATERIALSOURCE     = 51,    /* SVGA3dVertexMaterial */
880    SVGA3D_RS_EMISSIVEMATERIALSOURCE    = 52,    /* SVGA3dVertexMaterial */
881    SVGA3D_RS_TEXTUREFACTOR             = 53,    /* SVGA3dColor */
882    SVGA3D_RS_LOCALVIEWER               = 54,    /* SVGA3dBool */
883    SVGA3D_RS_SCISSORTESTENABLE         = 55,    /* SVGA3dBool */
884    SVGA3D_RS_BLENDCOLOR                = 56,    /* SVGA3dColor */
885    SVGA3D_RS_STENCILENABLE2SIDED       = 57,    /* SVGA3dBool */
886    SVGA3D_RS_CCWSTENCILFUNC            = 58,    /* SVGA3dCmpFunc */
887    SVGA3D_RS_CCWSTENCILFAIL            = 59,    /* SVGA3dStencilOp */
888    SVGA3D_RS_CCWSTENCILZFAIL           = 60,    /* SVGA3dStencilOp */
889    SVGA3D_RS_CCWSTENCILPASS            = 61,    /* SVGA3dStencilOp */
890    SVGA3D_RS_VERTEXBLEND               = 62,    /* SVGA3dVertexBlendFlags */
891    SVGA3D_RS_SLOPESCALEDEPTHBIAS       = 63,    /* float */
892    SVGA3D_RS_DEPTHBIAS                 = 64,    /* float */
893 
894 
895    /*
896     * Output Gamma Level
897     *
898     * Output gamma effects the gamma curve of colors that are output from the
899     * rendering pipeline.  A value of 1.0 specifies a linear color space. If the
900     * value is <= 0.0, gamma correction is ignored and linear color space is
901     * used.
902     */
903 
904    SVGA3D_RS_OUTPUTGAMMA               = 65,    /* float */
905    SVGA3D_RS_ZVISIBLE                  = 66,    /* SVGA3dBool */
906    SVGA3D_RS_LASTPIXEL                 = 67,    /* SVGA3dBool */
907    SVGA3D_RS_CLIPPING                  = 68,    /* SVGA3dBool */
908    SVGA3D_RS_WRAP0                     = 69,    /* SVGA3dWrapFlags */
909    SVGA3D_RS_WRAP1                     = 70,    /* SVGA3dWrapFlags */
910    SVGA3D_RS_WRAP2                     = 71,    /* SVGA3dWrapFlags */
911    SVGA3D_RS_WRAP3                     = 72,    /* SVGA3dWrapFlags */
912    SVGA3D_RS_WRAP4                     = 73,    /* SVGA3dWrapFlags */
913    SVGA3D_RS_WRAP5                     = 74,    /* SVGA3dWrapFlags */
914    SVGA3D_RS_WRAP6                     = 75,    /* SVGA3dWrapFlags */
915    SVGA3D_RS_WRAP7                     = 76,    /* SVGA3dWrapFlags */
916    SVGA3D_RS_WRAP8                     = 77,    /* SVGA3dWrapFlags */
917    SVGA3D_RS_WRAP9                     = 78,    /* SVGA3dWrapFlags */
918    SVGA3D_RS_WRAP10                    = 79,    /* SVGA3dWrapFlags */
919    SVGA3D_RS_WRAP11                    = 80,    /* SVGA3dWrapFlags */
920    SVGA3D_RS_WRAP12                    = 81,    /* SVGA3dWrapFlags */
921    SVGA3D_RS_WRAP13                    = 82,    /* SVGA3dWrapFlags */
922    SVGA3D_RS_WRAP14                    = 83,    /* SVGA3dWrapFlags */
923    SVGA3D_RS_WRAP15                    = 84,    /* SVGA3dWrapFlags */
924    SVGA3D_RS_MULTISAMPLEANTIALIAS      = 85,    /* SVGA3dBool */
925    SVGA3D_RS_MULTISAMPLEMASK           = 86,    /* uint32 */
926    SVGA3D_RS_INDEXEDVERTEXBLENDENABLE  = 87,    /* SVGA3dBool */
927    SVGA3D_RS_TWEENFACTOR               = 88,    /* float */
928    SVGA3D_RS_ANTIALIASEDLINEENABLE     = 89,    /* SVGA3dBool */
929    SVGA3D_RS_COLORWRITEENABLE1         = 90,    /* SVGA3dColorMask */
930    SVGA3D_RS_COLORWRITEENABLE2         = 91,    /* SVGA3dColorMask */
931    SVGA3D_RS_COLORWRITEENABLE3         = 92,    /* SVGA3dColorMask */
932    SVGA3D_RS_SEPARATEALPHABLENDENABLE  = 93,    /* SVGA3dBool */
933    SVGA3D_RS_SRCBLENDALPHA             = 94,    /* SVGA3dBlendOp */
934    SVGA3D_RS_DSTBLENDALPHA             = 95,    /* SVGA3dBlendOp */
935    SVGA3D_RS_BLENDEQUATIONALPHA        = 96,    /* SVGA3dBlendEquation */
936    SVGA3D_RS_TRANSPARENCYANTIALIAS     = 97,    /* SVGA3dTransparencyAntialiasType */
937    SVGA3D_RS_LINEWIDTH                 = 98,    /* float */
938    SVGA3D_RS_MAX
939 } SVGA3dRenderStateName;
940 
941 typedef enum {
942    SVGA3D_TRANSPARENCYANTIALIAS_NORMAL            = 0,
943    SVGA3D_TRANSPARENCYANTIALIAS_ALPHATOCOVERAGE   = 1,
944    SVGA3D_TRANSPARENCYANTIALIAS_SUPERSAMPLE       = 2,
945    SVGA3D_TRANSPARENCYANTIALIAS_MAX
946 } SVGA3dTransparencyAntialiasType;
947 
948 typedef enum {
949    SVGA3D_VERTEXMATERIAL_NONE     = 0,    /* Use the value in the current material */
950    SVGA3D_VERTEXMATERIAL_DIFFUSE  = 1,    /* Use the value in the diffuse component */
951    SVGA3D_VERTEXMATERIAL_SPECULAR = 2,    /* Use the value in the specular component */
952    SVGA3D_VERTEXMATERIAL_MAX      = 3,
953 } SVGA3dVertexMaterial;
954 
955 typedef enum {
956    SVGA3D_FILLMODE_INVALID = 0,
957    SVGA3D_FILLMODE_MIN     = 1,
958    SVGA3D_FILLMODE_POINT   = 1,
959    SVGA3D_FILLMODE_LINE    = 2,
960    SVGA3D_FILLMODE_FILL    = 3,
961    SVGA3D_FILLMODE_MAX
962 } SVGA3dFillModeType;
963 
964 
965 typedef
966 #include "vmware_pack_begin.h"
967 union {
968    struct {
969       uint16   mode;       /* SVGA3dFillModeType */
970       uint16   face;       /* SVGA3dFace */
971    };
972    uint32 uintValue;
973 }
974 #include "vmware_pack_end.h"
975 SVGA3dFillMode;
976 
977 typedef enum {
978    SVGA3D_SHADEMODE_INVALID = 0,
979    SVGA3D_SHADEMODE_FLAT    = 1,
980    SVGA3D_SHADEMODE_SMOOTH  = 2,
981    SVGA3D_SHADEMODE_PHONG   = 3,     /* Not supported */
982    SVGA3D_SHADEMODE_MAX
983 } SVGA3dShadeMode;
984 
985 typedef
986 #include "vmware_pack_begin.h"
987 union {
988    struct {
989       uint16 repeat;
990       uint16 pattern;
991    };
992    uint32 uintValue;
993 }
994 #include "vmware_pack_end.h"
995 SVGA3dLinePattern;
996 
997 typedef enum {
998    SVGA3D_BLENDOP_INVALID             = 0,
999    SVGA3D_BLENDOP_MIN                 = 1,
1000    SVGA3D_BLENDOP_ZERO                = 1,
1001    SVGA3D_BLENDOP_ONE                 = 2,
1002    SVGA3D_BLENDOP_SRCCOLOR            = 3,
1003    SVGA3D_BLENDOP_INVSRCCOLOR         = 4,
1004    SVGA3D_BLENDOP_SRCALPHA            = 5,
1005    SVGA3D_BLENDOP_INVSRCALPHA         = 6,
1006    SVGA3D_BLENDOP_DESTALPHA           = 7,
1007    SVGA3D_BLENDOP_INVDESTALPHA        = 8,
1008    SVGA3D_BLENDOP_DESTCOLOR           = 9,
1009    SVGA3D_BLENDOP_INVDESTCOLOR        = 10,
1010    SVGA3D_BLENDOP_SRCALPHASAT         = 11,
1011    SVGA3D_BLENDOP_BLENDFACTOR         = 12,
1012    SVGA3D_BLENDOP_INVBLENDFACTOR      = 13,
1013    SVGA3D_BLENDOP_SRC1COLOR           = 14,
1014    SVGA3D_BLENDOP_INVSRC1COLOR        = 15,
1015    SVGA3D_BLENDOP_SRC1ALPHA           = 16,
1016    SVGA3D_BLENDOP_INVSRC1ALPHA        = 17,
1017    SVGA3D_BLENDOP_BLENDFACTORALPHA    = 18,
1018    SVGA3D_BLENDOP_INVBLENDFACTORALPHA = 19,
1019    SVGA3D_BLENDOP_MAX
1020 } SVGA3dBlendOp;
1021 
1022 typedef enum {
1023    SVGA3D_BLENDEQ_INVALID            = 0,
1024    SVGA3D_BLENDEQ_MIN                = 1,
1025    SVGA3D_BLENDEQ_ADD                = 1,
1026    SVGA3D_BLENDEQ_SUBTRACT           = 2,
1027    SVGA3D_BLENDEQ_REVSUBTRACT        = 3,
1028    SVGA3D_BLENDEQ_MINIMUM            = 4,
1029    SVGA3D_BLENDEQ_MAXIMUM            = 5,
1030    SVGA3D_BLENDEQ_MAX
1031 } SVGA3dBlendEquation;
1032 
1033 typedef enum {
1034    SVGA3D_DX11_LOGICOP_MIN           = 0,
1035    SVGA3D_DX11_LOGICOP_CLEAR         = 0,
1036    SVGA3D_DX11_LOGICOP_SET           = 1,
1037    SVGA3D_DX11_LOGICOP_COPY          = 2,
1038    SVGA3D_DX11_LOGICOP_COPY_INVERTED = 3,
1039    SVGA3D_DX11_LOGICOP_NOOP          = 4,
1040    SVGA3D_DX11_LOGICOP_INVERT        = 5,
1041    SVGA3D_DX11_LOGICOP_AND           = 6,
1042    SVGA3D_DX11_LOGICOP_NAND          = 7,
1043    SVGA3D_DX11_LOGICOP_OR            = 8,
1044    SVGA3D_DX11_LOGICOP_NOR           = 9,
1045    SVGA3D_DX11_LOGICOP_XOR           = 10,
1046    SVGA3D_DX11_LOGICOP_EQUIV         = 11,
1047    SVGA3D_DX11_LOGICOP_AND_REVERSE   = 12,
1048    SVGA3D_DX11_LOGICOP_AND_INVERTED  = 13,
1049    SVGA3D_DX11_LOGICOP_OR_REVERSE    = 14,
1050    SVGA3D_DX11_LOGICOP_OR_INVERTED   = 15,
1051    SVGA3D_DX11_LOGICOP_MAX
1052 } SVGA3dDX11LogicOp;
1053 
1054 typedef enum {
1055    SVGA3D_FRONTWINDING_INVALID = 0,
1056    SVGA3D_FRONTWINDING_CW      = 1,
1057    SVGA3D_FRONTWINDING_CCW     = 2,
1058    SVGA3D_FRONTWINDING_MAX
1059 } SVGA3dFrontWinding;
1060 
1061 typedef enum {
1062    SVGA3D_FACE_INVALID  = 0,
1063    SVGA3D_FACE_NONE     = 1,
1064    SVGA3D_FACE_MIN      = 1,
1065    SVGA3D_FACE_FRONT    = 2,
1066    SVGA3D_FACE_BACK     = 3,
1067    SVGA3D_FACE_FRONT_BACK = 4,
1068    SVGA3D_FACE_MAX
1069 } SVGA3dFace;
1070 
1071 /*
1072  * The order and the values should not be changed
1073  */
1074 
1075 typedef enum {
1076    SVGA3D_CMP_INVALID              = 0,
1077    SVGA3D_CMP_NEVER                = 1,
1078    SVGA3D_CMP_LESS                 = 2,
1079    SVGA3D_CMP_EQUAL                = 3,
1080    SVGA3D_CMP_LESSEQUAL            = 4,
1081    SVGA3D_CMP_GREATER              = 5,
1082    SVGA3D_CMP_NOTEQUAL             = 6,
1083    SVGA3D_CMP_GREATEREQUAL         = 7,
1084    SVGA3D_CMP_ALWAYS               = 8,
1085    SVGA3D_CMP_MAX
1086 } SVGA3dCmpFunc;
1087 
1088 /*
1089  * SVGA3D_FOGFUNC_* specifies the fog equation, or PER_VERTEX which allows
1090  * the fog factor to be specified in the alpha component of the specular
1091  * (a.k.a. secondary) vertex color.
1092  */
1093 typedef enum {
1094    SVGA3D_FOGFUNC_INVALID          = 0,
1095    SVGA3D_FOGFUNC_EXP              = 1,
1096    SVGA3D_FOGFUNC_EXP2             = 2,
1097    SVGA3D_FOGFUNC_LINEAR           = 3,
1098    SVGA3D_FOGFUNC_PER_VERTEX       = 4
1099 } SVGA3dFogFunction;
1100 
1101 /*
1102  * SVGA3D_FOGTYPE_* specifies if fog factors are computed on a per-vertex
1103  * or per-pixel basis.
1104  */
1105 typedef enum {
1106    SVGA3D_FOGTYPE_INVALID          = 0,
1107    SVGA3D_FOGTYPE_VERTEX           = 1,
1108    SVGA3D_FOGTYPE_PIXEL            = 2,
1109    SVGA3D_FOGTYPE_MAX              = 3
1110 } SVGA3dFogType;
1111 
1112 /*
1113  * SVGA3D_FOGBASE_* selects depth or range-based fog. Depth-based fog is
1114  * computed using the eye Z value of each pixel (or vertex), whereas range-
1115  * based fog is computed using the actual distance (range) to the eye.
1116  */
1117 typedef enum {
1118    SVGA3D_FOGBASE_INVALID          = 0,
1119    SVGA3D_FOGBASE_DEPTHBASED       = 1,
1120    SVGA3D_FOGBASE_RANGEBASED       = 2,
1121    SVGA3D_FOGBASE_MAX              = 3
1122 } SVGA3dFogBase;
1123 
1124 typedef enum {
1125    SVGA3D_STENCILOP_INVALID        = 0,
1126    SVGA3D_STENCILOP_MIN            = 1,
1127    SVGA3D_STENCILOP_KEEP           = 1,
1128    SVGA3D_STENCILOP_ZERO           = 2,
1129    SVGA3D_STENCILOP_REPLACE        = 3,
1130    SVGA3D_STENCILOP_INCRSAT        = 4,
1131    SVGA3D_STENCILOP_DECRSAT        = 5,
1132    SVGA3D_STENCILOP_INVERT         = 6,
1133    SVGA3D_STENCILOP_INCR           = 7,
1134    SVGA3D_STENCILOP_DECR           = 8,
1135    SVGA3D_STENCILOP_MAX
1136 } SVGA3dStencilOp;
1137 
1138 typedef enum {
1139    SVGA3D_CLIPPLANE_0              = (1 << 0),
1140    SVGA3D_CLIPPLANE_1              = (1 << 1),
1141    SVGA3D_CLIPPLANE_2              = (1 << 2),
1142    SVGA3D_CLIPPLANE_3              = (1 << 3),
1143    SVGA3D_CLIPPLANE_4              = (1 << 4),
1144    SVGA3D_CLIPPLANE_5              = (1 << 5),
1145 } SVGA3dClipPlanes;
1146 
1147 typedef enum {
1148    SVGA3D_CLEAR_COLOR              = 0x1,
1149    SVGA3D_CLEAR_DEPTH              = 0x2,
1150    SVGA3D_CLEAR_STENCIL            = 0x4,
1151 
1152    /*
1153     * Hint only, must be used together with SVGA3D_CLEAR_COLOR. If
1154     * SVGA3D_CLEAR_DEPTH or SVGA3D_CLEAR_STENCIL bit is set, this
1155     * bit will be ignored.
1156     */
1157    SVGA3D_CLEAR_COLORFILL          = 0x8
1158 } SVGA3dClearFlag;
1159 
1160 typedef enum {
1161    SVGA3D_RT_DEPTH                 = 0,
1162    SVGA3D_RT_MIN                   = 0,
1163    SVGA3D_RT_STENCIL               = 1,
1164    SVGA3D_RT_COLOR0                = 2,
1165    SVGA3D_RT_COLOR1                = 3,
1166    SVGA3D_RT_COLOR2                = 4,
1167    SVGA3D_RT_COLOR3                = 5,
1168    SVGA3D_RT_COLOR4                = 6,
1169    SVGA3D_RT_COLOR5                = 7,
1170    SVGA3D_RT_COLOR6                = 8,
1171    SVGA3D_RT_COLOR7                = 9,
1172    SVGA3D_RT_MAX,
1173    SVGA3D_RT_INVALID               = ((uint32)-1),
1174 } SVGA3dRenderTargetType;
1175 
1176 #define SVGA3D_MAX_RT_COLOR (SVGA3D_RT_COLOR7 - SVGA3D_RT_COLOR0 + 1)
1177 
1178 typedef
1179 #include "vmware_pack_begin.h"
1180 union {
1181    struct {
1182       uint32  red   : 1;
1183       uint32  green : 1;
1184       uint32  blue  : 1;
1185       uint32  alpha : 1;
1186    };
1187    uint32 uintValue;
1188 }
1189 #include "vmware_pack_end.h"
1190 SVGA3dColorMask;
1191 
1192 typedef enum {
1193    SVGA3D_VBLEND_DISABLE            = 0,
1194    SVGA3D_VBLEND_1WEIGHT            = 1,
1195    SVGA3D_VBLEND_2WEIGHT            = 2,
1196    SVGA3D_VBLEND_3WEIGHT            = 3,
1197    SVGA3D_VBLEND_MAX                = 4,
1198 } SVGA3dVertexBlendFlags;
1199 
1200 typedef enum {
1201    SVGA3D_WRAPCOORD_0   = 1 << 0,
1202    SVGA3D_WRAPCOORD_1   = 1 << 1,
1203    SVGA3D_WRAPCOORD_2   = 1 << 2,
1204    SVGA3D_WRAPCOORD_3   = 1 << 3,
1205    SVGA3D_WRAPCOORD_ALL = 0xF,
1206 } SVGA3dWrapFlags;
1207 
1208 /*
1209  * SVGA_3D_CMD_TEXTURESTATE Types.  All value types
1210  * must fit in a uint32.
1211  */
1212 
1213 typedef enum {
1214    SVGA3D_TS_INVALID                    = 0,
1215    SVGA3D_TS_MIN                        = 1,
1216    SVGA3D_TS_BIND_TEXTURE               = 1,    /* SVGA3dSurfaceId */
1217    SVGA3D_TS_COLOROP                    = 2,    /* SVGA3dTextureCombiner */
1218    SVGA3D_TS_COLORARG1                  = 3,    /* SVGA3dTextureArgData */
1219    SVGA3D_TS_COLORARG2                  = 4,    /* SVGA3dTextureArgData */
1220    SVGA3D_TS_ALPHAOP                    = 5,    /* SVGA3dTextureCombiner */
1221    SVGA3D_TS_ALPHAARG1                  = 6,    /* SVGA3dTextureArgData */
1222    SVGA3D_TS_ALPHAARG2                  = 7,    /* SVGA3dTextureArgData */
1223    SVGA3D_TS_ADDRESSU                   = 8,    /* SVGA3dTextureAddress */
1224    SVGA3D_TS_ADDRESSV                   = 9,    /* SVGA3dTextureAddress */
1225    SVGA3D_TS_MIPFILTER                  = 10,   /* SVGA3dTextureFilter */
1226    SVGA3D_TS_MAGFILTER                  = 11,   /* SVGA3dTextureFilter */
1227    SVGA3D_TS_MINFILTER                  = 12,   /* SVGA3dTextureFilter */
1228    SVGA3D_TS_BORDERCOLOR                = 13,   /* SVGA3dColor */
1229    SVGA3D_TS_TEXCOORDINDEX              = 14,   /* uint32 */
1230    SVGA3D_TS_TEXTURETRANSFORMFLAGS      = 15,   /* SVGA3dTexTransformFlags */
1231    SVGA3D_TS_TEXCOORDGEN                = 16,   /* SVGA3dTextureCoordGen */
1232    SVGA3D_TS_BUMPENVMAT00               = 17,   /* float */
1233    SVGA3D_TS_BUMPENVMAT01               = 18,   /* float */
1234    SVGA3D_TS_BUMPENVMAT10               = 19,   /* float */
1235    SVGA3D_TS_BUMPENVMAT11               = 20,   /* float */
1236    SVGA3D_TS_TEXTURE_MIPMAP_LEVEL       = 21,   /* uint32 */
1237    SVGA3D_TS_TEXTURE_LOD_BIAS           = 22,   /* float */
1238    SVGA3D_TS_TEXTURE_ANISOTROPIC_LEVEL  = 23,   /* uint32 */
1239    SVGA3D_TS_ADDRESSW                   = 24,   /* SVGA3dTextureAddress */
1240 
1241 
1242    /*
1243     * Sampler Gamma Level
1244     *
1245     * Sampler gamma effects the color of samples taken from the sampler.  A
1246     * value of 1.0 will produce linear samples.  If the value is <= 0.0 the
1247     * gamma value is ignored and a linear space is used.
1248     */
1249 
1250    SVGA3D_TS_GAMMA                      = 25,   /* float */
1251    SVGA3D_TS_BUMPENVLSCALE              = 26,   /* float */
1252    SVGA3D_TS_BUMPENVLOFFSET             = 27,   /* float */
1253    SVGA3D_TS_COLORARG0                  = 28,   /* SVGA3dTextureArgData */
1254    SVGA3D_TS_ALPHAARG0                  = 29,   /* SVGA3dTextureArgData */
1255    SVGA3D_TS_PREGB_MAX                  = 30,   /* Max value before GBObjects */
1256    SVGA3D_TS_CONSTANT                   = 30,   /* SVGA3dColor */
1257    SVGA3D_TS_COLOR_KEY_ENABLE           = 31,   /* SVGA3dBool */
1258    SVGA3D_TS_COLOR_KEY                  = 32,   /* SVGA3dColor */
1259    SVGA3D_TS_MAX
1260 } SVGA3dTextureStateName;
1261 
1262 typedef enum {
1263    SVGA3D_TC_INVALID                   = 0,
1264    SVGA3D_TC_DISABLE                   = 1,
1265    SVGA3D_TC_SELECTARG1                = 2,
1266    SVGA3D_TC_SELECTARG2                = 3,
1267    SVGA3D_TC_MODULATE                  = 4,
1268    SVGA3D_TC_ADD                       = 5,
1269    SVGA3D_TC_ADDSIGNED                 = 6,
1270    SVGA3D_TC_SUBTRACT                  = 7,
1271    SVGA3D_TC_BLENDTEXTUREALPHA         = 8,
1272    SVGA3D_TC_BLENDDIFFUSEALPHA         = 9,
1273    SVGA3D_TC_BLENDCURRENTALPHA         = 10,
1274    SVGA3D_TC_BLENDFACTORALPHA          = 11,
1275    SVGA3D_TC_MODULATE2X                = 12,
1276    SVGA3D_TC_MODULATE4X                = 13,
1277    SVGA3D_TC_DSDT                      = 14,
1278    SVGA3D_TC_DOTPRODUCT3               = 15,
1279    SVGA3D_TC_BLENDTEXTUREALPHAPM       = 16,
1280    SVGA3D_TC_ADDSIGNED2X               = 17,
1281    SVGA3D_TC_ADDSMOOTH                 = 18,
1282    SVGA3D_TC_PREMODULATE               = 19,
1283    SVGA3D_TC_MODULATEALPHA_ADDCOLOR    = 20,
1284    SVGA3D_TC_MODULATECOLOR_ADDALPHA    = 21,
1285    SVGA3D_TC_MODULATEINVALPHA_ADDCOLOR = 22,
1286    SVGA3D_TC_MODULATEINVCOLOR_ADDALPHA = 23,
1287    SVGA3D_TC_BUMPENVMAPLUMINANCE       = 24,
1288    SVGA3D_TC_MULTIPLYADD               = 25,
1289    SVGA3D_TC_LERP                      = 26,
1290    SVGA3D_TC_MAX
1291 } SVGA3dTextureCombiner;
1292 
1293 #define SVGA3D_TC_CAP_BIT(svga3d_tc_op) (svga3d_tc_op ? (1 << (svga3d_tc_op - 1)) : 0)
1294 
1295 typedef enum {
1296    SVGA3D_TEX_ADDRESS_INVALID    = 0,
1297    SVGA3D_TEX_ADDRESS_MIN        = 1,
1298    SVGA3D_TEX_ADDRESS_WRAP       = 1,
1299    SVGA3D_TEX_ADDRESS_MIRROR     = 2,
1300    SVGA3D_TEX_ADDRESS_CLAMP      = 3,
1301    SVGA3D_TEX_ADDRESS_BORDER     = 4,
1302    SVGA3D_TEX_ADDRESS_MIRRORONCE = 5,
1303    SVGA3D_TEX_ADDRESS_EDGE       = 6,
1304    SVGA3D_TEX_ADDRESS_MAX
1305 } SVGA3dTextureAddress;
1306 
1307 /*
1308  * SVGA3D_TEX_FILTER_NONE as the minification filter means mipmapping is
1309  * disabled, and the rasterizer should use the magnification filter instead.
1310  */
1311 typedef enum {
1312    SVGA3D_TEX_FILTER_NONE           = 0,
1313    SVGA3D_TEX_FILTER_MIN            = 0,
1314    SVGA3D_TEX_FILTER_NEAREST        = 1,
1315    SVGA3D_TEX_FILTER_LINEAR         = 2,
1316    SVGA3D_TEX_FILTER_ANISOTROPIC    = 3,
1317    SVGA3D_TEX_FILTER_FLATCUBIC      = 4, /* Deprecated, not implemented */
1318    SVGA3D_TEX_FILTER_GAUSSIANCUBIC  = 5, /* Deprecated, not implemented */
1319    SVGA3D_TEX_FILTER_PYRAMIDALQUAD  = 6, /* Not currently implemented */
1320    SVGA3D_TEX_FILTER_GAUSSIANQUAD   = 7, /* Not currently implemented */
1321    SVGA3D_TEX_FILTER_MAX
1322 } SVGA3dTextureFilter;
1323 
1324 typedef enum {
1325    SVGA3D_TEX_TRANSFORM_OFF    = 0,
1326    SVGA3D_TEX_TRANSFORM_S      = (1 << 0),
1327    SVGA3D_TEX_TRANSFORM_T      = (1 << 1),
1328    SVGA3D_TEX_TRANSFORM_R      = (1 << 2),
1329    SVGA3D_TEX_TRANSFORM_Q      = (1 << 3),
1330    SVGA3D_TEX_PROJECTED        = (1 << 15),
1331 } SVGA3dTexTransformFlags;
1332 
1333 typedef enum {
1334    SVGA3D_TEXCOORD_GEN_OFF              = 0,
1335    SVGA3D_TEXCOORD_GEN_EYE_POSITION     = 1,
1336    SVGA3D_TEXCOORD_GEN_EYE_NORMAL       = 2,
1337    SVGA3D_TEXCOORD_GEN_REFLECTIONVECTOR = 3,
1338    SVGA3D_TEXCOORD_GEN_SPHERE           = 4,
1339    SVGA3D_TEXCOORD_GEN_MAX
1340 } SVGA3dTextureCoordGen;
1341 
1342 /*
1343  * Texture argument constants for texture combiner
1344  */
1345 typedef enum {
1346    SVGA3D_TA_INVALID    = 0,
1347    SVGA3D_TA_TFACTOR    = 1,
1348    SVGA3D_TA_PREVIOUS   = 2,
1349    SVGA3D_TA_DIFFUSE    = 3,
1350    SVGA3D_TA_TEXTURE    = 4,
1351    SVGA3D_TA_SPECULAR   = 5,
1352    SVGA3D_TA_CONSTANT   = 6,
1353    SVGA3D_TA_MAX
1354 } SVGA3dTextureArgData;
1355 
1356 #define SVGA3D_TM_MASK_LEN 4
1357 
1358 /* Modifiers for texture argument constants defined above. */
1359 typedef enum {
1360    SVGA3D_TM_NONE       = 0,
1361    SVGA3D_TM_ALPHA      = (1 << SVGA3D_TM_MASK_LEN),
1362    SVGA3D_TM_ONE_MINUS  = (2 << SVGA3D_TM_MASK_LEN),
1363 } SVGA3dTextureArgModifier;
1364 
1365 /*
1366  * Vertex declarations
1367  *
1368  * Notes:
1369  *
1370  * SVGA3D_DECLUSAGE_POSITIONT is for pre-transformed vertices. If you
1371  * draw with any POSITIONT vertex arrays, the programmable vertex
1372  * pipeline will be implicitly disabled. Drawing will take place as if
1373  * no vertex shader was bound.
1374  */
1375 
1376 typedef enum {
1377    SVGA3D_DECLUSAGE_POSITION     = 0,
1378    SVGA3D_DECLUSAGE_BLENDWEIGHT,
1379    SVGA3D_DECLUSAGE_BLENDINDICES,
1380    SVGA3D_DECLUSAGE_NORMAL,
1381    SVGA3D_DECLUSAGE_PSIZE,
1382    SVGA3D_DECLUSAGE_TEXCOORD,
1383    SVGA3D_DECLUSAGE_TANGENT,
1384    SVGA3D_DECLUSAGE_BINORMAL,
1385    SVGA3D_DECLUSAGE_TESSFACTOR,
1386    SVGA3D_DECLUSAGE_POSITIONT,
1387    SVGA3D_DECLUSAGE_COLOR,
1388    SVGA3D_DECLUSAGE_FOG,
1389    SVGA3D_DECLUSAGE_DEPTH,
1390    SVGA3D_DECLUSAGE_SAMPLE,
1391    SVGA3D_DECLUSAGE_MAX
1392 } SVGA3dDeclUsage;
1393 
1394 typedef enum {
1395    SVGA3D_DECLMETHOD_DEFAULT     = 0,
1396    SVGA3D_DECLMETHOD_PARTIALU,
1397    SVGA3D_DECLMETHOD_PARTIALV,
1398    SVGA3D_DECLMETHOD_CROSSUV,          /* Normal */
1399    SVGA3D_DECLMETHOD_UV,
1400    SVGA3D_DECLMETHOD_LOOKUP,           /* Lookup a displacement map */
1401    SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED, /* Lookup a pre-sampled displacement */
1402                                        /* map */
1403 } SVGA3dDeclMethod;
1404 
1405 typedef enum {
1406    SVGA3D_DECLTYPE_FLOAT1        =  0,
1407    SVGA3D_DECLTYPE_FLOAT2        =  1,
1408    SVGA3D_DECLTYPE_FLOAT3        =  2,
1409    SVGA3D_DECLTYPE_FLOAT4        =  3,
1410    SVGA3D_DECLTYPE_D3DCOLOR      =  4,
1411    SVGA3D_DECLTYPE_UBYTE4        =  5,
1412    SVGA3D_DECLTYPE_SHORT2        =  6,
1413    SVGA3D_DECLTYPE_SHORT4        =  7,
1414    SVGA3D_DECLTYPE_UBYTE4N       =  8,
1415    SVGA3D_DECLTYPE_SHORT2N       =  9,
1416    SVGA3D_DECLTYPE_SHORT4N       = 10,
1417    SVGA3D_DECLTYPE_USHORT2N      = 11,
1418    SVGA3D_DECLTYPE_USHORT4N      = 12,
1419    SVGA3D_DECLTYPE_UDEC3         = 13,
1420    SVGA3D_DECLTYPE_DEC3N         = 14,
1421    SVGA3D_DECLTYPE_FLOAT16_2     = 15,
1422    SVGA3D_DECLTYPE_FLOAT16_4     = 16,
1423    SVGA3D_DECLTYPE_MAX,
1424 } SVGA3dDeclType;
1425 
1426 /*
1427  * This structure is used for the divisor for geometry instancing;
1428  * it's a direct translation of the Direct3D equivalent.
1429  */
1430 typedef union {
1431    struct {
1432       /*
1433        * For index data, this number represents the number of instances to draw.
1434        * For instance data, this number represents the number of
1435        * instances/vertex in this stream
1436        */
1437       uint32 count : 30;
1438 
1439       /*
1440        * This is 1 if this is supposed to be the data that is repeated for
1441        * every instance.
1442        */
1443       uint32 indexedData : 1;
1444 
1445       /*
1446        * This is 1 if this is supposed to be the per-instance data.
1447        */
1448       uint32 instanceData : 1;
1449    };
1450 
1451    uint32 value;
1452 } SVGA3dVertexDivisor;
1453 
1454 typedef enum {
1455    /*
1456     * SVGA3D_PRIMITIVE_INVALID is a valid primitive type.
1457     *
1458     * List MIN second so debuggers will think INVALID is
1459     * the correct name.
1460     */
1461    SVGA3D_PRIMITIVE_INVALID                     = 0,
1462    SVGA3D_PRIMITIVE_MIN                         = 0,
1463    SVGA3D_PRIMITIVE_TRIANGLELIST                = 1,
1464    SVGA3D_PRIMITIVE_POINTLIST                   = 2,
1465    SVGA3D_PRIMITIVE_LINELIST                    = 3,
1466    SVGA3D_PRIMITIVE_LINESTRIP                   = 4,
1467    SVGA3D_PRIMITIVE_TRIANGLESTRIP               = 5,
1468    SVGA3D_PRIMITIVE_TRIANGLEFAN                 = 6,
1469    SVGA3D_PRIMITIVE_LINELIST_ADJ                = 7,
1470    SVGA3D_PRIMITIVE_PREDX_MAX                   = 7,
1471    SVGA3D_PRIMITIVE_LINESTRIP_ADJ               = 8,
1472    SVGA3D_PRIMITIVE_TRIANGLELIST_ADJ            = 9,
1473    SVGA3D_PRIMITIVE_TRIANGLESTRIP_ADJ           = 10,
1474    SVGA3D_PRIMITIVE_DX10_MAX                    = 11,
1475    SVGA3D_PRIMITIVE_1_CONTROL_POINT_PATCH       = 11,
1476    SVGA3D_PRIMITIVE_2_CONTROL_POINT_PATCH       = 12,
1477    SVGA3D_PRIMITIVE_3_CONTROL_POINT_PATCH       = 13,
1478    SVGA3D_PRIMITIVE_4_CONTROL_POINT_PATCH       = 14,
1479    SVGA3D_PRIMITIVE_5_CONTROL_POINT_PATCH       = 15,
1480    SVGA3D_PRIMITIVE_6_CONTROL_POINT_PATCH       = 16,
1481    SVGA3D_PRIMITIVE_7_CONTROL_POINT_PATCH       = 17,
1482    SVGA3D_PRIMITIVE_8_CONTROL_POINT_PATCH       = 18,
1483    SVGA3D_PRIMITIVE_9_CONTROL_POINT_PATCH       = 19,
1484    SVGA3D_PRIMITIVE_10_CONTROL_POINT_PATCH      = 20,
1485    SVGA3D_PRIMITIVE_11_CONTROL_POINT_PATCH      = 21,
1486    SVGA3D_PRIMITIVE_12_CONTROL_POINT_PATCH      = 22,
1487    SVGA3D_PRIMITIVE_13_CONTROL_POINT_PATCH      = 23,
1488    SVGA3D_PRIMITIVE_14_CONTROL_POINT_PATCH      = 24,
1489    SVGA3D_PRIMITIVE_15_CONTROL_POINT_PATCH      = 25,
1490    SVGA3D_PRIMITIVE_16_CONTROL_POINT_PATCH      = 26,
1491    SVGA3D_PRIMITIVE_17_CONTROL_POINT_PATCH      = 27,
1492    SVGA3D_PRIMITIVE_18_CONTROL_POINT_PATCH      = 28,
1493    SVGA3D_PRIMITIVE_19_CONTROL_POINT_PATCH      = 29,
1494    SVGA3D_PRIMITIVE_20_CONTROL_POINT_PATCH      = 30,
1495    SVGA3D_PRIMITIVE_21_CONTROL_POINT_PATCH      = 31,
1496    SVGA3D_PRIMITIVE_22_CONTROL_POINT_PATCH      = 32,
1497    SVGA3D_PRIMITIVE_23_CONTROL_POINT_PATCH      = 33,
1498    SVGA3D_PRIMITIVE_24_CONTROL_POINT_PATCH      = 34,
1499    SVGA3D_PRIMITIVE_25_CONTROL_POINT_PATCH      = 35,
1500    SVGA3D_PRIMITIVE_26_CONTROL_POINT_PATCH      = 36,
1501    SVGA3D_PRIMITIVE_27_CONTROL_POINT_PATCH      = 37,
1502    SVGA3D_PRIMITIVE_28_CONTROL_POINT_PATCH      = 38,
1503    SVGA3D_PRIMITIVE_29_CONTROL_POINT_PATCH      = 39,
1504    SVGA3D_PRIMITIVE_30_CONTROL_POINT_PATCH      = 40,
1505    SVGA3D_PRIMITIVE_31_CONTROL_POINT_PATCH      = 41,
1506    SVGA3D_PRIMITIVE_32_CONTROL_POINT_PATCH      = 42,
1507    SVGA3D_PRIMITIVE_MAX                         = 43
1508 } SVGA3dPrimitiveType;
1509 
1510 typedef enum {
1511    SVGA3D_COORDINATE_INVALID                   = 0,
1512    SVGA3D_COORDINATE_LEFTHANDED                = 1,
1513    SVGA3D_COORDINATE_RIGHTHANDED               = 2,
1514    SVGA3D_COORDINATE_MAX
1515 } SVGA3dCoordinateType;
1516 
1517 typedef enum {
1518    SVGA3D_TRANSFORM_INVALID                     = 0,
1519    SVGA3D_TRANSFORM_WORLD                       = 1,
1520    SVGA3D_TRANSFORM_MIN                         = 1,
1521    SVGA3D_TRANSFORM_VIEW                        = 2,
1522    SVGA3D_TRANSFORM_PROJECTION                  = 3,
1523    SVGA3D_TRANSFORM_TEXTURE0                    = 4,
1524    SVGA3D_TRANSFORM_TEXTURE1                    = 5,
1525    SVGA3D_TRANSFORM_TEXTURE2                    = 6,
1526    SVGA3D_TRANSFORM_TEXTURE3                    = 7,
1527    SVGA3D_TRANSFORM_TEXTURE4                    = 8,
1528    SVGA3D_TRANSFORM_TEXTURE5                    = 9,
1529    SVGA3D_TRANSFORM_TEXTURE6                    = 10,
1530    SVGA3D_TRANSFORM_TEXTURE7                    = 11,
1531    SVGA3D_TRANSFORM_WORLD1                      = 12,
1532    SVGA3D_TRANSFORM_WORLD2                      = 13,
1533    SVGA3D_TRANSFORM_WORLD3                      = 14,
1534    SVGA3D_TRANSFORM_MAX
1535 } SVGA3dTransformType;
1536 
1537 typedef enum {
1538    SVGA3D_LIGHTTYPE_INVALID                     = 0,
1539    SVGA3D_LIGHTTYPE_MIN                         = 1,
1540    SVGA3D_LIGHTTYPE_POINT                       = 1,
1541    SVGA3D_LIGHTTYPE_SPOT1                       = 2, /* 1-cone, in degrees */
1542    SVGA3D_LIGHTTYPE_SPOT2                       = 3, /* 2-cone, in radians */
1543    SVGA3D_LIGHTTYPE_DIRECTIONAL                 = 4,
1544    SVGA3D_LIGHTTYPE_MAX
1545 } SVGA3dLightType;
1546 
1547 typedef enum {
1548    SVGA3D_CUBEFACE_POSX                         = 0,
1549    SVGA3D_CUBEFACE_NEGX                         = 1,
1550    SVGA3D_CUBEFACE_POSY                         = 2,
1551    SVGA3D_CUBEFACE_NEGY                         = 3,
1552    SVGA3D_CUBEFACE_POSZ                         = 4,
1553    SVGA3D_CUBEFACE_NEGZ                         = 5,
1554 } SVGA3dCubeFace;
1555 
1556 typedef enum {
1557    SVGA3D_SHADERTYPE_INVALID                    = 0,
1558    SVGA3D_SHADERTYPE_MIN                        = 1,
1559    SVGA3D_SHADERTYPE_VS                         = 1,
1560    SVGA3D_SHADERTYPE_PS                         = 2,
1561    SVGA3D_SHADERTYPE_PREDX_MAX                  = 3,
1562    SVGA3D_SHADERTYPE_GS                         = 3,
1563    SVGA3D_SHADERTYPE_DX10_MAX                   = 4,
1564    SVGA3D_SHADERTYPE_HS                         = 4,
1565    SVGA3D_SHADERTYPE_DS                         = 5,
1566    SVGA3D_SHADERTYPE_CS                         = 6,
1567    SVGA3D_SHADERTYPE_MAX                        = 7
1568 } SVGA3dShaderType;
1569 
1570 #define SVGA3D_NUM_SHADERTYPE_PREDX \
1571    (SVGA3D_SHADERTYPE_PREDX_MAX - SVGA3D_SHADERTYPE_MIN)
1572 
1573 #define SVGA3D_NUM_SHADERTYPE_DX10 \
1574    (SVGA3D_SHADERTYPE_DX10_MAX - SVGA3D_SHADERTYPE_MIN)
1575 
1576 #define SVGA3D_NUM_SHADERTYPE \
1577    (SVGA3D_SHADERTYPE_MAX - SVGA3D_SHADERTYPE_MIN)
1578 
1579 typedef enum {
1580    SVGA3D_CONST_TYPE_MIN                        = 0,
1581    SVGA3D_CONST_TYPE_FLOAT                      = 0,
1582    SVGA3D_CONST_TYPE_INT                        = 1,
1583    SVGA3D_CONST_TYPE_BOOL                       = 2,
1584    SVGA3D_CONST_TYPE_MAX                        = 3,
1585 } SVGA3dShaderConstType;
1586 
1587 /*
1588  * Register limits for shader consts.
1589  */
1590 #define SVGA3D_CONSTREG_MAX            256
1591 #define SVGA3D_CONSTINTREG_MAX         16
1592 #define SVGA3D_CONSTBOOLREG_MAX        16
1593 
1594 typedef enum {
1595    SVGA3D_STRETCH_BLT_POINT                     = 0,
1596    SVGA3D_STRETCH_BLT_LINEAR                    = 1,
1597    SVGA3D_STRETCH_BLT_MAX
1598 } SVGA3dStretchBltMode;
1599 
1600 typedef enum {
1601    SVGA3D_QUERYTYPE_INVALID                     = ((uint8)-1),
1602    SVGA3D_QUERYTYPE_MIN                         = 0,
1603    SVGA3D_QUERYTYPE_OCCLUSION                   = 0,
1604    SVGA3D_QUERYTYPE_TIMESTAMP                   = 1,
1605    SVGA3D_QUERYTYPE_TIMESTAMPDISJOINT           = 2,
1606    SVGA3D_QUERYTYPE_PIPELINESTATS               = 3,
1607    SVGA3D_QUERYTYPE_OCCLUSIONPREDICATE          = 4,
1608    SVGA3D_QUERYTYPE_STREAMOUTPUTSTATS           = 5,
1609    SVGA3D_QUERYTYPE_STREAMOVERFLOWPREDICATE     = 6,
1610    SVGA3D_QUERYTYPE_OCCLUSION64                 = 7,
1611    SVGA3D_QUERYTYPE_DX10_MAX                    = 8,
1612    SVGA3D_QUERYTYPE_SOSTATS_STREAM0             = 8,
1613    SVGA3D_QUERYTYPE_SOSTATS_STREAM1             = 9,
1614    SVGA3D_QUERYTYPE_SOSTATS_STREAM2             = 10,
1615    SVGA3D_QUERYTYPE_SOSTATS_STREAM3             = 11,
1616    SVGA3D_QUERYTYPE_SOP_STREAM0                 = 12,
1617    SVGA3D_QUERYTYPE_SOP_STREAM1                 = 13,
1618    SVGA3D_QUERYTYPE_SOP_STREAM2                 = 14,
1619    SVGA3D_QUERYTYPE_SOP_STREAM3                 = 15,
1620    SVGA3D_QUERYTYPE_MAX
1621 } SVGA3dQueryType;
1622 
1623 typedef uint8 SVGA3dQueryTypeUint8;
1624 
1625 #define SVGA3D_NUM_QUERYTYPE  (SVGA3D_QUERYTYPE_MAX - SVGA3D_QUERYTYPE_MIN)
1626 
1627 /*
1628  * This is the maximum number of queries per context that can be active
1629  * simultaneously between a beginQuery and endQuery.
1630  */
1631 #define SVGA3D_MAX_QUERY 64
1632 
1633 /*
1634  * Query result buffer formats
1635  */
1636 typedef
1637 #include "vmware_pack_begin.h"
1638 struct {
1639    uint32 samplesRendered;
1640 }
1641 #include "vmware_pack_end.h"
1642 SVGADXOcclusionQueryResult;
1643 
1644 typedef
1645 #include "vmware_pack_begin.h"
1646 struct {
1647    uint32 passed;
1648 }
1649 #include "vmware_pack_end.h"
1650 SVGADXEventQueryResult;
1651 
1652 typedef
1653 #include "vmware_pack_begin.h"
1654 struct {
1655    uint64 timestamp;
1656 }
1657 #include "vmware_pack_end.h"
1658 SVGADXTimestampQueryResult;
1659 
1660 typedef
1661 #include "vmware_pack_begin.h"
1662 struct {
1663    uint64 realFrequency;
1664    uint32 disjoint;
1665 }
1666 #include "vmware_pack_end.h"
1667 SVGADXTimestampDisjointQueryResult;
1668 
1669 typedef
1670 #include "vmware_pack_begin.h"
1671 struct {
1672    uint64 inputAssemblyVertices;
1673    uint64 inputAssemblyPrimitives;
1674    uint64 vertexShaderInvocations;
1675    uint64 geometryShaderInvocations;
1676    uint64 geometryShaderPrimitives;
1677    uint64 clipperInvocations;
1678    uint64 clipperPrimitives;
1679    uint64 pixelShaderInvocations;
1680    uint64 hullShaderInvocations;
1681    uint64 domainShaderInvocations;
1682    uint64 computeShaderInvocations;
1683 }
1684 #include "vmware_pack_end.h"
1685 SVGADXPipelineStatisticsQueryResult;
1686 
1687 typedef
1688 #include "vmware_pack_begin.h"
1689 struct {
1690    uint32 anySamplesRendered;
1691 }
1692 #include "vmware_pack_end.h"
1693 SVGADXOcclusionPredicateQueryResult;
1694 
1695 typedef
1696 #include "vmware_pack_begin.h"
1697 struct {
1698    uint64 numPrimitivesWritten;
1699    uint64 numPrimitivesRequired;
1700 }
1701 #include "vmware_pack_end.h"
1702 SVGADXStreamOutStatisticsQueryResult;
1703 
1704 typedef
1705 #include "vmware_pack_begin.h"
1706 struct {
1707    uint32 overflowed;
1708 }
1709 #include "vmware_pack_end.h"
1710 SVGADXStreamOutPredicateQueryResult;
1711 
1712 typedef
1713 #include "vmware_pack_begin.h"
1714 struct {
1715    uint64 samplesRendered;
1716 }
1717 #include "vmware_pack_end.h"
1718 SVGADXOcclusion64QueryResult;
1719 
1720 /*
1721  * SVGADXQueryResultUnion is not intended for use in the protocol, but is
1722  * very helpful when working with queries generically.
1723  */
1724 typedef
1725 #include "vmware_pack_begin.h"
1726 union SVGADXQueryResultUnion {
1727    SVGADXOcclusionQueryResult occ;
1728    SVGADXEventQueryResult event;
1729    SVGADXTimestampQueryResult ts;
1730    SVGADXTimestampDisjointQueryResult tsDisjoint;
1731    SVGADXPipelineStatisticsQueryResult pipelineStats;
1732    SVGADXOcclusionPredicateQueryResult occPred;
1733    SVGADXStreamOutStatisticsQueryResult soStats;
1734    SVGADXStreamOutPredicateQueryResult soPred;
1735    SVGADXOcclusion64QueryResult occ64;
1736 }
1737 #include "vmware_pack_end.h"
1738 SVGADXQueryResultUnion;
1739 
1740 
1741 typedef enum {
1742    SVGA3D_QUERYSTATE_PENDING     = 0,      /* Query is not finished yet */
1743    SVGA3D_QUERYSTATE_SUCCEEDED   = 1,      /* Completed successfully */
1744    SVGA3D_QUERYSTATE_FAILED      = 2,      /* Completed unsuccessfully */
1745    SVGA3D_QUERYSTATE_NEW         = 3,      /* Never submitted (guest only) */
1746 } SVGA3dQueryState;
1747 
1748 typedef enum {
1749    SVGA3D_WRITE_HOST_VRAM        = 1,
1750    SVGA3D_READ_HOST_VRAM         = 2,
1751 } SVGA3dTransferType;
1752 
1753 typedef enum {
1754    SVGA3D_LOGICOP_INVALID   = 0,
1755    SVGA3D_LOGICOP_MIN       = 1,
1756    SVGA3D_LOGICOP_COPY      = 1,
1757    SVGA3D_LOGICOP_NOT       = 2,
1758    SVGA3D_LOGICOP_AND       = 3,
1759    SVGA3D_LOGICOP_OR        = 4,
1760    SVGA3D_LOGICOP_XOR       = 5,
1761    SVGA3D_LOGICOP_NXOR      = 6,
1762    SVGA3D_LOGICOP_ROP3MIN   = 30,   /* 7-29 are reserved for future logic ops. */
1763    SVGA3D_LOGICOP_ROP3MAX   = (SVGA3D_LOGICOP_ROP3MIN + 255),
1764    SVGA3D_LOGICOP_MAX       = (SVGA3D_LOGICOP_ROP3MAX + 1),
1765 } SVGA3dLogicOp;
1766 
1767 typedef
1768 #include "vmware_pack_begin.h"
1769 struct {
1770    union {
1771       struct {
1772 	 uint16  function;       /* SVGA3dFogFunction */
1773 	 uint8   type;           /* SVGA3dFogType */
1774 	 uint8   base;           /* SVGA3dFogBase */
1775       };
1776       uint32     uintValue;
1777    };
1778 }
1779 #include "vmware_pack_end.h"
1780 SVGA3dFogMode;
1781 
1782 /*
1783  * Uniquely identify one image (a 1D/2D/3D array) from a surface. This
1784  * is a surface ID as well as face/mipmap indices.
1785  */
1786 typedef
1787 #include "vmware_pack_begin.h"
1788 struct SVGA3dSurfaceImageId {
1789    uint32               sid;
1790    uint32               face;
1791    uint32               mipmap;
1792 }
1793 #include "vmware_pack_end.h"
1794 SVGA3dSurfaceImageId;
1795 
1796 typedef
1797 #include "vmware_pack_begin.h"
1798 struct SVGA3dSubSurfaceId {
1799    uint32 sid;
1800    uint32 subResourceId;
1801 }
1802 #include "vmware_pack_end.h"
1803 SVGA3dSubSurfaceId;
1804 
1805 typedef
1806 #include "vmware_pack_begin.h"
1807 struct {
1808    uint32               width;
1809    uint32               height;
1810    uint32               depth;
1811 }
1812 #include "vmware_pack_end.h"
1813 SVGA3dSize;
1814 
1815 /*
1816  * Guest-backed objects definitions.
1817  */
1818 typedef enum {
1819    SVGA_OTABLE_MOB             = 0,
1820    SVGA_OTABLE_MIN             = 0,
1821    SVGA_OTABLE_SURFACE         = 1,
1822    SVGA_OTABLE_CONTEXT         = 2,
1823    SVGA_OTABLE_SHADER          = 3,
1824    SVGA_OTABLE_SCREENTARGET    = 4,
1825 
1826    SVGA_OTABLE_DX9_MAX         = 5,
1827 
1828    SVGA_OTABLE_DXCONTEXT       = 5,
1829    SVGA_OTABLE_DX_MAX          = 6,
1830 
1831    SVGA_OTABLE_VADECODER       = 6,
1832    SVGA_OTABLE_VAPROCESSOR     = 7,
1833    SVGA_OTABLE_BUG_1952836_MAX = 8,
1834 
1835    /*
1836     * Additions to this table need to be tied to HW-version features and
1837     * checkpointed accordingly.  (See SVGACheckpointGuestBackedObjects.)
1838     */
1839    SVGA_OTABLE_DEVEL_MAX       = 8,
1840    SVGA_OTABLE_MAX             = 8
1841 } SVGAOTableType;
1842 
1843 /*
1844  * Deprecated.
1845  */
1846 #define SVGA_OTABLE_COUNT 4
1847 
1848 typedef enum {
1849    SVGA_COTABLE_MIN             = 0,
1850    SVGA_COTABLE_RTVIEW          = 0,
1851    SVGA_COTABLE_DSVIEW          = 1,
1852    SVGA_COTABLE_SRVIEW          = 2,
1853    SVGA_COTABLE_ELEMENTLAYOUT   = 3,
1854    SVGA_COTABLE_BLENDSTATE      = 4,
1855    SVGA_COTABLE_DEPTHSTENCIL    = 5,
1856    SVGA_COTABLE_RASTERIZERSTATE = 6,
1857    SVGA_COTABLE_SAMPLER         = 7,
1858    SVGA_COTABLE_STREAMOUTPUT    = 8,
1859    SVGA_COTABLE_DXQUERY         = 9,
1860    SVGA_COTABLE_DXSHADER        = 10,
1861    SVGA_COTABLE_DX10_MAX        = 11,
1862    SVGA_COTABLE_UAVIEW          = 11,
1863    SVGA_COTABLE_MAX
1864 } SVGACOTableType;
1865 
1866 /*
1867  * The largest size (number of entries) allowed in a COTable.
1868  */
1869 #define SVGA_COTABLE_MAX_IDS (MAX_UINT16 - 2)
1870 
1871 typedef enum SVGAMobFormat {
1872    SVGA3D_MOBFMT_INVALID     = SVGA3D_INVALID_ID,
1873    SVGA3D_MOBFMT_PTDEPTH_0   = 0,
1874    SVGA3D_MOBFMT_MIN         = 0,
1875    SVGA3D_MOBFMT_PTDEPTH_1   = 1,
1876    SVGA3D_MOBFMT_PTDEPTH_2   = 2,
1877    SVGA3D_MOBFMT_RANGE       = 3,
1878    SVGA3D_MOBFMT_PTDEPTH64_0 = 4,
1879    SVGA3D_MOBFMT_PTDEPTH64_1 = 5,
1880    SVGA3D_MOBFMT_PTDEPTH64_2 = 6,
1881    SVGA3D_MOBFMT_PREDX_MAX   = 7,
1882    SVGA3D_MOBFMT_EMPTY       = 7,
1883    SVGA3D_MOBFMT_MAX,
1884 } SVGAMobFormat;
1885 
1886 #define SVGA3D_MOB_EMPTY_BASE 1
1887 
1888 /*
1889  * Multisample pattern types.
1890  */
1891 
1892 typedef enum SVGA3dMSPattern {
1893    SVGA3D_MS_PATTERN_NONE     = 0,
1894    SVGA3D_MS_PATTERN_MIN      = 0,
1895    SVGA3D_MS_PATTERN_STANDARD = 1,
1896    SVGA3D_MS_PATTERN_CENTER   = 2,
1897    SVGA3D_MS_PATTERN_MAX      = 3,
1898 } SVGA3dMSPattern;
1899 
1900 /*
1901  * Precision settings for each sample.
1902  */
1903 
1904 typedef enum SVGA3dMSQualityLevel {
1905    SVGA3D_MS_QUALITY_NONE = 0,
1906    SVGA3D_MS_QUALITY_MIN  = 0,
1907    SVGA3D_MS_QUALITY_FULL = 1,
1908    SVGA3D_MS_QUALITY_MAX  = 2,
1909 } SVGA3dMSQualityLevel;
1910 
1911 #endif // _SVGA3D_TYPES_H_
1912