1 /**********************************************************
2 * Copyright 1998-2015 VMware, Inc. All rights reserved.
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 **********************************************************/
29 * SVGA 3d hardware cmd definitions
32 #ifndef _SVGA3D_CMD_H_
33 #define _SVGA3D_CMD_H_
35 #define INCLUDE_ALLOW_MODULE
36 #define INCLUDE_ALLOW_USERLEVEL
37 #define INCLUDE_ALLOW_VMCORE
39 #include "includeCheck.h"
40 #include "svga3d_types.h"
43 * Identifiers for commands in the command FIFO.
45 * IDs between 1000 and 1039 (inclusive) were used by obsolete versions of
46 * the SVGA3D protocol and remain reserved; they should not be used in the
49 * IDs between 1040 and 1999 (inclusive) are available for use by the
50 * current SVGA3D protocol.
52 * FIFO clients other than SVGA3D should stay below 1000, or at 2000
57 SVGA_3D_CMD_LEGACY_BASE
= 1000,
58 SVGA_3D_CMD_BASE
= 1040,
60 SVGA_3D_CMD_SURFACE_DEFINE
= 1040,
61 SVGA_3D_CMD_SURFACE_DESTROY
= 1041,
62 SVGA_3D_CMD_SURFACE_COPY
= 1042,
63 SVGA_3D_CMD_SURFACE_STRETCHBLT
= 1043,
64 SVGA_3D_CMD_SURFACE_DMA
= 1044,
65 SVGA_3D_CMD_CONTEXT_DEFINE
= 1045,
66 SVGA_3D_CMD_CONTEXT_DESTROY
= 1046,
67 SVGA_3D_CMD_SETTRANSFORM
= 1047,
68 SVGA_3D_CMD_SETZRANGE
= 1048,
69 SVGA_3D_CMD_SETRENDERSTATE
= 1049,
70 SVGA_3D_CMD_SETRENDERTARGET
= 1050,
71 SVGA_3D_CMD_SETTEXTURESTATE
= 1051,
72 SVGA_3D_CMD_SETMATERIAL
= 1052,
73 SVGA_3D_CMD_SETLIGHTDATA
= 1053,
74 SVGA_3D_CMD_SETLIGHTENABLED
= 1054,
75 SVGA_3D_CMD_SETVIEWPORT
= 1055,
76 SVGA_3D_CMD_SETCLIPPLANE
= 1056,
77 SVGA_3D_CMD_CLEAR
= 1057,
78 SVGA_3D_CMD_PRESENT
= 1058,
79 SVGA_3D_CMD_SHADER_DEFINE
= 1059,
80 SVGA_3D_CMD_SHADER_DESTROY
= 1060,
81 SVGA_3D_CMD_SET_SHADER
= 1061,
82 SVGA_3D_CMD_SET_SHADER_CONST
= 1062,
83 SVGA_3D_CMD_DRAW_PRIMITIVES
= 1063,
84 SVGA_3D_CMD_SETSCISSORRECT
= 1064,
85 SVGA_3D_CMD_BEGIN_QUERY
= 1065,
86 SVGA_3D_CMD_END_QUERY
= 1066,
87 SVGA_3D_CMD_WAIT_FOR_QUERY
= 1067,
88 SVGA_3D_CMD_PRESENT_READBACK
= 1068,
89 SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN
= 1069,
90 SVGA_3D_CMD_SURFACE_DEFINE_V2
= 1070,
91 SVGA_3D_CMD_GENERATE_MIPMAPS
= 1071,
92 SVGA_3D_CMD_VIDEO_CREATE_DECODER
= 1072,
93 SVGA_3D_CMD_VIDEO_DESTROY_DECODER
= 1073,
94 SVGA_3D_CMD_VIDEO_CREATE_PROCESSOR
= 1074,
95 SVGA_3D_CMD_VIDEO_DESTROY_PROCESSOR
= 1075,
96 SVGA_3D_CMD_VIDEO_DECODE_START_FRAME
= 1076,
97 SVGA_3D_CMD_VIDEO_DECODE_RENDER
= 1077,
98 SVGA_3D_CMD_VIDEO_DECODE_END_FRAME
= 1078,
99 SVGA_3D_CMD_VIDEO_PROCESS_FRAME
= 1079,
100 SVGA_3D_CMD_ACTIVATE_SURFACE
= 1080,
101 SVGA_3D_CMD_DEACTIVATE_SURFACE
= 1081,
102 SVGA_3D_CMD_SCREEN_DMA
= 1082,
103 SVGA_3D_CMD_SET_UNITY_SURFACE_COOKIE
= 1083,
104 SVGA_3D_CMD_OPEN_CONTEXT_SURFACE
= 1084,
106 SVGA_3D_CMD_LOGICOPS_BITBLT
= 1085,
107 SVGA_3D_CMD_LOGICOPS_TRANSBLT
= 1086,
108 SVGA_3D_CMD_LOGICOPS_STRETCHBLT
= 1087,
109 SVGA_3D_CMD_LOGICOPS_COLORFILL
= 1088,
110 SVGA_3D_CMD_LOGICOPS_ALPHABLEND
= 1089,
111 SVGA_3D_CMD_LOGICOPS_CLEARTYPEBLEND
= 1090,
113 SVGA_3D_CMD_SET_OTABLE_BASE
= 1091,
114 SVGA_3D_CMD_READBACK_OTABLE
= 1092,
116 SVGA_3D_CMD_DEFINE_GB_MOB
= 1093,
117 SVGA_3D_CMD_DESTROY_GB_MOB
= 1094,
118 SVGA_3D_CMD_DEAD3
= 1095,
119 SVGA_3D_CMD_UPDATE_GB_MOB_MAPPING
= 1096,
121 SVGA_3D_CMD_DEFINE_GB_SURFACE
= 1097,
122 SVGA_3D_CMD_DESTROY_GB_SURFACE
= 1098,
123 SVGA_3D_CMD_BIND_GB_SURFACE
= 1099,
124 SVGA_3D_CMD_COND_BIND_GB_SURFACE
= 1100,
125 SVGA_3D_CMD_UPDATE_GB_IMAGE
= 1101,
126 SVGA_3D_CMD_UPDATE_GB_SURFACE
= 1102,
127 SVGA_3D_CMD_READBACK_GB_IMAGE
= 1103,
128 SVGA_3D_CMD_READBACK_GB_SURFACE
= 1104,
129 SVGA_3D_CMD_INVALIDATE_GB_IMAGE
= 1105,
130 SVGA_3D_CMD_INVALIDATE_GB_SURFACE
= 1106,
132 SVGA_3D_CMD_DEFINE_GB_CONTEXT
= 1107,
133 SVGA_3D_CMD_DESTROY_GB_CONTEXT
= 1108,
134 SVGA_3D_CMD_BIND_GB_CONTEXT
= 1109,
135 SVGA_3D_CMD_READBACK_GB_CONTEXT
= 1110,
136 SVGA_3D_CMD_INVALIDATE_GB_CONTEXT
= 1111,
138 SVGA_3D_CMD_DEFINE_GB_SHADER
= 1112,
139 SVGA_3D_CMD_DESTROY_GB_SHADER
= 1113,
140 SVGA_3D_CMD_BIND_GB_SHADER
= 1114,
142 SVGA_3D_CMD_SET_OTABLE_BASE64
= 1115,
144 SVGA_3D_CMD_BEGIN_GB_QUERY
= 1116,
145 SVGA_3D_CMD_END_GB_QUERY
= 1117,
146 SVGA_3D_CMD_WAIT_FOR_GB_QUERY
= 1118,
148 SVGA_3D_CMD_NOP
= 1119,
150 SVGA_3D_CMD_ENABLE_GART
= 1120,
151 SVGA_3D_CMD_DISABLE_GART
= 1121,
152 SVGA_3D_CMD_MAP_MOB_INTO_GART
= 1122,
153 SVGA_3D_CMD_UNMAP_GART_RANGE
= 1123,
155 SVGA_3D_CMD_DEFINE_GB_SCREENTARGET
= 1124,
156 SVGA_3D_CMD_DESTROY_GB_SCREENTARGET
= 1125,
157 SVGA_3D_CMD_BIND_GB_SCREENTARGET
= 1126,
158 SVGA_3D_CMD_UPDATE_GB_SCREENTARGET
= 1127,
160 SVGA_3D_CMD_READBACK_GB_IMAGE_PARTIAL
= 1128,
161 SVGA_3D_CMD_INVALIDATE_GB_IMAGE_PARTIAL
= 1129,
163 SVGA_3D_CMD_SET_GB_SHADERCONSTS_INLINE
= 1130,
165 SVGA_3D_CMD_GB_SCREEN_DMA
= 1131,
166 SVGA_3D_CMD_BIND_GB_SURFACE_WITH_PITCH
= 1132,
167 SVGA_3D_CMD_GB_MOB_FENCE
= 1133,
168 SVGA_3D_CMD_DEFINE_GB_SURFACE_V2
= 1134,
169 SVGA_3D_CMD_DEFINE_GB_MOB64
= 1135,
170 SVGA_3D_CMD_REDEFINE_GB_MOB64
= 1136,
171 SVGA_3D_CMD_NOP_ERROR
= 1137,
173 SVGA_3D_CMD_SET_VERTEX_STREAMS
= 1138,
174 SVGA_3D_CMD_SET_VERTEX_DECLS
= 1139,
175 SVGA_3D_CMD_SET_VERTEX_DIVISORS
= 1140,
176 SVGA_3D_CMD_DRAW
= 1141,
177 SVGA_3D_CMD_DRAW_INDEXED
= 1142,
182 SVGA_3D_CMD_DX_MIN
= 1143,
183 SVGA_3D_CMD_DX_DEFINE_CONTEXT
= 1143,
184 SVGA_3D_CMD_DX_DESTROY_CONTEXT
= 1144,
185 SVGA_3D_CMD_DX_BIND_CONTEXT
= 1145,
186 SVGA_3D_CMD_DX_READBACK_CONTEXT
= 1146,
187 SVGA_3D_CMD_DX_INVALIDATE_CONTEXT
= 1147,
188 SVGA_3D_CMD_DX_SET_SINGLE_CONSTANT_BUFFER
= 1148,
189 SVGA_3D_CMD_DX_SET_SHADER_RESOURCES
= 1149,
190 SVGA_3D_CMD_DX_SET_SHADER
= 1150,
191 SVGA_3D_CMD_DX_SET_SAMPLERS
= 1151,
192 SVGA_3D_CMD_DX_DRAW
= 1152,
193 SVGA_3D_CMD_DX_DRAW_INDEXED
= 1153,
194 SVGA_3D_CMD_DX_DRAW_INSTANCED
= 1154,
195 SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED
= 1155,
196 SVGA_3D_CMD_DX_DRAW_AUTO
= 1156,
197 SVGA_3D_CMD_DX_SET_INPUT_LAYOUT
= 1157,
198 SVGA_3D_CMD_DX_SET_VERTEX_BUFFERS
= 1158,
199 SVGA_3D_CMD_DX_SET_INDEX_BUFFER
= 1159,
200 SVGA_3D_CMD_DX_SET_TOPOLOGY
= 1160,
201 SVGA_3D_CMD_DX_SET_RENDERTARGETS
= 1161,
202 SVGA_3D_CMD_DX_SET_BLEND_STATE
= 1162,
203 SVGA_3D_CMD_DX_SET_DEPTHSTENCIL_STATE
= 1163,
204 SVGA_3D_CMD_DX_SET_RASTERIZER_STATE
= 1164,
205 SVGA_3D_CMD_DX_DEFINE_QUERY
= 1165,
206 SVGA_3D_CMD_DX_DESTROY_QUERY
= 1166,
207 SVGA_3D_CMD_DX_BIND_QUERY
= 1167,
208 SVGA_3D_CMD_DX_SET_QUERY_OFFSET
= 1168,
209 SVGA_3D_CMD_DX_BEGIN_QUERY
= 1169,
210 SVGA_3D_CMD_DX_END_QUERY
= 1170,
211 SVGA_3D_CMD_DX_READBACK_QUERY
= 1171,
212 SVGA_3D_CMD_DX_SET_PREDICATION
= 1172,
213 SVGA_3D_CMD_DX_SET_SOTARGETS
= 1173,
214 SVGA_3D_CMD_DX_SET_VIEWPORTS
= 1174,
215 SVGA_3D_CMD_DX_SET_SCISSORRECTS
= 1175,
216 SVGA_3D_CMD_DX_CLEAR_RENDERTARGET_VIEW
= 1176,
217 SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW
= 1177,
218 SVGA_3D_CMD_DX_PRED_COPY_REGION
= 1178,
219 SVGA_3D_CMD_DX_PRED_COPY
= 1179,
220 SVGA_3D_CMD_DX_STRETCHBLT
= 1180,
221 SVGA_3D_CMD_DX_GENMIPS
= 1181,
222 SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE
= 1182,
223 SVGA_3D_CMD_DX_READBACK_SUBRESOURCE
= 1183,
224 SVGA_3D_CMD_DX_INVALIDATE_SUBRESOURCE
= 1184,
225 SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW
= 1185,
226 SVGA_3D_CMD_DX_DESTROY_SHADERRESOURCE_VIEW
= 1186,
227 SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW
= 1187,
228 SVGA_3D_CMD_DX_DESTROY_RENDERTARGET_VIEW
= 1188,
229 SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW
= 1189,
230 SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW
= 1190,
231 SVGA_3D_CMD_DX_DEFINE_ELEMENTLAYOUT
= 1191,
232 SVGA_3D_CMD_DX_DESTROY_ELEMENTLAYOUT
= 1192,
233 SVGA_3D_CMD_DX_DEFINE_BLEND_STATE
= 1193,
234 SVGA_3D_CMD_DX_DESTROY_BLEND_STATE
= 1194,
235 SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_STATE
= 1195,
236 SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_STATE
= 1196,
237 SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE
= 1197,
238 SVGA_3D_CMD_DX_DESTROY_RASTERIZER_STATE
= 1198,
239 SVGA_3D_CMD_DX_DEFINE_SAMPLER_STATE
= 1199,
240 SVGA_3D_CMD_DX_DESTROY_SAMPLER_STATE
= 1200,
241 SVGA_3D_CMD_DX_DEFINE_SHADER
= 1201,
242 SVGA_3D_CMD_DX_DESTROY_SHADER
= 1202,
243 SVGA_3D_CMD_DX_BIND_SHADER
= 1203,
244 SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT
= 1204,
245 SVGA_3D_CMD_DX_DESTROY_STREAMOUTPUT
= 1205,
246 SVGA_3D_CMD_DX_SET_STREAMOUTPUT
= 1206,
247 SVGA_3D_CMD_DX_SET_COTABLE
= 1207,
248 SVGA_3D_CMD_DX_READBACK_COTABLE
= 1208,
249 SVGA_3D_CMD_DX_BUFFER_COPY
= 1209,
250 SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER
= 1210,
251 SVGA_3D_CMD_DX_SURFACE_COPY_AND_READBACK
= 1211,
252 SVGA_3D_CMD_DX_MOVE_QUERY
= 1212,
253 SVGA_3D_CMD_DX_BIND_ALL_QUERY
= 1213,
254 SVGA_3D_CMD_DX_READBACK_ALL_QUERY
= 1214,
255 SVGA_3D_CMD_DX_PRED_TRANSFER_FROM_BUFFER
= 1215,
256 SVGA_3D_CMD_DX_MOB_FENCE_64
= 1216,
257 SVGA_3D_CMD_DX_BIND_SHADER_ON_CONTEXT
= 1217,
258 SVGA_3D_CMD_DX_HINT
= 1218,
259 SVGA_3D_CMD_DX_BUFFER_UPDATE
= 1219,
260 SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET
= 1220,
261 SVGA_3D_CMD_DX_SET_PS_CONSTANT_BUFFER_OFFSET
= 1221,
262 SVGA_3D_CMD_DX_SET_GS_CONSTANT_BUFFER_OFFSET
= 1222,
265 * Reserve some IDs to be used for the DX11 shader types.
267 SVGA_3D_CMD_DX_RESERVED1
= 1223,
268 SVGA_3D_CMD_DX_RESERVED2
= 1224,
269 SVGA_3D_CMD_DX_RESERVED3
= 1225,
271 SVGA_3D_CMD_DX_MAX
= 1226,
272 SVGA_3D_CMD_MAX
= 1226,
273 SVGA_3D_CMD_FUTURE_MAX
= 3000
277 * FIFO command format definitions:
281 * The data size header following cmdNum for every 3d command
284 #include "vmware_pack_begin.h"
289 #include "vmware_pack_end.h"
293 #include "vmware_pack_begin.h"
297 #include "vmware_pack_end.h"
301 #include "vmware_pack_begin.h"
304 SVGA3dSurfaceFlags surfaceFlags
;
305 SVGA3dSurfaceFormat format
;
307 * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
308 * structures must have the same value of numMipLevels field.
309 * Otherwise, all but the first SVGA3dSurfaceFace structures must have the
310 * numMipLevels set to 0.
312 SVGA3dSurfaceFace face
[SVGA3D_MAX_SURFACE_FACES
];
314 * Followed by an SVGA3dSize structure for each mip level in each face.
316 * A note on surface sizes: Sizes are always specified in pixels,
317 * even if the true surface size is not a multiple of the minimum
318 * block size of the surface's format. For example, a 3x3x1 DXT1
319 * compressed texture would actually be stored as a 4x4x1 image in
323 #include "vmware_pack_end.h"
324 SVGA3dCmdDefineSurface
; /* SVGA_3D_CMD_SURFACE_DEFINE */
327 #include "vmware_pack_begin.h"
330 SVGA3dSurfaceFlags surfaceFlags
;
331 SVGA3dSurfaceFormat format
;
333 * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
334 * structures must have the same value of numMipLevels field.
335 * Otherwise, all but the first SVGA3dSurfaceFace structures must have the
336 * numMipLevels set to 0.
338 SVGA3dSurfaceFace face
[SVGA3D_MAX_SURFACE_FACES
];
339 uint32 multisampleCount
;
340 SVGA3dTextureFilter autogenFilter
;
342 * Followed by an SVGA3dSize structure for each mip level in each face.
344 * A note on surface sizes: Sizes are always specified in pixels,
345 * even if the true surface size is not a multiple of the minimum
346 * block size of the surface's format. For example, a 3x3x1 DXT1
347 * compressed texture would actually be stored as a 4x4x1 image in
351 #include "vmware_pack_end.h"
352 SVGA3dCmdDefineSurface_v2
; /* SVGA_3D_CMD_SURFACE_DEFINE_V2 */
355 #include "vmware_pack_begin.h"
359 #include "vmware_pack_end.h"
360 SVGA3dCmdDestroySurface
; /* SVGA_3D_CMD_SURFACE_DESTROY */
363 #include "vmware_pack_begin.h"
367 #include "vmware_pack_end.h"
368 SVGA3dCmdDefineContext
; /* SVGA_3D_CMD_CONTEXT_DEFINE */
371 #include "vmware_pack_begin.h"
375 #include "vmware_pack_end.h"
376 SVGA3dCmdDestroyContext
; /* SVGA_3D_CMD_CONTEXT_DESTROY */
379 #include "vmware_pack_begin.h"
382 SVGA3dClearFlag clearFlag
;
386 /* Followed by variable number of SVGA3dRect structures */
388 #include "vmware_pack_end.h"
389 SVGA3dCmdClear
; /* SVGA_3D_CMD_CLEAR */
392 #include "vmware_pack_begin.h"
394 SVGA3dLightType type
;
395 SVGA3dBool inWorldSpace
;
409 #include "vmware_pack_end.h"
413 #include "vmware_pack_begin.h"
416 /* Followed by variable number of SVGA3dCopyRect structures */
418 #include "vmware_pack_end.h"
419 SVGA3dCmdPresent
; /* SVGA_3D_CMD_PRESENT */
422 #include "vmware_pack_begin.h"
424 SVGA3dRenderStateName state
;
430 #include "vmware_pack_end.h"
434 #include "vmware_pack_begin.h"
437 /* Followed by variable number of SVGA3dRenderState structures */
439 #include "vmware_pack_end.h"
440 SVGA3dCmdSetRenderState
; /* SVGA_3D_CMD_SETRENDERSTATE */
443 #include "vmware_pack_begin.h"
446 SVGA3dRenderTargetType type
;
447 SVGA3dSurfaceImageId target
;
449 #include "vmware_pack_end.h"
450 SVGA3dCmdSetRenderTarget
; /* SVGA_3D_CMD_SETRENDERTARGET */
453 #include "vmware_pack_begin.h"
455 SVGA3dSurfaceImageId src
;
456 SVGA3dSurfaceImageId dest
;
457 /* Followed by variable number of SVGA3dCopyBox structures */
459 #include "vmware_pack_end.h"
460 SVGA3dCmdSurfaceCopy
; /* SVGA_3D_CMD_SURFACE_COPY */
463 #include "vmware_pack_begin.h"
465 SVGA3dSurfaceImageId src
;
466 SVGA3dSurfaceImageId dest
;
469 SVGA3dStretchBltMode mode
;
471 #include "vmware_pack_end.h"
472 SVGA3dCmdSurfaceStretchBlt
; /* SVGA_3D_CMD_SURFACE_STRETCHBLT */
475 #include "vmware_pack_begin.h"
478 * If the discard flag is present in a surface DMA operation, the host may
479 * discard the contents of the current mipmap level and face of the target
480 * surface before applying the surface DMA contents.
485 * If the unsynchronized flag is present, the host may perform this upload
486 * without syncing to pending reads on this surface.
488 uint32 unsynchronized
: 1;
491 * Guests *MUST* set the reserved bits to 0 before submitting the command
492 * suffix as future flags may occupy these bits.
494 uint32 reserved
: 30;
496 #include "vmware_pack_end.h"
497 SVGA3dSurfaceDMAFlags
;
500 #include "vmware_pack_begin.h"
502 SVGAGuestImage guest
;
503 SVGA3dSurfaceImageId host
;
504 SVGA3dTransferType transfer
;
506 * Followed by variable number of SVGA3dCopyBox structures. For consistency
507 * in all clipping logic and coordinate translation, we define the
508 * "source" in each copyBox as the guest image and the
509 * "destination" as the host image, regardless of transfer
512 * For efficiency, the SVGA3D device is free to copy more data than
513 * specified. For example, it may round copy boxes outwards such
514 * that they lie on particular alignment boundaries.
517 #include "vmware_pack_end.h"
518 SVGA3dCmdSurfaceDMA
; /* SVGA_3D_CMD_SURFACE_DMA */
521 * SVGA3dCmdSurfaceDMASuffix --
523 * This is a command suffix that will appear after a SurfaceDMA command in
524 * the FIFO. It contains some extra information that hosts may use to
525 * optimize performance or protect the guest. This suffix exists to preserve
526 * backwards compatibility while also allowing for new functionality to be
531 #include "vmware_pack_begin.h"
536 * The maximum offset is used to determine the maximum offset from the
537 * guestPtr base address that will be accessed or written to during this
538 * surfaceDMA. If the suffix is supported, the host will respect this
539 * boundary while performing surface DMAs.
541 * Defaults to MAX_UINT32
543 uint32 maximumOffset
;
546 * A set of flags that describes optimizations that the host may perform
547 * while performing this surface DMA operation. The guest should never rely
548 * on behaviour that is different when these flags are set for correctness.
552 SVGA3dSurfaceDMAFlags flags
;
554 #include "vmware_pack_end.h"
555 SVGA3dCmdSurfaceDMASuffix
;
558 * SVGA_3D_CMD_DRAW_PRIMITIVES --
560 * This command is the SVGA3D device's generic drawing entry point.
561 * It can draw multiple ranges of primitives, optionally using an
562 * index buffer, using an arbitrary collection of vertex buffers.
564 * Each SVGA3dVertexDecl defines a distinct vertex array to bind
565 * during this draw call. The declarations specify which surface
566 * the vertex data lives in, what that vertex data is used for,
567 * and how to interpret it.
569 * Each SVGA3dPrimitiveRange defines a collection of primitives
570 * to render using the same vertex arrays. An index buffer is
575 #include "vmware_pack_begin.h"
578 * A range hint is an optional specification for the range of indices
579 * in an SVGA3dArray that will be used. If 'last' is zero, it is assumed
580 * that the entire array will be used.
582 * These are only hints. The SVGA3D device may use them for
583 * performance optimization if possible, but it's also allowed to
584 * ignore these values.
589 #include "vmware_pack_end.h"
590 SVGA3dArrayRangeHint
;
593 #include "vmware_pack_begin.h"
596 * Define the origin and shape of a vertex or index array. Both
597 * 'offset' and 'stride' are in bytes. The provided surface will be
598 * reinterpreted as a flat array of bytes in the same format used
599 * by surface DMA operations. To avoid unnecessary conversions, the
600 * surface should be created with the SVGA3D_BUFFER format.
602 * Index 0 in the array starts 'offset' bytes into the surface.
603 * Index 1 begins at byte 'offset + stride', etc. Array indices may
610 #include "vmware_pack_end.h"
614 #include "vmware_pack_begin.h"
617 * Describe a vertex array's data type, and define how it is to be
618 * used by the fixed function pipeline or the vertex shader. It
619 * isn't useful to have two VertexDecls with the same
620 * VertexArrayIdentity in one draw call.
623 SVGA3dDeclMethod method
;
624 SVGA3dDeclUsage usage
;
627 #include "vmware_pack_end.h"
628 SVGA3dVertexArrayIdentity
;
631 #include "vmware_pack_begin.h"
632 struct SVGA3dVertexDecl
{
633 SVGA3dVertexArrayIdentity identity
;
635 SVGA3dArrayRangeHint rangeHint
;
637 #include "vmware_pack_end.h"
641 #include "vmware_pack_begin.h"
642 struct SVGA3dPrimitiveRange
{
644 * Define a group of primitives to render, from sequential indices.
646 * The value of 'primitiveType' and 'primitiveCount' imply the
647 * total number of vertices that will be rendered.
649 SVGA3dPrimitiveType primType
;
650 uint32 primitiveCount
;
653 * Optional index buffer. If indexArray.surfaceId is
654 * SVGA3D_INVALID_ID, we render without an index buffer. Rendering
655 * without an index buffer is identical to rendering with an index
656 * buffer containing the sequence [0, 1, 2, 3, ...].
658 * If an index buffer is in use, indexWidth specifies the width in
659 * bytes of each index value. It must be less than or equal to
662 * (Currently, the SVGA3D device requires index buffers to be tightly
663 * packed. In other words, indexWidth == indexArray.stride)
665 SVGA3dArray indexArray
;
669 * Optional index bias. This number is added to all indices from
670 * indexArray before they are used as vertex array indices. This
671 * can be used in multiple ways:
673 * - When not using an indexArray, this bias can be used to
674 * specify where in the vertex arrays to begin rendering.
676 * - A positive number here is equivalent to increasing the
677 * offset in each vertex array.
679 * - A negative number can be used to render using a small
680 * vertex array and an index buffer that contains large
681 * values. This may be used by some applications that
682 * crop a vertex buffer without modifying their index
685 * Note that rendering with a negative bias value may be slower and
686 * use more memory than rendering with a positive or zero bias.
690 #include "vmware_pack_end.h"
691 SVGA3dPrimitiveRange
;
694 #include "vmware_pack_begin.h"
697 uint32 numVertexDecls
;
701 * There are two variable size arrays after the
702 * SVGA3dCmdDrawPrimitives structure. In order,
705 * 1. SVGA3dVertexDecl, quantity 'numVertexDecls', but no more than
706 * SVGA3D_MAX_VERTEX_ARRAYS;
707 * 2. SVGA3dPrimitiveRange, quantity 'numRanges', but no more than
708 * SVGA3D_MAX_DRAW_PRIMITIVE_RANGES;
709 * 3. Optionally, SVGA3dVertexDivisor, quantity 'numVertexDecls' (contains
710 * the frequency divisor for the corresponding vertex decl).
713 #include "vmware_pack_end.h"
714 SVGA3dCmdDrawPrimitives
; /* SVGA_3D_CMD_DRAWPRIMITIVES */
717 #include "vmware_pack_begin.h"
721 uint32 primitiveCount
; /* How many primitives to render */
722 uint32 startVertexLocation
; /* Which vertex do we start rendering at. */
724 uint8 primitiveType
; /* SVGA3dPrimitiveType */
727 #include "vmware_pack_end.h"
731 #include "vmware_pack_begin.h"
735 uint8 primitiveType
; /* SVGA3dPrimitiveType */
737 uint32 indexBufferSid
; /* Valid index buffer sid. */
738 uint32 indexBufferOffset
; /* Byte offset into the vertex buffer, almost */
739 /* always 0 for DX9 guests, non-zero for OpenGL */
740 /* guests. We can't represent non-multiple of */
741 /* stride offsets in D3D9Renderer... */
742 uint8 indexBufferStride
; /* Allowable values = 1, 2, or 4 */
744 int32 baseVertexLocation
; /* Bias applied to the index when selecting a */
745 /* vertex from the streams, may be negative */
747 uint32 primitiveCount
; /* How many primitives to render */
751 #include "vmware_pack_end.h"
752 SVGA3dCmdDrawIndexed
;
755 #include "vmware_pack_begin.h"
758 * Describe a vertex array's data type, and define how it is to be
759 * used by the fixed function pipeline or the vertex shader. It
760 * isn't useful to have two VertexDecls with the same
761 * VertexArrayIdentity in one draw call.
765 uint8 type
; /* SVGA3dDeclType */
766 uint8 method
; /* SVGA3dDeclMethod */
767 uint8 usage
; /* SVGA3dDeclUsage */
772 #include "vmware_pack_end.h"
776 #include "vmware_pack_begin.h"
783 * Followed by numElements SVGA3dVertexElement structures.
785 * If numElements < SVGA3D_MAX_VERTEX_ARRAYS, the remaining elements
786 * are cleared and will not be used by following draws.
789 #include "vmware_pack_end.h"
790 SVGA3dCmdSetVertexDecls
;
793 #include "vmware_pack_begin.h"
799 #include "vmware_pack_end.h"
803 #include "vmware_pack_begin.h"
809 * Followed by numStream SVGA3dVertexStream structures.
811 * If numStreams < SVGA3D_MAX_VERTEX_ARRAYS, the remaining streams
812 * are cleared and will not be used by following draws.
815 #include "vmware_pack_end.h"
816 SVGA3dCmdSetVertexStreams
;
819 #include "vmware_pack_begin.h"
824 #include "vmware_pack_end.h"
825 SVGA3dCmdSetVertexDivisors
;
828 #include "vmware_pack_begin.h"
831 SVGA3dTextureStateName name
;
837 #include "vmware_pack_end.h"
841 #include "vmware_pack_begin.h"
844 /* Followed by variable number of SVGA3dTextureState structures */
846 #include "vmware_pack_end.h"
847 SVGA3dCmdSetTextureState
; /* SVGA_3D_CMD_SETTEXTURESTATE */
850 #include "vmware_pack_begin.h"
853 SVGA3dTransformType type
;
856 #include "vmware_pack_end.h"
857 SVGA3dCmdSetTransform
; /* SVGA_3D_CMD_SETTRANSFORM */
860 #include "vmware_pack_begin.h"
865 #include "vmware_pack_end.h"
869 #include "vmware_pack_begin.h"
874 #include "vmware_pack_end.h"
875 SVGA3dCmdSetZRange
; /* SVGA_3D_CMD_SETZRANGE */
878 #include "vmware_pack_begin.h"
886 #include "vmware_pack_end.h"
890 #include "vmware_pack_begin.h"
894 SVGA3dMaterial material
;
896 #include "vmware_pack_end.h"
897 SVGA3dCmdSetMaterial
; /* SVGA_3D_CMD_SETMATERIAL */
900 #include "vmware_pack_begin.h"
904 SVGA3dLightData data
;
906 #include "vmware_pack_end.h"
907 SVGA3dCmdSetLightData
; /* SVGA_3D_CMD_SETLIGHTDATA */
910 #include "vmware_pack_begin.h"
916 #include "vmware_pack_end.h"
917 SVGA3dCmdSetLightEnabled
; /* SVGA_3D_CMD_SETLIGHTENABLED */
920 #include "vmware_pack_begin.h"
925 #include "vmware_pack_end.h"
926 SVGA3dCmdSetViewport
; /* SVGA_3D_CMD_SETVIEWPORT */
929 #include "vmware_pack_begin.h"
934 #include "vmware_pack_end.h"
935 SVGA3dCmdSetScissorRect
; /* SVGA_3D_CMD_SETSCISSORRECT */
938 #include "vmware_pack_begin.h"
944 #include "vmware_pack_end.h"
945 SVGA3dCmdSetClipPlane
; /* SVGA_3D_CMD_SETCLIPPLANE */
948 #include "vmware_pack_begin.h"
952 SVGA3dShaderType type
;
953 /* Followed by variable number of DWORDs for shader bycode */
955 #include "vmware_pack_end.h"
956 SVGA3dCmdDefineShader
; /* SVGA_3D_CMD_SHADER_DEFINE */
959 #include "vmware_pack_begin.h"
963 SVGA3dShaderType type
;
965 #include "vmware_pack_end.h"
966 SVGA3dCmdDestroyShader
; /* SVGA_3D_CMD_SHADER_DESTROY */
969 #include "vmware_pack_begin.h"
972 uint32 reg
; /* register number */
973 SVGA3dShaderType type
;
974 SVGA3dShaderConstType ctype
;
978 * Followed by a variable number of additional values.
981 #include "vmware_pack_end.h"
982 SVGA3dCmdSetShaderConst
; /* SVGA_3D_CMD_SET_SHADER_CONST */
985 #include "vmware_pack_begin.h"
988 SVGA3dShaderType type
;
991 #include "vmware_pack_end.h"
992 SVGA3dCmdSetShader
; /* SVGA_3D_CMD_SET_SHADER */
995 #include "vmware_pack_begin.h"
998 SVGA3dQueryType type
;
1000 #include "vmware_pack_end.h"
1001 SVGA3dCmdBeginQuery
; /* SVGA_3D_CMD_BEGIN_QUERY */
1004 #include "vmware_pack_begin.h"
1007 SVGA3dQueryType type
;
1008 SVGAGuestPtr guestResult
; /* Points to an SVGA3dQueryResult structure */
1010 #include "vmware_pack_end.h"
1011 SVGA3dCmdEndQuery
; /* SVGA_3D_CMD_END_QUERY */
1015 * SVGA3D_CMD_WAIT_FOR_QUERY --
1017 * Will read the SVGA3dQueryResult structure pointed to by guestResult,
1018 * and if the state member is set to anything else than
1019 * SVGA3D_QUERYSTATE_PENDING, this command will always be a no-op.
1021 * Otherwise, in addition to the query explicitly waited for,
1022 * All queries with the same type and issued with the same cid, for which
1023 * an SVGA_3D_CMD_END_QUERY command has previously been sent, will
1024 * be finished after execution of this command.
1026 * A query will be identified by the gmrId and offset of the guestResult
1027 * member. If the device can't find an SVGA_3D_CMD_END_QUERY that has
1028 * been sent previously with an indentical gmrId and offset, it will
1029 * effectively end all queries with an identical type issued with the
1030 * same cid, and the SVGA3dQueryResult structure pointed to by
1031 * guestResult will not be written to. This property can be used to
1032 * implement a query barrier for a given cid and query type.
1036 #include "vmware_pack_begin.h"
1038 uint32 cid
; /* Same parameters passed to END_QUERY */
1039 SVGA3dQueryType type
;
1040 SVGAGuestPtr guestResult
;
1042 #include "vmware_pack_end.h"
1043 SVGA3dCmdWaitForQuery
; /* SVGA_3D_CMD_WAIT_FOR_QUERY */
1046 #include "vmware_pack_begin.h"
1048 uint32 totalSize
; /* Set by guest before query is ended. */
1049 SVGA3dQueryState state
; /* Set by host or guest. See SVGA3dQueryState. */
1050 union { /* Set by host on exit from PENDING state */
1052 uint32 queryCookie
; /* May be used to identify which QueryGetData this
1053 result corresponds to. */
1056 #include "vmware_pack_end.h"
1061 * SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN --
1063 * This is a blit from an SVGA3D surface to a Screen Object.
1064 * This blit must be directed at a specific screen.
1066 * The blit copies from a rectangular region of an SVGA3D surface
1067 * image to a rectangular region of a screen.
1069 * This command takes an optional variable-length list of clipping
1070 * rectangles after the body of the command. If no rectangles are
1071 * specified, there is no clipping region. The entire destRect is
1072 * drawn to. If one or more rectangles are included, they describe
1073 * a clipping region. The clip rectangle coordinates are measured
1074 * relative to the top-left corner of destRect.
1076 * The srcImage must be from mip=0 face=0.
1078 * This supports scaling if the src and dest are of different sizes.
1081 * SVGA_FIFO_CAP_SCREEN_OBJECT
1085 #include "vmware_pack_begin.h"
1087 SVGA3dSurfaceImageId srcImage
;
1088 SVGASignedRect srcRect
;
1089 uint32 destScreenId
; /* Screen Object ID */
1090 SVGASignedRect destRect
;
1091 /* Clipping: zero or more SVGASignedRects follow */
1093 #include "vmware_pack_end.h"
1094 SVGA3dCmdBlitSurfaceToScreen
; /* SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN */
1097 #include "vmware_pack_begin.h"
1100 SVGA3dTextureFilter filter
;
1102 #include "vmware_pack_end.h"
1103 SVGA3dCmdGenerateMipmaps
; /* SVGA_3D_CMD_GENERATE_MIPMAPS */
1108 #include "vmware_pack_begin.h"
1112 #include "vmware_pack_end.h"
1113 SVGA3dCmdActivateSurface
; /* SVGA_3D_CMD_ACTIVATE_SURFACE */
1116 #include "vmware_pack_begin.h"
1120 #include "vmware_pack_end.h"
1121 SVGA3dCmdDeactivateSurface
; /* SVGA_3D_CMD_DEACTIVATE_SURFACE */
1124 * Screen DMA command
1126 * Available with SVGA_FIFO_CAP_SCREEN_OBJECT_2. The SVGA_CAP_3D device
1127 * cap bit is not required.
1129 * - refBuffer and destBuffer are 32bit BGRX; refBuffer and destBuffer could
1130 * be different, but it is required that guest makes sure refBuffer has
1131 * exactly the same contents that were written to when last time screen DMA
1132 * command is received by host.
1134 * - changemap is generated by lib/blit, and it has the changes from last
1135 * received screen DMA or more.
1139 #include "vmware_pack_begin.h"
1140 struct SVGA3dCmdScreenDMA
{
1142 SVGAGuestImage refBuffer
;
1143 SVGAGuestImage destBuffer
;
1144 SVGAGuestImage changeMap
;
1146 #include "vmware_pack_end.h"
1147 SVGA3dCmdScreenDMA
; /* SVGA_3D_CMD_SCREEN_DMA */
1150 * Set Unity Surface Cookie
1152 * Associates the supplied cookie with the surface id for use with
1153 * Unity. This cookie is a hint from guest to host, there is no way
1154 * for the guest to readback the cookie and the host is free to drop
1155 * the cookie association at will. The default value for the cookie
1156 * on all surfaces is 0.
1160 #include "vmware_pack_begin.h"
1161 struct SVGA3dCmdSetUnitySurfaceCookie
{
1165 #include "vmware_pack_end.h"
1166 SVGA3dCmdSetUnitySurfaceCookie
; /* SVGA_3D_CMD_SET_UNITY_SURFACE_COOKIE */
1169 * Open a context-specific surface in a non-context-specific manner.
1173 #include "vmware_pack_begin.h"
1174 struct SVGA3dCmdOpenContextSurface
{
1177 #include "vmware_pack_end.h"
1178 SVGA3dCmdOpenContextSurface
; /* SVGA_3D_CMD_OPEN_CONTEXT_SURFACE */
1185 #define SVGA3D_LOTRANSBLT_HONORALPHA (0x01)
1186 #define SVGA3D_LOSTRETCHBLT_MIRRORX (0x01)
1187 #define SVGA3D_LOSTRETCHBLT_MIRRORY (0x02)
1188 #define SVGA3D_LOALPHABLEND_SRCHASALPHA (0x01)
1191 #include "vmware_pack_begin.h"
1192 struct SVGA3dCmdLogicOpsBitBlt
{
1194 * All LogicOps surfaces are one-level
1195 * surfaces so mipmap & face should always
1198 SVGA3dSurfaceImageId src
;
1199 SVGA3dSurfaceImageId dst
;
1200 SVGA3dLogicOp logicOp
;
1201 /* Followed by variable number of SVGA3dCopyBox structures */
1203 #include "vmware_pack_end.h"
1204 SVGA3dCmdLogicOpsBitBlt
; /* SVGA_3D_CMD_LOGICOPS_BITBLT */
1208 #include "vmware_pack_begin.h"
1209 struct SVGA3dCmdLogicOpsTransBlt
{
1211 * All LogicOps surfaces are one-level
1212 * surfaces so mipmap & face should always
1215 SVGA3dSurfaceImageId src
;
1216 SVGA3dSurfaceImageId dst
;
1222 #include "vmware_pack_end.h"
1223 SVGA3dCmdLogicOpsTransBlt
; /* SVGA_3D_CMD_LOGICOPS_TRANSBLT */
1227 #include "vmware_pack_begin.h"
1228 struct SVGA3dCmdLogicOpsStretchBlt
{
1230 * All LogicOps surfaces are one-level
1231 * surfaces so mipmap & face should always
1234 SVGA3dSurfaceImageId src
;
1235 SVGA3dSurfaceImageId dst
;
1241 #include "vmware_pack_end.h"
1242 SVGA3dCmdLogicOpsStretchBlt
; /* SVGA_3D_CMD_LOGICOPS_STRETCHBLT */
1246 #include "vmware_pack_begin.h"
1247 struct SVGA3dCmdLogicOpsColorFill
{
1249 * All LogicOps surfaces are one-level
1250 * surfaces so mipmap & face should always
1253 SVGA3dSurfaceImageId dst
;
1255 SVGA3dLogicOp logicOp
;
1256 /* Followed by variable number of SVGA3dRect structures. */
1258 #include "vmware_pack_end.h"
1259 SVGA3dCmdLogicOpsColorFill
; /* SVGA_3D_CMD_LOGICOPS_COLORFILL */
1263 #include "vmware_pack_begin.h"
1264 struct SVGA3dCmdLogicOpsAlphaBlend
{
1266 * All LogicOps surfaces are one-level
1267 * surfaces so mipmap & face should always
1270 SVGA3dSurfaceImageId src
;
1271 SVGA3dSurfaceImageId dst
;
1277 #include "vmware_pack_end.h"
1278 SVGA3dCmdLogicOpsAlphaBlend
; /* SVGA_3D_CMD_LOGICOPS_ALPHABLEND */
1280 #define SVGA3D_CLEARTYPE_INVALID_GAMMA_INDEX 0xFFFFFFFF
1282 #define SVGA3D_CLEARTYPE_GAMMA_WIDTH 512
1283 #define SVGA3D_CLEARTYPE_GAMMA_HEIGHT 16
1286 #include "vmware_pack_begin.h"
1287 struct SVGA3dCmdLogicOpsClearTypeBlend
{
1289 * All LogicOps surfaces are one-level
1290 * surfaces so mipmap & face should always
1293 SVGA3dSurfaceImageId tmp
;
1294 SVGA3dSurfaceImageId dst
;
1295 SVGA3dSurfaceImageId gammaSurf
;
1296 SVGA3dSurfaceImageId alphaSurf
;
1302 /* Followed by variable number of SVGA3dBox structures */
1304 #include "vmware_pack_end.h"
1305 SVGA3dCmdLogicOpsClearTypeBlend
; /* SVGA_3D_CMD_LOGICOPS_CLEARTYPEBLEND */
1309 * Guest-backed objects definitions.
1313 #include "vmware_pack_begin.h"
1315 SVGAMobFormat ptDepth
;
1319 #include "vmware_pack_end.h"
1321 #define SVGA3D_OTABLE_MOB_ENTRY_SIZE (sizeof(SVGAOTableMobEntry))
1324 #include "vmware_pack_begin.h"
1326 SVGA3dSurfaceFormat format
;
1327 SVGA3dSurfaceFlags surfaceFlags
;
1328 uint32 numMipLevels
;
1329 uint32 multisampleCount
;
1330 SVGA3dTextureFilter autogenFilter
;
1337 #include "vmware_pack_end.h"
1338 SVGAOTableSurfaceEntry
;
1339 #define SVGA3D_OTABLE_SURFACE_ENTRY_SIZE (sizeof(SVGAOTableSurfaceEntry))
1342 #include "vmware_pack_begin.h"
1347 #include "vmware_pack_end.h"
1348 SVGAOTableContextEntry
;
1349 #define SVGA3D_OTABLE_CONTEXT_ENTRY_SIZE (sizeof(SVGAOTableContextEntry))
1352 #include "vmware_pack_begin.h"
1354 SVGA3dShaderType type
;
1356 uint32 offsetInBytes
;
1359 #include "vmware_pack_end.h"
1360 SVGAOTableShaderEntry
;
1361 #define SVGA3D_OTABLE_SHADER_ENTRY_SIZE (sizeof(SVGAOTableShaderEntry))
1363 #define SVGA_STFLAG_PRIMARY (1 << 0)
1364 typedef uint32 SVGAScreenTargetFlags
;
1367 #include "vmware_pack_begin.h"
1369 SVGA3dSurfaceImageId image
;
1374 SVGAScreenTargetFlags flags
;
1378 #include "vmware_pack_end.h"
1379 SVGAOTableScreenTargetEntry
;
1380 #define SVGA3D_OTABLE_SCREEN_TARGET_ENTRY_SIZE \
1381 (sizeof(SVGAOTableScreenTargetEntry))
1384 #include "vmware_pack_begin.h"
1388 #include "vmware_pack_end.h"
1389 SVGA3dShaderConstFloat
;
1392 #include "vmware_pack_begin.h"
1396 #include "vmware_pack_end.h"
1397 SVGA3dShaderConstInt
;
1400 #include "vmware_pack_begin.h"
1404 #include "vmware_pack_end.h"
1405 SVGA3dShaderConstBool
;
1408 #include "vmware_pack_begin.h"
1410 uint16 streamOffset
;
1416 #include "vmware_pack_end.h"
1417 SVGAGBVertexElement
;
1420 #include "vmware_pack_begin.h"
1426 #include "vmware_pack_end.h"
1429 #include "vmware_pack_begin.h"
1431 SVGA3dRect viewport
;
1432 SVGA3dRect scissorRect
;
1433 SVGA3dZRange zRange
;
1435 SVGA3dSurfaceImageId renderTargets
[SVGA3D_RT_MAX
];
1436 SVGAGBVertexElement decl1
[4];
1438 uint32 renderStates
[SVGA3D_RS_MAX
];
1439 SVGAGBVertexElement decl2
[18];
1444 SVGA3dMaterial material
;
1447 float clipPlanes
[SVGA3D_NUM_CLIPPLANES
][4];
1448 float matrices
[SVGA3D_TRANSFORM_MAX
][16];
1450 SVGA3dBool lightEnabled
[SVGA3D_NUM_LIGHTS
];
1451 SVGA3dLightData lightData
[SVGA3D_NUM_LIGHTS
];
1454 * Shaders currently bound
1456 uint32 shaders
[SVGA3D_NUM_SHADERTYPE_PREDX
];
1457 SVGAGBVertexElement decl3
[10];
1460 uint32 occQueryActive
;
1461 uint32 occQueryValue
;
1464 * Int/Bool Shader constants
1466 SVGA3dShaderConstInt pShaderIValues
[SVGA3D_CONSTINTREG_MAX
];
1467 SVGA3dShaderConstInt vShaderIValues
[SVGA3D_CONSTINTREG_MAX
];
1468 uint16 pShaderBValues
;
1469 uint16 vShaderBValues
;
1472 SVGAGBVertexStream streams
[SVGA3D_MAX_VERTEX_ARRAYS
];
1473 SVGA3dVertexDivisor divisors
[SVGA3D_MAX_VERTEX_ARRAYS
];
1474 uint32 numVertexDecls
;
1475 uint32 numVertexStreams
;
1476 uint32 numVertexDivisors
;
1482 * SVGA3D_TS_INVALID through SVGA3D_TS_CONSTANT are in the
1483 * textureStages array.
1484 * SVGA3D_TS_COLOR_KEY is in tsColorKey.
1486 uint32 tsColorKey
[SVGA3D_NUM_TEXTURE_UNITS
];
1487 uint32 textureStages
[SVGA3D_NUM_TEXTURE_UNITS
][SVGA3D_TS_CONSTANT
+ 1];
1488 uint32 tsColorKeyEnable
[SVGA3D_NUM_TEXTURE_UNITS
];
1491 * Float Shader constants.
1493 SVGA3dShaderConstFloat pShaderFValues
[SVGA3D_CONSTREG_MAX
];
1494 SVGA3dShaderConstFloat vShaderFValues
[SVGA3D_CONSTREG_MAX
];
1496 #include "vmware_pack_end.h"
1498 #define SVGA3D_CONTEXT_DATA_SIZE (sizeof(SVGAGBContextData))
1501 * SVGA3dCmdSetOTableBase --
1503 * This command allows the guest to specify the base PPN of the
1504 * specified object table.
1508 #include "vmware_pack_begin.h"
1510 SVGAOTableType type
;
1513 uint32 validSizeInBytes
;
1514 SVGAMobFormat ptDepth
;
1516 #include "vmware_pack_end.h"
1517 SVGA3dCmdSetOTableBase
; /* SVGA_3D_CMD_SET_OTABLE_BASE */
1520 #include "vmware_pack_begin.h"
1522 SVGAOTableType type
;
1525 uint32 validSizeInBytes
;
1526 SVGAMobFormat ptDepth
;
1528 #include "vmware_pack_end.h"
1529 SVGA3dCmdSetOTableBase64
; /* SVGA_3D_CMD_SET_OTABLE_BASE64 */
1532 #include "vmware_pack_begin.h"
1534 SVGAOTableType type
;
1536 #include "vmware_pack_end.h"
1537 SVGA3dCmdReadbackOTable
; /* SVGA_3D_CMD_READBACK_OTABLE */
1540 * Define a memory object (Mob) in the OTable.
1544 #include "vmware_pack_begin.h"
1545 struct SVGA3dCmdDefineGBMob
{
1547 SVGAMobFormat ptDepth
;
1551 #include "vmware_pack_end.h"
1552 SVGA3dCmdDefineGBMob
; /* SVGA_3D_CMD_DEFINE_GB_MOB */
1556 * Destroys an object in the OTable.
1560 #include "vmware_pack_begin.h"
1561 struct SVGA3dCmdDestroyGBMob
{
1564 #include "vmware_pack_end.h"
1565 SVGA3dCmdDestroyGBMob
; /* SVGA_3D_CMD_DESTROY_GB_MOB */
1569 * Define a memory object (Mob) in the OTable with a PPN64 base.
1573 #include "vmware_pack_begin.h"
1574 struct SVGA3dCmdDefineGBMob64
{
1576 SVGAMobFormat ptDepth
;
1580 #include "vmware_pack_end.h"
1581 SVGA3dCmdDefineGBMob64
; /* SVGA_3D_CMD_DEFINE_GB_MOB64 */
1584 * Redefine an object in the OTable with PPN64 base.
1588 #include "vmware_pack_begin.h"
1589 struct SVGA3dCmdRedefineGBMob64
{
1591 SVGAMobFormat ptDepth
;
1595 #include "vmware_pack_end.h"
1596 SVGA3dCmdRedefineGBMob64
; /* SVGA_3D_CMD_REDEFINE_GB_MOB64 */
1599 * Notification that the page tables have been modified.
1603 #include "vmware_pack_begin.h"
1604 struct SVGA3dCmdUpdateGBMobMapping
{
1607 #include "vmware_pack_end.h"
1608 SVGA3dCmdUpdateGBMobMapping
; /* SVGA_3D_CMD_UPDATE_GB_MOB_MAPPING */
1611 * Define a guest-backed surface.
1615 #include "vmware_pack_begin.h"
1616 struct SVGA3dCmdDefineGBSurface
{
1618 SVGA3dSurfaceFlags surfaceFlags
;
1619 SVGA3dSurfaceFormat format
;
1620 uint32 numMipLevels
;
1621 uint32 multisampleCount
;
1622 SVGA3dTextureFilter autogenFilter
;
1625 #include "vmware_pack_end.h"
1626 SVGA3dCmdDefineGBSurface
; /* SVGA_3D_CMD_DEFINE_GB_SURFACE */
1629 * Destroy a guest-backed surface.
1633 #include "vmware_pack_begin.h"
1634 struct SVGA3dCmdDestroyGBSurface
{
1637 #include "vmware_pack_end.h"
1638 SVGA3dCmdDestroyGBSurface
; /* SVGA_3D_CMD_DESTROY_GB_SURFACE */
1641 * Bind a guest-backed surface to a mob.
1645 #include "vmware_pack_begin.h"
1646 struct SVGA3dCmdBindGBSurface
{
1650 #include "vmware_pack_end.h"
1651 SVGA3dCmdBindGBSurface
; /* SVGA_3D_CMD_BIND_GB_SURFACE */
1654 #include "vmware_pack_begin.h"
1655 struct SVGA3dCmdBindGBSurfaceWithPitch
{
1658 uint32 baseLevelPitch
;
1660 #include "vmware_pack_end.h"
1661 SVGA3dCmdBindGBSurfaceWithPitch
; /* SVGA_3D_CMD_BIND_GB_SURFACE_WITH_PITCH */
1664 * Conditionally bind a mob to a guest-backed surface if testMobid
1665 * matches the currently bound mob. Optionally issue a
1666 * readback/update on the surface while it is still bound to the old
1667 * mobid if the mobid is changed by this command.
1670 #define SVGA3D_COND_BIND_GB_SURFACE_FLAG_READBACK (1 << 0)
1671 #define SVGA3D_COND_BIND_GB_SURFACE_FLAG_UPDATE (1 << 1)
1674 #include "vmware_pack_begin.h"
1677 SVGAMobId testMobid
;
1681 #include "vmware_pack_end.h"
1682 SVGA3dCmdCondBindGBSurface
; /* SVGA_3D_CMD_COND_BIND_GB_SURFACE */
1685 * Update an image in a guest-backed surface.
1686 * (Inform the device that the guest-contents have been updated.)
1690 #include "vmware_pack_begin.h"
1691 struct SVGA3dCmdUpdateGBImage
{
1692 SVGA3dSurfaceImageId image
;
1695 #include "vmware_pack_end.h"
1696 SVGA3dCmdUpdateGBImage
; /* SVGA_3D_CMD_UPDATE_GB_IMAGE */
1699 * Update an entire guest-backed surface.
1700 * (Inform the device that the guest-contents have been updated.)
1704 #include "vmware_pack_begin.h"
1705 struct SVGA3dCmdUpdateGBSurface
{
1708 #include "vmware_pack_end.h"
1709 SVGA3dCmdUpdateGBSurface
; /* SVGA_3D_CMD_UPDATE_GB_SURFACE */
1712 * Readback an image in a guest-backed surface.
1713 * (Request the device to flush the dirty contents into the guest.)
1717 #include "vmware_pack_begin.h"
1718 struct SVGA3dCmdReadbackGBImage
{
1719 SVGA3dSurfaceImageId image
;
1721 #include "vmware_pack_end.h"
1722 SVGA3dCmdReadbackGBImage
; /* SVGA_3D_CMD_READBACK_GB_IMAGE */
1725 * Readback an entire guest-backed surface.
1726 * (Request the device to flush the dirty contents into the guest.)
1730 #include "vmware_pack_begin.h"
1731 struct SVGA3dCmdReadbackGBSurface
{
1734 #include "vmware_pack_end.h"
1735 SVGA3dCmdReadbackGBSurface
; /* SVGA_3D_CMD_READBACK_GB_SURFACE */
1738 * Readback a sub rect of an image in a guest-backed surface. After
1739 * issuing this command the driver is required to issue an update call
1740 * of the same region before issuing any other commands that reference
1741 * this surface or rendering is not guaranteed.
1745 #include "vmware_pack_begin.h"
1746 struct SVGA3dCmdReadbackGBImagePartial
{
1747 SVGA3dSurfaceImageId image
;
1751 #include "vmware_pack_end.h"
1752 SVGA3dCmdReadbackGBImagePartial
; /* SVGA_3D_CMD_READBACK_GB_IMAGE_PARTIAL */
1756 * Invalidate an image in a guest-backed surface.
1757 * (Notify the device that the contents can be lost.)
1761 #include "vmware_pack_begin.h"
1762 struct SVGA3dCmdInvalidateGBImage
{
1763 SVGA3dSurfaceImageId image
;
1765 #include "vmware_pack_end.h"
1766 SVGA3dCmdInvalidateGBImage
; /* SVGA_3D_CMD_INVALIDATE_GB_IMAGE */
1769 * Invalidate an entire guest-backed surface.
1770 * (Notify the device that the contents if all images can be lost.)
1774 #include "vmware_pack_begin.h"
1775 struct SVGA3dCmdInvalidateGBSurface
{
1778 #include "vmware_pack_end.h"
1779 SVGA3dCmdInvalidateGBSurface
; /* SVGA_3D_CMD_INVALIDATE_GB_SURFACE */
1782 * Invalidate a sub rect of an image in a guest-backed surface. After
1783 * issuing this command the driver is required to issue an update call
1784 * of the same region before issuing any other commands that reference
1785 * this surface or rendering is not guaranteed.
1789 #include "vmware_pack_begin.h"
1790 struct SVGA3dCmdInvalidateGBImagePartial
{
1791 SVGA3dSurfaceImageId image
;
1795 #include "vmware_pack_end.h"
1796 SVGA3dCmdInvalidateGBImagePartial
; /* SVGA_3D_CMD_INVALIDATE_GB_IMAGE_PARTIAL */
1800 * Define a guest-backed context.
1804 #include "vmware_pack_begin.h"
1805 struct SVGA3dCmdDefineGBContext
{
1808 #include "vmware_pack_end.h"
1809 SVGA3dCmdDefineGBContext
; /* SVGA_3D_CMD_DEFINE_GB_CONTEXT */
1812 * Destroy a guest-backed context.
1816 #include "vmware_pack_begin.h"
1817 struct SVGA3dCmdDestroyGBContext
{
1820 #include "vmware_pack_end.h"
1821 SVGA3dCmdDestroyGBContext
; /* SVGA_3D_CMD_DESTROY_GB_CONTEXT */
1824 * Bind a guest-backed context.
1826 * validContents should be set to 0 for new contexts,
1827 * and 1 if this is an old context which is getting paged
1828 * back on to the device.
1830 * For new contexts, it is recommended that the driver
1831 * issue commands to initialize all interesting state
1832 * prior to rendering.
1836 #include "vmware_pack_begin.h"
1837 struct SVGA3dCmdBindGBContext
{
1840 uint32 validContents
;
1842 #include "vmware_pack_end.h"
1843 SVGA3dCmdBindGBContext
; /* SVGA_3D_CMD_BIND_GB_CONTEXT */
1846 * Readback a guest-backed context.
1847 * (Request that the device flush the contents back into guest memory.)
1851 #include "vmware_pack_begin.h"
1852 struct SVGA3dCmdReadbackGBContext
{
1855 #include "vmware_pack_end.h"
1856 SVGA3dCmdReadbackGBContext
; /* SVGA_3D_CMD_READBACK_GB_CONTEXT */
1859 * Invalidate a guest-backed context.
1862 #include "vmware_pack_begin.h"
1863 struct SVGA3dCmdInvalidateGBContext
{
1866 #include "vmware_pack_end.h"
1867 SVGA3dCmdInvalidateGBContext
; /* SVGA_3D_CMD_INVALIDATE_GB_CONTEXT */
1870 * Define a guest-backed shader.
1874 #include "vmware_pack_begin.h"
1875 struct SVGA3dCmdDefineGBShader
{
1877 SVGA3dShaderType type
;
1880 #include "vmware_pack_end.h"
1881 SVGA3dCmdDefineGBShader
; /* SVGA_3D_CMD_DEFINE_GB_SHADER */
1884 * Bind a guest-backed shader.
1888 #include "vmware_pack_begin.h"
1889 struct SVGA3dCmdBindGBShader
{
1892 uint32 offsetInBytes
;
1894 #include "vmware_pack_end.h"
1895 SVGA3dCmdBindGBShader
; /* SVGA_3D_CMD_BIND_GB_SHADER */
1898 * Destroy a guest-backed shader.
1902 #include "vmware_pack_begin.h"
1903 struct SVGA3dCmdDestroyGBShader
{
1906 #include "vmware_pack_end.h"
1907 SVGA3dCmdDestroyGBShader
; /* SVGA_3D_CMD_DESTROY_GB_SHADER */
1910 #include "vmware_pack_begin.h"
1914 SVGA3dShaderType shaderType
;
1915 SVGA3dShaderConstType constType
;
1918 * Followed by a variable number of shader constants.
1920 * Note that FLOAT and INT constants are 4-dwords in length, while
1921 * BOOL constants are 1-dword in length.
1924 #include "vmware_pack_end.h"
1925 SVGA3dCmdSetGBShaderConstInline
; /* SVGA_3D_CMD_SET_GB_SHADERCONSTS_INLINE */
1929 #include "vmware_pack_begin.h"
1932 SVGA3dQueryType type
;
1934 #include "vmware_pack_end.h"
1935 SVGA3dCmdBeginGBQuery
; /* SVGA_3D_CMD_BEGIN_GB_QUERY */
1938 #include "vmware_pack_begin.h"
1941 SVGA3dQueryType type
;
1945 #include "vmware_pack_end.h"
1946 SVGA3dCmdEndGBQuery
; /* SVGA_3D_CMD_END_GB_QUERY */
1950 * SVGA_3D_CMD_WAIT_FOR_GB_QUERY --
1952 * The semantics of this command are identical to the
1953 * SVGA_3D_CMD_WAIT_FOR_QUERY except that the results are written
1954 * to a Mob instead of a GMR.
1958 #include "vmware_pack_begin.h"
1961 SVGA3dQueryType type
;
1965 #include "vmware_pack_end.h"
1966 SVGA3dCmdWaitForGBQuery
; /* SVGA_3D_CMD_WAIT_FOR_GB_QUERY */
1970 #include "vmware_pack_begin.h"
1976 #include "vmware_pack_end.h"
1977 SVGA3dCmdEnableGart
; /* SVGA_3D_CMD_ENABLE_GART */
1980 #include "vmware_pack_begin.h"
1985 #include "vmware_pack_end.h"
1986 SVGA3dCmdMapMobIntoGart
; /* SVGA_3D_CMD_MAP_MOB_INTO_GART */
1990 #include "vmware_pack_begin.h"
1995 #include "vmware_pack_end.h"
1996 SVGA3dCmdUnmapGartRange
; /* SVGA_3D_CMD_UNMAP_GART_RANGE */
2004 #include "vmware_pack_begin.h"
2011 SVGAScreenTargetFlags flags
;
2014 * The physical DPI that the guest expects this screen displayed at.
2016 * Guests which are not DPI-aware should set this to zero.
2020 #include "vmware_pack_end.h"
2021 SVGA3dCmdDefineGBScreenTarget
; /* SVGA_3D_CMD_DEFINE_GB_SCREENTARGET */
2024 #include "vmware_pack_begin.h"
2028 #include "vmware_pack_end.h"
2029 SVGA3dCmdDestroyGBScreenTarget
; /* SVGA_3D_CMD_DESTROY_GB_SCREENTARGET */
2032 #include "vmware_pack_begin.h"
2035 SVGA3dSurfaceImageId image
;
2037 #include "vmware_pack_end.h"
2038 SVGA3dCmdBindGBScreenTarget
; /* SVGA_3D_CMD_BIND_GB_SCREENTARGET */
2041 #include "vmware_pack_begin.h"
2046 #include "vmware_pack_end.h"
2047 SVGA3dCmdUpdateGBScreenTarget
; /* SVGA_3D_CMD_UPDATE_GB_SCREENTARGET */
2050 #include "vmware_pack_begin.h"
2051 struct SVGA3dCmdGBScreenDMA
{
2054 SVGAMobId destMobID
;
2056 SVGAMobId changeMapMobID
;
2058 #include "vmware_pack_end.h"
2059 SVGA3dCmdGBScreenDMA
; /* SVGA_3D_CMD_GB_SCREEN_DMA */
2062 #include "vmware_pack_begin.h"
2068 #include "vmware_pack_end.h"
2069 SVGA3dCmdGBMobFence
; /* SVGA_3D_CMD_GB_MOB_FENCE*/
2071 #endif /* _SVGA3D_CMD_H_ */