VirtualBox

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

Last change on this file since 102143 was 102143, checked in by vboxsync, 18 months ago

Devices/Graphics: header update. bugref:10529

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

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