VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/vmsvga_include/svga3d_cmd.h@ 102142

最後變更 在這個檔案從102142是 96407,由 vboxsync 提交於 2 年 前

scm copyright and license note update

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette