svga3d_cmd.h 59 KB

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