svga3d_cmd.h 63 KB

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