Loading...
1/**********************************************************
2 * Copyright 1998-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_cmd.h --
28 *
29 * SVGA 3d hardware cmd definitions
30 */
31
32#ifndef _SVGA3D_CMD_H_
33#define _SVGA3D_CMD_H_
34
35#define INCLUDE_ALLOW_MODULE
36#define INCLUDE_ALLOW_USERLEVEL
37#define INCLUDE_ALLOW_VMCORE
38
39#include "includeCheck.h"
40#include "svga3d_types.h"
41
42/*
43 * Identifiers for commands in the command FIFO.
44 *
45 * IDs between 1000 and 1039 (inclusive) were used by obsolete versions of
46 * the SVGA3D protocol and remain reserved; they should not be used in the
47 * future.
48 *
49 * IDs between 1040 and 1999 (inclusive) are available for use by the
50 * current SVGA3D protocol.
51 *
52 * FIFO clients other than SVGA3D should stay below 1000, or at 2000
53 * and up.
54 */
55
56typedef enum {
57 SVGA_3D_CMD_LEGACY_BASE = 1000,
58 SVGA_3D_CMD_BASE = 1040,
59
60 SVGA_3D_CMD_SURFACE_DEFINE = 1040,
61 SVGA_3D_CMD_SURFACE_DESTROY = 1041,
62 SVGA_3D_CMD_SURFACE_COPY = 1042,
63 SVGA_3D_CMD_SURFACE_STRETCHBLT = 1043,
64 SVGA_3D_CMD_SURFACE_DMA = 1044,
65 SVGA_3D_CMD_CONTEXT_DEFINE = 1045,
66 SVGA_3D_CMD_CONTEXT_DESTROY = 1046,
67 SVGA_3D_CMD_SETTRANSFORM = 1047,
68 SVGA_3D_CMD_SETZRANGE = 1048,
69 SVGA_3D_CMD_SETRENDERSTATE = 1049,
70 SVGA_3D_CMD_SETRENDERTARGET = 1050,
71 SVGA_3D_CMD_SETTEXTURESTATE = 1051,
72 SVGA_3D_CMD_SETMATERIAL = 1052,
73 SVGA_3D_CMD_SETLIGHTDATA = 1053,
74 SVGA_3D_CMD_SETLIGHTENABLED = 1054,
75 SVGA_3D_CMD_SETVIEWPORT = 1055,
76 SVGA_3D_CMD_SETCLIPPLANE = 1056,
77 SVGA_3D_CMD_CLEAR = 1057,
78 SVGA_3D_CMD_PRESENT = 1058,
79 SVGA_3D_CMD_SHADER_DEFINE = 1059,
80 SVGA_3D_CMD_SHADER_DESTROY = 1060,
81 SVGA_3D_CMD_SET_SHADER = 1061,
82 SVGA_3D_CMD_SET_SHADER_CONST = 1062,
83 SVGA_3D_CMD_DRAW_PRIMITIVES = 1063,
84 SVGA_3D_CMD_SETSCISSORRECT = 1064,
85 SVGA_3D_CMD_BEGIN_QUERY = 1065,
86 SVGA_3D_CMD_END_QUERY = 1066,
87 SVGA_3D_CMD_WAIT_FOR_QUERY = 1067,
88 SVGA_3D_CMD_PRESENT_READBACK = 1068,
89 SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN = 1069,
90 SVGA_3D_CMD_SURFACE_DEFINE_V2 = 1070,
91 SVGA_3D_CMD_GENERATE_MIPMAPS = 1071,
92 SVGA_3D_CMD_VIDEO_CREATE_DECODER = 1072,
93 SVGA_3D_CMD_VIDEO_DESTROY_DECODER = 1073,
94 SVGA_3D_CMD_VIDEO_CREATE_PROCESSOR = 1074,
95 SVGA_3D_CMD_VIDEO_DESTROY_PROCESSOR = 1075,
96 SVGA_3D_CMD_VIDEO_DECODE_START_FRAME = 1076,
97 SVGA_3D_CMD_VIDEO_DECODE_RENDER = 1077,
98 SVGA_3D_CMD_VIDEO_DECODE_END_FRAME = 1078,
99 SVGA_3D_CMD_VIDEO_PROCESS_FRAME = 1079,
100 SVGA_3D_CMD_ACTIVATE_SURFACE = 1080,
101 SVGA_3D_CMD_DEACTIVATE_SURFACE = 1081,
102 SVGA_3D_CMD_SCREEN_DMA = 1082,
103 SVGA_3D_CMD_SET_UNITY_SURFACE_COOKIE = 1083,
104 SVGA_3D_CMD_OPEN_CONTEXT_SURFACE = 1084,
105
106 SVGA_3D_CMD_LOGICOPS_BITBLT = 1085,
107 SVGA_3D_CMD_LOGICOPS_TRANSBLT = 1086,
108 SVGA_3D_CMD_LOGICOPS_STRETCHBLT = 1087,
109 SVGA_3D_CMD_LOGICOPS_COLORFILL = 1088,
110 SVGA_3D_CMD_LOGICOPS_ALPHABLEND = 1089,
111 SVGA_3D_CMD_LOGICOPS_CLEARTYPEBLEND = 1090,
112
113 SVGA_3D_CMD_SET_OTABLE_BASE = 1091,
114 SVGA_3D_CMD_READBACK_OTABLE = 1092,
115
116 SVGA_3D_CMD_DEFINE_GB_MOB = 1093,
117 SVGA_3D_CMD_DESTROY_GB_MOB = 1094,
118 SVGA_3D_CMD_DEAD3 = 1095,
119 SVGA_3D_CMD_UPDATE_GB_MOB_MAPPING = 1096,
120
121 SVGA_3D_CMD_DEFINE_GB_SURFACE = 1097,
122 SVGA_3D_CMD_DESTROY_GB_SURFACE = 1098,
123 SVGA_3D_CMD_BIND_GB_SURFACE = 1099,
124 SVGA_3D_CMD_COND_BIND_GB_SURFACE = 1100,
125 SVGA_3D_CMD_UPDATE_GB_IMAGE = 1101,
126 SVGA_3D_CMD_UPDATE_GB_SURFACE = 1102,
127 SVGA_3D_CMD_READBACK_GB_IMAGE = 1103,
128 SVGA_3D_CMD_READBACK_GB_SURFACE = 1104,
129 SVGA_3D_CMD_INVALIDATE_GB_IMAGE = 1105,
130 SVGA_3D_CMD_INVALIDATE_GB_SURFACE = 1106,
131
132 SVGA_3D_CMD_DEFINE_GB_CONTEXT = 1107,
133 SVGA_3D_CMD_DESTROY_GB_CONTEXT = 1108,
134 SVGA_3D_CMD_BIND_GB_CONTEXT = 1109,
135 SVGA_3D_CMD_READBACK_GB_CONTEXT = 1110,
136 SVGA_3D_CMD_INVALIDATE_GB_CONTEXT = 1111,
137
138 SVGA_3D_CMD_DEFINE_GB_SHADER = 1112,
139 SVGA_3D_CMD_DESTROY_GB_SHADER = 1113,
140 SVGA_3D_CMD_BIND_GB_SHADER = 1114,
141
142 SVGA_3D_CMD_SET_OTABLE_BASE64 = 1115,
143
144 SVGA_3D_CMD_BEGIN_GB_QUERY = 1116,
145 SVGA_3D_CMD_END_GB_QUERY = 1117,
146 SVGA_3D_CMD_WAIT_FOR_GB_QUERY = 1118,
147
148 SVGA_3D_CMD_NOP = 1119,
149
150 SVGA_3D_CMD_ENABLE_GART = 1120,
151 SVGA_3D_CMD_DISABLE_GART = 1121,
152 SVGA_3D_CMD_MAP_MOB_INTO_GART = 1122,
153 SVGA_3D_CMD_UNMAP_GART_RANGE = 1123,
154
155 SVGA_3D_CMD_DEFINE_GB_SCREENTARGET = 1124,
156 SVGA_3D_CMD_DESTROY_GB_SCREENTARGET = 1125,
157 SVGA_3D_CMD_BIND_GB_SCREENTARGET = 1126,
158 SVGA_3D_CMD_UPDATE_GB_SCREENTARGET = 1127,
159
160 SVGA_3D_CMD_READBACK_GB_IMAGE_PARTIAL = 1128,
161 SVGA_3D_CMD_INVALIDATE_GB_IMAGE_PARTIAL = 1129,
162
163 SVGA_3D_CMD_SET_GB_SHADERCONSTS_INLINE = 1130,
164
165 SVGA_3D_CMD_GB_SCREEN_DMA = 1131,
166 SVGA_3D_CMD_BIND_GB_SURFACE_WITH_PITCH = 1132,
167 SVGA_3D_CMD_GB_MOB_FENCE = 1133,
168 SVGA_3D_CMD_DEFINE_GB_SURFACE_V2 = 1134,
169 SVGA_3D_CMD_DEFINE_GB_MOB64 = 1135,
170 SVGA_3D_CMD_REDEFINE_GB_MOB64 = 1136,
171 SVGA_3D_CMD_NOP_ERROR = 1137,
172
173 SVGA_3D_CMD_SET_VERTEX_STREAMS = 1138,
174 SVGA_3D_CMD_SET_VERTEX_DECLS = 1139,
175 SVGA_3D_CMD_SET_VERTEX_DIVISORS = 1140,
176 SVGA_3D_CMD_DRAW = 1141,
177 SVGA_3D_CMD_DRAW_INDEXED = 1142,
178
179 /*
180 * DX10 Commands
181 */
182 SVGA_3D_CMD_DX_MIN = 1143,
183 SVGA_3D_CMD_DX_DEFINE_CONTEXT = 1143,
184 SVGA_3D_CMD_DX_DESTROY_CONTEXT = 1144,
185 SVGA_3D_CMD_DX_BIND_CONTEXT = 1145,
186 SVGA_3D_CMD_DX_READBACK_CONTEXT = 1146,
187 SVGA_3D_CMD_DX_INVALIDATE_CONTEXT = 1147,
188 SVGA_3D_CMD_DX_SET_SINGLE_CONSTANT_BUFFER = 1148,
189 SVGA_3D_CMD_DX_SET_SHADER_RESOURCES = 1149,
190 SVGA_3D_CMD_DX_SET_SHADER = 1150,
191 SVGA_3D_CMD_DX_SET_SAMPLERS = 1151,
192 SVGA_3D_CMD_DX_DRAW = 1152,
193 SVGA_3D_CMD_DX_DRAW_INDEXED = 1153,
194 SVGA_3D_CMD_DX_DRAW_INSTANCED = 1154,
195 SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED = 1155,
196 SVGA_3D_CMD_DX_DRAW_AUTO = 1156,
197 SVGA_3D_CMD_DX_SET_INPUT_LAYOUT = 1157,
198 SVGA_3D_CMD_DX_SET_VERTEX_BUFFERS = 1158,
199 SVGA_3D_CMD_DX_SET_INDEX_BUFFER = 1159,
200 SVGA_3D_CMD_DX_SET_TOPOLOGY = 1160,
201 SVGA_3D_CMD_DX_SET_RENDERTARGETS = 1161,
202 SVGA_3D_CMD_DX_SET_BLEND_STATE = 1162,
203 SVGA_3D_CMD_DX_SET_DEPTHSTENCIL_STATE = 1163,
204 SVGA_3D_CMD_DX_SET_RASTERIZER_STATE = 1164,
205 SVGA_3D_CMD_DX_DEFINE_QUERY = 1165,
206 SVGA_3D_CMD_DX_DESTROY_QUERY = 1166,
207 SVGA_3D_CMD_DX_BIND_QUERY = 1167,
208 SVGA_3D_CMD_DX_SET_QUERY_OFFSET = 1168,
209 SVGA_3D_CMD_DX_BEGIN_QUERY = 1169,
210 SVGA_3D_CMD_DX_END_QUERY = 1170,
211 SVGA_3D_CMD_DX_READBACK_QUERY = 1171,
212 SVGA_3D_CMD_DX_SET_PREDICATION = 1172,
213 SVGA_3D_CMD_DX_SET_SOTARGETS = 1173,
214 SVGA_3D_CMD_DX_SET_VIEWPORTS = 1174,
215 SVGA_3D_CMD_DX_SET_SCISSORRECTS = 1175,
216 SVGA_3D_CMD_DX_CLEAR_RENDERTARGET_VIEW = 1176,
217 SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW = 1177,
218 SVGA_3D_CMD_DX_PRED_COPY_REGION = 1178,
219 SVGA_3D_CMD_DX_PRED_COPY = 1179,
220 SVGA_3D_CMD_DX_STRETCHBLT = 1180,
221 SVGA_3D_CMD_DX_GENMIPS = 1181,
222 SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE = 1182,
223 SVGA_3D_CMD_DX_READBACK_SUBRESOURCE = 1183,
224 SVGA_3D_CMD_DX_INVALIDATE_SUBRESOURCE = 1184,
225 SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW = 1185,
226 SVGA_3D_CMD_DX_DESTROY_SHADERRESOURCE_VIEW = 1186,
227 SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW = 1187,
228 SVGA_3D_CMD_DX_DESTROY_RENDERTARGET_VIEW = 1188,
229 SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW = 1189,
230 SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW = 1190,
231 SVGA_3D_CMD_DX_DEFINE_ELEMENTLAYOUT = 1191,
232 SVGA_3D_CMD_DX_DESTROY_ELEMENTLAYOUT = 1192,
233 SVGA_3D_CMD_DX_DEFINE_BLEND_STATE = 1193,
234 SVGA_3D_CMD_DX_DESTROY_BLEND_STATE = 1194,
235 SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_STATE = 1195,
236 SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_STATE = 1196,
237 SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE = 1197,
238 SVGA_3D_CMD_DX_DESTROY_RASTERIZER_STATE = 1198,
239 SVGA_3D_CMD_DX_DEFINE_SAMPLER_STATE = 1199,
240 SVGA_3D_CMD_DX_DESTROY_SAMPLER_STATE = 1200,
241 SVGA_3D_CMD_DX_DEFINE_SHADER = 1201,
242 SVGA_3D_CMD_DX_DESTROY_SHADER = 1202,
243 SVGA_3D_CMD_DX_BIND_SHADER = 1203,
244 SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT = 1204,
245 SVGA_3D_CMD_DX_DESTROY_STREAMOUTPUT = 1205,
246 SVGA_3D_CMD_DX_SET_STREAMOUTPUT = 1206,
247 SVGA_3D_CMD_DX_SET_COTABLE = 1207,
248 SVGA_3D_CMD_DX_READBACK_COTABLE = 1208,
249 SVGA_3D_CMD_DX_BUFFER_COPY = 1209,
250 SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER = 1210,
251 SVGA_3D_CMD_DX_SURFACE_COPY_AND_READBACK = 1211,
252 SVGA_3D_CMD_DX_MOVE_QUERY = 1212,
253 SVGA_3D_CMD_DX_BIND_ALL_QUERY = 1213,
254 SVGA_3D_CMD_DX_READBACK_ALL_QUERY = 1214,
255 SVGA_3D_CMD_DX_PRED_TRANSFER_FROM_BUFFER = 1215,
256 SVGA_3D_CMD_DX_MOB_FENCE_64 = 1216,
257 SVGA_3D_CMD_DX_BIND_SHADER_ON_CONTEXT = 1217,
258 SVGA_3D_CMD_DX_HINT = 1218,
259 SVGA_3D_CMD_DX_BUFFER_UPDATE = 1219,
260 SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET = 1220,
261 SVGA_3D_CMD_DX_SET_PS_CONSTANT_BUFFER_OFFSET = 1221,
262 SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET = 1222,
263
264 /*
265 * Reserve some IDs to be used for the DX11 shader types.
266 */
267 SVGA_3D_CMD_DX_RESERVED1 = 1223,
268 SVGA_3D_CMD_DX_RESERVED2 = 1224,
269 SVGA_3D_CMD_DX_RESERVED3 = 1225,
270
271 SVGA_3D_CMD_DX_MAX = 1226,
272 SVGA_3D_CMD_MAX = 1226,
273 SVGA_3D_CMD_FUTURE_MAX = 3000
274} SVGAFifo3dCmdId;
275
276/*
277 * FIFO command format definitions:
278 */
279
280/*
281 * The data size header following cmdNum for every 3d command
282 */
283typedef
284#include "vmware_pack_begin.h"
285struct {
286 uint32 id;
287 uint32 size;
288}
289#include "vmware_pack_end.h"
290SVGA3dCmdHeader;
291
292typedef
293#include "vmware_pack_begin.h"
294struct {
295 uint32 numMipLevels;
296}
297#include "vmware_pack_end.h"
298SVGA3dSurfaceFace;
299
300typedef
301#include "vmware_pack_begin.h"
302struct {
303 uint32 sid;
304 SVGA3dSurfaceFlags surfaceFlags;
305 SVGA3dSurfaceFormat format;
306 /*
307 * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
308 * structures must have the same value of numMipLevels field.
309 * Otherwise, all but the first SVGA3dSurfaceFace structures must have the
310 * numMipLevels set to 0.
311 */
312 SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
313 /*
314 * Followed by an SVGA3dSize structure for each mip level in each face.
315 *
316 * A note on surface sizes: Sizes are always specified in pixels,
317 * even if the true surface size is not a multiple of the minimum
318 * block size of the surface's format. For example, a 3x3x1 DXT1
319 * compressed texture would actually be stored as a 4x4x1 image in
320 * memory.
321 */
322}
323#include "vmware_pack_end.h"
324SVGA3dCmdDefineSurface; /* SVGA_3D_CMD_SURFACE_DEFINE */
325
326typedef
327#include "vmware_pack_begin.h"
328struct {
329 uint32 sid;
330 SVGA3dSurfaceFlags surfaceFlags;
331 SVGA3dSurfaceFormat format;
332 /*
333 * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
334 * structures must have the same value of numMipLevels field.
335 * Otherwise, all but the first SVGA3dSurfaceFace structures must have the
336 * numMipLevels set to 0.
337 */
338 SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
339 uint32 multisampleCount;
340 SVGA3dTextureFilter autogenFilter;
341 /*
342 * Followed by an SVGA3dSize structure for each mip level in each face.
343 *
344 * A note on surface sizes: Sizes are always specified in pixels,
345 * even if the true surface size is not a multiple of the minimum
346 * block size of the surface's format. For example, a 3x3x1 DXT1
347 * compressed texture would actually be stored as a 4x4x1 image in
348 * memory.
349 */
350}
351#include "vmware_pack_end.h"
352SVGA3dCmdDefineSurface_v2; /* SVGA_3D_CMD_SURFACE_DEFINE_V2 */
353
354typedef
355#include "vmware_pack_begin.h"
356struct {
357 uint32 sid;
358}
359#include "vmware_pack_end.h"
360SVGA3dCmdDestroySurface; /* SVGA_3D_CMD_SURFACE_DESTROY */
361
362typedef
363#include "vmware_pack_begin.h"
364struct {
365 uint32 cid;
366}
367#include "vmware_pack_end.h"
368SVGA3dCmdDefineContext; /* SVGA_3D_CMD_CONTEXT_DEFINE */
369
370typedef
371#include "vmware_pack_begin.h"
372struct {
373 uint32 cid;
374}
375#include "vmware_pack_end.h"
376SVGA3dCmdDestroyContext; /* SVGA_3D_CMD_CONTEXT_DESTROY */
377
378typedef
379#include "vmware_pack_begin.h"
380struct {
381 uint32 cid;
382 SVGA3dClearFlag clearFlag;
383 uint32 color;
384 float depth;
385 uint32 stencil;
386 /* Followed by variable number of SVGA3dRect structures */
387}
388#include "vmware_pack_end.h"
389SVGA3dCmdClear; /* SVGA_3D_CMD_CLEAR */
390
391typedef
392#include "vmware_pack_begin.h"
393struct {
394 SVGA3dLightType type;
395 SVGA3dBool inWorldSpace;
396 float diffuse[4];
397 float specular[4];
398 float ambient[4];
399 float position[4];
400 float direction[4];
401 float range;
402 float falloff;
403 float attenuation0;
404 float attenuation1;
405 float attenuation2;
406 float theta;
407 float phi;
408}
409#include "vmware_pack_end.h"
410SVGA3dLightData;
411
412typedef
413#include "vmware_pack_begin.h"
414struct {
415 uint32 sid;
416 /* Followed by variable number of SVGA3dCopyRect structures */
417}
418#include "vmware_pack_end.h"
419SVGA3dCmdPresent; /* SVGA_3D_CMD_PRESENT */
420
421typedef
422#include "vmware_pack_begin.h"
423struct {
424 SVGA3dRenderStateName state;
425 union {
426 uint32 uintValue;
427 float floatValue;
428 };
429}
430#include "vmware_pack_end.h"
431SVGA3dRenderState;
432
433typedef
434#include "vmware_pack_begin.h"
435struct {
436 uint32 cid;
437 /* Followed by variable number of SVGA3dRenderState structures */
438}
439#include "vmware_pack_end.h"
440SVGA3dCmdSetRenderState; /* SVGA_3D_CMD_SETRENDERSTATE */
441
442typedef
443#include "vmware_pack_begin.h"
444struct {
445 uint32 cid;
446 SVGA3dRenderTargetType type;
447 SVGA3dSurfaceImageId target;
448}
449#include "vmware_pack_end.h"
450SVGA3dCmdSetRenderTarget; /* SVGA_3D_CMD_SETRENDERTARGET */
451
452typedef
453#include "vmware_pack_begin.h"
454struct {
455 SVGA3dSurfaceImageId src;
456 SVGA3dSurfaceImageId dest;
457 /* Followed by variable number of SVGA3dCopyBox structures */
458}
459#include "vmware_pack_end.h"
460SVGA3dCmdSurfaceCopy; /* SVGA_3D_CMD_SURFACE_COPY */
461
462typedef
463#include "vmware_pack_begin.h"
464struct {
465 SVGA3dSurfaceImageId src;
466 SVGA3dSurfaceImageId dest;
467 SVGA3dBox boxSrc;
468 SVGA3dBox boxDest;
469 SVGA3dStretchBltMode mode;
470}
471#include "vmware_pack_end.h"
472SVGA3dCmdSurfaceStretchBlt; /* SVGA_3D_CMD_SURFACE_STRETCHBLT */
473
474typedef
475#include "vmware_pack_begin.h"
476struct {
477 /*
478 * If the discard flag is present in a surface DMA operation, the host may
479 * discard the contents of the current mipmap level and face of the target
480 * surface before applying the surface DMA contents.
481 */
482 uint32 discard : 1;
483
484 /*
485 * If the unsynchronized flag is present, the host may perform this upload
486 * without syncing to pending reads on this surface.
487 */
488 uint32 unsynchronized : 1;
489
490 /*
491 * Guests *MUST* set the reserved bits to 0 before submitting the command
492 * suffix as future flags may occupy these bits.
493 */
494 uint32 reserved : 30;
495}
496#include "vmware_pack_end.h"
497SVGA3dSurfaceDMAFlags;
498
499typedef
500#include "vmware_pack_begin.h"
501struct {
502 SVGAGuestImage guest;
503 SVGA3dSurfaceImageId host;
504 SVGA3dTransferType transfer;
505 /*
506 * Followed by variable number of SVGA3dCopyBox structures. For consistency
507 * in all clipping logic and coordinate translation, we define the
508 * "source" in each copyBox as the guest image and the
509 * "destination" as the host image, regardless of transfer
510 * direction.
511 *
512 * For efficiency, the SVGA3D device is free to copy more data than
513 * specified. For example, it may round copy boxes outwards such
514 * that they lie on particular alignment boundaries.
515 */
516}
517#include "vmware_pack_end.h"
518SVGA3dCmdSurfaceDMA; /* SVGA_3D_CMD_SURFACE_DMA */
519
520/*
521 * SVGA3dCmdSurfaceDMASuffix --
522 *
523 * This is a command suffix that will appear after a SurfaceDMA command in
524 * the FIFO. It contains some extra information that hosts may use to
525 * optimize performance or protect the guest. This suffix exists to preserve
526 * backwards compatibility while also allowing for new functionality to be
527 * implemented.
528 */
529
530typedef
531#include "vmware_pack_begin.h"
532struct {
533 uint32 suffixSize;
534
535 /*
536 * The maximum offset is used to determine the maximum offset from the
537 * guestPtr base address that will be accessed or written to during this
538 * surfaceDMA. If the suffix is supported, the host will respect this
539 * boundary while performing surface DMAs.
540 *
541 * Defaults to MAX_UINT32
542 */
543 uint32 maximumOffset;
544
545 /*
546 * A set of flags that describes optimizations that the host may perform
547 * while performing this surface DMA operation. The guest should never rely
548 * on behaviour that is different when these flags are set for correctness.
549 *
550 * Defaults to 0
551 */
552 SVGA3dSurfaceDMAFlags flags;
553}
554#include "vmware_pack_end.h"
555SVGA3dCmdSurfaceDMASuffix;
556
557/*
558 * SVGA_3D_CMD_DRAW_PRIMITIVES --
559 *
560 * This command is the SVGA3D device's generic drawing entry point.
561 * It can draw multiple ranges of primitives, optionally using an
562 * index buffer, using an arbitrary collection of vertex buffers.
563 *
564 * Each SVGA3dVertexDecl defines a distinct vertex array to bind
565 * during this draw call. The declarations specify which surface
566 * the vertex data lives in, what that vertex data is used for,
567 * and how to interpret it.
568 *
569 * Each SVGA3dPrimitiveRange defines a collection of primitives
570 * to render using the same vertex arrays. An index buffer is
571 * optional.
572 */
573
574typedef
575#include "vmware_pack_begin.h"
576struct {
577 /*
578 * A range hint is an optional specification for the range of indices
579 * in an SVGA3dArray that will be used. If 'last' is zero, it is assumed
580 * that the entire array will be used.
581 *
582 * These are only hints. The SVGA3D device may use them for
583 * performance optimization if possible, but it's also allowed to
584 * ignore these values.
585 */
586 uint32 first;
587 uint32 last;
588}
589#include "vmware_pack_end.h"
590SVGA3dArrayRangeHint;
591
592typedef
593#include "vmware_pack_begin.h"
594struct {
595 /*
596 * Define the origin and shape of a vertex or index array. Both
597 * 'offset' and 'stride' are in bytes. The provided surface will be
598 * reinterpreted as a flat array of bytes in the same format used
599 * by surface DMA operations. To avoid unnecessary conversions, the
600 * surface should be created with the SVGA3D_BUFFER format.
601 *
602 * Index 0 in the array starts 'offset' bytes into the surface.
603 * Index 1 begins at byte 'offset + stride', etc. Array indices may
604 * not be negative.
605 */
606 uint32 surfaceId;
607 uint32 offset;
608 uint32 stride;
609}
610#include "vmware_pack_end.h"
611SVGA3dArray;
612
613typedef
614#include "vmware_pack_begin.h"
615struct {
616 /*
617 * Describe a vertex array's data type, and define how it is to be
618 * used by the fixed function pipeline or the vertex shader. It
619 * isn't useful to have two VertexDecls with the same
620 * VertexArrayIdentity in one draw call.
621 */
622 SVGA3dDeclType type;
623 SVGA3dDeclMethod method;
624 SVGA3dDeclUsage usage;
625 uint32 usageIndex;
626}
627#include "vmware_pack_end.h"
628SVGA3dVertexArrayIdentity;
629
630typedef
631#include "vmware_pack_begin.h"
632struct SVGA3dVertexDecl {
633 SVGA3dVertexArrayIdentity identity;
634 SVGA3dArray array;
635 SVGA3dArrayRangeHint rangeHint;
636}
637#include "vmware_pack_end.h"
638SVGA3dVertexDecl;
639
640typedef
641#include "vmware_pack_begin.h"
642struct SVGA3dPrimitiveRange {
643 /*
644 * Define a group of primitives to render, from sequential indices.
645 *
646 * The value of 'primitiveType' and 'primitiveCount' imply the
647 * total number of vertices that will be rendered.
648 */
649 SVGA3dPrimitiveType primType;
650 uint32 primitiveCount;
651
652 /*
653 * Optional index buffer. If indexArray.surfaceId is
654 * SVGA3D_INVALID_ID, we render without an index buffer. Rendering
655 * without an index buffer is identical to rendering with an index
656 * buffer containing the sequence [0, 1, 2, 3, ...].
657 *
658 * If an index buffer is in use, indexWidth specifies the width in
659 * bytes of each index value. It must be less than or equal to
660 * indexArray.stride.
661 *
662 * (Currently, the SVGA3D device requires index buffers to be tightly
663 * packed. In other words, indexWidth == indexArray.stride)
664 */
665 SVGA3dArray indexArray;
666 uint32 indexWidth;
667
668 /*
669 * Optional index bias. This number is added to all indices from
670 * indexArray before they are used as vertex array indices. This
671 * can be used in multiple ways:
672 *
673 * - When not using an indexArray, this bias can be used to
674 * specify where in the vertex arrays to begin rendering.
675 *
676 * - A positive number here is equivalent to increasing the
677 * offset in each vertex array.
678 *
679 * - A negative number can be used to render using a small
680 * vertex array and an index buffer that contains large
681 * values. This may be used by some applications that
682 * crop a vertex buffer without modifying their index
683 * buffer.
684 *
685 * Note that rendering with a negative bias value may be slower and
686 * use more memory than rendering with a positive or zero bias.
687 */
688 int32 indexBias;
689}
690#include "vmware_pack_end.h"
691SVGA3dPrimitiveRange;
692
693typedef
694#include "vmware_pack_begin.h"
695struct {
696 uint32 cid;
697 uint32 numVertexDecls;
698 uint32 numRanges;
699
700 /*
701 * There are two variable size arrays after the
702 * SVGA3dCmdDrawPrimitives structure. In order,
703 * they are:
704 *
705 * 1. SVGA3dVertexDecl, quantity 'numVertexDecls', but no more than
706 * SVGA3D_MAX_VERTEX_ARRAYS;
707 * 2. SVGA3dPrimitiveRange, quantity 'numRanges', but no more than
708 * SVGA3D_MAX_DRAW_PRIMITIVE_RANGES;
709 * 3. Optionally, SVGA3dVertexDivisor, quantity 'numVertexDecls' (contains
710 * the frequency divisor for the corresponding vertex decl).
711 */
712}
713#include "vmware_pack_end.h"
714SVGA3dCmdDrawPrimitives; /* SVGA_3D_CMD_DRAWPRIMITIVES */
715
716typedef
717#include "vmware_pack_begin.h"
718struct {
719 uint32 cid;
720
721 uint32 primitiveCount; /* How many primitives to render */
722 uint32 startVertexLocation; /* Which vertex do we start rendering at. */
723
724 uint8 primitiveType; /* SVGA3dPrimitiveType */
725 uint8 padding[3];
726}
727#include "vmware_pack_end.h"
728SVGA3dCmdDraw;
729
730typedef
731#include "vmware_pack_begin.h"
732struct {
733 uint32 cid;
734
735 uint8 primitiveType; /* SVGA3dPrimitiveType */
736
737 uint32 indexBufferSid; /* Valid index buffer sid. */
738 uint32 indexBufferOffset; /* Byte offset into the vertex buffer, almost */
739 /* always 0 for DX9 guests, non-zero for OpenGL */
740 /* guests. We can't represent non-multiple of */
741 /* stride offsets in D3D9Renderer... */
742 uint8 indexBufferStride; /* Allowable values = 1, 2, or 4 */
743
744 int32 baseVertexLocation; /* Bias applied to the index when selecting a */
745 /* vertex from the streams, may be negative */
746
747 uint32 primitiveCount; /* How many primitives to render */
748 uint32 pad0;
749 uint16 pad1;
750}
751#include "vmware_pack_end.h"
752SVGA3dCmdDrawIndexed;
753
754typedef
755#include "vmware_pack_begin.h"
756struct {
757 /*
758 * Describe a vertex array's data type, and define how it is to be
759 * used by the fixed function pipeline or the vertex shader. It
760 * isn't useful to have two VertexDecls with the same
761 * VertexArrayIdentity in one draw call.
762 */
763 uint16 streamOffset;
764 uint8 stream;
765 uint8 type; /* SVGA3dDeclType */
766 uint8 method; /* SVGA3dDeclMethod */
767 uint8 usage; /* SVGA3dDeclUsage */
768 uint8 usageIndex;
769 uint8 padding;
770
771}
772#include "vmware_pack_end.h"
773SVGA3dVertexElement;
774
775typedef
776#include "vmware_pack_begin.h"
777struct {
778 uint32 cid;
779
780 uint32 numElements;
781
782 /*
783 * Followed by numElements SVGA3dVertexElement structures.
784 *
785 * If numElements < SVGA3D_MAX_VERTEX_ARRAYS, the remaining elements
786 * are cleared and will not be used by following draws.
787 */
788}
789#include "vmware_pack_end.h"
790SVGA3dCmdSetVertexDecls;
791
792typedef
793#include "vmware_pack_begin.h"
794struct {
795 uint32 sid;
796 uint32 stride;
797 uint32 offset;
798}
799#include "vmware_pack_end.h"
800SVGA3dVertexStream;
801
802typedef
803#include "vmware_pack_begin.h"
804struct {
805 uint32 cid;
806
807 uint32 numStreams;
808 /*
809 * Followed by numStream SVGA3dVertexStream structures.
810 *
811 * If numStreams < SVGA3D_MAX_VERTEX_ARRAYS, the remaining streams
812 * are cleared and will not be used by following draws.
813 */
814}
815#include "vmware_pack_end.h"
816SVGA3dCmdSetVertexStreams;
817
818typedef
819#include "vmware_pack_begin.h"
820struct {
821 uint32 cid;
822 uint32 numDivisors;
823}
824#include "vmware_pack_end.h"
825SVGA3dCmdSetVertexDivisors;
826
827typedef
828#include "vmware_pack_begin.h"
829struct {
830 uint32 stage;
831 SVGA3dTextureStateName name;
832 union {
833 uint32 value;
834 float floatValue;
835 };
836}
837#include "vmware_pack_end.h"
838SVGA3dTextureState;
839
840typedef
841#include "vmware_pack_begin.h"
842struct {
843 uint32 cid;
844 /* Followed by variable number of SVGA3dTextureState structures */
845}
846#include "vmware_pack_end.h"
847SVGA3dCmdSetTextureState; /* SVGA_3D_CMD_SETTEXTURESTATE */
848
849typedef
850#include "vmware_pack_begin.h"
851struct {
852 uint32 cid;
853 SVGA3dTransformType type;
854 float matrix[16];
855}
856#include "vmware_pack_end.h"
857SVGA3dCmdSetTransform; /* SVGA_3D_CMD_SETTRANSFORM */
858
859typedef
860#include "vmware_pack_begin.h"
861struct {
862 float min;
863 float max;
864}
865#include "vmware_pack_end.h"
866SVGA3dZRange;
867
868typedef
869#include "vmware_pack_begin.h"
870struct {
871 uint32 cid;
872 SVGA3dZRange zRange;
873}
874#include "vmware_pack_end.h"
875SVGA3dCmdSetZRange; /* SVGA_3D_CMD_SETZRANGE */
876
877typedef
878#include "vmware_pack_begin.h"
879struct {
880 float diffuse[4];
881 float ambient[4];
882 float specular[4];
883 float emissive[4];
884 float shininess;
885}
886#include "vmware_pack_end.h"
887SVGA3dMaterial;
888
889typedef
890#include "vmware_pack_begin.h"
891struct {
892 uint32 cid;
893 SVGA3dFace face;
894 SVGA3dMaterial material;
895}
896#include "vmware_pack_end.h"
897SVGA3dCmdSetMaterial; /* SVGA_3D_CMD_SETMATERIAL */
898
899typedef
900#include "vmware_pack_begin.h"
901struct {
902 uint32 cid;
903 uint32 index;
904 SVGA3dLightData data;
905}
906#include "vmware_pack_end.h"
907SVGA3dCmdSetLightData; /* SVGA_3D_CMD_SETLIGHTDATA */
908
909typedef
910#include "vmware_pack_begin.h"
911struct {
912 uint32 cid;
913 uint32 index;
914 uint32 enabled;
915}
916#include "vmware_pack_end.h"
917SVGA3dCmdSetLightEnabled; /* SVGA_3D_CMD_SETLIGHTENABLED */
918
919typedef
920#include "vmware_pack_begin.h"
921struct {
922 uint32 cid;
923 SVGA3dRect rect;
924}
925#include "vmware_pack_end.h"
926SVGA3dCmdSetViewport; /* SVGA_3D_CMD_SETVIEWPORT */
927
928typedef
929#include "vmware_pack_begin.h"
930struct {
931 uint32 cid;
932 SVGA3dRect rect;
933}
934#include "vmware_pack_end.h"
935SVGA3dCmdSetScissorRect; /* SVGA_3D_CMD_SETSCISSORRECT */
936
937typedef
938#include "vmware_pack_begin.h"
939struct {
940 uint32 cid;
941 uint32 index;
942 float plane[4];
943}
944#include "vmware_pack_end.h"
945SVGA3dCmdSetClipPlane; /* SVGA_3D_CMD_SETCLIPPLANE */
946
947typedef
948#include "vmware_pack_begin.h"
949struct {
950 uint32 cid;
951 uint32 shid;
952 SVGA3dShaderType type;
953 /* Followed by variable number of DWORDs for shader bycode */
954}
955#include "vmware_pack_end.h"
956SVGA3dCmdDefineShader; /* SVGA_3D_CMD_SHADER_DEFINE */
957
958typedef
959#include "vmware_pack_begin.h"
960struct {
961 uint32 cid;
962 uint32 shid;
963 SVGA3dShaderType type;
964}
965#include "vmware_pack_end.h"
966SVGA3dCmdDestroyShader; /* SVGA_3D_CMD_SHADER_DESTROY */
967
968typedef
969#include "vmware_pack_begin.h"
970struct {
971 uint32 cid;
972 uint32 reg; /* register number */
973 SVGA3dShaderType type;
974 SVGA3dShaderConstType ctype;
975 uint32 values[4];
976
977 /*
978 * Followed by a variable number of additional values.
979 */
980}
981#include "vmware_pack_end.h"
982SVGA3dCmdSetShaderConst; /* SVGA_3D_CMD_SET_SHADER_CONST */
983
984typedef
985#include "vmware_pack_begin.h"
986struct {
987 uint32 cid;
988 SVGA3dShaderType type;
989 uint32 shid;
990}
991#include "vmware_pack_end.h"
992SVGA3dCmdSetShader; /* SVGA_3D_CMD_SET_SHADER */
993
994typedef
995#include "vmware_pack_begin.h"
996struct {
997 uint32 cid;
998 SVGA3dQueryType type;
999}
1000#include "vmware_pack_end.h"
1001SVGA3dCmdBeginQuery; /* SVGA_3D_CMD_BEGIN_QUERY */
1002
1003typedef
1004#include "vmware_pack_begin.h"
1005struct {
1006 uint32 cid;
1007 SVGA3dQueryType type;
1008 SVGAGuestPtr guestResult; /* Points to an SVGA3dQueryResult structure */
1009}
1010#include "vmware_pack_end.h"
1011SVGA3dCmdEndQuery; /* SVGA_3D_CMD_END_QUERY */
1012
1013
1014/*
1015 * SVGA3D_CMD_WAIT_FOR_QUERY --
1016 *
1017 * Will read the SVGA3dQueryResult structure pointed to by guestResult,
1018 * and if the state member is set to anything else than
1019 * SVGA3D_QUERYSTATE_PENDING, this command will always be a no-op.
1020 *
1021 * Otherwise, in addition to the query explicitly waited for,
1022 * All queries with the same type and issued with the same cid, for which
1023 * an SVGA_3D_CMD_END_QUERY command has previously been sent, will
1024 * be finished after execution of this command.
1025 *
1026 * A query will be identified by the gmrId and offset of the guestResult
1027 * member. If the device can't find an SVGA_3D_CMD_END_QUERY that has
1028 * been sent previously with an indentical gmrId and offset, it will
1029 * effectively end all queries with an identical type issued with the
1030 * same cid, and the SVGA3dQueryResult structure pointed to by
1031 * guestResult will not be written to. This property can be used to
1032 * implement a query barrier for a given cid and query type.
1033 */
1034
1035typedef
1036#include "vmware_pack_begin.h"
1037struct {
1038 uint32 cid; /* Same parameters passed to END_QUERY */
1039 SVGA3dQueryType type;
1040 SVGAGuestPtr guestResult;
1041}
1042#include "vmware_pack_end.h"
1043SVGA3dCmdWaitForQuery; /* SVGA_3D_CMD_WAIT_FOR_QUERY */
1044
1045typedef
1046#include "vmware_pack_begin.h"
1047struct {
1048 uint32 totalSize; /* Set by guest before query is ended. */
1049 SVGA3dQueryState state; /* Set by host or guest. See SVGA3dQueryState. */
1050 union { /* Set by host on exit from PENDING state */
1051 uint32 result32;
1052 uint32 queryCookie; /* May be used to identify which QueryGetData this
1053 result corresponds to. */
1054 };
1055}
1056#include "vmware_pack_end.h"
1057SVGA3dQueryResult;
1058
1059
1060/*
1061 * SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN --
1062 *
1063 * This is a blit from an SVGA3D surface to a Screen Object.
1064 * This blit must be directed at a specific screen.
1065 *
1066 * The blit copies from a rectangular region of an SVGA3D surface
1067 * image to a rectangular region of a screen.
1068 *
1069 * This command takes an optional variable-length list of clipping
1070 * rectangles after the body of the command. If no rectangles are
1071 * specified, there is no clipping region. The entire destRect is
1072 * drawn to. If one or more rectangles are included, they describe
1073 * a clipping region. The clip rectangle coordinates are measured
1074 * relative to the top-left corner of destRect.
1075 *
1076 * The srcImage must be from mip=0 face=0.
1077 *
1078 * This supports scaling if the src and dest are of different sizes.
1079 *
1080 * Availability:
1081 * SVGA_FIFO_CAP_SCREEN_OBJECT
1082 */
1083
1084typedef
1085#include "vmware_pack_begin.h"
1086struct {
1087 SVGA3dSurfaceImageId srcImage;
1088 SVGASignedRect srcRect;
1089 uint32 destScreenId; /* Screen Object ID */
1090 SVGASignedRect destRect;
1091 /* Clipping: zero or more SVGASignedRects follow */
1092}
1093#include "vmware_pack_end.h"
1094SVGA3dCmdBlitSurfaceToScreen; /* SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN */
1095
1096typedef
1097#include "vmware_pack_begin.h"
1098struct {
1099 uint32 sid;
1100 SVGA3dTextureFilter filter;
1101}
1102#include "vmware_pack_end.h"
1103SVGA3dCmdGenerateMipmaps; /* SVGA_3D_CMD_GENERATE_MIPMAPS */
1104
1105
1106
1107typedef
1108#include "vmware_pack_begin.h"
1109struct {
1110 uint32 sid;
1111}
1112#include "vmware_pack_end.h"
1113SVGA3dCmdActivateSurface; /* SVGA_3D_CMD_ACTIVATE_SURFACE */
1114
1115typedef
1116#include "vmware_pack_begin.h"
1117struct {
1118 uint32 sid;
1119}
1120#include "vmware_pack_end.h"
1121SVGA3dCmdDeactivateSurface; /* SVGA_3D_CMD_DEACTIVATE_SURFACE */
1122
1123/*
1124 * Screen DMA command
1125 *
1126 * Available with SVGA_FIFO_CAP_SCREEN_OBJECT_2. The SVGA_CAP_3D device
1127 * cap bit is not required.
1128 *
1129 * - refBuffer and destBuffer are 32bit BGRX; refBuffer and destBuffer could
1130 * be different, but it is required that guest makes sure refBuffer has
1131 * exactly the same contents that were written to when last time screen DMA
1132 * command is received by host.
1133 *
1134 * - changemap is generated by lib/blit, and it has the changes from last
1135 * received screen DMA or more.
1136 */
1137
1138typedef
1139#include "vmware_pack_begin.h"
1140struct SVGA3dCmdScreenDMA {
1141 uint32 screenId;
1142 SVGAGuestImage refBuffer;
1143 SVGAGuestImage destBuffer;
1144 SVGAGuestImage changeMap;
1145}
1146#include "vmware_pack_end.h"
1147SVGA3dCmdScreenDMA; /* SVGA_3D_CMD_SCREEN_DMA */
1148
1149/*
1150 * Set Unity Surface Cookie
1151 *
1152 * Associates the supplied cookie with the surface id for use with
1153 * Unity. This cookie is a hint from guest to host, there is no way
1154 * for the guest to readback the cookie and the host is free to drop
1155 * the cookie association at will. The default value for the cookie
1156 * on all surfaces is 0.
1157 */
1158
1159typedef
1160#include "vmware_pack_begin.h"
1161struct SVGA3dCmdSetUnitySurfaceCookie {
1162 uint32 sid;
1163 uint64 cookie;
1164}
1165#include "vmware_pack_end.h"
1166SVGA3dCmdSetUnitySurfaceCookie; /* SVGA_3D_CMD_SET_UNITY_SURFACE_COOKIE */
1167
1168/*
1169 * Open a context-specific surface in a non-context-specific manner.
1170 */
1171
1172typedef
1173#include "vmware_pack_begin.h"
1174struct SVGA3dCmdOpenContextSurface {
1175 uint32 sid;
1176}
1177#include "vmware_pack_end.h"
1178SVGA3dCmdOpenContextSurface; /* SVGA_3D_CMD_OPEN_CONTEXT_SURFACE */
1179
1180
1181/*
1182 * Logic ops
1183 */
1184
1185#define SVGA3D_LOTRANSBLT_HONORALPHA (0x01)
1186#define SVGA3D_LOSTRETCHBLT_MIRRORX (0x01)
1187#define SVGA3D_LOSTRETCHBLT_MIRRORY (0x02)
1188#define SVGA3D_LOALPHABLEND_SRCHASALPHA (0x01)
1189
1190typedef
1191#include "vmware_pack_begin.h"
1192struct SVGA3dCmdLogicOpsBitBlt {
1193 /*
1194 * All LogicOps surfaces are one-level
1195 * surfaces so mipmap & face should always
1196 * be zero.
1197 */
1198 SVGA3dSurfaceImageId src;
1199 SVGA3dSurfaceImageId dst;
1200 SVGA3dLogicOp logicOp;
1201 /* Followed by variable number of SVGA3dCopyBox structures */
1202}
1203#include "vmware_pack_end.h"
1204SVGA3dCmdLogicOpsBitBlt; /* SVGA_3D_CMD_LOGICOPS_BITBLT */
1205
1206
1207typedef
1208#include "vmware_pack_begin.h"
1209struct SVGA3dCmdLogicOpsTransBlt {
1210 /*
1211 * All LogicOps surfaces are one-level
1212 * surfaces so mipmap & face should always
1213 * be zero.
1214 */
1215 SVGA3dSurfaceImageId src;
1216 SVGA3dSurfaceImageId dst;
1217 uint32 color;
1218 uint32 flags;
1219 SVGA3dBox srcBox;
1220 SVGA3dBox dstBox;
1221}
1222#include "vmware_pack_end.h"
1223SVGA3dCmdLogicOpsTransBlt; /* SVGA_3D_CMD_LOGICOPS_TRANSBLT */
1224
1225
1226typedef
1227#include "vmware_pack_begin.h"
1228struct SVGA3dCmdLogicOpsStretchBlt {
1229 /*
1230 * All LogicOps surfaces are one-level
1231 * surfaces so mipmap & face should always
1232 * be zero.
1233 */
1234 SVGA3dSurfaceImageId src;
1235 SVGA3dSurfaceImageId dst;
1236 uint16 mode;
1237 uint16 flags;
1238 SVGA3dBox srcBox;
1239 SVGA3dBox dstBox;
1240}
1241#include "vmware_pack_end.h"
1242SVGA3dCmdLogicOpsStretchBlt; /* SVGA_3D_CMD_LOGICOPS_STRETCHBLT */
1243
1244
1245typedef
1246#include "vmware_pack_begin.h"
1247struct SVGA3dCmdLogicOpsColorFill {
1248 /*
1249 * All LogicOps surfaces are one-level
1250 * surfaces so mipmap & face should always
1251 * be zero.
1252 */
1253 SVGA3dSurfaceImageId dst;
1254 uint32 color;
1255 SVGA3dLogicOp logicOp;
1256 /* Followed by variable number of SVGA3dRect structures. */
1257}
1258#include "vmware_pack_end.h"
1259SVGA3dCmdLogicOpsColorFill; /* SVGA_3D_CMD_LOGICOPS_COLORFILL */
1260
1261
1262typedef
1263#include "vmware_pack_begin.h"
1264struct SVGA3dCmdLogicOpsAlphaBlend {
1265 /*
1266 * All LogicOps surfaces are one-level
1267 * surfaces so mipmap & face should always
1268 * be zero.
1269 */
1270 SVGA3dSurfaceImageId src;
1271 SVGA3dSurfaceImageId dst;
1272 uint32 alphaVal;
1273 uint32 flags;
1274 SVGA3dBox srcBox;
1275 SVGA3dBox dstBox;
1276}
1277#include "vmware_pack_end.h"
1278SVGA3dCmdLogicOpsAlphaBlend; /* SVGA_3D_CMD_LOGICOPS_ALPHABLEND */
1279
1280#define SVGA3D_CLEARTYPE_INVALID_GAMMA_INDEX 0xFFFFFFFF
1281
1282#define SVGA3D_CLEARTYPE_GAMMA_WIDTH 512
1283#define SVGA3D_CLEARTYPE_GAMMA_HEIGHT 16
1284
1285typedef
1286#include "vmware_pack_begin.h"
1287struct SVGA3dCmdLogicOpsClearTypeBlend {
1288 /*
1289 * All LogicOps surfaces are one-level
1290 * surfaces so mipmap & face should always
1291 * be zero.
1292 */
1293 SVGA3dSurfaceImageId tmp;
1294 SVGA3dSurfaceImageId dst;
1295 SVGA3dSurfaceImageId gammaSurf;
1296 SVGA3dSurfaceImageId alphaSurf;
1297 uint32 gamma;
1298 uint32 color;
1299 uint32 color2;
1300 int32 alphaOffsetX;
1301 int32 alphaOffsetY;
1302 /* Followed by variable number of SVGA3dBox structures */
1303}
1304#include "vmware_pack_end.h"
1305SVGA3dCmdLogicOpsClearTypeBlend; /* SVGA_3D_CMD_LOGICOPS_CLEARTYPEBLEND */
1306
1307
1308/*
1309 * Guest-backed objects definitions.
1310 */
1311
1312typedef
1313#include "vmware_pack_begin.h"
1314struct {
1315 SVGAMobFormat ptDepth;
1316 uint32 sizeInBytes;
1317 PPN64 base;
1318}
1319#include "vmware_pack_end.h"
1320SVGAOTableMobEntry;
1321#define SVGA3D_OTABLE_MOB_ENTRY_SIZE (sizeof(SVGAOTableMobEntry))
1322
1323typedef
1324#include "vmware_pack_begin.h"
1325struct {
1326 SVGA3dSurfaceFormat format;
1327 SVGA3dSurfaceFlags surfaceFlags;
1328 uint32 numMipLevels;
1329 uint32 multisampleCount;
1330 SVGA3dTextureFilter autogenFilter;
1331 SVGA3dSize size;
1332 SVGAMobId mobid;
1333 uint32 arraySize;
1334 uint32 mobPitch;
1335 uint32 pad[5];
1336}
1337#include "vmware_pack_end.h"
1338SVGAOTableSurfaceEntry;
1339#define SVGA3D_OTABLE_SURFACE_ENTRY_SIZE (sizeof(SVGAOTableSurfaceEntry))
1340
1341typedef
1342#include "vmware_pack_begin.h"
1343struct {
1344 uint32 cid;
1345 SVGAMobId mobid;
1346}
1347#include "vmware_pack_end.h"
1348SVGAOTableContextEntry;
1349#define SVGA3D_OTABLE_CONTEXT_ENTRY_SIZE (sizeof(SVGAOTableContextEntry))
1350
1351typedef
1352#include "vmware_pack_begin.h"
1353struct {
1354 SVGA3dShaderType type;
1355 uint32 sizeInBytes;
1356 uint32 offsetInBytes;
1357 SVGAMobId mobid;
1358}
1359#include "vmware_pack_end.h"
1360SVGAOTableShaderEntry;
1361#define SVGA3D_OTABLE_SHADER_ENTRY_SIZE (sizeof(SVGAOTableShaderEntry))
1362
1363#define SVGA_STFLAG_PRIMARY (1 << 0)
1364typedef uint32 SVGAScreenTargetFlags;
1365
1366typedef
1367#include "vmware_pack_begin.h"
1368struct {
1369 SVGA3dSurfaceImageId image;
1370 uint32 width;
1371 uint32 height;
1372 int32 xRoot;
1373 int32 yRoot;
1374 SVGAScreenTargetFlags flags;
1375 uint32 dpi;
1376 uint32 pad[7];
1377}
1378#include "vmware_pack_end.h"
1379SVGAOTableScreenTargetEntry;
1380#define SVGA3D_OTABLE_SCREEN_TARGET_ENTRY_SIZE \
1381 (sizeof(SVGAOTableScreenTargetEntry))
1382
1383typedef
1384#include "vmware_pack_begin.h"
1385struct {
1386 float value[4];
1387}
1388#include "vmware_pack_end.h"
1389SVGA3dShaderConstFloat;
1390
1391typedef
1392#include "vmware_pack_begin.h"
1393struct {
1394 int32 value[4];
1395}
1396#include "vmware_pack_end.h"
1397SVGA3dShaderConstInt;
1398
1399typedef
1400#include "vmware_pack_begin.h"
1401struct {
1402 uint32 value;
1403}
1404#include "vmware_pack_end.h"
1405SVGA3dShaderConstBool;
1406
1407typedef
1408#include "vmware_pack_begin.h"
1409struct {
1410 uint16 streamOffset;
1411 uint8 stream;
1412 uint8 type;
1413 uint8 methodUsage;
1414 uint8 usageIndex;
1415}
1416#include "vmware_pack_end.h"
1417SVGAGBVertexElement;
1418
1419typedef
1420#include "vmware_pack_begin.h"
1421struct {
1422 uint32 sid;
1423 uint16 stride;
1424 uint32 offset;
1425}
1426#include "vmware_pack_end.h"
1427SVGAGBVertexStream;
1428typedef
1429#include "vmware_pack_begin.h"
1430struct {
1431 SVGA3dRect viewport;
1432 SVGA3dRect scissorRect;
1433 SVGA3dZRange zRange;
1434
1435 SVGA3dSurfaceImageId renderTargets[SVGA3D_RT_MAX];
1436 SVGAGBVertexElement decl1[4];
1437
1438 uint32 renderStates[SVGA3D_RS_MAX];
1439 SVGAGBVertexElement decl2[18];
1440 uint32 pad0[2];
1441
1442 struct {
1443 SVGA3dFace face;
1444 SVGA3dMaterial material;
1445 } material;
1446
1447 float clipPlanes[SVGA3D_NUM_CLIPPLANES][4];
1448 float matrices[SVGA3D_TRANSFORM_MAX][16];
1449
1450 SVGA3dBool lightEnabled[SVGA3D_NUM_LIGHTS];
1451 SVGA3dLightData lightData[SVGA3D_NUM_LIGHTS];
1452
1453 /*
1454 * Shaders currently bound
1455 */
1456 uint32 shaders[SVGA3D_NUM_SHADERTYPE_PREDX];
1457 SVGAGBVertexElement decl3[10];
1458 uint32 pad1[3];
1459
1460 uint32 occQueryActive;
1461 uint32 occQueryValue;
1462
1463 /*
1464 * Int/Bool Shader constants
1465 */
1466 SVGA3dShaderConstInt pShaderIValues[SVGA3D_CONSTINTREG_MAX];
1467 SVGA3dShaderConstInt vShaderIValues[SVGA3D_CONSTINTREG_MAX];
1468 uint16 pShaderBValues;
1469 uint16 vShaderBValues;
1470
1471
1472 SVGAGBVertexStream streams[SVGA3D_MAX_VERTEX_ARRAYS];
1473 SVGA3dVertexDivisor divisors[SVGA3D_MAX_VERTEX_ARRAYS];
1474 uint32 numVertexDecls;
1475 uint32 numVertexStreams;
1476 uint32 numVertexDivisors;
1477 uint32 pad2[30];
1478
1479 /*
1480 * Texture Stages
1481 *
1482 * SVGA3D_TS_INVALID through SVGA3D_TS_CONSTANT are in the
1483 * textureStages array.
1484 * SVGA3D_TS_COLOR_KEY is in tsColorKey.
1485 */
1486 uint32 tsColorKey[SVGA3D_NUM_TEXTURE_UNITS];
1487 uint32 textureStages[SVGA3D_NUM_TEXTURE_UNITS][SVGA3D_TS_CONSTANT + 1];
1488 uint32 tsColorKeyEnable[SVGA3D_NUM_TEXTURE_UNITS];
1489
1490 /*
1491 * Float Shader constants.
1492 */
1493 SVGA3dShaderConstFloat pShaderFValues[SVGA3D_CONSTREG_MAX];
1494 SVGA3dShaderConstFloat vShaderFValues[SVGA3D_CONSTREG_MAX];
1495}
1496#include "vmware_pack_end.h"
1497SVGAGBContextData;
1498#define SVGA3D_CONTEXT_DATA_SIZE (sizeof(SVGAGBContextData))
1499
1500/*
1501 * SVGA3dCmdSetOTableBase --
1502 *
1503 * This command allows the guest to specify the base PPN of the
1504 * specified object table.
1505 */
1506
1507typedef
1508#include "vmware_pack_begin.h"
1509struct {
1510 SVGAOTableType type;
1511 PPN baseAddress;
1512 uint32 sizeInBytes;
1513 uint32 validSizeInBytes;
1514 SVGAMobFormat ptDepth;
1515}
1516#include "vmware_pack_end.h"
1517SVGA3dCmdSetOTableBase; /* SVGA_3D_CMD_SET_OTABLE_BASE */
1518
1519typedef
1520#include "vmware_pack_begin.h"
1521struct {
1522 SVGAOTableType type;
1523 PPN64 baseAddress;
1524 uint32 sizeInBytes;
1525 uint32 validSizeInBytes;
1526 SVGAMobFormat ptDepth;
1527}
1528#include "vmware_pack_end.h"
1529SVGA3dCmdSetOTableBase64; /* SVGA_3D_CMD_SET_OTABLE_BASE64 */
1530
1531typedef
1532#include "vmware_pack_begin.h"
1533struct {
1534 SVGAOTableType type;
1535}
1536#include "vmware_pack_end.h"
1537SVGA3dCmdReadbackOTable; /* SVGA_3D_CMD_READBACK_OTABLE */
1538
1539/*
1540 * Define a memory object (Mob) in the OTable.
1541 */
1542
1543typedef
1544#include "vmware_pack_begin.h"
1545struct SVGA3dCmdDefineGBMob {
1546 SVGAMobId mobid;
1547 SVGAMobFormat ptDepth;
1548 PPN base;
1549 uint32 sizeInBytes;
1550}
1551#include "vmware_pack_end.h"
1552SVGA3dCmdDefineGBMob; /* SVGA_3D_CMD_DEFINE_GB_MOB */
1553
1554
1555/*
1556 * Destroys an object in the OTable.
1557 */
1558
1559typedef
1560#include "vmware_pack_begin.h"
1561struct SVGA3dCmdDestroyGBMob {
1562 SVGAMobId mobid;
1563}
1564#include "vmware_pack_end.h"
1565SVGA3dCmdDestroyGBMob; /* SVGA_3D_CMD_DESTROY_GB_MOB */
1566
1567
1568/*
1569 * Define a memory object (Mob) in the OTable with a PPN64 base.
1570 */
1571
1572typedef
1573#include "vmware_pack_begin.h"
1574struct SVGA3dCmdDefineGBMob64 {
1575 SVGAMobId mobid;
1576 SVGAMobFormat ptDepth;
1577 PPN64 base;
1578 uint32 sizeInBytes;
1579}
1580#include "vmware_pack_end.h"
1581SVGA3dCmdDefineGBMob64; /* SVGA_3D_CMD_DEFINE_GB_MOB64 */
1582
1583/*
1584 * Redefine an object in the OTable with PPN64 base.
1585 */
1586
1587typedef
1588#include "vmware_pack_begin.h"
1589struct SVGA3dCmdRedefineGBMob64 {
1590 SVGAMobId mobid;
1591 SVGAMobFormat ptDepth;
1592 PPN64 base;
1593 uint32 sizeInBytes;
1594}
1595#include "vmware_pack_end.h"
1596SVGA3dCmdRedefineGBMob64; /* SVGA_3D_CMD_REDEFINE_GB_MOB64 */
1597
1598/*
1599 * Notification that the page tables have been modified.
1600 */
1601
1602typedef
1603#include "vmware_pack_begin.h"
1604struct SVGA3dCmdUpdateGBMobMapping {
1605 SVGAMobId mobid;
1606}
1607#include "vmware_pack_end.h"
1608SVGA3dCmdUpdateGBMobMapping; /* SVGA_3D_CMD_UPDATE_GB_MOB_MAPPING */
1609
1610/*
1611 * Define a guest-backed surface.
1612 */
1613
1614typedef
1615#include "vmware_pack_begin.h"
1616struct SVGA3dCmdDefineGBSurface {
1617 uint32 sid;
1618 SVGA3dSurfaceFlags surfaceFlags;
1619 SVGA3dSurfaceFormat format;
1620 uint32 numMipLevels;
1621 uint32 multisampleCount;
1622 SVGA3dTextureFilter autogenFilter;
1623 SVGA3dSize size;
1624}
1625#include "vmware_pack_end.h"
1626SVGA3dCmdDefineGBSurface; /* SVGA_3D_CMD_DEFINE_GB_SURFACE */
1627
1628/*
1629 * Destroy a guest-backed surface.
1630 */
1631
1632typedef
1633#include "vmware_pack_begin.h"
1634struct SVGA3dCmdDestroyGBSurface {
1635 uint32 sid;
1636}
1637#include "vmware_pack_end.h"
1638SVGA3dCmdDestroyGBSurface; /* SVGA_3D_CMD_DESTROY_GB_SURFACE */
1639
1640/*
1641 * Bind a guest-backed surface to a mob.
1642 */
1643
1644typedef
1645#include "vmware_pack_begin.h"
1646struct SVGA3dCmdBindGBSurface {
1647 uint32 sid;
1648 SVGAMobId mobid;
1649}
1650#include "vmware_pack_end.h"
1651SVGA3dCmdBindGBSurface; /* SVGA_3D_CMD_BIND_GB_SURFACE */
1652
1653typedef
1654#include "vmware_pack_begin.h"
1655struct SVGA3dCmdBindGBSurfaceWithPitch {
1656 uint32 sid;
1657 SVGAMobId mobid;
1658 uint32 baseLevelPitch;
1659}
1660#include "vmware_pack_end.h"
1661SVGA3dCmdBindGBSurfaceWithPitch; /* SVGA_3D_CMD_BIND_GB_SURFACE_WITH_PITCH */
1662
1663/*
1664 * Conditionally bind a mob to a guest-backed surface if testMobid
1665 * matches the currently bound mob. Optionally issue a
1666 * readback/update on the surface while it is still bound to the old
1667 * mobid if the mobid is changed by this command.
1668 */
1669
1670#define SVGA3D_COND_BIND_GB_SURFACE_FLAG_READBACK (1 << 0)
1671#define SVGA3D_COND_BIND_GB_SURFACE_FLAG_UPDATE (1 << 1)
1672
1673typedef
1674#include "vmware_pack_begin.h"
1675struct{
1676 uint32 sid;
1677 SVGAMobId testMobid;
1678 SVGAMobId mobid;
1679 uint32 flags;
1680}
1681#include "vmware_pack_end.h"
1682SVGA3dCmdCondBindGBSurface; /* SVGA_3D_CMD_COND_BIND_GB_SURFACE */
1683
1684/*
1685 * Update an image in a guest-backed surface.
1686 * (Inform the device that the guest-contents have been updated.)
1687 */
1688
1689typedef
1690#include "vmware_pack_begin.h"
1691struct SVGA3dCmdUpdateGBImage {
1692 SVGA3dSurfaceImageId image;
1693 SVGA3dBox box;
1694}
1695#include "vmware_pack_end.h"
1696SVGA3dCmdUpdateGBImage; /* SVGA_3D_CMD_UPDATE_GB_IMAGE */
1697
1698/*
1699 * Update an entire guest-backed surface.
1700 * (Inform the device that the guest-contents have been updated.)
1701 */
1702
1703typedef
1704#include "vmware_pack_begin.h"
1705struct SVGA3dCmdUpdateGBSurface {
1706 uint32 sid;
1707}
1708#include "vmware_pack_end.h"
1709SVGA3dCmdUpdateGBSurface; /* SVGA_3D_CMD_UPDATE_GB_SURFACE */
1710
1711/*
1712 * Readback an image in a guest-backed surface.
1713 * (Request the device to flush the dirty contents into the guest.)
1714 */
1715
1716typedef
1717#include "vmware_pack_begin.h"
1718struct SVGA3dCmdReadbackGBImage {
1719 SVGA3dSurfaceImageId image;
1720}
1721#include "vmware_pack_end.h"
1722SVGA3dCmdReadbackGBImage; /* SVGA_3D_CMD_READBACK_GB_IMAGE */
1723
1724/*
1725 * Readback an entire guest-backed surface.
1726 * (Request the device to flush the dirty contents into the guest.)
1727 */
1728
1729typedef
1730#include "vmware_pack_begin.h"
1731struct SVGA3dCmdReadbackGBSurface {
1732 uint32 sid;
1733}
1734#include "vmware_pack_end.h"
1735SVGA3dCmdReadbackGBSurface; /* SVGA_3D_CMD_READBACK_GB_SURFACE */
1736
1737/*
1738 * Readback a sub rect of an image in a guest-backed surface. After
1739 * issuing this command the driver is required to issue an update call
1740 * of the same region before issuing any other commands that reference
1741 * this surface or rendering is not guaranteed.
1742 */
1743
1744typedef
1745#include "vmware_pack_begin.h"
1746struct SVGA3dCmdReadbackGBImagePartial {
1747 SVGA3dSurfaceImageId image;
1748 SVGA3dBox box;
1749 uint32 invertBox;
1750}
1751#include "vmware_pack_end.h"
1752SVGA3dCmdReadbackGBImagePartial; /* SVGA_3D_CMD_READBACK_GB_IMAGE_PARTIAL */
1753
1754
1755/*
1756 * Invalidate an image in a guest-backed surface.
1757 * (Notify the device that the contents can be lost.)
1758 */
1759
1760typedef
1761#include "vmware_pack_begin.h"
1762struct SVGA3dCmdInvalidateGBImage {
1763 SVGA3dSurfaceImageId image;
1764}
1765#include "vmware_pack_end.h"
1766SVGA3dCmdInvalidateGBImage; /* SVGA_3D_CMD_INVALIDATE_GB_IMAGE */
1767
1768/*
1769 * Invalidate an entire guest-backed surface.
1770 * (Notify the device that the contents if all images can be lost.)
1771 */
1772
1773typedef
1774#include "vmware_pack_begin.h"
1775struct SVGA3dCmdInvalidateGBSurface {
1776 uint32 sid;
1777}
1778#include "vmware_pack_end.h"
1779SVGA3dCmdInvalidateGBSurface; /* SVGA_3D_CMD_INVALIDATE_GB_SURFACE */
1780
1781/*
1782 * Invalidate a sub rect of an image in a guest-backed surface. After
1783 * issuing this command the driver is required to issue an update call
1784 * of the same region before issuing any other commands that reference
1785 * this surface or rendering is not guaranteed.
1786 */
1787
1788typedef
1789#include "vmware_pack_begin.h"
1790struct SVGA3dCmdInvalidateGBImagePartial {
1791 SVGA3dSurfaceImageId image;
1792 SVGA3dBox box;
1793 uint32 invertBox;
1794}
1795#include "vmware_pack_end.h"
1796SVGA3dCmdInvalidateGBImagePartial; /* SVGA_3D_CMD_INVALIDATE_GB_IMAGE_PARTIAL */
1797
1798
1799/*
1800 * Define a guest-backed context.
1801 */
1802
1803typedef
1804#include "vmware_pack_begin.h"
1805struct SVGA3dCmdDefineGBContext {
1806 uint32 cid;
1807}
1808#include "vmware_pack_end.h"
1809SVGA3dCmdDefineGBContext; /* SVGA_3D_CMD_DEFINE_GB_CONTEXT */
1810
1811/*
1812 * Destroy a guest-backed context.
1813 */
1814
1815typedef
1816#include "vmware_pack_begin.h"
1817struct SVGA3dCmdDestroyGBContext {
1818 uint32 cid;
1819}
1820#include "vmware_pack_end.h"
1821SVGA3dCmdDestroyGBContext; /* SVGA_3D_CMD_DESTROY_GB_CONTEXT */
1822
1823/*
1824 * Bind a guest-backed context.
1825 *
1826 * validContents should be set to 0 for new contexts,
1827 * and 1 if this is an old context which is getting paged
1828 * back on to the device.
1829 *
1830 * For new contexts, it is recommended that the driver
1831 * issue commands to initialize all interesting state
1832 * prior to rendering.
1833 */
1834
1835typedef
1836#include "vmware_pack_begin.h"
1837struct SVGA3dCmdBindGBContext {
1838 uint32 cid;
1839 SVGAMobId mobid;
1840 uint32 validContents;
1841}
1842#include "vmware_pack_end.h"
1843SVGA3dCmdBindGBContext; /* SVGA_3D_CMD_BIND_GB_CONTEXT */
1844
1845/*
1846 * Readback a guest-backed context.
1847 * (Request that the device flush the contents back into guest memory.)
1848 */
1849
1850typedef
1851#include "vmware_pack_begin.h"
1852struct SVGA3dCmdReadbackGBContext {
1853 uint32 cid;
1854}
1855#include "vmware_pack_end.h"
1856SVGA3dCmdReadbackGBContext; /* SVGA_3D_CMD_READBACK_GB_CONTEXT */
1857
1858/*
1859 * Invalidate a guest-backed context.
1860 */
1861typedef
1862#include "vmware_pack_begin.h"
1863struct SVGA3dCmdInvalidateGBContext {
1864 uint32 cid;
1865}
1866#include "vmware_pack_end.h"
1867SVGA3dCmdInvalidateGBContext; /* SVGA_3D_CMD_INVALIDATE_GB_CONTEXT */
1868
1869/*
1870 * Define a guest-backed shader.
1871 */
1872
1873typedef
1874#include "vmware_pack_begin.h"
1875struct SVGA3dCmdDefineGBShader {
1876 uint32 shid;
1877 SVGA3dShaderType type;
1878 uint32 sizeInBytes;
1879}
1880#include "vmware_pack_end.h"
1881SVGA3dCmdDefineGBShader; /* SVGA_3D_CMD_DEFINE_GB_SHADER */
1882
1883/*
1884 * Bind a guest-backed shader.
1885 */
1886
1887typedef
1888#include "vmware_pack_begin.h"
1889struct SVGA3dCmdBindGBShader {
1890 uint32 shid;
1891 SVGAMobId mobid;
1892 uint32 offsetInBytes;
1893}
1894#include "vmware_pack_end.h"
1895SVGA3dCmdBindGBShader; /* SVGA_3D_CMD_BIND_GB_SHADER */
1896
1897/*
1898 * Destroy a guest-backed shader.
1899 */
1900
1901typedef
1902#include "vmware_pack_begin.h"
1903struct SVGA3dCmdDestroyGBShader {
1904 uint32 shid;
1905}
1906#include "vmware_pack_end.h"
1907SVGA3dCmdDestroyGBShader; /* SVGA_3D_CMD_DESTROY_GB_SHADER */
1908
1909typedef
1910#include "vmware_pack_begin.h"
1911struct {
1912 uint32 cid;
1913 uint32 regStart;
1914 SVGA3dShaderType shaderType;
1915 SVGA3dShaderConstType constType;
1916
1917 /*
1918 * Followed by a variable number of shader constants.
1919 *
1920 * Note that FLOAT and INT constants are 4-dwords in length, while
1921 * BOOL constants are 1-dword in length.
1922 */
1923}
1924#include "vmware_pack_end.h"
1925SVGA3dCmdSetGBShaderConstInline; /* SVGA_3D_CMD_SET_GB_SHADERCONSTS_INLINE */
1926
1927
1928typedef
1929#include "vmware_pack_begin.h"
1930struct {
1931 uint32 cid;
1932 SVGA3dQueryType type;
1933}
1934#include "vmware_pack_end.h"
1935SVGA3dCmdBeginGBQuery; /* SVGA_3D_CMD_BEGIN_GB_QUERY */
1936
1937typedef
1938#include "vmware_pack_begin.h"
1939struct {
1940 uint32 cid;
1941 SVGA3dQueryType type;
1942 SVGAMobId mobid;
1943 uint32 offset;
1944}
1945#include "vmware_pack_end.h"
1946SVGA3dCmdEndGBQuery; /* SVGA_3D_CMD_END_GB_QUERY */
1947
1948
1949/*
1950 * SVGA_3D_CMD_WAIT_FOR_GB_QUERY --
1951 *
1952 * The semantics of this command are identical to the
1953 * SVGA_3D_CMD_WAIT_FOR_QUERY except that the results are written
1954 * to a Mob instead of a GMR.
1955 */
1956
1957typedef
1958#include "vmware_pack_begin.h"
1959struct {
1960 uint32 cid;
1961 SVGA3dQueryType type;
1962 SVGAMobId mobid;
1963 uint32 offset;
1964}
1965#include "vmware_pack_end.h"
1966SVGA3dCmdWaitForGBQuery; /* SVGA_3D_CMD_WAIT_FOR_GB_QUERY */
1967
1968
1969typedef
1970#include "vmware_pack_begin.h"
1971struct {
1972 SVGAMobId mobid;
1973 uint32 mustBeZero;
1974 uint32 initialized;
1975}
1976#include "vmware_pack_end.h"
1977SVGA3dCmdEnableGart; /* SVGA_3D_CMD_ENABLE_GART */
1978
1979typedef
1980#include "vmware_pack_begin.h"
1981struct {
1982 SVGAMobId mobid;
1983 uint32 gartOffset;
1984}
1985#include "vmware_pack_end.h"
1986SVGA3dCmdMapMobIntoGart; /* SVGA_3D_CMD_MAP_MOB_INTO_GART */
1987
1988
1989typedef
1990#include "vmware_pack_begin.h"
1991struct {
1992 uint32 gartOffset;
1993 uint32 numPages;
1994}
1995#include "vmware_pack_end.h"
1996SVGA3dCmdUnmapGartRange; /* SVGA_3D_CMD_UNMAP_GART_RANGE */
1997
1998
1999/*
2000 * Screen Targets
2001 */
2002
2003typedef
2004#include "vmware_pack_begin.h"
2005struct {
2006 uint32 stid;
2007 uint32 width;
2008 uint32 height;
2009 int32 xRoot;
2010 int32 yRoot;
2011 SVGAScreenTargetFlags flags;
2012
2013 /*
2014 * The physical DPI that the guest expects this screen displayed at.
2015 *
2016 * Guests which are not DPI-aware should set this to zero.
2017 */
2018 uint32 dpi;
2019}
2020#include "vmware_pack_end.h"
2021SVGA3dCmdDefineGBScreenTarget; /* SVGA_3D_CMD_DEFINE_GB_SCREENTARGET */
2022
2023typedef
2024#include "vmware_pack_begin.h"
2025struct {
2026 uint32 stid;
2027}
2028#include "vmware_pack_end.h"
2029SVGA3dCmdDestroyGBScreenTarget; /* SVGA_3D_CMD_DESTROY_GB_SCREENTARGET */
2030
2031typedef
2032#include "vmware_pack_begin.h"
2033struct {
2034 uint32 stid;
2035 SVGA3dSurfaceImageId image;
2036}
2037#include "vmware_pack_end.h"
2038SVGA3dCmdBindGBScreenTarget; /* SVGA_3D_CMD_BIND_GB_SCREENTARGET */
2039
2040typedef
2041#include "vmware_pack_begin.h"
2042struct {
2043 uint32 stid;
2044 SVGA3dRect rect;
2045}
2046#include "vmware_pack_end.h"
2047SVGA3dCmdUpdateGBScreenTarget; /* SVGA_3D_CMD_UPDATE_GB_SCREENTARGET */
2048
2049typedef
2050#include "vmware_pack_begin.h"
2051struct SVGA3dCmdGBScreenDMA {
2052 uint32 screenId;
2053 uint32 dead;
2054 SVGAMobId destMobID;
2055 uint32 destPitch;
2056 SVGAMobId changeMapMobID;
2057}
2058#include "vmware_pack_end.h"
2059SVGA3dCmdGBScreenDMA; /* SVGA_3D_CMD_GB_SCREEN_DMA */
2060
2061typedef
2062#include "vmware_pack_begin.h"
2063struct {
2064 uint32 value;
2065 uint32 mobId;
2066 uint32 mobOffset;
2067}
2068#include "vmware_pack_end.h"
2069SVGA3dCmdGBMobFence; /* SVGA_3D_CMD_GB_MOB_FENCE*/
2070
2071#endif /* _SVGA3D_CMD_H_ */
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
2/*
3 * Copyright 2012-2021 VMware, Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person
6 * obtaining a copy of this software and associated documentation
7 * files (the "Software"), to deal in the Software without
8 * restriction, including without limitation the rights to use, copy,
9 * modify, merge, publish, distribute, sublicense, and/or sell copies
10 * of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 *
25 */
26
27/*
28 * svga3d_cmd.h --
29 *
30 * SVGA 3d hardware cmd definitions
31 */
32
33
34
35#ifndef _SVGA3D_CMD_H_
36#define _SVGA3D_CMD_H_
37
38#include "svga3d_types.h"
39#include "svga3d_limits.h"
40#include "svga_reg.h"
41
42typedef enum SVGAFifo3dCmdId {
43 SVGA_3D_CMD_LEGACY_BASE = 1000,
44 SVGA_3D_CMD_BASE = 1040,
45
46 SVGA_3D_CMD_SURFACE_DEFINE = 1040,
47 SVGA_3D_CMD_SURFACE_DESTROY = 1041,
48 SVGA_3D_CMD_SURFACE_COPY = 1042,
49 SVGA_3D_CMD_SURFACE_STRETCHBLT = 1043,
50 SVGA_3D_CMD_SURFACE_DMA = 1044,
51 SVGA_3D_CMD_CONTEXT_DEFINE = 1045,
52 SVGA_3D_CMD_CONTEXT_DESTROY = 1046,
53 SVGA_3D_CMD_SETTRANSFORM = 1047,
54 SVGA_3D_CMD_SETZRANGE = 1048,
55 SVGA_3D_CMD_SETRENDERSTATE = 1049,
56 SVGA_3D_CMD_SETRENDERTARGET = 1050,
57 SVGA_3D_CMD_SETTEXTURESTATE = 1051,
58 SVGA_3D_CMD_SETMATERIAL = 1052,
59 SVGA_3D_CMD_SETLIGHTDATA = 1053,
60 SVGA_3D_CMD_SETLIGHTENABLED = 1054,
61 SVGA_3D_CMD_SETVIEWPORT = 1055,
62 SVGA_3D_CMD_SETCLIPPLANE = 1056,
63 SVGA_3D_CMD_CLEAR = 1057,
64 SVGA_3D_CMD_PRESENT = 1058,
65 SVGA_3D_CMD_SHADER_DEFINE = 1059,
66 SVGA_3D_CMD_SHADER_DESTROY = 1060,
67 SVGA_3D_CMD_SET_SHADER = 1061,
68 SVGA_3D_CMD_SET_SHADER_CONST = 1062,
69 SVGA_3D_CMD_DRAW_PRIMITIVES = 1063,
70 SVGA_3D_CMD_SETSCISSORRECT = 1064,
71 SVGA_3D_CMD_BEGIN_QUERY = 1065,
72 SVGA_3D_CMD_END_QUERY = 1066,
73 SVGA_3D_CMD_WAIT_FOR_QUERY = 1067,
74 SVGA_3D_CMD_PRESENT_READBACK = 1068,
75 SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN = 1069,
76 SVGA_3D_CMD_SURFACE_DEFINE_V2 = 1070,
77 SVGA_3D_CMD_GENERATE_MIPMAPS = 1071,
78 SVGA_3D_CMD_DEAD4 = 1072,
79 SVGA_3D_CMD_DEAD5 = 1073,
80 SVGA_3D_CMD_DEAD6 = 1074,
81 SVGA_3D_CMD_DEAD7 = 1075,
82 SVGA_3D_CMD_DEAD8 = 1076,
83 SVGA_3D_CMD_DEAD9 = 1077,
84 SVGA_3D_CMD_DEAD10 = 1078,
85 SVGA_3D_CMD_DEAD11 = 1079,
86 SVGA_3D_CMD_ACTIVATE_SURFACE = 1080,
87 SVGA_3D_CMD_DEACTIVATE_SURFACE = 1081,
88 SVGA_3D_CMD_SCREEN_DMA = 1082,
89 SVGA_3D_CMD_DEAD1 = 1083,
90 SVGA_3D_CMD_DEAD2 = 1084,
91
92 SVGA_3D_CMD_DEAD12 = 1085,
93 SVGA_3D_CMD_DEAD13 = 1086,
94 SVGA_3D_CMD_DEAD14 = 1087,
95 SVGA_3D_CMD_DEAD15 = 1088,
96 SVGA_3D_CMD_DEAD16 = 1089,
97 SVGA_3D_CMD_DEAD17 = 1090,
98
99 SVGA_3D_CMD_SET_OTABLE_BASE = 1091,
100 SVGA_3D_CMD_READBACK_OTABLE = 1092,
101
102 SVGA_3D_CMD_DEFINE_GB_MOB = 1093,
103 SVGA_3D_CMD_DESTROY_GB_MOB = 1094,
104 SVGA_3D_CMD_DEAD3 = 1095,
105 SVGA_3D_CMD_UPDATE_GB_MOB_MAPPING = 1096,
106
107 SVGA_3D_CMD_DEFINE_GB_SURFACE = 1097,
108 SVGA_3D_CMD_DESTROY_GB_SURFACE = 1098,
109 SVGA_3D_CMD_BIND_GB_SURFACE = 1099,
110 SVGA_3D_CMD_COND_BIND_GB_SURFACE = 1100,
111 SVGA_3D_CMD_UPDATE_GB_IMAGE = 1101,
112 SVGA_3D_CMD_UPDATE_GB_SURFACE = 1102,
113 SVGA_3D_CMD_READBACK_GB_IMAGE = 1103,
114 SVGA_3D_CMD_READBACK_GB_SURFACE = 1104,
115 SVGA_3D_CMD_INVALIDATE_GB_IMAGE = 1105,
116 SVGA_3D_CMD_INVALIDATE_GB_SURFACE = 1106,
117
118 SVGA_3D_CMD_DEFINE_GB_CONTEXT = 1107,
119 SVGA_3D_CMD_DESTROY_GB_CONTEXT = 1108,
120 SVGA_3D_CMD_BIND_GB_CONTEXT = 1109,
121 SVGA_3D_CMD_READBACK_GB_CONTEXT = 1110,
122 SVGA_3D_CMD_INVALIDATE_GB_CONTEXT = 1111,
123
124 SVGA_3D_CMD_DEFINE_GB_SHADER = 1112,
125 SVGA_3D_CMD_DESTROY_GB_SHADER = 1113,
126 SVGA_3D_CMD_BIND_GB_SHADER = 1114,
127
128 SVGA_3D_CMD_SET_OTABLE_BASE64 = 1115,
129
130 SVGA_3D_CMD_BEGIN_GB_QUERY = 1116,
131 SVGA_3D_CMD_END_GB_QUERY = 1117,
132 SVGA_3D_CMD_WAIT_FOR_GB_QUERY = 1118,
133
134 SVGA_3D_CMD_NOP = 1119,
135
136 SVGA_3D_CMD_ENABLE_GART = 1120,
137 SVGA_3D_CMD_DISABLE_GART = 1121,
138 SVGA_3D_CMD_MAP_MOB_INTO_GART = 1122,
139 SVGA_3D_CMD_UNMAP_GART_RANGE = 1123,
140
141 SVGA_3D_CMD_DEFINE_GB_SCREENTARGET = 1124,
142 SVGA_3D_CMD_DESTROY_GB_SCREENTARGET = 1125,
143 SVGA_3D_CMD_BIND_GB_SCREENTARGET = 1126,
144 SVGA_3D_CMD_UPDATE_GB_SCREENTARGET = 1127,
145
146 SVGA_3D_CMD_READBACK_GB_IMAGE_PARTIAL = 1128,
147 SVGA_3D_CMD_INVALIDATE_GB_IMAGE_PARTIAL = 1129,
148
149 SVGA_3D_CMD_SET_GB_SHADERCONSTS_INLINE = 1130,
150
151 SVGA_3D_CMD_GB_SCREEN_DMA = 1131,
152 SVGA_3D_CMD_BIND_GB_SURFACE_WITH_PITCH = 1132,
153 SVGA_3D_CMD_GB_MOB_FENCE = 1133,
154 SVGA_3D_CMD_DEFINE_GB_SURFACE_V2 = 1134,
155 SVGA_3D_CMD_DEFINE_GB_MOB64 = 1135,
156 SVGA_3D_CMD_REDEFINE_GB_MOB64 = 1136,
157 SVGA_3D_CMD_NOP_ERROR = 1137,
158
159 SVGA_3D_CMD_SET_VERTEX_STREAMS = 1138,
160 SVGA_3D_CMD_SET_VERTEX_DECLS = 1139,
161 SVGA_3D_CMD_SET_VERTEX_DIVISORS = 1140,
162 SVGA_3D_CMD_DRAW = 1141,
163 SVGA_3D_CMD_DRAW_INDEXED = 1142,
164
165 SVGA_3D_CMD_DX_MIN = 1143,
166 SVGA_3D_CMD_DX_DEFINE_CONTEXT = 1143,
167 SVGA_3D_CMD_DX_DESTROY_CONTEXT = 1144,
168 SVGA_3D_CMD_DX_BIND_CONTEXT = 1145,
169 SVGA_3D_CMD_DX_READBACK_CONTEXT = 1146,
170 SVGA_3D_CMD_DX_INVALIDATE_CONTEXT = 1147,
171 SVGA_3D_CMD_DX_SET_SINGLE_CONSTANT_BUFFER = 1148,
172 SVGA_3D_CMD_DX_SET_SHADER_RESOURCES = 1149,
173 SVGA_3D_CMD_DX_SET_SHADER = 1150,
174 SVGA_3D_CMD_DX_SET_SAMPLERS = 1151,
175 SVGA_3D_CMD_DX_DRAW = 1152,
176 SVGA_3D_CMD_DX_DRAW_INDEXED = 1153,
177 SVGA_3D_CMD_DX_DRAW_INSTANCED = 1154,
178 SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED = 1155,
179 SVGA_3D_CMD_DX_DRAW_AUTO = 1156,
180 SVGA_3D_CMD_DX_SET_INPUT_LAYOUT = 1157,
181 SVGA_3D_CMD_DX_SET_VERTEX_BUFFERS = 1158,
182 SVGA_3D_CMD_DX_SET_INDEX_BUFFER = 1159,
183 SVGA_3D_CMD_DX_SET_TOPOLOGY = 1160,
184 SVGA_3D_CMD_DX_SET_RENDERTARGETS = 1161,
185 SVGA_3D_CMD_DX_SET_BLEND_STATE = 1162,
186 SVGA_3D_CMD_DX_SET_DEPTHSTENCIL_STATE = 1163,
187 SVGA_3D_CMD_DX_SET_RASTERIZER_STATE = 1164,
188 SVGA_3D_CMD_DX_DEFINE_QUERY = 1165,
189 SVGA_3D_CMD_DX_DESTROY_QUERY = 1166,
190 SVGA_3D_CMD_DX_BIND_QUERY = 1167,
191 SVGA_3D_CMD_DX_SET_QUERY_OFFSET = 1168,
192 SVGA_3D_CMD_DX_BEGIN_QUERY = 1169,
193 SVGA_3D_CMD_DX_END_QUERY = 1170,
194 SVGA_3D_CMD_DX_READBACK_QUERY = 1171,
195 SVGA_3D_CMD_DX_SET_PREDICATION = 1172,
196 SVGA_3D_CMD_DX_SET_SOTARGETS = 1173,
197 SVGA_3D_CMD_DX_SET_VIEWPORTS = 1174,
198 SVGA_3D_CMD_DX_SET_SCISSORRECTS = 1175,
199 SVGA_3D_CMD_DX_CLEAR_RENDERTARGET_VIEW = 1176,
200 SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW = 1177,
201 SVGA_3D_CMD_DX_PRED_COPY_REGION = 1178,
202 SVGA_3D_CMD_DX_PRED_COPY = 1179,
203 SVGA_3D_CMD_DX_PRESENTBLT = 1180,
204 SVGA_3D_CMD_DX_GENMIPS = 1181,
205 SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE = 1182,
206 SVGA_3D_CMD_DX_READBACK_SUBRESOURCE = 1183,
207 SVGA_3D_CMD_DX_INVALIDATE_SUBRESOURCE = 1184,
208 SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW = 1185,
209 SVGA_3D_CMD_DX_DESTROY_SHADERRESOURCE_VIEW = 1186,
210 SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW = 1187,
211 SVGA_3D_CMD_DX_DESTROY_RENDERTARGET_VIEW = 1188,
212 SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW = 1189,
213 SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW = 1190,
214 SVGA_3D_CMD_DX_DEFINE_ELEMENTLAYOUT = 1191,
215 SVGA_3D_CMD_DX_DESTROY_ELEMENTLAYOUT = 1192,
216 SVGA_3D_CMD_DX_DEFINE_BLEND_STATE = 1193,
217 SVGA_3D_CMD_DX_DESTROY_BLEND_STATE = 1194,
218 SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_STATE = 1195,
219 SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_STATE = 1196,
220 SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE = 1197,
221 SVGA_3D_CMD_DX_DESTROY_RASTERIZER_STATE = 1198,
222 SVGA_3D_CMD_DX_DEFINE_SAMPLER_STATE = 1199,
223 SVGA_3D_CMD_DX_DESTROY_SAMPLER_STATE = 1200,
224 SVGA_3D_CMD_DX_DEFINE_SHADER = 1201,
225 SVGA_3D_CMD_DX_DESTROY_SHADER = 1202,
226 SVGA_3D_CMD_DX_BIND_SHADER = 1203,
227 SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT = 1204,
228 SVGA_3D_CMD_DX_DESTROY_STREAMOUTPUT = 1205,
229 SVGA_3D_CMD_DX_SET_STREAMOUTPUT = 1206,
230 SVGA_3D_CMD_DX_SET_COTABLE = 1207,
231 SVGA_3D_CMD_DX_READBACK_COTABLE = 1208,
232 SVGA_3D_CMD_DX_BUFFER_COPY = 1209,
233 SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER = 1210,
234 SVGA_3D_CMD_DX_SURFACE_COPY_AND_READBACK = 1211,
235 SVGA_3D_CMD_DX_MOVE_QUERY = 1212,
236 SVGA_3D_CMD_DX_BIND_ALL_QUERY = 1213,
237 SVGA_3D_CMD_DX_READBACK_ALL_QUERY = 1214,
238 SVGA_3D_CMD_DX_PRED_TRANSFER_FROM_BUFFER = 1215,
239 SVGA_3D_CMD_DX_MOB_FENCE_64 = 1216,
240 SVGA_3D_CMD_DX_BIND_ALL_SHADER = 1217,
241 SVGA_3D_CMD_DX_HINT = 1218,
242 SVGA_3D_CMD_DX_BUFFER_UPDATE = 1219,
243 SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET = 1220,
244 SVGA_3D_CMD_DX_SET_PS_CONSTANT_BUFFER_OFFSET = 1221,
245 SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET = 1222,
246 SVGA_3D_CMD_DX_SET_HS_CONSTANT_BUFFER_OFFSET = 1223,
247 SVGA_3D_CMD_DX_SET_DS_CONSTANT_BUFFER_OFFSET = 1224,
248 SVGA_3D_CMD_DX_SET_CS_CONSTANT_BUFFER_OFFSET = 1225,
249
250 SVGA_3D_CMD_DX_COND_BIND_ALL_SHADER = 1226,
251 SVGA_3D_CMD_DX_MAX = 1227,
252
253 SVGA_3D_CMD_SCREEN_COPY = 1227,
254
255 SVGA_3D_CMD_RESERVED1 = 1228,
256 SVGA_3D_CMD_RESERVED2 = 1229,
257 SVGA_3D_CMD_RESERVED3 = 1230,
258 SVGA_3D_CMD_RESERVED4 = 1231,
259 SVGA_3D_CMD_RESERVED5 = 1232,
260 SVGA_3D_CMD_RESERVED6 = 1233,
261 SVGA_3D_CMD_RESERVED7 = 1234,
262 SVGA_3D_CMD_RESERVED8 = 1235,
263
264 SVGA_3D_CMD_GROW_OTABLE = 1236,
265 SVGA_3D_CMD_DX_GROW_COTABLE = 1237,
266 SVGA_3D_CMD_INTRA_SURFACE_COPY = 1238,
267
268 SVGA_3D_CMD_DEFINE_GB_SURFACE_V3 = 1239,
269
270 SVGA_3D_CMD_DX_RESOLVE_COPY = 1240,
271 SVGA_3D_CMD_DX_PRED_RESOLVE_COPY = 1241,
272 SVGA_3D_CMD_DX_PRED_CONVERT_REGION = 1242,
273 SVGA_3D_CMD_DX_PRED_CONVERT = 1243,
274 SVGA_3D_CMD_WHOLE_SURFACE_COPY = 1244,
275
276 SVGA_3D_CMD_DX_DEFINE_UA_VIEW = 1245,
277 SVGA_3D_CMD_DX_DESTROY_UA_VIEW = 1246,
278 SVGA_3D_CMD_DX_CLEAR_UA_VIEW_UINT = 1247,
279 SVGA_3D_CMD_DX_CLEAR_UA_VIEW_FLOAT = 1248,
280 SVGA_3D_CMD_DX_COPY_STRUCTURE_COUNT = 1249,
281 SVGA_3D_CMD_DX_SET_UA_VIEWS = 1250,
282
283 SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED_INDIRECT = 1251,
284 SVGA_3D_CMD_DX_DRAW_INSTANCED_INDIRECT = 1252,
285 SVGA_3D_CMD_DX_DISPATCH = 1253,
286 SVGA_3D_CMD_DX_DISPATCH_INDIRECT = 1254,
287
288 SVGA_3D_CMD_WRITE_ZERO_SURFACE = 1255,
289 SVGA_3D_CMD_UPDATE_ZERO_SURFACE = 1256,
290 SVGA_3D_CMD_DX_TRANSFER_TO_BUFFER = 1257,
291 SVGA_3D_CMD_DX_SET_STRUCTURE_COUNT = 1258,
292
293 SVGA_3D_CMD_LOGICOPS_BITBLT = 1259,
294 SVGA_3D_CMD_LOGICOPS_TRANSBLT = 1260,
295 SVGA_3D_CMD_LOGICOPS_STRETCHBLT = 1261,
296 SVGA_3D_CMD_LOGICOPS_COLORFILL = 1262,
297 SVGA_3D_CMD_LOGICOPS_ALPHABLEND = 1263,
298 SVGA_3D_CMD_LOGICOPS_CLEARTYPEBLEND = 1264,
299
300 SVGA_3D_CMD_DX_COPY_COTABLE_INTO_MOB = 1265,
301
302 SVGA_3D_CMD_UPDATE_GB_SCREENTARGET_V2 = 1266,
303
304 SVGA_3D_CMD_DEFINE_GB_SURFACE_V4 = 1267,
305 SVGA_3D_CMD_DX_SET_CS_UA_VIEWS = 1268,
306 SVGA_3D_CMD_DX_SET_MIN_LOD = 1269,
307
308 SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW_V2 = 1272,
309 SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT_WITH_MOB = 1273,
310 SVGA_3D_CMD_DX_SET_SHADER_IFACE = 1274,
311 SVGA_3D_CMD_DX_BIND_STREAMOUTPUT = 1275,
312 SVGA_3D_CMD_SURFACE_STRETCHBLT_NON_MS_TO_MS = 1276,
313 SVGA_3D_CMD_DX_BIND_SHADER_IFACE = 1277,
314
315 SVGA_3D_CMD_UPDATE_GB_SCREENTARGET_MOVE = 1278,
316
317 SVGA_3D_CMD_DX_PRED_STAGING_COPY = 1281,
318 SVGA_3D_CMD_DX_STAGING_COPY = 1282,
319 SVGA_3D_CMD_DX_PRED_STAGING_COPY_REGION = 1283,
320 SVGA_3D_CMD_DX_SET_VERTEX_BUFFERS_V2 = 1284,
321 SVGA_3D_CMD_DX_SET_INDEX_BUFFER_V2 = 1285,
322 SVGA_3D_CMD_DX_SET_VERTEX_BUFFERS_OFFSET_AND_SIZE = 1286,
323 SVGA_3D_CMD_DX_SET_INDEX_BUFFER_OFFSET_AND_SIZE = 1287,
324 SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE_V2 = 1288,
325 SVGA_3D_CMD_DX_PRED_STAGING_CONVERT_REGION = 1289,
326 SVGA_3D_CMD_DX_PRED_STAGING_CONVERT = 1290,
327 SVGA_3D_CMD_DX_STAGING_BUFFER_COPY = 1291,
328
329 SVGA_3D_CMD_MAX = 1303,
330 SVGA_3D_CMD_FUTURE_MAX = 3000
331} SVGAFifo3dCmdId;
332
333#define SVGA_NUM_3D_CMD (SVGA_3D_CMD_MAX - SVGA_3D_CMD_BASE)
334
335#pragma pack(push, 1)
336typedef struct {
337 uint32 id;
338 uint32 size;
339} SVGA3dCmdHeader;
340#pragma pack(pop)
341
342#pragma pack(push, 1)
343typedef struct {
344 uint32 numMipLevels;
345} SVGA3dSurfaceFace;
346#pragma pack(pop)
347
348#pragma pack(push, 1)
349typedef struct {
350 uint32 sid;
351 SVGA3dSurface1Flags surfaceFlags;
352 SVGA3dSurfaceFormat format;
353
354 SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
355
356} SVGA3dCmdDefineSurface;
357#pragma pack(pop)
358
359#pragma pack(push, 1)
360typedef struct {
361 uint32 sid;
362 SVGA3dSurface1Flags surfaceFlags;
363 SVGA3dSurfaceFormat format;
364
365 SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
366 uint32 multisampleCount;
367 SVGA3dTextureFilter autogenFilter;
368
369} SVGA3dCmdDefineSurface_v2;
370#pragma pack(pop)
371
372#pragma pack(push, 1)
373typedef struct {
374 uint32 sid;
375} SVGA3dCmdDestroySurface;
376#pragma pack(pop)
377
378#pragma pack(push, 1)
379typedef struct {
380 uint32 cid;
381} SVGA3dCmdDefineContext;
382#pragma pack(pop)
383
384#pragma pack(push, 1)
385typedef struct {
386 uint32 cid;
387} SVGA3dCmdDestroyContext;
388#pragma pack(pop)
389
390#pragma pack(push, 1)
391typedef struct {
392 uint32 cid;
393 SVGA3dClearFlag clearFlag;
394 uint32 color;
395 float depth;
396 uint32 stencil;
397
398} SVGA3dCmdClear;
399#pragma pack(pop)
400
401#pragma pack(push, 1)
402typedef struct {
403 SVGA3dLightType type;
404 SVGA3dBool inWorldSpace;
405 float diffuse[4];
406 float specular[4];
407 float ambient[4];
408 float position[4];
409 float direction[4];
410 float range;
411 float falloff;
412 float attenuation0;
413 float attenuation1;
414 float attenuation2;
415 float theta;
416 float phi;
417} SVGA3dLightData;
418#pragma pack(pop)
419
420#pragma pack(push, 1)
421typedef struct {
422 uint32 sid;
423
424} SVGA3dCmdPresent;
425#pragma pack(pop)
426
427#pragma pack(push, 1)
428typedef struct {
429 SVGA3dRenderStateName state;
430 union {
431 uint32 uintValue;
432 float floatValue;
433 };
434} SVGA3dRenderState;
435#pragma pack(pop)
436
437#pragma pack(push, 1)
438typedef struct {
439 uint32 cid;
440
441} SVGA3dCmdSetRenderState;
442#pragma pack(pop)
443
444#pragma pack(push, 1)
445typedef struct {
446 uint32 cid;
447 SVGA3dRenderTargetType type;
448 SVGA3dSurfaceImageId target;
449} SVGA3dCmdSetRenderTarget;
450#pragma pack(pop)
451
452#pragma pack(push, 1)
453typedef struct {
454 SVGA3dSurfaceImageId src;
455 SVGA3dSurfaceImageId dest;
456
457} SVGA3dCmdSurfaceCopy;
458#pragma pack(pop)
459
460#pragma pack(push, 1)
461typedef struct {
462 SVGA3dSurfaceImageId surface;
463 SVGA3dCopyBox box;
464} SVGA3dCmdIntraSurfaceCopy;
465#pragma pack(pop)
466
467#pragma pack(push, 1)
468typedef struct {
469 uint32 srcSid;
470 uint32 destSid;
471} SVGA3dCmdWholeSurfaceCopy;
472#pragma pack(pop)
473
474#pragma pack(push, 1)
475typedef struct {
476 SVGA3dSurfaceImageId src;
477 SVGA3dSurfaceImageId dest;
478 SVGA3dBox boxSrc;
479 SVGA3dBox boxDest;
480} SVGA3dCmdSurfaceStretchBltNonMSToMS;
481#pragma pack(pop)
482
483#pragma pack(push, 1)
484typedef struct {
485 SVGA3dSurfaceImageId src;
486 SVGA3dSurfaceImageId dest;
487 SVGA3dBox boxSrc;
488 SVGA3dBox boxDest;
489 SVGA3dStretchBltMode mode;
490} SVGA3dCmdSurfaceStretchBlt;
491#pragma pack(pop)
492
493#pragma pack(push, 1)
494typedef struct {
495 uint32 discard : 1;
496
497 uint32 unsynchronized : 1;
498
499 uint32 reserved : 30;
500} SVGA3dSurfaceDMAFlags;
501#pragma pack(pop)
502
503#pragma pack(push, 1)
504typedef struct {
505 SVGAGuestImage guest;
506 SVGA3dSurfaceImageId host;
507 SVGA3dTransferType transfer;
508
509} SVGA3dCmdSurfaceDMA;
510#pragma pack(pop)
511
512#pragma pack(push, 1)
513typedef struct {
514 uint32 suffixSize;
515
516 uint32 maximumOffset;
517
518 SVGA3dSurfaceDMAFlags flags;
519} SVGA3dCmdSurfaceDMASuffix;
520#pragma pack(pop)
521
522#pragma pack(push, 1)
523typedef struct {
524 uint32 first;
525 uint32 last;
526} SVGA3dArrayRangeHint;
527#pragma pack(pop)
528
529#pragma pack(push, 1)
530typedef struct {
531 uint32 surfaceId;
532 uint32 offset;
533 uint32 stride;
534} SVGA3dArray;
535#pragma pack(pop)
536
537#pragma pack(push, 1)
538typedef struct {
539 SVGA3dDeclType type;
540 SVGA3dDeclMethod method;
541 SVGA3dDeclUsage usage;
542 uint32 usageIndex;
543} SVGA3dVertexArrayIdentity;
544#pragma pack(pop)
545
546#pragma pack(push, 1)
547typedef struct SVGA3dVertexDecl {
548 SVGA3dVertexArrayIdentity identity;
549 SVGA3dArray array;
550 SVGA3dArrayRangeHint rangeHint;
551} SVGA3dVertexDecl;
552#pragma pack(pop)
553
554#pragma pack(push, 1)
555typedef struct SVGA3dPrimitiveRange {
556 SVGA3dPrimitiveType primType;
557 uint32 primitiveCount;
558
559 SVGA3dArray indexArray;
560 uint32 indexWidth;
561
562 int32 indexBias;
563} SVGA3dPrimitiveRange;
564#pragma pack(pop)
565
566#pragma pack(push, 1)
567typedef struct {
568 uint32 cid;
569 uint32 numVertexDecls;
570 uint32 numRanges;
571
572} SVGA3dCmdDrawPrimitives;
573#pragma pack(pop)
574
575#pragma pack(push, 1)
576typedef struct {
577 uint32 cid;
578
579 uint32 primitiveCount;
580 uint32 startVertexLocation;
581
582 uint8 primitiveType;
583 uint8 padding[3];
584} SVGA3dCmdDraw;
585#pragma pack(pop)
586
587#pragma pack(push, 1)
588typedef struct {
589 uint32 cid;
590
591 uint8 primitiveType;
592
593 uint32 indexBufferSid;
594 uint32 indexBufferOffset;
595
596 uint8 indexBufferStride;
597
598 int32 baseVertexLocation;
599
600 uint32 primitiveCount;
601 uint32 pad0;
602 uint16 pad1;
603} SVGA3dCmdDrawIndexed;
604#pragma pack(pop)
605
606#pragma pack(push, 1)
607typedef struct {
608 uint16 streamOffset;
609 uint8 stream;
610 uint8 type;
611 uint8 method;
612 uint8 usage;
613 uint8 usageIndex;
614 uint8 padding;
615
616} SVGA3dVertexElement;
617#pragma pack(pop)
618
619#define SVGA3D_VERTEX_ELEMENT_RESPECT_STREAM (1 << 7)
620
621#pragma pack(push, 1)
622typedef struct {
623 uint32 cid;
624
625 uint32 numElements;
626
627} SVGA3dCmdSetVertexDecls;
628#pragma pack(pop)
629
630#pragma pack(push, 1)
631typedef struct {
632 uint32 sid;
633 uint32 stride;
634 uint32 offset;
635} SVGA3dVertexStream;
636#pragma pack(pop)
637
638#pragma pack(push, 1)
639typedef struct {
640 uint32 cid;
641
642 uint32 numStreams;
643
644} SVGA3dCmdSetVertexStreams;
645#pragma pack(pop)
646
647#pragma pack(push, 1)
648typedef struct {
649 uint32 cid;
650 uint32 numDivisors;
651} SVGA3dCmdSetVertexDivisors;
652#pragma pack(pop)
653
654#pragma pack(push, 1)
655typedef struct {
656 uint32 stage;
657 SVGA3dTextureStateName name;
658 union {
659 uint32 value;
660 float floatValue;
661 };
662} SVGA3dTextureState;
663#pragma pack(pop)
664
665#pragma pack(push, 1)
666typedef struct {
667 uint32 cid;
668
669} SVGA3dCmdSetTextureState;
670#pragma pack(pop)
671
672#pragma pack(push, 1)
673typedef struct {
674 uint32 cid;
675 SVGA3dTransformType type;
676 float matrix[16];
677} SVGA3dCmdSetTransform;
678#pragma pack(pop)
679
680#pragma pack(push, 1)
681typedef struct {
682 float min;
683 float max;
684} SVGA3dZRange;
685#pragma pack(pop)
686
687#pragma pack(push, 1)
688typedef struct {
689 uint32 cid;
690 SVGA3dZRange zRange;
691} SVGA3dCmdSetZRange;
692#pragma pack(pop)
693
694#pragma pack(push, 1)
695typedef struct {
696 float diffuse[4];
697 float ambient[4];
698 float specular[4];
699 float emissive[4];
700 float shininess;
701} SVGA3dMaterial;
702#pragma pack(pop)
703
704#pragma pack(push, 1)
705typedef struct {
706 uint32 cid;
707 SVGA3dFace face;
708 SVGA3dMaterial material;
709} SVGA3dCmdSetMaterial;
710#pragma pack(pop)
711
712#pragma pack(push, 1)
713typedef struct {
714 uint32 cid;
715 uint32 index;
716 SVGA3dLightData data;
717} SVGA3dCmdSetLightData;
718#pragma pack(pop)
719
720#pragma pack(push, 1)
721typedef struct {
722 uint32 cid;
723 uint32 index;
724 uint32 enabled;
725} SVGA3dCmdSetLightEnabled;
726#pragma pack(pop)
727
728#pragma pack(push, 1)
729typedef struct {
730 uint32 cid;
731 SVGA3dRect rect;
732} SVGA3dCmdSetViewport;
733#pragma pack(pop)
734
735#pragma pack(push, 1)
736typedef struct {
737 uint32 cid;
738 SVGA3dRect rect;
739} SVGA3dCmdSetScissorRect;
740#pragma pack(pop)
741
742#pragma pack(push, 1)
743typedef struct {
744 uint32 cid;
745 uint32 index;
746 float plane[4];
747} SVGA3dCmdSetClipPlane;
748#pragma pack(pop)
749
750#pragma pack(push, 1)
751typedef struct {
752 uint32 cid;
753 uint32 shid;
754 SVGA3dShaderType type;
755
756} SVGA3dCmdDefineShader;
757#pragma pack(pop)
758
759#pragma pack(push, 1)
760typedef struct {
761 uint32 cid;
762 uint32 shid;
763 SVGA3dShaderType type;
764} SVGA3dCmdDestroyShader;
765#pragma pack(pop)
766
767#pragma pack(push, 1)
768typedef struct {
769 uint32 cid;
770 uint32 reg;
771 SVGA3dShaderType type;
772 SVGA3dShaderConstType ctype;
773 uint32 values[4];
774
775} SVGA3dCmdSetShaderConst;
776#pragma pack(pop)
777
778#pragma pack(push, 1)
779typedef struct {
780 uint32 cid;
781 SVGA3dShaderType type;
782 uint32 shid;
783} SVGA3dCmdSetShader;
784#pragma pack(pop)
785
786#pragma pack(push, 1)
787typedef struct {
788 uint32 cid;
789 SVGA3dQueryType type;
790} SVGA3dCmdBeginQuery;
791#pragma pack(pop)
792
793#pragma pack(push, 1)
794typedef struct {
795 uint32 cid;
796 SVGA3dQueryType type;
797 SVGAGuestPtr guestResult;
798} SVGA3dCmdEndQuery;
799#pragma pack(pop)
800
801#pragma pack(push, 1)
802typedef struct {
803 uint32 cid;
804 SVGA3dQueryType type;
805 SVGAGuestPtr guestResult;
806} SVGA3dCmdWaitForQuery;
807#pragma pack(pop)
808
809#pragma pack(push, 1)
810typedef struct {
811 uint32 totalSize;
812 SVGA3dQueryState state;
813 union {
814 uint32 result32;
815 uint32 queryCookie;
816 };
817} SVGA3dQueryResult;
818#pragma pack(pop)
819
820#pragma pack(push, 1)
821typedef struct {
822 SVGA3dSurfaceImageId srcImage;
823 SVGASignedRect srcRect;
824 uint32 destScreenId;
825 SVGASignedRect destRect;
826
827} SVGA3dCmdBlitSurfaceToScreen;
828#pragma pack(pop)
829
830#pragma pack(push, 1)
831typedef struct {
832 uint32 sid;
833 SVGA3dTextureFilter filter;
834} SVGA3dCmdGenerateMipmaps;
835#pragma pack(pop)
836
837#pragma pack(push, 1)
838typedef struct {
839 uint32 sid;
840} SVGA3dCmdActivateSurface;
841#pragma pack(pop)
842
843#pragma pack(push, 1)
844typedef struct {
845 uint32 sid;
846} SVGA3dCmdDeactivateSurface;
847#pragma pack(pop)
848
849#pragma pack(push, 1)
850typedef struct SVGA3dCmdScreenDMA {
851 uint32 screenId;
852 SVGAGuestImage refBuffer;
853 SVGAGuestImage destBuffer;
854 SVGAGuestImage changeMap;
855} SVGA3dCmdScreenDMA;
856#pragma pack(pop)
857
858#define SVGA3D_LOTRANSBLT_HONORALPHA (0x01)
859#define SVGA3D_LOSTRETCHBLT_MIRRORX (0x01)
860#define SVGA3D_LOSTRETCHBLT_MIRRORY (0x02)
861#define SVGA3D_LOALPHABLEND_SRCHASALPHA (0x01)
862
863#pragma pack(push, 1)
864typedef struct SVGA3dCmdLogicOpsBitBlt {
865 SVGA3dSurfaceImageId src;
866 SVGA3dSurfaceImageId dst;
867 SVGA3dLogicOp logicOp;
868 SVGA3dLogicOpRop3 logicOpRop3;
869
870} SVGA3dCmdLogicOpsBitBlt;
871#pragma pack(pop)
872
873#pragma pack(push, 1)
874typedef struct SVGA3dCmdLogicOpsTransBlt {
875 SVGA3dSurfaceImageId src;
876 SVGA3dSurfaceImageId dst;
877 uint32 color;
878 uint32 flags;
879 SVGA3dBox srcBox;
880 SVGA3dSignedBox dstBox;
881 SVGA3dBox clipBox;
882} SVGA3dCmdLogicOpsTransBlt;
883#pragma pack(pop)
884
885#pragma pack(push, 1)
886typedef struct SVGA3dCmdLogicOpsStretchBlt {
887 SVGA3dSurfaceImageId src;
888 SVGA3dSurfaceImageId dst;
889 uint16 mode;
890 uint16 flags;
891 SVGA3dBox srcBox;
892 SVGA3dSignedBox dstBox;
893 SVGA3dBox clipBox;
894} SVGA3dCmdLogicOpsStretchBlt;
895#pragma pack(pop)
896
897#pragma pack(push, 1)
898typedef struct SVGA3dCmdLogicOpsColorFill {
899 SVGA3dSurfaceImageId dst;
900 uint32 color;
901 SVGA3dLogicOp logicOp;
902 SVGA3dLogicOpRop3 logicOpRop3;
903
904} SVGA3dCmdLogicOpsColorFill;
905#pragma pack(pop)
906
907#pragma pack(push, 1)
908typedef struct SVGA3dCmdLogicOpsAlphaBlend {
909 SVGA3dSurfaceImageId src;
910 SVGA3dSurfaceImageId dst;
911 uint32 alphaVal;
912 uint32 flags;
913 SVGA3dBox srcBox;
914 SVGA3dSignedBox dstBox;
915 SVGA3dBox clipBox;
916} SVGA3dCmdLogicOpsAlphaBlend;
917#pragma pack(pop)
918
919#define SVGA3D_CLEARTYPE_INVALID_GAMMA_INDEX 0xFFFFFFFF
920
921#define SVGA3D_CLEARTYPE_GAMMA_WIDTH 512
922#define SVGA3D_CLEARTYPE_GAMMA_HEIGHT 16
923
924#pragma pack(push, 1)
925typedef struct SVGA3dCmdLogicOpsClearTypeBlend {
926 SVGA3dSurfaceImageId tmp;
927 SVGA3dSurfaceImageId dst;
928 SVGA3dSurfaceImageId gammaSurf;
929 SVGA3dSurfaceImageId alphaSurf;
930 uint32 gamma;
931 uint32 color;
932 uint32 color2;
933 int32 alphaOffsetX;
934 int32 alphaOffsetY;
935
936} SVGA3dCmdLogicOpsClearTypeBlend;
937#pragma pack(pop)
938
939#pragma pack(push, 1)
940typedef struct {
941 SVGAMobFormat ptDepth;
942 uint32 sizeInBytes;
943 PPN64 base;
944} SVGAOTableMobEntry;
945#pragma pack(pop)
946
947#pragma pack(push, 1)
948typedef struct {
949 SVGA3dSurfaceFormat format;
950 SVGA3dSurface1Flags surface1Flags;
951 uint32 numMipLevels;
952 uint32 multisampleCount;
953 SVGA3dTextureFilter autogenFilter;
954 SVGA3dSize size;
955 SVGAMobId mobid;
956 uint32 arraySize;
957 uint32 mobPitch;
958 SVGA3dSurface2Flags surface2Flags;
959 uint8 multisamplePattern;
960 uint8 qualityLevel;
961 uint16 bufferByteStride;
962 float minLOD;
963 uint32 pad0[2];
964} SVGAOTableSurfaceEntry;
965#pragma pack(pop)
966
967#pragma pack(push, 1)
968typedef struct {
969 uint32 cid;
970 SVGAMobId mobid;
971} SVGAOTableContextEntry;
972#pragma pack(pop)
973
974#pragma pack(push, 1)
975typedef struct {
976 SVGA3dShaderType type;
977 uint32 sizeInBytes;
978 uint32 offsetInBytes;
979 SVGAMobId mobid;
980} SVGAOTableShaderEntry;
981#pragma pack(pop)
982
983#define SVGA_STFLAG_PRIMARY (1 << 0)
984#define SVGA_STFLAG_RESERVED (1 << 1)
985typedef uint32 SVGAScreenTargetFlags;
986
987#pragma pack(push, 1)
988typedef struct {
989 SVGA3dSurfaceImageId image;
990 uint32 width;
991 uint32 height;
992 int32 xRoot;
993 int32 yRoot;
994 SVGAScreenTargetFlags flags;
995 uint32 dpi;
996 uint32 pad[7];
997} SVGAOTableScreenTargetEntry;
998#pragma pack(pop)
999
1000#pragma pack(push, 1)
1001typedef struct {
1002 float value[4];
1003} SVGA3dShaderConstFloat;
1004#pragma pack(pop)
1005
1006#pragma pack(push, 1)
1007typedef struct {
1008 int32 value[4];
1009} SVGA3dShaderConstInt;
1010#pragma pack(pop)
1011
1012#pragma pack(push, 1)
1013typedef struct {
1014 uint32 value;
1015} SVGA3dShaderConstBool;
1016#pragma pack(pop)
1017
1018#pragma pack(push, 1)
1019typedef struct {
1020 uint16 streamOffset;
1021 uint8 stream;
1022 uint8 type;
1023 uint8 methodUsage;
1024 uint8 usageIndex;
1025} SVGAGBVertexElement;
1026#pragma pack(pop)
1027
1028#pragma pack(push, 1)
1029typedef struct {
1030 uint32 sid;
1031 uint16 stride;
1032 uint32 offset;
1033} SVGAGBVertexStream;
1034#pragma pack(pop)
1035#pragma pack(push, 1)
1036typedef struct {
1037 SVGA3dRect viewport;
1038 SVGA3dRect scissorRect;
1039 SVGA3dZRange zRange;
1040
1041 SVGA3dSurfaceImageId renderTargets[SVGA3D_RT_MAX];
1042 SVGAGBVertexElement decl1[4];
1043
1044 uint32 renderStates[SVGA3D_RS_MAX];
1045 SVGAGBVertexElement decl2[18];
1046 uint32 pad0[2];
1047
1048 struct {
1049 SVGA3dFace face;
1050 SVGA3dMaterial material;
1051 } material;
1052
1053 float clipPlanes[SVGA3D_MAX_CLIP_PLANES][4];
1054 float matrices[SVGA3D_TRANSFORM_MAX][16];
1055
1056 SVGA3dBool lightEnabled[SVGA3D_NUM_LIGHTS];
1057 SVGA3dLightData lightData[SVGA3D_NUM_LIGHTS];
1058
1059 uint32 shaders[SVGA3D_NUM_SHADERTYPE_PREDX];
1060 SVGAGBVertexElement decl3[10];
1061 uint32 pad1[3];
1062
1063 uint32 occQueryActive;
1064 uint32 occQueryValue;
1065
1066 SVGA3dShaderConstInt pShaderIValues[SVGA3D_CONSTINTREG_MAX];
1067 SVGA3dShaderConstInt vShaderIValues[SVGA3D_CONSTINTREG_MAX];
1068 uint16 pShaderBValues;
1069 uint16 vShaderBValues;
1070
1071 SVGAGBVertexStream streams[SVGA3D_MAX_VERTEX_ARRAYS];
1072 SVGA3dVertexDivisor divisors[SVGA3D_MAX_VERTEX_ARRAYS];
1073 uint32 numVertexDecls;
1074 uint32 numVertexStreams;
1075 uint32 numVertexDivisors;
1076 uint32 pad2[30];
1077
1078 uint32 tsColorKey[SVGA3D_NUM_TEXTURE_UNITS];
1079 uint32 textureStages[SVGA3D_NUM_TEXTURE_UNITS][SVGA3D_TS_CONSTANT + 1];
1080 uint32 tsColorKeyEnable[SVGA3D_NUM_TEXTURE_UNITS];
1081
1082 SVGA3dShaderConstFloat pShaderFValues[SVGA3D_CONSTREG_MAX];
1083 SVGA3dShaderConstFloat vShaderFValues[SVGA3D_CONSTREG_MAX];
1084} SVGAGBContextData;
1085#pragma pack(pop)
1086
1087#pragma pack(push, 1)
1088typedef struct {
1089 SVGAOTableType type;
1090 PPN32 baseAddress;
1091 uint32 sizeInBytes;
1092 uint32 validSizeInBytes;
1093 SVGAMobFormat ptDepth;
1094} SVGA3dCmdSetOTableBase;
1095#pragma pack(pop)
1096
1097#pragma pack(push, 1)
1098typedef struct {
1099 SVGAOTableType type;
1100 PPN64 baseAddress;
1101 uint32 sizeInBytes;
1102 uint32 validSizeInBytes;
1103 SVGAMobFormat ptDepth;
1104} SVGA3dCmdSetOTableBase64;
1105#pragma pack(pop)
1106
1107#pragma pack(push, 1)
1108typedef struct {
1109 SVGAOTableType type;
1110 PPN64 baseAddress;
1111 uint32 sizeInBytes;
1112 uint32 validSizeInBytes;
1113 SVGAMobFormat ptDepth;
1114} SVGA3dCmdGrowOTable;
1115#pragma pack(pop)
1116
1117#pragma pack(push, 1)
1118typedef struct {
1119 SVGAOTableType type;
1120} SVGA3dCmdReadbackOTable;
1121#pragma pack(pop)
1122
1123#pragma pack(push, 1)
1124typedef struct SVGA3dCmdDefineGBMob {
1125 SVGAMobId mobid;
1126 SVGAMobFormat ptDepth;
1127 PPN32 base;
1128 uint32 sizeInBytes;
1129} SVGA3dCmdDefineGBMob;
1130#pragma pack(pop)
1131
1132#pragma pack(push, 1)
1133typedef struct SVGA3dCmdDestroyGBMob {
1134 SVGAMobId mobid;
1135} SVGA3dCmdDestroyGBMob;
1136#pragma pack(pop)
1137
1138#pragma pack(push, 1)
1139typedef struct SVGA3dCmdDefineGBMob64 {
1140 SVGAMobId mobid;
1141 SVGAMobFormat ptDepth;
1142 PPN64 base;
1143 uint32 sizeInBytes;
1144} SVGA3dCmdDefineGBMob64;
1145#pragma pack(pop)
1146
1147#pragma pack(push, 1)
1148typedef struct SVGA3dCmdRedefineGBMob64 {
1149 SVGAMobId mobid;
1150 SVGAMobFormat ptDepth;
1151 PPN64 base;
1152 uint32 sizeInBytes;
1153} SVGA3dCmdRedefineGBMob64;
1154#pragma pack(pop)
1155
1156#pragma pack(push, 1)
1157typedef struct SVGA3dCmdUpdateGBMobMapping {
1158 SVGAMobId mobid;
1159} SVGA3dCmdUpdateGBMobMapping;
1160#pragma pack(pop)
1161
1162#pragma pack(push, 1)
1163typedef struct SVGA3dCmdDefineGBSurface {
1164 uint32 sid;
1165 SVGA3dSurface1Flags surfaceFlags;
1166 SVGA3dSurfaceFormat format;
1167 uint32 numMipLevels;
1168 uint32 multisampleCount;
1169 SVGA3dTextureFilter autogenFilter;
1170 SVGA3dSize size;
1171} SVGA3dCmdDefineGBSurface;
1172#pragma pack(pop)
1173
1174#pragma pack(push, 1)
1175typedef struct SVGA3dCmdDefineGBSurface_v2 {
1176 uint32 sid;
1177 SVGA3dSurface1Flags surfaceFlags;
1178 SVGA3dSurfaceFormat format;
1179 uint32 numMipLevels;
1180 uint32 multisampleCount;
1181 SVGA3dTextureFilter autogenFilter;
1182 SVGA3dSize size;
1183 uint32 arraySize;
1184 uint32 pad;
1185} SVGA3dCmdDefineGBSurface_v2;
1186#pragma pack(pop)
1187
1188#pragma pack(push, 1)
1189typedef struct SVGA3dCmdDefineGBSurface_v3 {
1190 uint32 sid;
1191 SVGA3dSurfaceAllFlags surfaceFlags;
1192 SVGA3dSurfaceFormat format;
1193 uint32 numMipLevels;
1194 uint32 multisampleCount;
1195 SVGA3dMSPattern multisamplePattern;
1196 SVGA3dMSQualityLevel qualityLevel;
1197 SVGA3dTextureFilter autogenFilter;
1198 SVGA3dSize size;
1199 uint32 arraySize;
1200} SVGA3dCmdDefineGBSurface_v3;
1201#pragma pack(pop)
1202
1203#pragma pack(push, 1)
1204typedef struct SVGA3dCmdDefineGBSurface_v4 {
1205 uint32 sid;
1206 SVGA3dSurfaceAllFlags surfaceFlags;
1207 SVGA3dSurfaceFormat format;
1208 uint32 numMipLevels;
1209 uint32 multisampleCount;
1210 SVGA3dMSPattern multisamplePattern;
1211 SVGA3dMSQualityLevel qualityLevel;
1212 SVGA3dTextureFilter autogenFilter;
1213 SVGA3dSize size;
1214 uint32 arraySize;
1215 uint32 bufferByteStride;
1216} SVGA3dCmdDefineGBSurface_v4;
1217#pragma pack(pop)
1218
1219#pragma pack(push, 1)
1220typedef struct SVGA3dCmdDestroyGBSurface {
1221 uint32 sid;
1222} SVGA3dCmdDestroyGBSurface;
1223#pragma pack(pop)
1224
1225#pragma pack(push, 1)
1226typedef struct SVGA3dCmdBindGBSurface {
1227 uint32 sid;
1228 SVGAMobId mobid;
1229} SVGA3dCmdBindGBSurface;
1230#pragma pack(pop)
1231
1232#pragma pack(push, 1)
1233typedef struct SVGA3dCmdBindGBSurfaceWithPitch {
1234 uint32 sid;
1235 SVGAMobId mobid;
1236 uint32 baseLevelPitch;
1237} SVGA3dCmdBindGBSurfaceWithPitch;
1238#pragma pack(pop)
1239
1240#define SVGA3D_COND_BIND_GB_SURFACE_FLAG_READBACK (1 << 0)
1241#define SVGA3D_COND_BIND_GB_SURFACE_FLAG_UPDATE (1 << 1)
1242
1243#pragma pack(push, 1)
1244typedef struct SVGA3dCmdCondBindGBSurface {
1245 uint32 sid;
1246 SVGAMobId testMobid;
1247 SVGAMobId mobid;
1248 uint32 flags;
1249} SVGA3dCmdCondBindGBSurface;
1250#pragma pack(pop)
1251
1252#pragma pack(push, 1)
1253typedef struct SVGA3dCmdUpdateGBImage {
1254 SVGA3dSurfaceImageId image;
1255 SVGA3dBox box;
1256} SVGA3dCmdUpdateGBImage;
1257#pragma pack(pop)
1258
1259#pragma pack(push, 1)
1260typedef struct SVGA3dCmdUpdateGBSurface {
1261 uint32 sid;
1262} SVGA3dCmdUpdateGBSurface;
1263#pragma pack(pop)
1264
1265#pragma pack(push, 1)
1266typedef struct SVGA3dCmdReadbackGBImage {
1267 SVGA3dSurfaceImageId image;
1268} SVGA3dCmdReadbackGBImage;
1269#pragma pack(pop)
1270
1271#pragma pack(push, 1)
1272typedef struct SVGA3dCmdReadbackGBSurface {
1273 uint32 sid;
1274} SVGA3dCmdReadbackGBSurface;
1275#pragma pack(pop)
1276
1277#pragma pack(push, 1)
1278typedef struct SVGA3dCmdReadbackGBImagePartial {
1279 SVGA3dSurfaceImageId image;
1280 SVGA3dBox box;
1281 uint32 invertBox;
1282} SVGA3dCmdReadbackGBImagePartial;
1283#pragma pack(pop)
1284
1285#pragma pack(push, 1)
1286typedef struct SVGA3dCmdInvalidateGBImage {
1287 SVGA3dSurfaceImageId image;
1288} SVGA3dCmdInvalidateGBImage;
1289#pragma pack(pop)
1290
1291#pragma pack(push, 1)
1292typedef struct SVGA3dCmdInvalidateGBSurface {
1293 uint32 sid;
1294} SVGA3dCmdInvalidateGBSurface;
1295#pragma pack(pop)
1296
1297#pragma pack(push, 1)
1298typedef struct SVGA3dCmdInvalidateGBImagePartial {
1299 SVGA3dSurfaceImageId image;
1300 SVGA3dBox box;
1301 uint32 invertBox;
1302} SVGA3dCmdInvalidateGBImagePartial;
1303#pragma pack(pop)
1304
1305#pragma pack(push, 1)
1306typedef struct SVGA3dCmdDefineGBContext {
1307 uint32 cid;
1308} SVGA3dCmdDefineGBContext;
1309#pragma pack(pop)
1310
1311#pragma pack(push, 1)
1312typedef struct SVGA3dCmdDestroyGBContext {
1313 uint32 cid;
1314} SVGA3dCmdDestroyGBContext;
1315#pragma pack(pop)
1316
1317#pragma pack(push, 1)
1318typedef struct SVGA3dCmdBindGBContext {
1319 uint32 cid;
1320 SVGAMobId mobid;
1321 uint32 validContents;
1322} SVGA3dCmdBindGBContext;
1323#pragma pack(pop)
1324
1325#pragma pack(push, 1)
1326typedef struct SVGA3dCmdReadbackGBContext {
1327 uint32 cid;
1328} SVGA3dCmdReadbackGBContext;
1329#pragma pack(pop)
1330
1331#pragma pack(push, 1)
1332typedef struct SVGA3dCmdInvalidateGBContext {
1333 uint32 cid;
1334} SVGA3dCmdInvalidateGBContext;
1335#pragma pack(pop)
1336
1337#pragma pack(push, 1)
1338typedef struct SVGA3dCmdDefineGBShader {
1339 uint32 shid;
1340 SVGA3dShaderType type;
1341 uint32 sizeInBytes;
1342} SVGA3dCmdDefineGBShader;
1343#pragma pack(pop)
1344
1345#pragma pack(push, 1)
1346typedef struct SVGA3dCmdBindGBShader {
1347 uint32 shid;
1348 SVGAMobId mobid;
1349 uint32 offsetInBytes;
1350} SVGA3dCmdBindGBShader;
1351#pragma pack(pop)
1352
1353#pragma pack(push, 1)
1354typedef struct SVGA3dCmdDestroyGBShader {
1355 uint32 shid;
1356} SVGA3dCmdDestroyGBShader;
1357#pragma pack(pop)
1358
1359#pragma pack(push, 1)
1360typedef struct {
1361 uint32 cid;
1362 uint32 regStart;
1363 SVGA3dShaderType shaderType;
1364 SVGA3dShaderConstType constType;
1365
1366} SVGA3dCmdSetGBShaderConstInline;
1367#pragma pack(pop)
1368
1369#pragma pack(push, 1)
1370typedef struct {
1371 uint32 cid;
1372 SVGA3dQueryType type;
1373} SVGA3dCmdBeginGBQuery;
1374#pragma pack(pop)
1375
1376#pragma pack(push, 1)
1377typedef struct {
1378 uint32 cid;
1379 SVGA3dQueryType type;
1380 SVGAMobId mobid;
1381 uint32 offset;
1382} SVGA3dCmdEndGBQuery;
1383#pragma pack(pop)
1384
1385#pragma pack(push, 1)
1386typedef struct {
1387 uint32 cid;
1388 SVGA3dQueryType type;
1389 SVGAMobId mobid;
1390 uint32 offset;
1391} SVGA3dCmdWaitForGBQuery;
1392#pragma pack(pop)
1393
1394#pragma pack(push, 1)
1395typedef struct {
1396 SVGAMobId mobid;
1397 uint32 mustBeZero;
1398 uint32 initialized;
1399} SVGA3dCmdEnableGart;
1400#pragma pack(pop)
1401
1402#pragma pack(push, 1)
1403typedef struct {
1404 SVGAMobId mobid;
1405 uint32 gartOffset;
1406} SVGA3dCmdMapMobIntoGart;
1407#pragma pack(pop)
1408
1409#pragma pack(push, 1)
1410typedef struct {
1411 uint32 gartOffset;
1412 uint32 numPages;
1413} SVGA3dCmdUnmapGartRange;
1414#pragma pack(pop)
1415
1416#pragma pack(push, 1)
1417typedef struct {
1418 uint32 stid;
1419 uint32 width;
1420 uint32 height;
1421 int32 xRoot;
1422 int32 yRoot;
1423 SVGAScreenTargetFlags flags;
1424
1425 uint32 dpi;
1426} SVGA3dCmdDefineGBScreenTarget;
1427#pragma pack(pop)
1428
1429#pragma pack(push, 1)
1430typedef struct {
1431 uint32 stid;
1432} SVGA3dCmdDestroyGBScreenTarget;
1433#pragma pack(pop)
1434
1435#pragma pack(push, 1)
1436typedef struct {
1437 uint32 stid;
1438 SVGA3dSurfaceImageId image;
1439} SVGA3dCmdBindGBScreenTarget;
1440#pragma pack(pop)
1441
1442#pragma pack(push, 1)
1443typedef struct {
1444 uint32 stid;
1445 SVGA3dRect rect;
1446} SVGA3dCmdUpdateGBScreenTarget;
1447#pragma pack(pop)
1448
1449#pragma pack(push, 1)
1450typedef struct {
1451 uint32 stid;
1452 SVGA3dRect rect;
1453 SVGA3dFrameUpdateType type;
1454} SVGA3dCmdUpdateGBScreenTarget_v2;
1455#pragma pack(pop)
1456
1457#pragma pack(push, 1)
1458typedef struct {
1459 uint32 stid;
1460 SVGA3dRect rect;
1461 SVGA3dFrameUpdateType type;
1462 SVGAUnsignedPoint srcPoint;
1463} SVGA3dCmdUpdateGBScreenTargetMove;
1464#pragma pack(pop)
1465
1466#pragma pack(push, 1)
1467typedef struct SVGA3dCmdGBScreenDMA {
1468 uint32 screenId;
1469 uint32 dead;
1470 SVGAMobId destMobID;
1471 uint32 destPitch;
1472 SVGAMobId changeMapMobID;
1473} SVGA3dCmdGBScreenDMA;
1474#pragma pack(pop)
1475
1476#pragma pack(push, 1)
1477typedef struct {
1478 uint32 value;
1479 uint32 mobId;
1480 uint32 mobOffset;
1481} SVGA3dCmdGBMobFence;
1482#pragma pack(pop)
1483
1484#pragma pack(push, 1)
1485typedef struct {
1486 uint32 stid;
1487 SVGA3dSurfaceImageId dest;
1488
1489 uint32 statusMobId;
1490 uint32 statusMobOffset;
1491
1492 uint32 mustBeInvalidId;
1493 uint32 mustBeZero;
1494} SVGA3dCmdScreenCopy;
1495#pragma pack(pop)
1496
1497#define SVGA_SCREEN_COPY_STATUS_FAILURE 0x00
1498#define SVGA_SCREEN_COPY_STATUS_SUCCESS 0x01
1499#define SVGA_SCREEN_COPY_STATUS_INVALID 0xFFFFFFFF
1500
1501#pragma pack(push, 1)
1502typedef struct {
1503 uint32 sid;
1504} SVGA3dCmdWriteZeroSurface;
1505#pragma pack(pop)
1506
1507#pragma pack(push, 1)
1508typedef struct {
1509 uint32 sid;
1510} SVGA3dCmdUpdateZeroSurface;
1511#pragma pack(pop)
1512
1513#endif