svga3d_dx.h 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487
  1. /**********************************************************
  2. * Copyright 2012-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_dx.h --
  27. *
  28. * SVGA 3d hardware definitions for DX10 support.
  29. */
  30. #ifndef _SVGA3D_DX_H_
  31. #define _SVGA3D_DX_H_
  32. #define INCLUDE_ALLOW_MODULE
  33. #define INCLUDE_ALLOW_USERLEVEL
  34. #define INCLUDE_ALLOW_VMCORE
  35. #include "includeCheck.h"
  36. #include "svga3d_limits.h"
  37. #define SVGA3D_INPUT_MIN 0
  38. #define SVGA3D_INPUT_PER_VERTEX_DATA 0
  39. #define SVGA3D_INPUT_PER_INSTANCE_DATA 1
  40. #define SVGA3D_INPUT_MAX 2
  41. typedef uint32 SVGA3dInputClassification;
  42. #define SVGA3D_RESOURCE_TYPE_MIN 1
  43. #define SVGA3D_RESOURCE_BUFFER 1
  44. #define SVGA3D_RESOURCE_TEXTURE1D 2
  45. #define SVGA3D_RESOURCE_TEXTURE2D 3
  46. #define SVGA3D_RESOURCE_TEXTURE3D 4
  47. #define SVGA3D_RESOURCE_TEXTURECUBE 5
  48. #define SVGA3D_RESOURCE_TYPE_DX10_MAX 6
  49. #define SVGA3D_RESOURCE_BUFFEREX 6
  50. #define SVGA3D_RESOURCE_TYPE_MAX 7
  51. typedef uint32 SVGA3dResourceType;
  52. #define SVGA3D_DEPTH_WRITE_MASK_ZERO 0
  53. #define SVGA3D_DEPTH_WRITE_MASK_ALL 1
  54. typedef uint8 SVGA3dDepthWriteMask;
  55. #define SVGA3D_FILTER_MIP_LINEAR (1 << 0)
  56. #define SVGA3D_FILTER_MAG_LINEAR (1 << 2)
  57. #define SVGA3D_FILTER_MIN_LINEAR (1 << 4)
  58. #define SVGA3D_FILTER_ANISOTROPIC (1 << 6)
  59. #define SVGA3D_FILTER_COMPARE (1 << 7)
  60. typedef uint32 SVGA3dFilter;
  61. #define SVGA3D_CULL_INVALID 0
  62. #define SVGA3D_CULL_MIN 1
  63. #define SVGA3D_CULL_NONE 1
  64. #define SVGA3D_CULL_FRONT 2
  65. #define SVGA3D_CULL_BACK 3
  66. #define SVGA3D_CULL_MAX 4
  67. typedef uint8 SVGA3dCullMode;
  68. #define SVGA3D_COMPARISON_INVALID 0
  69. #define SVGA3D_COMPARISON_MIN 1
  70. #define SVGA3D_COMPARISON_NEVER 1
  71. #define SVGA3D_COMPARISON_LESS 2
  72. #define SVGA3D_COMPARISON_EQUAL 3
  73. #define SVGA3D_COMPARISON_LESS_EQUAL 4
  74. #define SVGA3D_COMPARISON_GREATER 5
  75. #define SVGA3D_COMPARISON_NOT_EQUAL 6
  76. #define SVGA3D_COMPARISON_GREATER_EQUAL 7
  77. #define SVGA3D_COMPARISON_ALWAYS 8
  78. #define SVGA3D_COMPARISON_MAX 9
  79. typedef uint8 SVGA3dComparisonFunc;
  80. #define SVGA3D_DX_MAX_VERTEXBUFFERS 32
  81. #define SVGA3D_DX_MAX_SOTARGETS 4
  82. #define SVGA3D_DX_MAX_SRVIEWS 128
  83. #define SVGA3D_DX_MAX_CONSTBUFFERS 16
  84. #define SVGA3D_DX_MAX_SAMPLERS 16
  85. /* Id limits */
  86. static const uint32 SVGA3dBlendObjectCountPerContext = 4096;
  87. static const uint32 SVGA3dDepthStencilObjectCountPerContext = 4096;
  88. typedef uint32 SVGA3dSurfaceId;
  89. typedef uint32 SVGA3dShaderResourceViewId;
  90. typedef uint32 SVGA3dRenderTargetViewId;
  91. typedef uint32 SVGA3dDepthStencilViewId;
  92. typedef uint32 SVGA3dShaderId;
  93. typedef uint32 SVGA3dElementLayoutId;
  94. typedef uint32 SVGA3dSamplerId;
  95. typedef uint32 SVGA3dBlendStateId;
  96. typedef uint32 SVGA3dDepthStencilStateId;
  97. typedef uint32 SVGA3dRasterizerStateId;
  98. typedef uint32 SVGA3dQueryId;
  99. typedef uint32 SVGA3dStreamOutputId;
  100. typedef union {
  101. struct {
  102. float r;
  103. float g;
  104. float b;
  105. float a;
  106. };
  107. float value[4];
  108. } SVGA3dRGBAFloat;
  109. typedef
  110. #include "vmware_pack_begin.h"
  111. struct {
  112. uint32 cid;
  113. SVGAMobId mobid;
  114. }
  115. #include "vmware_pack_end.h"
  116. SVGAOTableDXContextEntry;
  117. typedef
  118. #include "vmware_pack_begin.h"
  119. struct SVGA3dCmdDXDefineContext {
  120. uint32 cid;
  121. }
  122. #include "vmware_pack_end.h"
  123. SVGA3dCmdDXDefineContext; /* SVGA_3D_CMD_DX_DEFINE_CONTEXT */
  124. typedef
  125. #include "vmware_pack_begin.h"
  126. struct SVGA3dCmdDXDestroyContext {
  127. uint32 cid;
  128. }
  129. #include "vmware_pack_end.h"
  130. SVGA3dCmdDXDestroyContext; /* SVGA_3D_CMD_DX_DESTROY_CONTEXT */
  131. /*
  132. * Bind a DX context.
  133. *
  134. * validContents should be set to 0 for new contexts,
  135. * and 1 if this is an old context which is getting paged
  136. * back on to the device.
  137. *
  138. * For new contexts, it is recommended that the driver
  139. * issue commands to initialize all interesting state
  140. * prior to rendering.
  141. */
  142. typedef
  143. #include "vmware_pack_begin.h"
  144. struct SVGA3dCmdDXBindContext {
  145. uint32 cid;
  146. SVGAMobId mobid;
  147. uint32 validContents;
  148. }
  149. #include "vmware_pack_end.h"
  150. SVGA3dCmdDXBindContext; /* SVGA_3D_CMD_DX_BIND_CONTEXT */
  151. /*
  152. * Readback a DX context.
  153. * (Request that the device flush the contents back into guest memory.)
  154. */
  155. typedef
  156. #include "vmware_pack_begin.h"
  157. struct SVGA3dCmdDXReadbackContext {
  158. uint32 cid;
  159. }
  160. #include "vmware_pack_end.h"
  161. SVGA3dCmdDXReadbackContext; /* SVGA_3D_CMD_DX_READBACK_CONTEXT */
  162. /*
  163. * Invalidate a guest-backed context.
  164. */
  165. typedef
  166. #include "vmware_pack_begin.h"
  167. struct SVGA3dCmdDXInvalidateContext {
  168. uint32 cid;
  169. }
  170. #include "vmware_pack_end.h"
  171. SVGA3dCmdDXInvalidateContext; /* SVGA_3D_CMD_DX_INVALIDATE_CONTEXT */
  172. typedef
  173. #include "vmware_pack_begin.h"
  174. struct SVGA3dReplyFormatData {
  175. uint32 formatSupport;
  176. uint32 msaa2xQualityLevels:5;
  177. uint32 msaa4xQualityLevels:5;
  178. uint32 msaa8xQualityLevels:5;
  179. uint32 msaa16xQualityLevels:5;
  180. uint32 msaa32xQualityLevels:5;
  181. uint32 pad:7;
  182. }
  183. #include "vmware_pack_end.h"
  184. SVGA3dReplyFormatData;
  185. typedef
  186. #include "vmware_pack_begin.h"
  187. struct SVGA3dCmdDXSetSingleConstantBuffer {
  188. uint32 slot;
  189. SVGA3dShaderType type;
  190. SVGA3dSurfaceId sid;
  191. uint32 offsetInBytes;
  192. uint32 sizeInBytes;
  193. }
  194. #include "vmware_pack_end.h"
  195. SVGA3dCmdDXSetSingleConstantBuffer;
  196. /* SVGA_3D_CMD_DX_SET_SINGLE_CONSTANT_BUFFER */
  197. typedef
  198. #include "vmware_pack_begin.h"
  199. struct SVGA3dCmdDXSetShaderResources {
  200. uint32 startView;
  201. SVGA3dShaderType type;
  202. /*
  203. * Followed by a variable number of SVGA3dShaderResourceViewId's.
  204. */
  205. }
  206. #include "vmware_pack_end.h"
  207. SVGA3dCmdDXSetShaderResources; /* SVGA_3D_CMD_DX_SET_SHADER_RESOURCES */
  208. typedef
  209. #include "vmware_pack_begin.h"
  210. struct SVGA3dCmdDXSetShader {
  211. SVGA3dShaderId shaderId;
  212. SVGA3dShaderType type;
  213. }
  214. #include "vmware_pack_end.h"
  215. SVGA3dCmdDXSetShader; /* SVGA_3D_CMD_DX_SET_SHADER */
  216. typedef
  217. #include "vmware_pack_begin.h"
  218. struct SVGA3dCmdDXSetSamplers {
  219. uint32 startSampler;
  220. SVGA3dShaderType type;
  221. /*
  222. * Followed by a variable number of SVGA3dSamplerId's.
  223. */
  224. }
  225. #include "vmware_pack_end.h"
  226. SVGA3dCmdDXSetSamplers; /* SVGA_3D_CMD_DX_SET_SAMPLERS */
  227. typedef
  228. #include "vmware_pack_begin.h"
  229. struct SVGA3dCmdDXDraw {
  230. uint32 vertexCount;
  231. uint32 startVertexLocation;
  232. }
  233. #include "vmware_pack_end.h"
  234. SVGA3dCmdDXDraw; /* SVGA_3D_CMD_DX_DRAW */
  235. typedef
  236. #include "vmware_pack_begin.h"
  237. struct SVGA3dCmdDXDrawIndexed {
  238. uint32 indexCount;
  239. uint32 startIndexLocation;
  240. int32 baseVertexLocation;
  241. }
  242. #include "vmware_pack_end.h"
  243. SVGA3dCmdDXDrawIndexed; /* SVGA_3D_CMD_DX_DRAW_INDEXED */
  244. typedef
  245. #include "vmware_pack_begin.h"
  246. struct SVGA3dCmdDXDrawInstanced {
  247. uint32 vertexCountPerInstance;
  248. uint32 instanceCount;
  249. uint32 startVertexLocation;
  250. uint32 startInstanceLocation;
  251. }
  252. #include "vmware_pack_end.h"
  253. SVGA3dCmdDXDrawInstanced; /* SVGA_3D_CMD_DX_DRAW_INSTANCED */
  254. typedef
  255. #include "vmware_pack_begin.h"
  256. struct SVGA3dCmdDXDrawIndexedInstanced {
  257. uint32 indexCountPerInstance;
  258. uint32 instanceCount;
  259. uint32 startIndexLocation;
  260. int32 baseVertexLocation;
  261. uint32 startInstanceLocation;
  262. }
  263. #include "vmware_pack_end.h"
  264. SVGA3dCmdDXDrawIndexedInstanced; /* SVGA_3D_CMD_DX_DRAW_INDEXED_INSTANCED */
  265. typedef
  266. #include "vmware_pack_begin.h"
  267. struct SVGA3dCmdDXDrawAuto {
  268. uint32 pad0;
  269. }
  270. #include "vmware_pack_end.h"
  271. SVGA3dCmdDXDrawAuto; /* SVGA_3D_CMD_DX_DRAW_AUTO */
  272. typedef
  273. #include "vmware_pack_begin.h"
  274. struct SVGA3dCmdDXSetInputLayout {
  275. SVGA3dElementLayoutId elementLayoutId;
  276. }
  277. #include "vmware_pack_end.h"
  278. SVGA3dCmdDXSetInputLayout; /* SVGA_3D_CMD_DX_SET_INPUT_LAYOUT */
  279. typedef
  280. #include "vmware_pack_begin.h"
  281. struct SVGA3dVertexBuffer {
  282. SVGA3dSurfaceId sid;
  283. uint32 stride;
  284. uint32 offset;
  285. }
  286. #include "vmware_pack_end.h"
  287. SVGA3dVertexBuffer;
  288. typedef
  289. #include "vmware_pack_begin.h"
  290. struct SVGA3dCmdDXSetVertexBuffers {
  291. uint32 startBuffer;
  292. /* Followed by a variable number of SVGA3dVertexBuffer's. */
  293. }
  294. #include "vmware_pack_end.h"
  295. SVGA3dCmdDXSetVertexBuffers; /* SVGA_3D_CMD_DX_SET_VERTEX_BUFFERS */
  296. typedef
  297. #include "vmware_pack_begin.h"
  298. struct SVGA3dCmdDXSetIndexBuffer {
  299. SVGA3dSurfaceId sid;
  300. SVGA3dSurfaceFormat format;
  301. uint32 offset;
  302. }
  303. #include "vmware_pack_end.h"
  304. SVGA3dCmdDXSetIndexBuffer; /* SVGA_3D_CMD_DX_SET_INDEX_BUFFER */
  305. typedef
  306. #include "vmware_pack_begin.h"
  307. struct SVGA3dCmdDXSetTopology {
  308. SVGA3dPrimitiveType topology;
  309. }
  310. #include "vmware_pack_end.h"
  311. SVGA3dCmdDXSetTopology; /* SVGA_3D_CMD_DX_SET_TOPOLOGY */
  312. typedef
  313. #include "vmware_pack_begin.h"
  314. struct SVGA3dCmdDXSetRenderTargets {
  315. SVGA3dDepthStencilViewId depthStencilViewId;
  316. /* Followed by a variable number of SVGA3dRenderTargetViewId's. */
  317. }
  318. #include "vmware_pack_end.h"
  319. SVGA3dCmdDXSetRenderTargets; /* SVGA_3D_CMD_DX_SET_RENDERTARGETS */
  320. typedef
  321. #include "vmware_pack_begin.h"
  322. struct SVGA3dCmdDXSetBlendState {
  323. SVGA3dBlendStateId blendId;
  324. float blendFactor[4];
  325. uint32 sampleMask;
  326. }
  327. #include "vmware_pack_end.h"
  328. SVGA3dCmdDXSetBlendState; /* SVGA_3D_CMD_DX_SET_BLEND_STATE */
  329. typedef
  330. #include "vmware_pack_begin.h"
  331. struct SVGA3dCmdDXSetDepthStencilState {
  332. SVGA3dDepthStencilStateId depthStencilId;
  333. uint32 stencilRef;
  334. }
  335. #include "vmware_pack_end.h"
  336. SVGA3dCmdDXSetDepthStencilState; /* SVGA_3D_CMD_DX_SET_DEPTHSTENCIL_STATE */
  337. typedef
  338. #include "vmware_pack_begin.h"
  339. struct SVGA3dCmdDXSetRasterizerState {
  340. SVGA3dRasterizerStateId rasterizerId;
  341. }
  342. #include "vmware_pack_end.h"
  343. SVGA3dCmdDXSetRasterizerState; /* SVGA_3D_CMD_DX_SET_RASTERIZER_STATE */
  344. #define SVGA3D_DXQUERY_FLAG_PREDICATEHINT (1 << 0)
  345. typedef uint32 SVGA3dDXQueryFlags;
  346. /*
  347. * The SVGADXQueryDeviceState and SVGADXQueryDeviceBits are used by the device
  348. * to track query state transitions, but are not intended to be used by the
  349. * driver.
  350. */
  351. #define SVGADX_QDSTATE_INVALID ((uint8)-1) /* Query has no state */
  352. #define SVGADX_QDSTATE_MIN 0
  353. #define SVGADX_QDSTATE_IDLE 0 /* Query hasn't started yet */
  354. #define SVGADX_QDSTATE_ACTIVE 1 /* Query is actively gathering data */
  355. #define SVGADX_QDSTATE_PENDING 2 /* Query is waiting for results */
  356. #define SVGADX_QDSTATE_FINISHED 3 /* Query has completed */
  357. #define SVGADX_QDSTATE_MAX 4
  358. typedef uint8 SVGADXQueryDeviceState;
  359. typedef
  360. #include "vmware_pack_begin.h"
  361. struct {
  362. SVGA3dQueryTypeUint8 type;
  363. uint16 pad0;
  364. SVGADXQueryDeviceState state;
  365. SVGA3dDXQueryFlags flags;
  366. SVGAMobId mobid;
  367. uint32 offset;
  368. }
  369. #include "vmware_pack_end.h"
  370. SVGACOTableDXQueryEntry;
  371. typedef
  372. #include "vmware_pack_begin.h"
  373. struct SVGA3dCmdDXDefineQuery {
  374. SVGA3dQueryId queryId;
  375. SVGA3dQueryType type;
  376. SVGA3dDXQueryFlags flags;
  377. }
  378. #include "vmware_pack_end.h"
  379. SVGA3dCmdDXDefineQuery; /* SVGA_3D_CMD_DX_DEFINE_QUERY */
  380. typedef
  381. #include "vmware_pack_begin.h"
  382. struct SVGA3dCmdDXDestroyQuery {
  383. SVGA3dQueryId queryId;
  384. }
  385. #include "vmware_pack_end.h"
  386. SVGA3dCmdDXDestroyQuery; /* SVGA_3D_CMD_DX_DESTROY_QUERY */
  387. typedef
  388. #include "vmware_pack_begin.h"
  389. struct SVGA3dCmdDXBindQuery {
  390. SVGA3dQueryId queryId;
  391. SVGAMobId mobid;
  392. }
  393. #include "vmware_pack_end.h"
  394. SVGA3dCmdDXBindQuery; /* SVGA_3D_CMD_DX_BIND_QUERY */
  395. typedef
  396. #include "vmware_pack_begin.h"
  397. struct SVGA3dCmdDXSetQueryOffset {
  398. SVGA3dQueryId queryId;
  399. uint32 mobOffset;
  400. }
  401. #include "vmware_pack_end.h"
  402. SVGA3dCmdDXSetQueryOffset; /* SVGA_3D_CMD_DX_SET_QUERY_OFFSET */
  403. typedef
  404. #include "vmware_pack_begin.h"
  405. struct SVGA3dCmdDXBeginQuery {
  406. SVGA3dQueryId queryId;
  407. }
  408. #include "vmware_pack_end.h"
  409. SVGA3dCmdDXBeginQuery; /* SVGA_3D_CMD_DX_QUERY_BEGIN */
  410. typedef
  411. #include "vmware_pack_begin.h"
  412. struct SVGA3dCmdDXEndQuery {
  413. SVGA3dQueryId queryId;
  414. }
  415. #include "vmware_pack_end.h"
  416. SVGA3dCmdDXEndQuery; /* SVGA_3D_CMD_DX_QUERY_END */
  417. typedef
  418. #include "vmware_pack_begin.h"
  419. struct SVGA3dCmdDXReadbackQuery {
  420. SVGA3dQueryId queryId;
  421. }
  422. #include "vmware_pack_end.h"
  423. SVGA3dCmdDXReadbackQuery; /* SVGA_3D_CMD_DX_READBACK_QUERY */
  424. typedef
  425. #include "vmware_pack_begin.h"
  426. struct SVGA3dCmdDXMoveQuery {
  427. SVGA3dQueryId queryId;
  428. SVGAMobId mobid;
  429. uint32 mobOffset;
  430. }
  431. #include "vmware_pack_end.h"
  432. SVGA3dCmdDXMoveQuery; /* SVGA_3D_CMD_DX_MOVE_QUERY */
  433. typedef
  434. #include "vmware_pack_begin.h"
  435. struct SVGA3dCmdDXBindAllQuery {
  436. uint32 cid;
  437. SVGAMobId mobid;
  438. }
  439. #include "vmware_pack_end.h"
  440. SVGA3dCmdDXBindAllQuery; /* SVGA_3D_CMD_DX_BIND_ALL_QUERY */
  441. typedef
  442. #include "vmware_pack_begin.h"
  443. struct SVGA3dCmdDXReadbackAllQuery {
  444. uint32 cid;
  445. }
  446. #include "vmware_pack_end.h"
  447. SVGA3dCmdDXReadbackAllQuery; /* SVGA_3D_CMD_DX_READBACK_ALL_QUERY */
  448. typedef
  449. #include "vmware_pack_begin.h"
  450. struct SVGA3dCmdDXSetPredication {
  451. SVGA3dQueryId queryId;
  452. uint32 predicateValue;
  453. }
  454. #include "vmware_pack_end.h"
  455. SVGA3dCmdDXSetPredication; /* SVGA_3D_CMD_DX_SET_PREDICATION */
  456. typedef
  457. #include "vmware_pack_begin.h"
  458. struct MKS3dDXSOState {
  459. uint32 offset; /* Starting offset */
  460. uint32 intOffset; /* Internal offset */
  461. uint32 vertexCount; /* vertices written */
  462. uint32 sizeInBytes; /* max bytes to write */
  463. }
  464. #include "vmware_pack_end.h"
  465. SVGA3dDXSOState;
  466. /* Set the offset field to this value to append SO values to the buffer */
  467. #define SVGA3D_DX_SO_OFFSET_APPEND ((uint32) ~0u)
  468. typedef
  469. #include "vmware_pack_begin.h"
  470. struct SVGA3dSoTarget {
  471. SVGA3dSurfaceId sid;
  472. uint32 offset;
  473. uint32 sizeInBytes;
  474. }
  475. #include "vmware_pack_end.h"
  476. SVGA3dSoTarget;
  477. typedef
  478. #include "vmware_pack_begin.h"
  479. struct SVGA3dCmdDXSetSOTargets {
  480. uint32 pad0;
  481. /* Followed by a variable number of SVGA3dSOTarget's. */
  482. }
  483. #include "vmware_pack_end.h"
  484. SVGA3dCmdDXSetSOTargets; /* SVGA_3D_CMD_DX_SET_SOTARGETS */
  485. typedef
  486. #include "vmware_pack_begin.h"
  487. struct SVGA3dViewport
  488. {
  489. float x;
  490. float y;
  491. float width;
  492. float height;
  493. float minDepth;
  494. float maxDepth;
  495. }
  496. #include "vmware_pack_end.h"
  497. SVGA3dViewport;
  498. typedef
  499. #include "vmware_pack_begin.h"
  500. struct SVGA3dCmdDXSetViewports {
  501. uint32 pad0;
  502. /* Followed by a variable number of SVGA3dViewport's. */
  503. }
  504. #include "vmware_pack_end.h"
  505. SVGA3dCmdDXSetViewports; /* SVGA_3D_CMD_DX_SET_VIEWPORTS */
  506. #define SVGA3D_DX_MAX_VIEWPORTS 16
  507. typedef
  508. #include "vmware_pack_begin.h"
  509. struct SVGA3dCmdDXSetScissorRects {
  510. uint32 pad0;
  511. /* Followed by a variable number of SVGASignedRect's. */
  512. }
  513. #include "vmware_pack_end.h"
  514. SVGA3dCmdDXSetScissorRects; /* SVGA_3D_CMD_DX_SET_SCISSORRECTS */
  515. #define SVGA3D_DX_MAX_SCISSORRECTS 16
  516. typedef
  517. #include "vmware_pack_begin.h"
  518. struct SVGA3dCmdDXClearRenderTargetView {
  519. SVGA3dRenderTargetViewId renderTargetViewId;
  520. SVGA3dRGBAFloat rgba;
  521. }
  522. #include "vmware_pack_end.h"
  523. SVGA3dCmdDXClearRenderTargetView; /* SVGA_3D_CMD_DX_CLEAR_RENDERTARGET_VIEW */
  524. typedef
  525. #include "vmware_pack_begin.h"
  526. struct SVGA3dCmdDXClearDepthStencilView {
  527. uint16 flags;
  528. uint16 stencil;
  529. SVGA3dDepthStencilViewId depthStencilViewId;
  530. float depth;
  531. }
  532. #include "vmware_pack_end.h"
  533. SVGA3dCmdDXClearDepthStencilView; /* SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW */
  534. typedef
  535. #include "vmware_pack_begin.h"
  536. struct SVGA3dCmdDXPredCopyRegion {
  537. SVGA3dSurfaceId dstSid;
  538. uint32 dstSubResource;
  539. SVGA3dSurfaceId srcSid;
  540. uint32 srcSubResource;
  541. SVGA3dCopyBox box;
  542. }
  543. #include "vmware_pack_end.h"
  544. SVGA3dCmdDXPredCopyRegion;
  545. /* SVGA_3D_CMD_DX_PRED_COPY_REGION */
  546. typedef
  547. #include "vmware_pack_begin.h"
  548. struct SVGA3dCmdDXPredCopy {
  549. SVGA3dSurfaceId dstSid;
  550. SVGA3dSurfaceId srcSid;
  551. }
  552. #include "vmware_pack_end.h"
  553. SVGA3dCmdDXPredCopy; /* SVGA_3D_CMD_DX_PRED_COPY */
  554. typedef
  555. #include "vmware_pack_begin.h"
  556. struct SVGA3dCmdDXBufferCopy {
  557. SVGA3dSurfaceId dest;
  558. SVGA3dSurfaceId src;
  559. uint32 destX;
  560. uint32 srcX;
  561. uint32 width;
  562. }
  563. #include "vmware_pack_end.h"
  564. SVGA3dCmdDXBufferCopy;
  565. /* SVGA_3D_CMD_DX_BUFFER_COPY */
  566. typedef uint32 SVGA3dDXStretchBltMode;
  567. #define SVGADX_STRETCHBLT_LINEAR (1 << 0)
  568. #define SVGADX_STRETCHBLT_FORCE_SRC_SRGB (1 << 1)
  569. typedef
  570. #include "vmware_pack_begin.h"
  571. struct SVGA3dCmdDXStretchBlt {
  572. SVGA3dSurfaceId srcSid;
  573. uint32 srcSubResource;
  574. SVGA3dSurfaceId dstSid;
  575. uint32 destSubResource;
  576. SVGA3dBox boxSrc;
  577. SVGA3dBox boxDest;
  578. SVGA3dDXStretchBltMode mode;
  579. }
  580. #include "vmware_pack_end.h"
  581. SVGA3dCmdDXStretchBlt; /* SVGA_3D_CMD_DX_STRETCHBLT */
  582. typedef
  583. #include "vmware_pack_begin.h"
  584. struct SVGA3dCmdDXGenMips {
  585. SVGA3dShaderResourceViewId shaderResourceViewId;
  586. }
  587. #include "vmware_pack_end.h"
  588. SVGA3dCmdDXGenMips; /* SVGA_3D_CMD_DX_GENMIPS */
  589. /*
  590. * Defines a resource/DX surface. Resources share the surfaceId namespace.
  591. *
  592. */
  593. typedef
  594. #include "vmware_pack_begin.h"
  595. struct SVGA3dCmdDefineGBSurface_v2 {
  596. uint32 sid;
  597. SVGA3dSurfaceFlags surfaceFlags;
  598. SVGA3dSurfaceFormat format;
  599. uint32 numMipLevels;
  600. uint32 multisampleCount;
  601. SVGA3dTextureFilter autogenFilter;
  602. SVGA3dSize size;
  603. uint32 arraySize;
  604. uint32 pad;
  605. }
  606. #include "vmware_pack_end.h"
  607. SVGA3dCmdDefineGBSurface_v2; /* SVGA_3D_CMD_DEFINE_GB_SURFACE_V2 */
  608. /*
  609. * Update a sub-resource in a guest-backed resource.
  610. * (Inform the device that the guest-contents have been updated.)
  611. */
  612. typedef
  613. #include "vmware_pack_begin.h"
  614. struct SVGA3dCmdDXUpdateSubResource {
  615. SVGA3dSurfaceId sid;
  616. uint32 subResource;
  617. SVGA3dBox box;
  618. }
  619. #include "vmware_pack_end.h"
  620. SVGA3dCmdDXUpdateSubResource; /* SVGA_3D_CMD_DX_UPDATE_SUBRESOURCE */
  621. /*
  622. * Readback a subresource in a guest-backed resource.
  623. * (Request the device to flush the dirty contents into the guest.)
  624. */
  625. typedef
  626. #include "vmware_pack_begin.h"
  627. struct SVGA3dCmdDXReadbackSubResource {
  628. SVGA3dSurfaceId sid;
  629. uint32 subResource;
  630. }
  631. #include "vmware_pack_end.h"
  632. SVGA3dCmdDXReadbackSubResource; /* SVGA_3D_CMD_DX_READBACK_SUBRESOURCE */
  633. /*
  634. * Invalidate an image in a guest-backed surface.
  635. * (Notify the device that the contents can be lost.)
  636. */
  637. typedef
  638. #include "vmware_pack_begin.h"
  639. struct SVGA3dCmdDXInvalidateSubResource {
  640. SVGA3dSurfaceId sid;
  641. uint32 subResource;
  642. }
  643. #include "vmware_pack_end.h"
  644. SVGA3dCmdDXInvalidateSubResource; /* SVGA_3D_CMD_DX_INVALIDATE_SUBRESOURCE */
  645. /*
  646. * Raw byte wise transfer from a buffer surface into another surface
  647. * of the requested box.
  648. */
  649. typedef
  650. #include "vmware_pack_begin.h"
  651. struct SVGA3dCmdDXTransferFromBuffer {
  652. SVGA3dSurfaceId srcSid;
  653. uint32 srcOffset;
  654. uint32 srcPitch;
  655. uint32 srcSlicePitch;
  656. SVGA3dSurfaceId destSid;
  657. uint32 destSubResource;
  658. SVGA3dBox destBox;
  659. }
  660. #include "vmware_pack_end.h"
  661. SVGA3dCmdDXTransferFromBuffer; /* SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER */
  662. /*
  663. * Raw byte wise transfer from a buffer surface into another surface
  664. * of the requested box. Supported if SVGA3D_DEVCAP_DXCONTEXT is set.
  665. * The context is implied from the command buffer header.
  666. */
  667. typedef
  668. #include "vmware_pack_begin.h"
  669. struct SVGA3dCmdDXPredTransferFromBuffer {
  670. SVGA3dSurfaceId srcSid;
  671. uint32 srcOffset;
  672. uint32 srcPitch;
  673. uint32 srcSlicePitch;
  674. SVGA3dSurfaceId destSid;
  675. uint32 destSubResource;
  676. SVGA3dBox destBox;
  677. }
  678. #include "vmware_pack_end.h"
  679. SVGA3dCmdDXPredTransferFromBuffer;
  680. /* SVGA_3D_CMD_DX_PRED_TRANSFER_FROM_BUFFER */
  681. typedef
  682. #include "vmware_pack_begin.h"
  683. struct SVGA3dCmdDXSurfaceCopyAndReadback {
  684. SVGA3dSurfaceId srcSid;
  685. SVGA3dSurfaceId destSid;
  686. SVGA3dCopyBox box;
  687. }
  688. #include "vmware_pack_end.h"
  689. SVGA3dCmdDXSurfaceCopyAndReadback;
  690. /* SVGA_3D_CMD_DX_SURFACE_COPY_AND_READBACK */
  691. typedef
  692. #include "vmware_pack_begin.h"
  693. struct {
  694. union {
  695. struct {
  696. uint32 firstElement;
  697. uint32 numElements;
  698. uint32 pad0;
  699. uint32 pad1;
  700. } buffer;
  701. struct {
  702. uint32 mostDetailedMip;
  703. uint32 firstArraySlice;
  704. uint32 mipLevels;
  705. uint32 arraySize;
  706. } tex;
  707. struct {
  708. uint32 firstElement;
  709. uint32 numElements;
  710. uint32 flags;
  711. uint32 pad0;
  712. } bufferex;
  713. };
  714. }
  715. #include "vmware_pack_end.h"
  716. SVGA3dShaderResourceViewDesc;
  717. typedef
  718. #include "vmware_pack_begin.h"
  719. struct {
  720. SVGA3dSurfaceId sid;
  721. SVGA3dSurfaceFormat format;
  722. SVGA3dResourceType resourceDimension;
  723. SVGA3dShaderResourceViewDesc desc;
  724. uint32 pad;
  725. }
  726. #include "vmware_pack_end.h"
  727. SVGACOTableDXSRViewEntry;
  728. typedef
  729. #include "vmware_pack_begin.h"
  730. struct SVGA3dCmdDXDefineShaderResourceView {
  731. SVGA3dShaderResourceViewId shaderResourceViewId;
  732. SVGA3dSurfaceId sid;
  733. SVGA3dSurfaceFormat format;
  734. SVGA3dResourceType resourceDimension;
  735. SVGA3dShaderResourceViewDesc desc;
  736. }
  737. #include "vmware_pack_end.h"
  738. SVGA3dCmdDXDefineShaderResourceView;
  739. /* SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW */
  740. typedef
  741. #include "vmware_pack_begin.h"
  742. struct SVGA3dCmdDXDestroyShaderResourceView {
  743. SVGA3dShaderResourceViewId shaderResourceViewId;
  744. }
  745. #include "vmware_pack_end.h"
  746. SVGA3dCmdDXDestroyShaderResourceView;
  747. /* SVGA_3D_CMD_DX_DESTROY_SHADERRESOURCE_VIEW */
  748. typedef
  749. #include "vmware_pack_begin.h"
  750. struct SVGA3dRenderTargetViewDesc {
  751. union {
  752. struct {
  753. uint32 firstElement;
  754. uint32 numElements;
  755. } buffer;
  756. struct {
  757. uint32 mipSlice;
  758. uint32 firstArraySlice;
  759. uint32 arraySize;
  760. } tex; /* 1d, 2d, cube */
  761. struct {
  762. uint32 mipSlice;
  763. uint32 firstW;
  764. uint32 wSize;
  765. } tex3D;
  766. };
  767. }
  768. #include "vmware_pack_end.h"
  769. SVGA3dRenderTargetViewDesc;
  770. typedef
  771. #include "vmware_pack_begin.h"
  772. struct {
  773. SVGA3dSurfaceId sid;
  774. SVGA3dSurfaceFormat format;
  775. SVGA3dResourceType resourceDimension;
  776. SVGA3dRenderTargetViewDesc desc;
  777. uint32 pad[2];
  778. }
  779. #include "vmware_pack_end.h"
  780. SVGACOTableDXRTViewEntry;
  781. typedef
  782. #include "vmware_pack_begin.h"
  783. struct SVGA3dCmdDXDefineRenderTargetView {
  784. SVGA3dRenderTargetViewId renderTargetViewId;
  785. SVGA3dSurfaceId sid;
  786. SVGA3dSurfaceFormat format;
  787. SVGA3dResourceType resourceDimension;
  788. SVGA3dRenderTargetViewDesc desc;
  789. }
  790. #include "vmware_pack_end.h"
  791. SVGA3dCmdDXDefineRenderTargetView;
  792. /* SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW */
  793. typedef
  794. #include "vmware_pack_begin.h"
  795. struct SVGA3dCmdDXDestroyRenderTargetView {
  796. SVGA3dRenderTargetViewId renderTargetViewId;
  797. }
  798. #include "vmware_pack_end.h"
  799. SVGA3dCmdDXDestroyRenderTargetView;
  800. /* SVGA_3D_CMD_DX_DESTROY_RENDERTARGET_VIEW */
  801. /*
  802. */
  803. #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_DEPTH 0x01
  804. #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_STENCIL 0x02
  805. #define SVGA3D_DXDSVIEW_CREATE_FLAG_MASK 0x03
  806. typedef uint8 SVGA3DCreateDSViewFlags;
  807. typedef
  808. #include "vmware_pack_begin.h"
  809. struct {
  810. SVGA3dSurfaceId sid;
  811. SVGA3dSurfaceFormat format;
  812. SVGA3dResourceType resourceDimension;
  813. uint32 mipSlice;
  814. uint32 firstArraySlice;
  815. uint32 arraySize;
  816. SVGA3DCreateDSViewFlags flags;
  817. uint8 pad0;
  818. uint16 pad1;
  819. uint32 pad2;
  820. }
  821. #include "vmware_pack_end.h"
  822. SVGACOTableDXDSViewEntry;
  823. typedef
  824. #include "vmware_pack_begin.h"
  825. struct SVGA3dCmdDXDefineDepthStencilView {
  826. SVGA3dDepthStencilViewId depthStencilViewId;
  827. SVGA3dSurfaceId sid;
  828. SVGA3dSurfaceFormat format;
  829. SVGA3dResourceType resourceDimension;
  830. uint32 mipSlice;
  831. uint32 firstArraySlice;
  832. uint32 arraySize;
  833. SVGA3DCreateDSViewFlags flags;
  834. uint8 pad0;
  835. uint16 pad1;
  836. }
  837. #include "vmware_pack_end.h"
  838. SVGA3dCmdDXDefineDepthStencilView;
  839. /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW */
  840. typedef
  841. #include "vmware_pack_begin.h"
  842. struct SVGA3dCmdDXDestroyDepthStencilView {
  843. SVGA3dDepthStencilViewId depthStencilViewId;
  844. }
  845. #include "vmware_pack_end.h"
  846. SVGA3dCmdDXDestroyDepthStencilView;
  847. /* SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW */
  848. typedef
  849. #include "vmware_pack_begin.h"
  850. struct SVGA3dInputElementDesc {
  851. uint32 inputSlot;
  852. uint32 alignedByteOffset;
  853. SVGA3dSurfaceFormat format;
  854. SVGA3dInputClassification inputSlotClass;
  855. uint32 instanceDataStepRate;
  856. uint32 inputRegister;
  857. }
  858. #include "vmware_pack_end.h"
  859. SVGA3dInputElementDesc;
  860. typedef
  861. #include "vmware_pack_begin.h"
  862. struct {
  863. /*
  864. * XXX: How many of these can there be?
  865. */
  866. uint32 elid;
  867. uint32 numDescs;
  868. SVGA3dInputElementDesc desc[32];
  869. uint32 pad[62];
  870. }
  871. #include "vmware_pack_end.h"
  872. SVGACOTableDXElementLayoutEntry;
  873. typedef
  874. #include "vmware_pack_begin.h"
  875. struct SVGA3dCmdDXDefineElementLayout {
  876. SVGA3dElementLayoutId elementLayoutId;
  877. /* Followed by a variable number of SVGA3dInputElementDesc's. */
  878. }
  879. #include "vmware_pack_end.h"
  880. SVGA3dCmdDXDefineElementLayout;
  881. /* SVGA_3D_CMD_DX_DEFINE_ELEMENTLAYOUT */
  882. typedef
  883. #include "vmware_pack_begin.h"
  884. struct SVGA3dCmdDXDestroyElementLayout {
  885. SVGA3dElementLayoutId elementLayoutId;
  886. }
  887. #include "vmware_pack_end.h"
  888. SVGA3dCmdDXDestroyElementLayout;
  889. /* SVGA_3D_CMD_DX_DESTROY_ELEMENTLAYOUT */
  890. #define SVGA3D_DX_MAX_RENDER_TARGETS 8
  891. typedef
  892. #include "vmware_pack_begin.h"
  893. struct SVGA3dDXBlendStatePerRT {
  894. uint8 blendEnable;
  895. uint8 srcBlend;
  896. uint8 destBlend;
  897. uint8 blendOp;
  898. uint8 srcBlendAlpha;
  899. uint8 destBlendAlpha;
  900. uint8 blendOpAlpha;
  901. uint8 renderTargetWriteMask;
  902. uint8 logicOpEnable;
  903. uint8 logicOp;
  904. uint16 pad0;
  905. }
  906. #include "vmware_pack_end.h"
  907. SVGA3dDXBlendStatePerRT;
  908. typedef
  909. #include "vmware_pack_begin.h"
  910. struct {
  911. uint8 alphaToCoverageEnable;
  912. uint8 independentBlendEnable;
  913. uint16 pad0;
  914. SVGA3dDXBlendStatePerRT perRT[SVGA3D_MAX_RENDER_TARGETS];
  915. uint32 pad1[7];
  916. }
  917. #include "vmware_pack_end.h"
  918. SVGACOTableDXBlendStateEntry;
  919. /*
  920. */
  921. typedef
  922. #include "vmware_pack_begin.h"
  923. struct SVGA3dCmdDXDefineBlendState {
  924. SVGA3dBlendStateId blendId;
  925. uint8 alphaToCoverageEnable;
  926. uint8 independentBlendEnable;
  927. uint16 pad0;
  928. SVGA3dDXBlendStatePerRT perRT[SVGA3D_MAX_RENDER_TARGETS];
  929. }
  930. #include "vmware_pack_end.h"
  931. SVGA3dCmdDXDefineBlendState; /* SVGA_3D_CMD_DX_DEFINE_BLEND_STATE */
  932. typedef
  933. #include "vmware_pack_begin.h"
  934. struct SVGA3dCmdDXDestroyBlendState {
  935. SVGA3dBlendStateId blendId;
  936. }
  937. #include "vmware_pack_end.h"
  938. SVGA3dCmdDXDestroyBlendState; /* SVGA_3D_CMD_DX_DESTROY_BLEND_STATE */
  939. typedef
  940. #include "vmware_pack_begin.h"
  941. struct {
  942. uint8 depthEnable;
  943. SVGA3dDepthWriteMask depthWriteMask;
  944. SVGA3dComparisonFunc depthFunc;
  945. uint8 stencilEnable;
  946. uint8 frontEnable;
  947. uint8 backEnable;
  948. uint8 stencilReadMask;
  949. uint8 stencilWriteMask;
  950. uint8 frontStencilFailOp;
  951. uint8 frontStencilDepthFailOp;
  952. uint8 frontStencilPassOp;
  953. SVGA3dComparisonFunc frontStencilFunc;
  954. uint8 backStencilFailOp;
  955. uint8 backStencilDepthFailOp;
  956. uint8 backStencilPassOp;
  957. SVGA3dComparisonFunc backStencilFunc;
  958. }
  959. #include "vmware_pack_end.h"
  960. SVGACOTableDXDepthStencilEntry;
  961. /*
  962. */
  963. typedef
  964. #include "vmware_pack_begin.h"
  965. struct SVGA3dCmdDXDefineDepthStencilState {
  966. SVGA3dDepthStencilStateId depthStencilId;
  967. uint8 depthEnable;
  968. SVGA3dDepthWriteMask depthWriteMask;
  969. SVGA3dComparisonFunc depthFunc;
  970. uint8 stencilEnable;
  971. uint8 frontEnable;
  972. uint8 backEnable;
  973. uint8 stencilReadMask;
  974. uint8 stencilWriteMask;
  975. uint8 frontStencilFailOp;
  976. uint8 frontStencilDepthFailOp;
  977. uint8 frontStencilPassOp;
  978. SVGA3dComparisonFunc frontStencilFunc;
  979. uint8 backStencilFailOp;
  980. uint8 backStencilDepthFailOp;
  981. uint8 backStencilPassOp;
  982. SVGA3dComparisonFunc backStencilFunc;
  983. }
  984. #include "vmware_pack_end.h"
  985. SVGA3dCmdDXDefineDepthStencilState;
  986. /* SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_STATE */
  987. typedef
  988. #include "vmware_pack_begin.h"
  989. struct SVGA3dCmdDXDestroyDepthStencilState {
  990. SVGA3dDepthStencilStateId depthStencilId;
  991. }
  992. #include "vmware_pack_end.h"
  993. SVGA3dCmdDXDestroyDepthStencilState;
  994. /* SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_STATE */
  995. typedef
  996. #include "vmware_pack_begin.h"
  997. struct {
  998. uint8 fillMode;
  999. SVGA3dCullMode cullMode;
  1000. uint8 frontCounterClockwise;
  1001. uint8 provokingVertexLast;
  1002. int32 depthBias;
  1003. float depthBiasClamp;
  1004. float slopeScaledDepthBias;
  1005. uint8 depthClipEnable;
  1006. uint8 scissorEnable;
  1007. uint8 multisampleEnable;
  1008. uint8 antialiasedLineEnable;
  1009. float lineWidth;
  1010. uint8 lineStippleEnable;
  1011. uint8 lineStippleFactor;
  1012. uint16 lineStipplePattern;
  1013. uint32 forcedSampleCount;
  1014. }
  1015. #include "vmware_pack_end.h"
  1016. SVGACOTableDXRasterizerStateEntry;
  1017. /*
  1018. */
  1019. typedef
  1020. #include "vmware_pack_begin.h"
  1021. struct SVGA3dCmdDXDefineRasterizerState {
  1022. SVGA3dRasterizerStateId rasterizerId;
  1023. uint8 fillMode;
  1024. SVGA3dCullMode cullMode;
  1025. uint8 frontCounterClockwise;
  1026. uint8 provokingVertexLast;
  1027. int32 depthBias;
  1028. float depthBiasClamp;
  1029. float slopeScaledDepthBias;
  1030. uint8 depthClipEnable;
  1031. uint8 scissorEnable;
  1032. uint8 multisampleEnable;
  1033. uint8 antialiasedLineEnable;
  1034. float lineWidth;
  1035. uint8 lineStippleEnable;
  1036. uint8 lineStippleFactor;
  1037. uint16 lineStipplePattern;
  1038. }
  1039. #include "vmware_pack_end.h"
  1040. SVGA3dCmdDXDefineRasterizerState;
  1041. /* SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE */
  1042. typedef
  1043. #include "vmware_pack_begin.h"
  1044. struct SVGA3dCmdDXDestroyRasterizerState {
  1045. SVGA3dRasterizerStateId rasterizerId;
  1046. }
  1047. #include "vmware_pack_end.h"
  1048. SVGA3dCmdDXDestroyRasterizerState;
  1049. /* SVGA_3D_CMD_DX_DESTROY_RASTERIZER_STATE */
  1050. typedef
  1051. #include "vmware_pack_begin.h"
  1052. struct {
  1053. SVGA3dFilter filter;
  1054. uint8 addressU;
  1055. uint8 addressV;
  1056. uint8 addressW;
  1057. uint8 pad0;
  1058. float mipLODBias;
  1059. uint8 maxAnisotropy;
  1060. SVGA3dComparisonFunc comparisonFunc;
  1061. uint16 pad1;
  1062. SVGA3dRGBAFloat borderColor;
  1063. float minLOD;
  1064. float maxLOD;
  1065. uint32 pad2[6];
  1066. }
  1067. #include "vmware_pack_end.h"
  1068. SVGACOTableDXSamplerEntry;
  1069. /*
  1070. */
  1071. typedef
  1072. #include "vmware_pack_begin.h"
  1073. struct SVGA3dCmdDXDefineSamplerState {
  1074. SVGA3dSamplerId samplerId;
  1075. SVGA3dFilter filter;
  1076. uint8 addressU;
  1077. uint8 addressV;
  1078. uint8 addressW;
  1079. uint8 pad0;
  1080. float mipLODBias;
  1081. uint8 maxAnisotropy;
  1082. SVGA3dComparisonFunc comparisonFunc;
  1083. uint16 pad1;
  1084. SVGA3dRGBAFloat borderColor;
  1085. float minLOD;
  1086. float maxLOD;
  1087. }
  1088. #include "vmware_pack_end.h"
  1089. SVGA3dCmdDXDefineSamplerState; /* SVGA_3D_CMD_DX_DEFINE_SAMPLER_STATE */
  1090. typedef
  1091. #include "vmware_pack_begin.h"
  1092. struct SVGA3dCmdDXDestroySamplerState {
  1093. SVGA3dSamplerId samplerId;
  1094. }
  1095. #include "vmware_pack_end.h"
  1096. SVGA3dCmdDXDestroySamplerState; /* SVGA_3D_CMD_DX_DESTROY_SAMPLER_STATE */
  1097. /*
  1098. */
  1099. typedef
  1100. #include "vmware_pack_begin.h"
  1101. struct SVGA3dSignatureEntry {
  1102. uint8 systemValue;
  1103. uint8 reg; /* register is a reserved word */
  1104. uint16 mask;
  1105. uint8 registerComponentType;
  1106. uint8 minPrecision;
  1107. uint16 pad0;
  1108. }
  1109. #include "vmware_pack_end.h"
  1110. SVGA3dSignatureEntry;
  1111. typedef
  1112. #include "vmware_pack_begin.h"
  1113. struct SVGA3dCmdDXDefineShader {
  1114. SVGA3dShaderId shaderId;
  1115. SVGA3dShaderType type;
  1116. uint32 sizeInBytes; /* Number of bytes of shader text. */
  1117. }
  1118. #include "vmware_pack_end.h"
  1119. SVGA3dCmdDXDefineShader; /* SVGA_3D_CMD_DX_DEFINE_SHADER */
  1120. typedef
  1121. #include "vmware_pack_begin.h"
  1122. struct SVGACOTableDXShaderEntry {
  1123. SVGA3dShaderType type;
  1124. uint32 sizeInBytes;
  1125. uint32 offsetInBytes;
  1126. SVGAMobId mobid;
  1127. uint32 numInputSignatureEntries;
  1128. uint32 numOutputSignatureEntries;
  1129. uint32 numPatchConstantSignatureEntries;
  1130. uint32 pad;
  1131. }
  1132. #include "vmware_pack_end.h"
  1133. SVGACOTableDXShaderEntry;
  1134. typedef
  1135. #include "vmware_pack_begin.h"
  1136. struct SVGA3dCmdDXDestroyShader {
  1137. SVGA3dShaderId shaderId;
  1138. }
  1139. #include "vmware_pack_end.h"
  1140. SVGA3dCmdDXDestroyShader; /* SVGA_3D_CMD_DX_DESTROY_SHADER */
  1141. typedef
  1142. #include "vmware_pack_begin.h"
  1143. struct SVGA3dCmdDXBindShader {
  1144. uint32 cid;
  1145. uint32 shid;
  1146. SVGAMobId mobid;
  1147. uint32 offsetInBytes;
  1148. }
  1149. #include "vmware_pack_end.h"
  1150. SVGA3dCmdDXBindShader; /* SVGA_3D_CMD_DX_BIND_SHADER */
  1151. /*
  1152. * The maximum number of streamout decl's in each streamout entry.
  1153. */
  1154. #define SVGA3D_MAX_STREAMOUT_DECLS 64
  1155. typedef
  1156. #include "vmware_pack_begin.h"
  1157. struct SVGA3dStreamOutputDeclarationEntry {
  1158. uint32 outputSlot;
  1159. uint32 registerIndex;
  1160. uint8 registerMask;
  1161. uint8 pad0;
  1162. uint16 pad1;
  1163. uint32 stream;
  1164. }
  1165. #include "vmware_pack_end.h"
  1166. SVGA3dStreamOutputDeclarationEntry;
  1167. typedef
  1168. #include "vmware_pack_begin.h"
  1169. struct SVGAOTableStreamOutputEntry {
  1170. uint32 numOutputStreamEntries;
  1171. SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS];
  1172. uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
  1173. uint32 rasterizedStream;
  1174. uint32 pad[250];
  1175. }
  1176. #include "vmware_pack_end.h"
  1177. SVGACOTableDXStreamOutputEntry;
  1178. typedef
  1179. #include "vmware_pack_begin.h"
  1180. struct SVGA3dCmdDXDefineStreamOutput {
  1181. SVGA3dStreamOutputId soid;
  1182. uint32 numOutputStreamEntries;
  1183. SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS];
  1184. uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
  1185. uint32 rasterizedStream;
  1186. }
  1187. #include "vmware_pack_end.h"
  1188. SVGA3dCmdDXDefineStreamOutput; /* SVGA_3D_CMD_DX_DEFINE_STREAMOUTPUT */
  1189. typedef
  1190. #include "vmware_pack_begin.h"
  1191. struct SVGA3dCmdDXDestroyStreamOutput {
  1192. SVGA3dStreamOutputId soid;
  1193. }
  1194. #include "vmware_pack_end.h"
  1195. SVGA3dCmdDXDestroyStreamOutput; /* SVGA_3D_CMD_DX_DESTROY_STREAMOUTPUT */
  1196. typedef
  1197. #include "vmware_pack_begin.h"
  1198. struct SVGA3dCmdDXSetStreamOutput {
  1199. SVGA3dStreamOutputId soid;
  1200. }
  1201. #include "vmware_pack_end.h"
  1202. SVGA3dCmdDXSetStreamOutput; /* SVGA_3D_CMD_DX_SET_STREAMOUTPUT */
  1203. typedef
  1204. #include "vmware_pack_begin.h"
  1205. struct {
  1206. uint64 value;
  1207. uint32 mobId;
  1208. uint32 mobOffset;
  1209. }
  1210. #include "vmware_pack_end.h"
  1211. SVGA3dCmdDXMobFence64; /* SVGA_3D_CMD_DX_MOB_FENCE_64 */
  1212. /*
  1213. * SVGA3dCmdSetCOTable --
  1214. *
  1215. * This command allows the guest to bind a mob to a context-object table.
  1216. */
  1217. typedef
  1218. #include "vmware_pack_begin.h"
  1219. struct SVGA3dCmdDXSetCOTable {
  1220. uint32 cid;
  1221. uint32 mobid;
  1222. SVGACOTableType type;
  1223. uint32 validSizeInBytes;
  1224. }
  1225. #include "vmware_pack_end.h"
  1226. SVGA3dCmdDXSetCOTable; /* SVGA_3D_CMD_DX_SET_COTABLE */
  1227. typedef
  1228. #include "vmware_pack_begin.h"
  1229. struct SVGA3dCmdDXReadbackCOTable {
  1230. uint32 cid;
  1231. SVGACOTableType type;
  1232. }
  1233. #include "vmware_pack_end.h"
  1234. SVGA3dCmdDXReadbackCOTable; /* SVGA_3D_CMD_DX_READBACK_COTABLE */
  1235. typedef
  1236. #include "vmware_pack_begin.h"
  1237. struct SVGA3dCOTableData {
  1238. uint32 mobid;
  1239. }
  1240. #include "vmware_pack_end.h"
  1241. SVGA3dCOTableData;
  1242. typedef
  1243. #include "vmware_pack_begin.h"
  1244. struct SVGA3dBufferBinding {
  1245. uint32 bufferId;
  1246. uint32 stride;
  1247. uint32 offset;
  1248. }
  1249. #include "vmware_pack_end.h"
  1250. SVGA3dBufferBinding;
  1251. typedef
  1252. #include "vmware_pack_begin.h"
  1253. struct SVGA3dConstantBufferBinding {
  1254. uint32 sid;
  1255. uint32 offsetInBytes;
  1256. uint32 sizeInBytes;
  1257. }
  1258. #include "vmware_pack_end.h"
  1259. SVGA3dConstantBufferBinding;
  1260. typedef
  1261. #include "vmware_pack_begin.h"
  1262. struct SVGADXInputAssemblyMobFormat {
  1263. uint32 layoutId;
  1264. SVGA3dBufferBinding vertexBuffers[SVGA3D_DX_MAX_VERTEXBUFFERS];
  1265. uint32 indexBufferSid;
  1266. uint32 pad;
  1267. uint32 indexBufferOffset;
  1268. uint32 indexBufferFormat;
  1269. uint32 topology;
  1270. }
  1271. #include "vmware_pack_end.h"
  1272. SVGADXInputAssemblyMobFormat;
  1273. typedef
  1274. #include "vmware_pack_begin.h"
  1275. struct SVGADXContextMobFormat {
  1276. SVGADXInputAssemblyMobFormat inputAssembly;
  1277. struct {
  1278. uint32 blendStateId;
  1279. uint32 blendFactor[4];
  1280. uint32 sampleMask;
  1281. uint32 depthStencilStateId;
  1282. uint32 stencilRef;
  1283. uint32 rasterizerStateId;
  1284. uint32 depthStencilViewId;
  1285. uint32 renderTargetViewIds[SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS];
  1286. uint32 unorderedAccessViewIds[SVGA3D_MAX_UAVIEWS];
  1287. } renderState;
  1288. struct {
  1289. uint32 targets[SVGA3D_DX_MAX_SOTARGETS];
  1290. uint32 soid;
  1291. } streamOut;
  1292. uint32 pad0[11];
  1293. uint8 numViewports;
  1294. uint8 numScissorRects;
  1295. uint16 pad1[1];
  1296. uint32 pad2[3];
  1297. SVGA3dViewport viewports[SVGA3D_DX_MAX_VIEWPORTS];
  1298. uint32 pad3[32];
  1299. SVGASignedRect scissorRects[SVGA3D_DX_MAX_SCISSORRECTS];
  1300. uint32 pad4[64];
  1301. struct {
  1302. uint32 queryID;
  1303. uint32 value;
  1304. } predication;
  1305. uint32 pad5[2];
  1306. struct {
  1307. uint32 shaderId;
  1308. SVGA3dConstantBufferBinding constantBuffers[SVGA3D_DX_MAX_CONSTBUFFERS];
  1309. uint32 shaderResources[SVGA3D_DX_MAX_SRVIEWS];
  1310. uint32 samplers[SVGA3D_DX_MAX_SAMPLERS];
  1311. } shaderState[SVGA3D_NUM_SHADERTYPE];
  1312. uint32 pad6[26];
  1313. SVGA3dQueryId queryID[SVGA3D_MAX_QUERY];
  1314. SVGA3dCOTableData cotables[SVGA_COTABLE_MAX];
  1315. uint32 pad7[381];
  1316. }
  1317. #include "vmware_pack_end.h"
  1318. SVGADXContextMobFormat;
  1319. typedef
  1320. #include "vmware_pack_begin.h"
  1321. struct SVGA3dCmdDXTempSetContext {
  1322. uint32 dxcid;
  1323. }
  1324. #include "vmware_pack_end.h"
  1325. SVGA3dCmdDXTempSetContext; /* SVGA_3D_CMD_DX_TEMP_SET_CONTEXT */
  1326. #endif /* _SVGA3D_DX_H_ */