1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32#ifndef _SVGA3D_REG_H_
33#define _SVGA3D_REG_H_
34
35#include "svga_reg.h"
36
37
38
39
40
41
42
43
44
45
46
47
48
49#define SVGA3D_MAKE_HWVERSION(major, minor) (((major) << 16) | ((minor) & 0xFF))
50#define SVGA3D_MAJOR_HWVERSION(version) ((version) >> 16)
51#define SVGA3D_MINOR_HWVERSION(version) ((version) & 0xFF)
52
53typedef enum {
54 SVGA3D_HWVERSION_WS5_RC1 = SVGA3D_MAKE_HWVERSION(0, 1),
55 SVGA3D_HWVERSION_WS5_RC2 = SVGA3D_MAKE_HWVERSION(0, 2),
56 SVGA3D_HWVERSION_WS51_RC1 = SVGA3D_MAKE_HWVERSION(0, 3),
57 SVGA3D_HWVERSION_WS6_B1 = SVGA3D_MAKE_HWVERSION(1, 1),
58 SVGA3D_HWVERSION_FUSION_11 = SVGA3D_MAKE_HWVERSION(1, 4),
59 SVGA3D_HWVERSION_WS65_B1 = SVGA3D_MAKE_HWVERSION(2, 0),
60 SVGA3D_HWVERSION_WS8_B1 = SVGA3D_MAKE_HWVERSION(2, 1),
61 SVGA3D_HWVERSION_CURRENT = SVGA3D_HWVERSION_WS8_B1,
62} SVGA3dHardwareVersion;
63
64
65
66
67
68typedef uint32 SVGA3dBool;
69#define SVGA3D_NUM_CLIPPLANES 6
70#define SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS 8
71#define SVGA3D_MAX_CONTEXT_IDS 256
72#define SVGA3D_MAX_SURFACE_IDS (32 * 1024)
73
74
75
76
77
78
79
80
81
82
83typedef enum SVGA3dSurfaceFormat {
84 SVGA3D_FORMAT_INVALID = 0,
85
86 SVGA3D_X8R8G8B8 = 1,
87 SVGA3D_A8R8G8B8 = 2,
88
89 SVGA3D_R5G6B5 = 3,
90 SVGA3D_X1R5G5B5 = 4,
91 SVGA3D_A1R5G5B5 = 5,
92 SVGA3D_A4R4G4B4 = 6,
93
94 SVGA3D_Z_D32 = 7,
95 SVGA3D_Z_D16 = 8,
96 SVGA3D_Z_D24S8 = 9,
97 SVGA3D_Z_D15S1 = 10,
98
99 SVGA3D_LUMINANCE8 = 11,
100 SVGA3D_LUMINANCE4_ALPHA4 = 12,
101 SVGA3D_LUMINANCE16 = 13,
102 SVGA3D_LUMINANCE8_ALPHA8 = 14,
103
104 SVGA3D_DXT1 = 15,
105 SVGA3D_DXT2 = 16,
106 SVGA3D_DXT3 = 17,
107 SVGA3D_DXT4 = 18,
108 SVGA3D_DXT5 = 19,
109
110 SVGA3D_BUMPU8V8 = 20,
111 SVGA3D_BUMPL6V5U5 = 21,
112 SVGA3D_BUMPX8L8V8U8 = 22,
113 SVGA3D_BUMPL8V8U8 = 23,
114
115 SVGA3D_ARGB_S10E5 = 24,
116 SVGA3D_ARGB_S23E8 = 25,
117
118 SVGA3D_A2R10G10B10 = 26,
119
120
121 SVGA3D_V8U8 = 27,
122 SVGA3D_Q8W8V8U8 = 28,
123 SVGA3D_CxV8U8 = 29,
124
125
126 SVGA3D_X8L8V8U8 = 30,
127 SVGA3D_A2W10V10U10 = 31,
128
129 SVGA3D_ALPHA8 = 32,
130
131
132 SVGA3D_R_S10E5 = 33,
133 SVGA3D_R_S23E8 = 34,
134 SVGA3D_RG_S10E5 = 35,
135 SVGA3D_RG_S23E8 = 36,
136
137
138
139
140
141
142
143 SVGA3D_BUFFER = 37,
144
145 SVGA3D_Z_D24X8 = 38,
146
147 SVGA3D_V16U16 = 39,
148
149 SVGA3D_G16R16 = 40,
150 SVGA3D_A16B16G16R16 = 41,
151
152
153 SVGA3D_UYVY = 42,
154 SVGA3D_YUY2 = 43,
155
156
157 SVGA3D_NV12 = 44,
158
159
160 SVGA3D_AYUV = 45,
161
162 SVGA3D_BC4_UNORM = 108,
163 SVGA3D_BC5_UNORM = 111,
164
165
166 SVGA3D_Z_DF16 = 118,
167 SVGA3D_Z_DF24 = 119,
168 SVGA3D_Z_D24S8_INT = 120,
169
170 SVGA3D_FORMAT_MAX
171} SVGA3dSurfaceFormat;
172
173typedef uint32 SVGA3dColor;
174
175
176
177
178
179
180
181typedef enum {
182 SVGA3DFORMAT_OP_TEXTURE = 0x00000001,
183 SVGA3DFORMAT_OP_VOLUMETEXTURE = 0x00000002,
184 SVGA3DFORMAT_OP_CUBETEXTURE = 0x00000004,
185 SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET = 0x00000008,
186 SVGA3DFORMAT_OP_SAME_FORMAT_RENDERTARGET = 0x00000010,
187 SVGA3DFORMAT_OP_ZSTENCIL = 0x00000040,
188 SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH = 0x00000080,
189
190
191
192
193
194
195
196 SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET = 0x00000100,
197
198
199
200
201
202 SVGA3DFORMAT_OP_DISPLAYMODE = 0x00000400,
203
204
205
206
207
208
209
210 SVGA3DFORMAT_OP_3DACCELERATION = 0x00000800,
211
212
213
214
215
216 SVGA3DFORMAT_OP_PIXELSIZE = 0x00001000,
217
218
219
220
221
222 SVGA3DFORMAT_OP_CONVERT_TO_ARGB = 0x00002000,
223
224
225
226
227 SVGA3DFORMAT_OP_OFFSCREENPLAIN = 0x00004000,
228
229
230
231
232
233 SVGA3DFORMAT_OP_SRGBREAD = 0x00008000,
234
235
236
237
238 SVGA3DFORMAT_OP_BUMPMAP = 0x00010000,
239
240
241
242
243 SVGA3DFORMAT_OP_DMAP = 0x00020000,
244
245
246
247
248 SVGA3DFORMAT_OP_NOFILTER = 0x00040000,
249
250
251
252
253
254 SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB = 0x00080000,
255
256
257
258
259
260 SVGA3DFORMAT_OP_SRGBWRITE = 0x00100000,
261
262
263
264
265 SVGA3DFORMAT_OP_NOALPHABLEND = 0x00200000,
266
267
268
269
270
271 SVGA3DFORMAT_OP_AUTOGENMIPMAP = 0x00400000,
272
273
274
275
276 SVGA3DFORMAT_OP_VERTEXTEXTURE = 0x00800000,
277
278
279
280
281
282 SVGA3DFORMAT_OP_NOTEXCOORDWRAPNORMIP = 0x01000000
283} SVGA3dFormatOp;
284
285
286
287
288
289typedef union {
290 uint32 value;
291 struct {
292 uint32 texture : 1;
293 uint32 volumeTexture : 1;
294 uint32 cubeTexture : 1;
295 uint32 offscreenRenderTarget : 1;
296 uint32 sameFormatRenderTarget : 1;
297 uint32 unknown1 : 1;
298 uint32 zStencil : 1;
299 uint32 zStencilArbitraryDepth : 1;
300 uint32 sameFormatUpToAlpha : 1;
301 uint32 unknown2 : 1;
302 uint32 displayMode : 1;
303 uint32 acceleration3d : 1;
304 uint32 pixelSize : 1;
305 uint32 convertToARGB : 1;
306 uint32 offscreenPlain : 1;
307 uint32 sRGBRead : 1;
308 uint32 bumpMap : 1;
309 uint32 dmap : 1;
310 uint32 noFilter : 1;
311 uint32 memberOfGroupARGB : 1;
312 uint32 sRGBWrite : 1;
313 uint32 noAlphaBlend : 1;
314 uint32 autoGenMipMap : 1;
315 uint32 vertexTexture : 1;
316 uint32 noTexCoordWrapNorMip : 1;
317 };
318} SVGA3dSurfaceFormatCaps;
319
320
321
322
323
324
325typedef enum {
326 SVGA3D_RS_INVALID = 0,
327 SVGA3D_RS_ZENABLE = 1,
328 SVGA3D_RS_ZWRITEENABLE = 2,
329 SVGA3D_RS_ALPHATESTENABLE = 3,
330 SVGA3D_RS_DITHERENABLE = 4,
331 SVGA3D_RS_BLENDENABLE = 5,
332 SVGA3D_RS_FOGENABLE = 6,
333 SVGA3D_RS_SPECULARENABLE = 7,
334 SVGA3D_RS_STENCILENABLE = 8,
335 SVGA3D_RS_LIGHTINGENABLE = 9,
336 SVGA3D_RS_NORMALIZENORMALS = 10,
337 SVGA3D_RS_POINTSPRITEENABLE = 11,
338 SVGA3D_RS_POINTSCALEENABLE = 12,
339 SVGA3D_RS_STENCILREF = 13,
340 SVGA3D_RS_STENCILMASK = 14,
341 SVGA3D_RS_STENCILWRITEMASK = 15,
342 SVGA3D_RS_FOGSTART = 16,
343 SVGA3D_RS_FOGEND = 17,
344 SVGA3D_RS_FOGDENSITY = 18,
345 SVGA3D_RS_POINTSIZE = 19,
346 SVGA3D_RS_POINTSIZEMIN = 20,
347 SVGA3D_RS_POINTSIZEMAX = 21,
348 SVGA3D_RS_POINTSCALE_A = 22,
349 SVGA3D_RS_POINTSCALE_B = 23,
350 SVGA3D_RS_POINTSCALE_C = 24,
351 SVGA3D_RS_FOGCOLOR = 25,
352 SVGA3D_RS_AMBIENT = 26,
353 SVGA3D_RS_CLIPPLANEENABLE = 27,
354 SVGA3D_RS_FOGMODE = 28,
355 SVGA3D_RS_FILLMODE = 29,
356 SVGA3D_RS_SHADEMODE = 30,
357 SVGA3D_RS_LINEPATTERN = 31,
358 SVGA3D_RS_SRCBLEND = 32,
359 SVGA3D_RS_DSTBLEND = 33,
360 SVGA3D_RS_BLENDEQUATION = 34,
361 SVGA3D_RS_CULLMODE = 35,
362 SVGA3D_RS_ZFUNC = 36,
363 SVGA3D_RS_ALPHAFUNC = 37,
364 SVGA3D_RS_STENCILFUNC = 38,
365 SVGA3D_RS_STENCILFAIL = 39,
366 SVGA3D_RS_STENCILZFAIL = 40,
367 SVGA3D_RS_STENCILPASS = 41,
368 SVGA3D_RS_ALPHAREF = 42,
369 SVGA3D_RS_FRONTWINDING = 43,
370 SVGA3D_RS_COORDINATETYPE = 44,
371 SVGA3D_RS_ZBIAS = 45,
372 SVGA3D_RS_RANGEFOGENABLE = 46,
373 SVGA3D_RS_COLORWRITEENABLE = 47,
374 SVGA3D_RS_VERTEXMATERIALENABLE = 48,
375 SVGA3D_RS_DIFFUSEMATERIALSOURCE = 49,
376 SVGA3D_RS_SPECULARMATERIALSOURCE = 50,
377 SVGA3D_RS_AMBIENTMATERIALSOURCE = 51,
378 SVGA3D_RS_EMISSIVEMATERIALSOURCE = 52,
379 SVGA3D_RS_TEXTUREFACTOR = 53,
380 SVGA3D_RS_LOCALVIEWER = 54,
381 SVGA3D_RS_SCISSORTESTENABLE = 55,
382 SVGA3D_RS_BLENDCOLOR = 56,
383 SVGA3D_RS_STENCILENABLE2SIDED = 57,
384 SVGA3D_RS_CCWSTENCILFUNC = 58,
385 SVGA3D_RS_CCWSTENCILFAIL = 59,
386 SVGA3D_RS_CCWSTENCILZFAIL = 60,
387 SVGA3D_RS_CCWSTENCILPASS = 61,
388 SVGA3D_RS_VERTEXBLEND = 62,
389 SVGA3D_RS_SLOPESCALEDEPTHBIAS = 63,
390 SVGA3D_RS_DEPTHBIAS = 64,
391
392
393
394
395
396
397
398
399
400
401
402 SVGA3D_RS_OUTPUTGAMMA = 65,
403 SVGA3D_RS_ZVISIBLE = 66,
404 SVGA3D_RS_LASTPIXEL = 67,
405 SVGA3D_RS_CLIPPING = 68,
406 SVGA3D_RS_WRAP0 = 69,
407 SVGA3D_RS_WRAP1 = 70,
408 SVGA3D_RS_WRAP2 = 71,
409 SVGA3D_RS_WRAP3 = 72,
410 SVGA3D_RS_WRAP4 = 73,
411 SVGA3D_RS_WRAP5 = 74,
412 SVGA3D_RS_WRAP6 = 75,
413 SVGA3D_RS_WRAP7 = 76,
414 SVGA3D_RS_WRAP8 = 77,
415 SVGA3D_RS_WRAP9 = 78,
416 SVGA3D_RS_WRAP10 = 79,
417 SVGA3D_RS_WRAP11 = 80,
418 SVGA3D_RS_WRAP12 = 81,
419 SVGA3D_RS_WRAP13 = 82,
420 SVGA3D_RS_WRAP14 = 83,
421 SVGA3D_RS_WRAP15 = 84,
422 SVGA3D_RS_MULTISAMPLEANTIALIAS = 85,
423 SVGA3D_RS_MULTISAMPLEMASK = 86,
424 SVGA3D_RS_INDEXEDVERTEXBLENDENABLE = 87,
425 SVGA3D_RS_TWEENFACTOR = 88,
426 SVGA3D_RS_ANTIALIASEDLINEENABLE = 89,
427 SVGA3D_RS_COLORWRITEENABLE1 = 90,
428 SVGA3D_RS_COLORWRITEENABLE2 = 91,
429 SVGA3D_RS_COLORWRITEENABLE3 = 92,
430 SVGA3D_RS_SEPARATEALPHABLENDENABLE = 93,
431 SVGA3D_RS_SRCBLENDALPHA = 94,
432 SVGA3D_RS_DSTBLENDALPHA = 95,
433 SVGA3D_RS_BLENDEQUATIONALPHA = 96,
434 SVGA3D_RS_TRANSPARENCYANTIALIAS = 97,
435 SVGA3D_RS_LINEAA = 98,
436 SVGA3D_RS_LINEWIDTH = 99,
437 SVGA3D_RS_MAX
438} SVGA3dRenderStateName;
439
440typedef enum {
441 SVGA3D_TRANSPARENCYANTIALIAS_NORMAL = 0,
442 SVGA3D_TRANSPARENCYANTIALIAS_ALPHATOCOVERAGE = 1,
443 SVGA3D_TRANSPARENCYANTIALIAS_SUPERSAMPLE = 2,
444 SVGA3D_TRANSPARENCYANTIALIAS_MAX
445} SVGA3dTransparencyAntialiasType;
446
447typedef enum {
448 SVGA3D_VERTEXMATERIAL_NONE = 0,
449 SVGA3D_VERTEXMATERIAL_DIFFUSE = 1,
450 SVGA3D_VERTEXMATERIAL_SPECULAR = 2,
451} SVGA3dVertexMaterial;
452
453typedef enum {
454 SVGA3D_FILLMODE_INVALID = 0,
455 SVGA3D_FILLMODE_POINT = 1,
456 SVGA3D_FILLMODE_LINE = 2,
457 SVGA3D_FILLMODE_FILL = 3,
458 SVGA3D_FILLMODE_MAX
459} SVGA3dFillModeType;
460
461
462typedef
463union {
464 struct {
465 uint16 mode;
466 uint16 face;
467 };
468 uint32 uintValue;
469} SVGA3dFillMode;
470
471typedef enum {
472 SVGA3D_SHADEMODE_INVALID = 0,
473 SVGA3D_SHADEMODE_FLAT = 1,
474 SVGA3D_SHADEMODE_SMOOTH = 2,
475 SVGA3D_SHADEMODE_PHONG = 3,
476 SVGA3D_SHADEMODE_MAX
477} SVGA3dShadeMode;
478
479typedef
480union {
481 struct {
482 uint16 repeat;
483 uint16 pattern;
484 };
485 uint32 uintValue;
486} SVGA3dLinePattern;
487
488typedef enum {
489 SVGA3D_BLENDOP_INVALID = 0,
490 SVGA3D_BLENDOP_ZERO = 1,
491 SVGA3D_BLENDOP_ONE = 2,
492 SVGA3D_BLENDOP_SRCCOLOR = 3,
493 SVGA3D_BLENDOP_INVSRCCOLOR = 4,
494 SVGA3D_BLENDOP_SRCALPHA = 5,
495 SVGA3D_BLENDOP_INVSRCALPHA = 6,
496 SVGA3D_BLENDOP_DESTALPHA = 7,
497 SVGA3D_BLENDOP_INVDESTALPHA = 8,
498 SVGA3D_BLENDOP_DESTCOLOR = 9,
499 SVGA3D_BLENDOP_INVDESTCOLOR = 10,
500 SVGA3D_BLENDOP_SRCALPHASAT = 11,
501 SVGA3D_BLENDOP_BLENDFACTOR = 12,
502 SVGA3D_BLENDOP_INVBLENDFACTOR = 13,
503 SVGA3D_BLENDOP_MAX
504} SVGA3dBlendOp;
505
506typedef enum {
507 SVGA3D_BLENDEQ_INVALID = 0,
508 SVGA3D_BLENDEQ_ADD = 1,
509 SVGA3D_BLENDEQ_SUBTRACT = 2,
510 SVGA3D_BLENDEQ_REVSUBTRACT = 3,
511 SVGA3D_BLENDEQ_MINIMUM = 4,
512 SVGA3D_BLENDEQ_MAXIMUM = 5,
513 SVGA3D_BLENDEQ_MAX
514} SVGA3dBlendEquation;
515
516typedef enum {
517 SVGA3D_FRONTWINDING_INVALID = 0,
518 SVGA3D_FRONTWINDING_CW = 1,
519 SVGA3D_FRONTWINDING_CCW = 2,
520 SVGA3D_FRONTWINDING_MAX
521} SVGA3dFrontWinding;
522
523typedef enum {
524 SVGA3D_FACE_INVALID = 0,
525 SVGA3D_FACE_NONE = 1,
526 SVGA3D_FACE_FRONT = 2,
527 SVGA3D_FACE_BACK = 3,
528 SVGA3D_FACE_FRONT_BACK = 4,
529 SVGA3D_FACE_MAX
530} SVGA3dFace;
531
532
533
534
535
536typedef enum {
537 SVGA3D_CMP_INVALID = 0,
538 SVGA3D_CMP_NEVER = 1,
539 SVGA3D_CMP_LESS = 2,
540 SVGA3D_CMP_EQUAL = 3,
541 SVGA3D_CMP_LESSEQUAL = 4,
542 SVGA3D_CMP_GREATER = 5,
543 SVGA3D_CMP_NOTEQUAL = 6,
544 SVGA3D_CMP_GREATEREQUAL = 7,
545 SVGA3D_CMP_ALWAYS = 8,
546 SVGA3D_CMP_MAX
547} SVGA3dCmpFunc;
548
549
550
551
552
553
554typedef enum {
555 SVGA3D_FOGFUNC_INVALID = 0,
556 SVGA3D_FOGFUNC_EXP = 1,
557 SVGA3D_FOGFUNC_EXP2 = 2,
558 SVGA3D_FOGFUNC_LINEAR = 3,
559 SVGA3D_FOGFUNC_PER_VERTEX = 4
560} SVGA3dFogFunction;
561
562
563
564
565
566typedef enum {
567 SVGA3D_FOGTYPE_INVALID = 0,
568 SVGA3D_FOGTYPE_VERTEX = 1,
569 SVGA3D_FOGTYPE_PIXEL = 2,
570 SVGA3D_FOGTYPE_MAX = 3
571} SVGA3dFogType;
572
573
574
575
576
577
578typedef enum {
579 SVGA3D_FOGBASE_INVALID = 0,
580 SVGA3D_FOGBASE_DEPTHBASED = 1,
581 SVGA3D_FOGBASE_RANGEBASED = 2,
582 SVGA3D_FOGBASE_MAX = 3
583} SVGA3dFogBase;
584
585typedef enum {
586 SVGA3D_STENCILOP_INVALID = 0,
587 SVGA3D_STENCILOP_KEEP = 1,
588 SVGA3D_STENCILOP_ZERO = 2,
589 SVGA3D_STENCILOP_REPLACE = 3,
590 SVGA3D_STENCILOP_INCRSAT = 4,
591 SVGA3D_STENCILOP_DECRSAT = 5,
592 SVGA3D_STENCILOP_INVERT = 6,
593 SVGA3D_STENCILOP_INCR = 7,
594 SVGA3D_STENCILOP_DECR = 8,
595 SVGA3D_STENCILOP_MAX
596} SVGA3dStencilOp;
597
598typedef enum {
599 SVGA3D_CLIPPLANE_0 = (1 << 0),
600 SVGA3D_CLIPPLANE_1 = (1 << 1),
601 SVGA3D_CLIPPLANE_2 = (1 << 2),
602 SVGA3D_CLIPPLANE_3 = (1 << 3),
603 SVGA3D_CLIPPLANE_4 = (1 << 4),
604 SVGA3D_CLIPPLANE_5 = (1 << 5),
605} SVGA3dClipPlanes;
606
607typedef enum {
608 SVGA3D_CLEAR_COLOR = 0x1,
609 SVGA3D_CLEAR_DEPTH = 0x2,
610 SVGA3D_CLEAR_STENCIL = 0x4
611} SVGA3dClearFlag;
612
613typedef enum {
614 SVGA3D_RT_DEPTH = 0,
615 SVGA3D_RT_STENCIL = 1,
616 SVGA3D_RT_COLOR0 = 2,
617 SVGA3D_RT_COLOR1 = 3,
618 SVGA3D_RT_COLOR2 = 4,
619 SVGA3D_RT_COLOR3 = 5,
620 SVGA3D_RT_COLOR4 = 6,
621 SVGA3D_RT_COLOR5 = 7,
622 SVGA3D_RT_COLOR6 = 8,
623 SVGA3D_RT_COLOR7 = 9,
624 SVGA3D_RT_MAX,
625 SVGA3D_RT_INVALID = ((uint32)-1),
626} SVGA3dRenderTargetType;
627
628#define SVGA3D_MAX_RT_COLOR (SVGA3D_RT_COLOR7 - SVGA3D_RT_COLOR0 + 1)
629
630typedef
631union {
632 struct {
633 uint32 red : 1;
634 uint32 green : 1;
635 uint32 blue : 1;
636 uint32 alpha : 1;
637 };
638 uint32 uintValue;
639} SVGA3dColorMask;
640
641typedef enum {
642 SVGA3D_VBLEND_DISABLE = 0,
643 SVGA3D_VBLEND_1WEIGHT = 1,
644 SVGA3D_VBLEND_2WEIGHT = 2,
645 SVGA3D_VBLEND_3WEIGHT = 3,
646} SVGA3dVertexBlendFlags;
647
648typedef enum {
649 SVGA3D_WRAPCOORD_0 = 1 << 0,
650 SVGA3D_WRAPCOORD_1 = 1 << 1,
651 SVGA3D_WRAPCOORD_2 = 1 << 2,
652 SVGA3D_WRAPCOORD_3 = 1 << 3,
653 SVGA3D_WRAPCOORD_ALL = 0xF,
654} SVGA3dWrapFlags;
655
656
657
658
659
660
661typedef enum {
662 SVGA3D_TS_INVALID = 0,
663 SVGA3D_TS_BIND_TEXTURE = 1,
664 SVGA3D_TS_COLOROP = 2,
665 SVGA3D_TS_COLORARG1 = 3,
666 SVGA3D_TS_COLORARG2 = 4,
667 SVGA3D_TS_ALPHAOP = 5,
668 SVGA3D_TS_ALPHAARG1 = 6,
669 SVGA3D_TS_ALPHAARG2 = 7,
670 SVGA3D_TS_ADDRESSU = 8,
671 SVGA3D_TS_ADDRESSV = 9,
672 SVGA3D_TS_MIPFILTER = 10,
673 SVGA3D_TS_MAGFILTER = 11,
674 SVGA3D_TS_MINFILTER = 12,
675 SVGA3D_TS_BORDERCOLOR = 13,
676 SVGA3D_TS_TEXCOORDINDEX = 14,
677 SVGA3D_TS_TEXTURETRANSFORMFLAGS = 15,
678 SVGA3D_TS_TEXCOORDGEN = 16,
679 SVGA3D_TS_BUMPENVMAT00 = 17,
680 SVGA3D_TS_BUMPENVMAT01 = 18,
681 SVGA3D_TS_BUMPENVMAT10 = 19,
682 SVGA3D_TS_BUMPENVMAT11 = 20,
683 SVGA3D_TS_TEXTURE_MIPMAP_LEVEL = 21,
684 SVGA3D_TS_TEXTURE_LOD_BIAS = 22,
685 SVGA3D_TS_TEXTURE_ANISOTROPIC_LEVEL = 23,
686 SVGA3D_TS_ADDRESSW = 24,
687
688
689
690
691
692
693
694
695
696
697 SVGA3D_TS_GAMMA = 25,
698 SVGA3D_TS_BUMPENVLSCALE = 26,
699 SVGA3D_TS_BUMPENVLOFFSET = 27,
700 SVGA3D_TS_COLORARG0 = 28,
701 SVGA3D_TS_ALPHAARG0 = 29,
702 SVGA3D_TS_MAX
703} SVGA3dTextureStateName;
704
705typedef enum {
706 SVGA3D_TC_INVALID = 0,
707 SVGA3D_TC_DISABLE = 1,
708 SVGA3D_TC_SELECTARG1 = 2,
709 SVGA3D_TC_SELECTARG2 = 3,
710 SVGA3D_TC_MODULATE = 4,
711 SVGA3D_TC_ADD = 5,
712 SVGA3D_TC_ADDSIGNED = 6,
713 SVGA3D_TC_SUBTRACT = 7,
714 SVGA3D_TC_BLENDTEXTUREALPHA = 8,
715 SVGA3D_TC_BLENDDIFFUSEALPHA = 9,
716 SVGA3D_TC_BLENDCURRENTALPHA = 10,
717 SVGA3D_TC_BLENDFACTORALPHA = 11,
718 SVGA3D_TC_MODULATE2X = 12,
719 SVGA3D_TC_MODULATE4X = 13,
720 SVGA3D_TC_DSDT = 14,
721 SVGA3D_TC_DOTPRODUCT3 = 15,
722 SVGA3D_TC_BLENDTEXTUREALPHAPM = 16,
723 SVGA3D_TC_ADDSIGNED2X = 17,
724 SVGA3D_TC_ADDSMOOTH = 18,
725 SVGA3D_TC_PREMODULATE = 19,
726 SVGA3D_TC_MODULATEALPHA_ADDCOLOR = 20,
727 SVGA3D_TC_MODULATECOLOR_ADDALPHA = 21,
728 SVGA3D_TC_MODULATEINVALPHA_ADDCOLOR = 22,
729 SVGA3D_TC_MODULATEINVCOLOR_ADDALPHA = 23,
730 SVGA3D_TC_BUMPENVMAPLUMINANCE = 24,
731 SVGA3D_TC_MULTIPLYADD = 25,
732 SVGA3D_TC_LERP = 26,
733 SVGA3D_TC_MAX
734} SVGA3dTextureCombiner;
735
736#define SVGA3D_TC_CAP_BIT(svga3d_tc_op) (svga3d_tc_op ? (1 << (svga3d_tc_op - 1)) : 0)
737
738typedef enum {
739 SVGA3D_TEX_ADDRESS_INVALID = 0,
740 SVGA3D_TEX_ADDRESS_WRAP = 1,
741 SVGA3D_TEX_ADDRESS_MIRROR = 2,
742 SVGA3D_TEX_ADDRESS_CLAMP = 3,
743 SVGA3D_TEX_ADDRESS_BORDER = 4,
744 SVGA3D_TEX_ADDRESS_MIRRORONCE = 5,
745 SVGA3D_TEX_ADDRESS_EDGE = 6,
746 SVGA3D_TEX_ADDRESS_MAX
747} SVGA3dTextureAddress;
748
749
750
751
752
753typedef enum {
754 SVGA3D_TEX_FILTER_NONE = 0,
755 SVGA3D_TEX_FILTER_NEAREST = 1,
756 SVGA3D_TEX_FILTER_LINEAR = 2,
757 SVGA3D_TEX_FILTER_ANISOTROPIC = 3,
758 SVGA3D_TEX_FILTER_FLATCUBIC = 4,
759 SVGA3D_TEX_FILTER_GAUSSIANCUBIC = 5,
760 SVGA3D_TEX_FILTER_PYRAMIDALQUAD = 6,
761 SVGA3D_TEX_FILTER_GAUSSIANQUAD = 7,
762 SVGA3D_TEX_FILTER_MAX
763} SVGA3dTextureFilter;
764
765typedef enum {
766 SVGA3D_TEX_TRANSFORM_OFF = 0,
767 SVGA3D_TEX_TRANSFORM_S = (1 << 0),
768 SVGA3D_TEX_TRANSFORM_T = (1 << 1),
769 SVGA3D_TEX_TRANSFORM_R = (1 << 2),
770 SVGA3D_TEX_TRANSFORM_Q = (1 << 3),
771 SVGA3D_TEX_PROJECTED = (1 << 15),
772} SVGA3dTexTransformFlags;
773
774typedef enum {
775 SVGA3D_TEXCOORD_GEN_OFF = 0,
776 SVGA3D_TEXCOORD_GEN_EYE_POSITION = 1,
777 SVGA3D_TEXCOORD_GEN_EYE_NORMAL = 2,
778 SVGA3D_TEXCOORD_GEN_REFLECTIONVECTOR = 3,
779 SVGA3D_TEXCOORD_GEN_SPHERE = 4,
780 SVGA3D_TEXCOORD_GEN_MAX
781} SVGA3dTextureCoordGen;
782
783
784
785
786typedef enum {
787 SVGA3D_TA_INVALID = 0,
788 SVGA3D_TA_CONSTANT = 1,
789 SVGA3D_TA_PREVIOUS = 2,
790 SVGA3D_TA_DIFFUSE = 3,
791 SVGA3D_TA_TEXTURE = 4,
792 SVGA3D_TA_SPECULAR = 5,
793 SVGA3D_TA_MAX
794} SVGA3dTextureArgData;
795
796#define SVGA3D_TM_MASK_LEN 4
797
798
799typedef enum {
800 SVGA3D_TM_NONE = 0,
801 SVGA3D_TM_ALPHA = (1 << SVGA3D_TM_MASK_LEN),
802 SVGA3D_TM_ONE_MINUS = (2 << SVGA3D_TM_MASK_LEN),
803} SVGA3dTextureArgModifier;
804
805#define SVGA3D_INVALID_ID ((uint32)-1)
806#define SVGA3D_MAX_CLIP_PLANES 6
807
808
809
810
811
812
813
814#define SVGA3D_MAX_TEXTURE_COORDS 8
815
816
817
818
819
820
821
822
823
824
825
826
827typedef enum {
828 SVGA3D_DECLUSAGE_POSITION = 0,
829 SVGA3D_DECLUSAGE_BLENDWEIGHT,
830 SVGA3D_DECLUSAGE_BLENDINDICES,
831 SVGA3D_DECLUSAGE_NORMAL,
832 SVGA3D_DECLUSAGE_PSIZE,
833 SVGA3D_DECLUSAGE_TEXCOORD,
834 SVGA3D_DECLUSAGE_TANGENT,
835 SVGA3D_DECLUSAGE_BINORMAL,
836 SVGA3D_DECLUSAGE_TESSFACTOR,
837 SVGA3D_DECLUSAGE_POSITIONT,
838 SVGA3D_DECLUSAGE_COLOR,
839 SVGA3D_DECLUSAGE_FOG,
840 SVGA3D_DECLUSAGE_DEPTH,
841 SVGA3D_DECLUSAGE_SAMPLE,
842 SVGA3D_DECLUSAGE_MAX
843} SVGA3dDeclUsage;
844
845typedef enum {
846 SVGA3D_DECLMETHOD_DEFAULT = 0,
847 SVGA3D_DECLMETHOD_PARTIALU,
848 SVGA3D_DECLMETHOD_PARTIALV,
849 SVGA3D_DECLMETHOD_CROSSUV,
850 SVGA3D_DECLMETHOD_UV,
851 SVGA3D_DECLMETHOD_LOOKUP,
852 SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED,
853} SVGA3dDeclMethod;
854
855typedef enum {
856 SVGA3D_DECLTYPE_FLOAT1 = 0,
857 SVGA3D_DECLTYPE_FLOAT2 = 1,
858 SVGA3D_DECLTYPE_FLOAT3 = 2,
859 SVGA3D_DECLTYPE_FLOAT4 = 3,
860 SVGA3D_DECLTYPE_D3DCOLOR = 4,
861 SVGA3D_DECLTYPE_UBYTE4 = 5,
862 SVGA3D_DECLTYPE_SHORT2 = 6,
863 SVGA3D_DECLTYPE_SHORT4 = 7,
864 SVGA3D_DECLTYPE_UBYTE4N = 8,
865 SVGA3D_DECLTYPE_SHORT2N = 9,
866 SVGA3D_DECLTYPE_SHORT4N = 10,
867 SVGA3D_DECLTYPE_USHORT2N = 11,
868 SVGA3D_DECLTYPE_USHORT4N = 12,
869 SVGA3D_DECLTYPE_UDEC3 = 13,
870 SVGA3D_DECLTYPE_DEC3N = 14,
871 SVGA3D_DECLTYPE_FLOAT16_2 = 15,
872 SVGA3D_DECLTYPE_FLOAT16_4 = 16,
873 SVGA3D_DECLTYPE_MAX,
874} SVGA3dDeclType;
875
876
877
878
879
880typedef union {
881 struct {
882
883
884
885
886
887 uint32 count : 30;
888
889
890
891
892
893 uint32 indexedData : 1;
894
895
896
897
898 uint32 instanceData : 1;
899 };
900
901 uint32 value;
902} SVGA3dVertexDivisor;
903
904typedef enum {
905 SVGA3D_PRIMITIVE_INVALID = 0,
906 SVGA3D_PRIMITIVE_TRIANGLELIST = 1,
907 SVGA3D_PRIMITIVE_POINTLIST = 2,
908 SVGA3D_PRIMITIVE_LINELIST = 3,
909 SVGA3D_PRIMITIVE_LINESTRIP = 4,
910 SVGA3D_PRIMITIVE_TRIANGLESTRIP = 5,
911 SVGA3D_PRIMITIVE_TRIANGLEFAN = 6,
912 SVGA3D_PRIMITIVE_MAX
913} SVGA3dPrimitiveType;
914
915typedef enum {
916 SVGA3D_COORDINATE_INVALID = 0,
917 SVGA3D_COORDINATE_LEFTHANDED = 1,
918 SVGA3D_COORDINATE_RIGHTHANDED = 2,
919 SVGA3D_COORDINATE_MAX
920} SVGA3dCoordinateType;
921
922typedef enum {
923 SVGA3D_TRANSFORM_INVALID = 0,
924 SVGA3D_TRANSFORM_WORLD = 1,
925 SVGA3D_TRANSFORM_VIEW = 2,
926 SVGA3D_TRANSFORM_PROJECTION = 3,
927 SVGA3D_TRANSFORM_TEXTURE0 = 4,
928 SVGA3D_TRANSFORM_TEXTURE1 = 5,
929 SVGA3D_TRANSFORM_TEXTURE2 = 6,
930 SVGA3D_TRANSFORM_TEXTURE3 = 7,
931 SVGA3D_TRANSFORM_TEXTURE4 = 8,
932 SVGA3D_TRANSFORM_TEXTURE5 = 9,
933 SVGA3D_TRANSFORM_TEXTURE6 = 10,
934 SVGA3D_TRANSFORM_TEXTURE7 = 11,
935 SVGA3D_TRANSFORM_WORLD1 = 12,
936 SVGA3D_TRANSFORM_WORLD2 = 13,
937 SVGA3D_TRANSFORM_WORLD3 = 14,
938 SVGA3D_TRANSFORM_MAX
939} SVGA3dTransformType;
940
941typedef enum {
942 SVGA3D_LIGHTTYPE_INVALID = 0,
943 SVGA3D_LIGHTTYPE_POINT = 1,
944 SVGA3D_LIGHTTYPE_SPOT1 = 2,
945 SVGA3D_LIGHTTYPE_SPOT2 = 3,
946 SVGA3D_LIGHTTYPE_DIRECTIONAL = 4,
947 SVGA3D_LIGHTTYPE_MAX
948} SVGA3dLightType;
949
950typedef enum {
951 SVGA3D_CUBEFACE_POSX = 0,
952 SVGA3D_CUBEFACE_NEGX = 1,
953 SVGA3D_CUBEFACE_POSY = 2,
954 SVGA3D_CUBEFACE_NEGY = 3,
955 SVGA3D_CUBEFACE_POSZ = 4,
956 SVGA3D_CUBEFACE_NEGZ = 5,
957} SVGA3dCubeFace;
958
959typedef enum {
960 SVGA3D_SHADERTYPE_VS = 1,
961 SVGA3D_SHADERTYPE_PS = 2,
962 SVGA3D_SHADERTYPE_MAX
963} SVGA3dShaderType;
964
965typedef enum {
966 SVGA3D_CONST_TYPE_FLOAT = 0,
967 SVGA3D_CONST_TYPE_INT = 1,
968 SVGA3D_CONST_TYPE_BOOL = 2,
969} SVGA3dShaderConstType;
970
971#define SVGA3D_MAX_SURFACE_FACES 6
972
973typedef enum {
974 SVGA3D_STRETCH_BLT_POINT = 0,
975 SVGA3D_STRETCH_BLT_LINEAR = 1,
976 SVGA3D_STRETCH_BLT_MAX
977} SVGA3dStretchBltMode;
978
979typedef enum {
980 SVGA3D_QUERYTYPE_OCCLUSION = 0,
981 SVGA3D_QUERYTYPE_MAX
982} SVGA3dQueryType;
983
984typedef enum {
985 SVGA3D_QUERYSTATE_PENDING = 0,
986 SVGA3D_QUERYSTATE_SUCCEEDED = 1,
987 SVGA3D_QUERYSTATE_FAILED = 2,
988 SVGA3D_QUERYSTATE_NEW = 3,
989} SVGA3dQueryState;
990
991typedef enum {
992 SVGA3D_WRITE_HOST_VRAM = 1,
993 SVGA3D_READ_HOST_VRAM = 2,
994} SVGA3dTransferType;
995
996
997
998
999
1000#define SVGA3D_MAX_VERTEX_ARRAYS 32
1001
1002
1003
1004
1005
1006#define SVGA3D_MAX_DRAW_PRIMITIVE_RANGES 32
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022#define SVGA_3D_CMD_LEGACY_BASE 1000
1023#define SVGA_3D_CMD_BASE 1040
1024
1025#define SVGA_3D_CMD_SURFACE_DEFINE SVGA_3D_CMD_BASE + 0
1026#define SVGA_3D_CMD_SURFACE_DESTROY SVGA_3D_CMD_BASE + 1
1027#define SVGA_3D_CMD_SURFACE_COPY SVGA_3D_CMD_BASE + 2
1028#define SVGA_3D_CMD_SURFACE_STRETCHBLT SVGA_3D_CMD_BASE + 3
1029#define SVGA_3D_CMD_SURFACE_DMA SVGA_3D_CMD_BASE + 4
1030#define SVGA_3D_CMD_CONTEXT_DEFINE SVGA_3D_CMD_BASE + 5
1031#define SVGA_3D_CMD_CONTEXT_DESTROY SVGA_3D_CMD_BASE + 6
1032#define SVGA_3D_CMD_SETTRANSFORM SVGA_3D_CMD_BASE + 7
1033#define SVGA_3D_CMD_SETZRANGE SVGA_3D_CMD_BASE + 8
1034#define SVGA_3D_CMD_SETRENDERSTATE SVGA_3D_CMD_BASE + 9
1035#define SVGA_3D_CMD_SETRENDERTARGET SVGA_3D_CMD_BASE + 10
1036#define SVGA_3D_CMD_SETTEXTURESTATE SVGA_3D_CMD_BASE + 11
1037#define SVGA_3D_CMD_SETMATERIAL SVGA_3D_CMD_BASE + 12
1038#define SVGA_3D_CMD_SETLIGHTDATA SVGA_3D_CMD_BASE + 13
1039#define SVGA_3D_CMD_SETLIGHTENABLED SVGA_3D_CMD_BASE + 14
1040#define SVGA_3D_CMD_SETVIEWPORT SVGA_3D_CMD_BASE + 15
1041#define SVGA_3D_CMD_SETCLIPPLANE SVGA_3D_CMD_BASE + 16
1042#define SVGA_3D_CMD_CLEAR SVGA_3D_CMD_BASE + 17
1043#define SVGA_3D_CMD_PRESENT SVGA_3D_CMD_BASE + 18
1044#define SVGA_3D_CMD_SHADER_DEFINE SVGA_3D_CMD_BASE + 19
1045#define SVGA_3D_CMD_SHADER_DESTROY SVGA_3D_CMD_BASE + 20
1046#define SVGA_3D_CMD_SET_SHADER SVGA_3D_CMD_BASE + 21
1047#define SVGA_3D_CMD_SET_SHADER_CONST SVGA_3D_CMD_BASE + 22
1048#define SVGA_3D_CMD_DRAW_PRIMITIVES SVGA_3D_CMD_BASE + 23
1049#define SVGA_3D_CMD_SETSCISSORRECT SVGA_3D_CMD_BASE + 24
1050#define SVGA_3D_CMD_BEGIN_QUERY SVGA_3D_CMD_BASE + 25
1051#define SVGA_3D_CMD_END_QUERY SVGA_3D_CMD_BASE + 26
1052#define SVGA_3D_CMD_WAIT_FOR_QUERY SVGA_3D_CMD_BASE + 27
1053#define SVGA_3D_CMD_PRESENT_READBACK SVGA_3D_CMD_BASE + 28
1054#define SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN SVGA_3D_CMD_BASE + 29
1055#define SVGA_3D_CMD_SURFACE_DEFINE_V2 SVGA_3D_CMD_BASE + 30
1056#define SVGA_3D_CMD_GENERATE_MIPMAPS SVGA_3D_CMD_BASE + 31
1057#define SVGA_3D_CMD_ACTIVATE_SURFACE SVGA_3D_CMD_BASE + 40
1058#define SVGA_3D_CMD_DEACTIVATE_SURFACE SVGA_3D_CMD_BASE + 41
1059#define SVGA_3D_CMD_MAX SVGA_3D_CMD_BASE + 42
1060
1061#define SVGA_3D_CMD_FUTURE_MAX 2000
1062
1063
1064
1065
1066
1067typedef struct {
1068 union {
1069 struct {
1070 uint16 function;
1071 uint8 type;
1072 uint8 base;
1073 };
1074 uint32 uintValue;
1075 };
1076} SVGA3dFogMode;
1077
1078
1079
1080
1081
1082
1083typedef
1084struct SVGA3dSurfaceImageId {
1085 uint32 sid;
1086 uint32 face;
1087 uint32 mipmap;
1088} SVGA3dSurfaceImageId;
1089
1090typedef
1091struct SVGA3dGuestImage {
1092 SVGAGuestPtr ptr;
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109 uint32 pitch;
1110} SVGA3dGuestImage;
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120typedef
1121struct {
1122 uint32 id;
1123 uint32 size;
1124} SVGA3dCmdHeader;
1125
1126
1127
1128
1129
1130
1131typedef
1132struct {
1133 uint32 width;
1134 uint32 height;
1135 uint32 depth;
1136} SVGA3dSize;
1137
1138typedef enum {
1139 SVGA3D_SURFACE_CUBEMAP = (1 << 0),
1140 SVGA3D_SURFACE_HINT_STATIC = (1 << 1),
1141 SVGA3D_SURFACE_HINT_DYNAMIC = (1 << 2),
1142 SVGA3D_SURFACE_HINT_INDEXBUFFER = (1 << 3),
1143 SVGA3D_SURFACE_HINT_VERTEXBUFFER = (1 << 4),
1144 SVGA3D_SURFACE_HINT_TEXTURE = (1 << 5),
1145 SVGA3D_SURFACE_HINT_RENDERTARGET = (1 << 6),
1146 SVGA3D_SURFACE_HINT_DEPTHSTENCIL = (1 << 7),
1147 SVGA3D_SURFACE_HINT_WRITEONLY = (1 << 8),
1148 SVGA3D_SURFACE_MASKABLE_ANTIALIAS = (1 << 9),
1149 SVGA3D_SURFACE_AUTOGENMIPMAPS = (1 << 10),
1150} SVGA3dSurfaceFlags;
1151
1152typedef
1153struct {
1154 uint32 numMipLevels;
1155} SVGA3dSurfaceFace;
1156
1157typedef
1158struct {
1159 uint32 sid;
1160 SVGA3dSurfaceFlags surfaceFlags;
1161 SVGA3dSurfaceFormat format;
1162
1163
1164
1165
1166
1167
1168 SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178} SVGA3dCmdDefineSurface;
1179
1180typedef
1181struct {
1182 uint32 sid;
1183 SVGA3dSurfaceFlags surfaceFlags;
1184 SVGA3dSurfaceFormat format;
1185
1186
1187
1188
1189
1190
1191 SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
1192 uint32 multisampleCount;
1193 SVGA3dTextureFilter autogenFilter;
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203} SVGA3dCmdDefineSurface_v2;
1204
1205typedef
1206struct {
1207 uint32 sid;
1208} SVGA3dCmdDestroySurface;
1209
1210typedef
1211struct {
1212 uint32 cid;
1213} SVGA3dCmdDefineContext;
1214
1215typedef
1216struct {
1217 uint32 cid;
1218} SVGA3dCmdDestroyContext;
1219
1220typedef
1221struct {
1222 uint32 cid;
1223 SVGA3dClearFlag clearFlag;
1224 uint32 color;
1225 float depth;
1226 uint32 stencil;
1227
1228} SVGA3dCmdClear;
1229
1230typedef
1231struct SVGA3dCopyRect {
1232 uint32 x;
1233 uint32 y;
1234 uint32 w;
1235 uint32 h;
1236 uint32 srcx;
1237 uint32 srcy;
1238} SVGA3dCopyRect;
1239
1240typedef
1241struct SVGA3dCopyBox {
1242 uint32 x;
1243 uint32 y;
1244 uint32 z;
1245 uint32 w;
1246 uint32 h;
1247 uint32 d;
1248 uint32 srcx;
1249 uint32 srcy;
1250 uint32 srcz;
1251} SVGA3dCopyBox;
1252
1253typedef
1254struct {
1255 uint32 x;
1256 uint32 y;
1257 uint32 w;
1258 uint32 h;
1259} SVGA3dRect;
1260
1261typedef
1262struct {
1263 uint32 x;
1264 uint32 y;
1265 uint32 z;
1266 uint32 w;
1267 uint32 h;
1268 uint32 d;
1269} SVGA3dBox;
1270
1271typedef
1272struct {
1273 uint32 x;
1274 uint32 y;
1275 uint32 z;
1276} SVGA3dPoint;
1277
1278typedef
1279struct {
1280 SVGA3dLightType type;
1281 SVGA3dBool inWorldSpace;
1282 float diffuse[4];
1283 float specular[4];
1284 float ambient[4];
1285 float position[4];
1286 float direction[4];
1287 float range;
1288 float falloff;
1289 float attenuation0;
1290 float attenuation1;
1291 float attenuation2;
1292 float theta;
1293 float phi;
1294} SVGA3dLightData;
1295
1296typedef
1297struct {
1298 uint32 sid;
1299
1300} SVGA3dCmdPresent;
1301
1302typedef
1303struct {
1304 SVGA3dRenderStateName state;
1305 union {
1306 uint32 uintValue;
1307 float floatValue;
1308 };
1309} SVGA3dRenderState;
1310
1311typedef
1312struct {
1313 uint32 cid;
1314
1315} SVGA3dCmdSetRenderState;
1316
1317typedef
1318struct {
1319 uint32 cid;
1320 SVGA3dRenderTargetType type;
1321 SVGA3dSurfaceImageId target;
1322} SVGA3dCmdSetRenderTarget;
1323
1324typedef
1325struct {
1326 SVGA3dSurfaceImageId src;
1327 SVGA3dSurfaceImageId dest;
1328
1329} SVGA3dCmdSurfaceCopy;
1330
1331typedef
1332struct {
1333 SVGA3dSurfaceImageId src;
1334 SVGA3dSurfaceImageId dest;
1335 SVGA3dBox boxSrc;
1336 SVGA3dBox boxDest;
1337 SVGA3dStretchBltMode mode;
1338} SVGA3dCmdSurfaceStretchBlt;
1339
1340typedef
1341struct {
1342
1343
1344
1345
1346
1347 uint32 discard : 1;
1348
1349
1350
1351
1352
1353 uint32 unsynchronized : 1;
1354
1355
1356
1357
1358
1359 uint32 reserved : 30;
1360} SVGA3dSurfaceDMAFlags;
1361
1362typedef
1363struct {
1364 SVGA3dGuestImage guest;
1365 SVGA3dSurfaceImageId host;
1366 SVGA3dTransferType transfer;
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378} SVGA3dCmdSurfaceDMA;
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390typedef
1391struct {
1392 uint32 suffixSize;
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402 uint32 maximumOffset;
1403
1404
1405
1406
1407
1408
1409
1410
1411 SVGA3dSurfaceDMAFlags flags;
1412} SVGA3dCmdSurfaceDMASuffix;
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431typedef
1432struct {
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442 uint32 first;
1443 uint32 last;
1444} SVGA3dArrayRangeHint;
1445
1446typedef
1447struct {
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459 uint32 surfaceId;
1460 uint32 offset;
1461 uint32 stride;
1462} SVGA3dArray;
1463
1464typedef
1465struct {
1466
1467
1468
1469
1470
1471
1472 SVGA3dDeclType type;
1473 SVGA3dDeclMethod method;
1474 SVGA3dDeclUsage usage;
1475 uint32 usageIndex;
1476} SVGA3dVertexArrayIdentity;
1477
1478typedef
1479struct {
1480 SVGA3dVertexArrayIdentity identity;
1481 SVGA3dArray array;
1482 SVGA3dArrayRangeHint rangeHint;
1483} SVGA3dVertexDecl;
1484
1485typedef
1486struct {
1487
1488
1489
1490
1491
1492
1493 SVGA3dPrimitiveType primType;
1494 uint32 primitiveCount;
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509 SVGA3dArray indexArray;
1510 uint32 indexWidth;
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532 int32 indexBias;
1533} SVGA3dPrimitiveRange;
1534
1535typedef
1536struct {
1537 uint32 cid;
1538 uint32 numVertexDecls;
1539 uint32 numRanges;
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553} SVGA3dCmdDrawPrimitives;
1554
1555typedef
1556struct {
1557 uint32 stage;
1558 SVGA3dTextureStateName name;
1559 union {
1560 uint32 value;
1561 float floatValue;
1562 };
1563} SVGA3dTextureState;
1564
1565typedef
1566struct {
1567 uint32 cid;
1568
1569} SVGA3dCmdSetTextureState;
1570
1571typedef
1572struct {
1573 uint32 cid;
1574 SVGA3dTransformType type;
1575 float matrix[16];
1576} SVGA3dCmdSetTransform;
1577
1578typedef
1579struct {
1580 float min;
1581 float max;
1582} SVGA3dZRange;
1583
1584typedef
1585struct {
1586 uint32 cid;
1587 SVGA3dZRange zRange;
1588} SVGA3dCmdSetZRange;
1589
1590typedef
1591struct {
1592 float diffuse[4];
1593 float ambient[4];
1594 float specular[4];
1595 float emissive[4];
1596 float shininess;
1597} SVGA3dMaterial;
1598
1599typedef
1600struct {
1601 uint32 cid;
1602 SVGA3dFace face;
1603 SVGA3dMaterial material;
1604} SVGA3dCmdSetMaterial;
1605
1606typedef
1607struct {
1608 uint32 cid;
1609 uint32 index;
1610 SVGA3dLightData data;
1611} SVGA3dCmdSetLightData;
1612
1613typedef
1614struct {
1615 uint32 cid;
1616 uint32 index;
1617 uint32 enabled;
1618} SVGA3dCmdSetLightEnabled;
1619
1620typedef
1621struct {
1622 uint32 cid;
1623 SVGA3dRect rect;
1624} SVGA3dCmdSetViewport;
1625
1626typedef
1627struct {
1628 uint32 cid;
1629 SVGA3dRect rect;
1630} SVGA3dCmdSetScissorRect;
1631
1632typedef
1633struct {
1634 uint32 cid;
1635 uint32 index;
1636 float plane[4];
1637} SVGA3dCmdSetClipPlane;
1638
1639typedef
1640struct {
1641 uint32 cid;
1642 uint32 shid;
1643 SVGA3dShaderType type;
1644
1645} SVGA3dCmdDefineShader;
1646
1647typedef
1648struct {
1649 uint32 cid;
1650 uint32 shid;
1651 SVGA3dShaderType type;
1652} SVGA3dCmdDestroyShader;
1653
1654typedef
1655struct {
1656 uint32 cid;
1657 uint32 reg;
1658 SVGA3dShaderType type;
1659 SVGA3dShaderConstType ctype;
1660 uint32 values[4];
1661} SVGA3dCmdSetShaderConst;
1662
1663typedef
1664struct {
1665 uint32 cid;
1666 SVGA3dShaderType type;
1667 uint32 shid;
1668} SVGA3dCmdSetShader;
1669
1670typedef
1671struct {
1672 uint32 cid;
1673 SVGA3dQueryType type;
1674} SVGA3dCmdBeginQuery;
1675
1676typedef
1677struct {
1678 uint32 cid;
1679 SVGA3dQueryType type;
1680 SVGAGuestPtr guestResult;
1681} SVGA3dCmdEndQuery;
1682
1683typedef
1684struct {
1685 uint32 cid;
1686 SVGA3dQueryType type;
1687 SVGAGuestPtr guestResult;
1688} SVGA3dCmdWaitForQuery;
1689
1690typedef
1691struct {
1692 uint32 totalSize;
1693 SVGA3dQueryState state;
1694 union {
1695 uint32 result32;
1696 };
1697} SVGA3dQueryResult;
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736typedef
1737struct {
1738 SVGA3dSurfaceImageId srcImage;
1739 SVGASignedRect srcRect;
1740 uint32 destScreenId;
1741 SVGASignedRect destRect;
1742
1743} SVGA3dCmdBlitSurfaceToScreen;
1744
1745typedef
1746struct {
1747 uint32 sid;
1748 SVGA3dTextureFilter filter;
1749} SVGA3dCmdGenerateMipmaps;
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778typedef enum {
1779 SVGA3D_DEVCAP_3D = 0,
1780 SVGA3D_DEVCAP_MAX_LIGHTS = 1,
1781 SVGA3D_DEVCAP_MAX_TEXTURES = 2,
1782 SVGA3D_DEVCAP_MAX_CLIP_PLANES = 3,
1783 SVGA3D_DEVCAP_VERTEX_SHADER_VERSION = 4,
1784 SVGA3D_DEVCAP_VERTEX_SHADER = 5,
1785 SVGA3D_DEVCAP_FRAGMENT_SHADER_VERSION = 6,
1786 SVGA3D_DEVCAP_FRAGMENT_SHADER = 7,
1787 SVGA3D_DEVCAP_MAX_RENDER_TARGETS = 8,
1788 SVGA3D_DEVCAP_S23E8_TEXTURES = 9,
1789 SVGA3D_DEVCAP_S10E5_TEXTURES = 10,
1790 SVGA3D_DEVCAP_MAX_FIXED_VERTEXBLEND = 11,
1791 SVGA3D_DEVCAP_D16_BUFFER_FORMAT = 12,
1792 SVGA3D_DEVCAP_D24S8_BUFFER_FORMAT = 13,
1793 SVGA3D_DEVCAP_D24X8_BUFFER_FORMAT = 14,
1794 SVGA3D_DEVCAP_QUERY_TYPES = 15,
1795 SVGA3D_DEVCAP_TEXTURE_GRADIENT_SAMPLING = 16,
1796 SVGA3D_DEVCAP_MAX_POINT_SIZE = 17,
1797 SVGA3D_DEVCAP_MAX_SHADER_TEXTURES = 18,
1798 SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH = 19,
1799 SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT = 20,
1800 SVGA3D_DEVCAP_MAX_VOLUME_EXTENT = 21,
1801 SVGA3D_DEVCAP_MAX_TEXTURE_REPEAT = 22,
1802 SVGA3D_DEVCAP_MAX_TEXTURE_ASPECT_RATIO = 23,
1803 SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY = 24,
1804 SVGA3D_DEVCAP_MAX_PRIMITIVE_COUNT = 25,
1805 SVGA3D_DEVCAP_MAX_VERTEX_INDEX = 26,
1806 SVGA3D_DEVCAP_MAX_VERTEX_SHADER_INSTRUCTIONS = 27,
1807 SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_INSTRUCTIONS = 28,
1808 SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS = 29,
1809 SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS = 30,
1810 SVGA3D_DEVCAP_TEXTURE_OPS = 31,
1811 SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8 = 32,
1812 SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8 = 33,
1813 SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10 = 34,
1814 SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5 = 35,
1815 SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5 = 36,
1816 SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4 = 37,
1817 SVGA3D_DEVCAP_SURFACEFMT_R5G6B5 = 38,
1818 SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE16 = 39,
1819 SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8_ALPHA8 = 40,
1820 SVGA3D_DEVCAP_SURFACEFMT_ALPHA8 = 41,
1821 SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8 = 42,
1822 SVGA3D_DEVCAP_SURFACEFMT_Z_D16 = 43,
1823 SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8 = 44,
1824 SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8 = 45,
1825 SVGA3D_DEVCAP_SURFACEFMT_DXT1 = 46,
1826 SVGA3D_DEVCAP_SURFACEFMT_DXT2 = 47,
1827 SVGA3D_DEVCAP_SURFACEFMT_DXT3 = 48,
1828 SVGA3D_DEVCAP_SURFACEFMT_DXT4 = 49,
1829 SVGA3D_DEVCAP_SURFACEFMT_DXT5 = 50,
1830 SVGA3D_DEVCAP_SURFACEFMT_BUMPX8L8V8U8 = 51,
1831 SVGA3D_DEVCAP_SURFACEFMT_A2W10V10U10 = 52,
1832 SVGA3D_DEVCAP_SURFACEFMT_BUMPU8V8 = 53,
1833 SVGA3D_DEVCAP_SURFACEFMT_Q8W8V8U8 = 54,
1834 SVGA3D_DEVCAP_SURFACEFMT_CxV8U8 = 55,
1835 SVGA3D_DEVCAP_SURFACEFMT_R_S10E5 = 56,
1836 SVGA3D_DEVCAP_SURFACEFMT_R_S23E8 = 57,
1837 SVGA3D_DEVCAP_SURFACEFMT_RG_S10E5 = 58,
1838 SVGA3D_DEVCAP_SURFACEFMT_RG_S23E8 = 59,
1839 SVGA3D_DEVCAP_SURFACEFMT_ARGB_S10E5 = 60,
1840 SVGA3D_DEVCAP_SURFACEFMT_ARGB_S23E8 = 61,
1841 SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEXTURES = 63,
1842
1843
1844
1845
1846
1847 SVGA3D_DEVCAP_MAX_SIMULTANEOUS_RENDER_TARGETS = 64,
1848
1849 SVGA3D_DEVCAP_SURFACEFMT_V16U16 = 65,
1850 SVGA3D_DEVCAP_SURFACEFMT_G16R16 = 66,
1851 SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16 = 67,
1852 SVGA3D_DEVCAP_SURFACEFMT_UYVY = 68,
1853 SVGA3D_DEVCAP_SURFACEFMT_YUY2 = 69,
1854 SVGA3D_DEVCAP_MULTISAMPLE_NONMASKABLESAMPLES = 70,
1855 SVGA3D_DEVCAP_MULTISAMPLE_MASKABLESAMPLES = 71,
1856 SVGA3D_DEVCAP_ALPHATOCOVERAGE = 72,
1857 SVGA3D_DEVCAP_SUPERSAMPLE = 73,
1858 SVGA3D_DEVCAP_AUTOGENMIPMAPS = 74,
1859 SVGA3D_DEVCAP_SURFACEFMT_NV12 = 75,
1860 SVGA3D_DEVCAP_SURFACEFMT_AYUV = 76,
1861
1862
1863
1864
1865
1866 SVGA3D_DEVCAP_MAX_CONTEXT_IDS = 77,
1867
1868
1869
1870
1871
1872 SVGA3D_DEVCAP_MAX_SURFACE_IDS = 78,
1873
1874 SVGA3D_DEVCAP_SURFACEFMT_Z_DF16 = 79,
1875 SVGA3D_DEVCAP_SURFACEFMT_Z_DF24 = 80,
1876 SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT = 81,
1877
1878 SVGA3D_DEVCAP_SURFACEFMT_BC4_UNORM = 82,
1879 SVGA3D_DEVCAP_SURFACEFMT_BC5_UNORM = 83,
1880
1881
1882
1883
1884
1885
1886 SVGA3D_DEVCAP_MAX
1887} SVGA3dDevCapIndex;
1888
1889typedef union {
1890 Bool b;
1891 uint32 u;
1892 int32 i;
1893 float f;
1894} SVGA3dDevCapResult;
1895
1896#endif
1897