svga3d_dx.h 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724
  1. /* SPDX-License-Identifier: GPL-2.0 OR MIT */
  2. /*
  3. * Copyright 2012-2021 VMware, Inc.
  4. *
  5. * Permission is hereby granted, free of charge, to any person
  6. * obtaining a copy of this software and associated documentation
  7. * files (the "Software"), to deal in the Software without
  8. * restriction, including without limitation the rights to use, copy,
  9. * modify, merge, publish, distribute, sublicense, and/or sell copies
  10. * of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be
  14. * included in all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  19. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  20. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  21. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  23. * SOFTWARE.
  24. *
  25. */
  26. /*
  27. * svga3d_dx.h --
  28. *
  29. * SVGA 3d hardware definitions for DX10 support.
  30. */
  31. #ifndef _SVGA3D_DX_H_
  32. #define _SVGA3D_DX_H_
  33. #include "svga_reg.h"
  34. #include "svga3d_limits.h"
  35. #include "svga3d_types.h"
  36. #define SVGA3D_INPUT_MIN 0
  37. #define SVGA3D_INPUT_PER_VERTEX_DATA 0
  38. #define SVGA3D_INPUT_PER_INSTANCE_DATA 1
  39. #define SVGA3D_INPUT_MAX 2
  40. typedef uint32 SVGA3dInputClassification;
  41. #define SVGA3D_COLOR_WRITE_ENABLE_RED (1 << 0)
  42. #define SVGA3D_COLOR_WRITE_ENABLE_GREEN (1 << 1)
  43. #define SVGA3D_COLOR_WRITE_ENABLE_BLUE (1 << 2)
  44. #define SVGA3D_COLOR_WRITE_ENABLE_ALPHA (1 << 3)
  45. #define SVGA3D_COLOR_WRITE_ENABLE_ALL \
  46. (SVGA3D_COLOR_WRITE_ENABLE_RED | SVGA3D_COLOR_WRITE_ENABLE_GREEN | \
  47. SVGA3D_COLOR_WRITE_ENABLE_BLUE | SVGA3D_COLOR_WRITE_ENABLE_ALPHA)
  48. typedef uint8 SVGA3dColorWriteEnable;
  49. #define SVGA3D_DEPTH_WRITE_MASK_ZERO 0
  50. #define SVGA3D_DEPTH_WRITE_MASK_ALL 1
  51. typedef uint8 SVGA3dDepthWriteMask;
  52. #define SVGA3D_FILTER_MIP_LINEAR (1 << 0)
  53. #define SVGA3D_FILTER_MAG_LINEAR (1 << 2)
  54. #define SVGA3D_FILTER_MIN_LINEAR (1 << 4)
  55. #define SVGA3D_FILTER_ANISOTROPIC (1 << 6)
  56. #define SVGA3D_FILTER_COMPARE (1 << 7)
  57. typedef uint32 SVGA3dFilter;
  58. #define SVGA3D_CULL_INVALID 0
  59. #define SVGA3D_CULL_MIN 1
  60. #define SVGA3D_CULL_NONE 1
  61. #define SVGA3D_CULL_FRONT 2
  62. #define SVGA3D_CULL_BACK 3
  63. #define SVGA3D_CULL_MAX 4
  64. typedef uint8 SVGA3dCullMode;
  65. #define SVGA3D_COMPARISON_INVALID 0
  66. #define SVGA3D_COMPARISON_MIN 1
  67. #define SVGA3D_COMPARISON_NEVER 1
  68. #define SVGA3D_COMPARISON_LESS 2
  69. #define SVGA3D_COMPARISON_EQUAL 3
  70. #define SVGA3D_COMPARISON_LESS_EQUAL 4
  71. #define SVGA3D_COMPARISON_GREATER 5
  72. #define SVGA3D_COMPARISON_NOT_EQUAL 6
  73. #define SVGA3D_COMPARISON_GREATER_EQUAL 7
  74. #define SVGA3D_COMPARISON_ALWAYS 8
  75. #define SVGA3D_COMPARISON_MAX 9
  76. typedef uint8 SVGA3dComparisonFunc;
  77. #define SVGA3D_MULTISAMPLE_RAST_DISABLE 0
  78. #define SVGA3D_MULTISAMPLE_RAST_ENABLE 1
  79. #define SVGA3D_MULTISAMPLE_RAST_DX_MAX 1
  80. #define SVGA3D_MULTISAMPLE_RAST_DISABLE_LINE 2
  81. #define SVGA3D_MULTISAMPLE_RAST_MAX 2
  82. typedef uint8 SVGA3dMultisampleRastEnable;
  83. #define SVGA3D_DX_MAX_VERTEXBUFFERS 32
  84. #define SVGA3D_DX_MAX_VERTEXINPUTREGISTERS 16
  85. #define SVGA3D_DX_SM41_MAX_VERTEXINPUTREGISTERS 32
  86. #define SVGA3D_DX_MAX_SOTARGETS 4
  87. #define SVGA3D_DX_MAX_SRVIEWS 128
  88. #define SVGA3D_DX_MAX_CONSTBUFFERS 16
  89. #define SVGA3D_DX_MAX_SAMPLERS 16
  90. #define SVGA3D_DX_MAX_CLASS_INSTANCES 253
  91. #define SVGA3D_DX_MAX_CONSTBUF_BINDING_SIZE (4096 * 4 * (uint32)sizeof(uint32))
  92. typedef uint32 SVGA3dShaderResourceViewId;
  93. typedef uint32 SVGA3dRenderTargetViewId;
  94. typedef uint32 SVGA3dDepthStencilViewId;
  95. typedef uint32 SVGA3dUAViewId;
  96. typedef uint32 SVGA3dShaderId;
  97. typedef uint32 SVGA3dElementLayoutId;
  98. typedef uint32 SVGA3dSamplerId;
  99. typedef uint32 SVGA3dBlendStateId;
  100. typedef uint32 SVGA3dDepthStencilStateId;
  101. typedef uint32 SVGA3dRasterizerStateId;
  102. typedef uint32 SVGA3dQueryId;
  103. typedef uint32 SVGA3dStreamOutputId;
  104. typedef union {
  105. struct {
  106. uint32 r;
  107. uint32 g;
  108. uint32 b;
  109. uint32 a;
  110. };
  111. uint32 value[4];
  112. } SVGA3dRGBAUint32;
  113. #pragma pack(push, 1)
  114. typedef struct {
  115. uint32 cid;
  116. SVGAMobId mobid;
  117. } SVGAOTableDXContextEntry;
  118. #pragma pack(pop)
  119. #pragma pack(push, 1)
  120. typedef struct SVGA3dCmdDXDefineContext {
  121. uint32 cid;
  122. } SVGA3dCmdDXDefineContext;
  123. #pragma pack(pop)
  124. #pragma pack(push, 1)
  125. typedef struct SVGA3dCmdDXDestroyContext {
  126. uint32 cid;
  127. } SVGA3dCmdDXDestroyContext;
  128. #pragma pack(pop)
  129. #pragma pack(push, 1)
  130. typedef struct SVGA3dCmdDXBindContext {
  131. uint32 cid;
  132. SVGAMobId mobid;
  133. uint32 validContents;
  134. } SVGA3dCmdDXBindContext;
  135. #pragma pack(pop)
  136. #pragma pack(push, 1)
  137. typedef struct SVGA3dCmdDXReadbackContext {
  138. uint32 cid;
  139. } SVGA3dCmdDXReadbackContext;
  140. #pragma pack(pop)
  141. #pragma pack(push, 1)
  142. typedef struct SVGA3dCmdDXInvalidateContext {
  143. uint32 cid;
  144. } SVGA3dCmdDXInvalidateContext;
  145. #pragma pack(pop)
  146. #pragma pack(push, 1)
  147. typedef struct SVGA3dCmdDXSetSingleConstantBuffer {
  148. uint32 slot;
  149. SVGA3dShaderType type;
  150. SVGA3dSurfaceId sid;
  151. uint32 offsetInBytes;
  152. uint32 sizeInBytes;
  153. } SVGA3dCmdDXSetSingleConstantBuffer;
  154. #pragma pack(pop)
  155. #pragma pack(push, 1)
  156. typedef struct SVGA3dCmdDXSetShaderResources {
  157. uint32 startView;
  158. SVGA3dShaderType type;
  159. } SVGA3dCmdDXSetShaderResources;
  160. #pragma pack(pop)
  161. #pragma pack(push, 1)
  162. typedef struct SVGA3dCmdDXSetShader {
  163. SVGA3dShaderId shaderId;
  164. SVGA3dShaderType type;
  165. } SVGA3dCmdDXSetShader;
  166. #pragma pack(pop)
  167. typedef union {
  168. struct {
  169. uint32 cbOffset : 12;
  170. uint32 cbId : 4;
  171. uint32 baseSamp : 4;
  172. uint32 baseTex : 7;
  173. uint32 reserved : 5;
  174. };
  175. uint32 value;
  176. } SVGA3dIfaceData;
  177. #pragma pack(push, 1)
  178. typedef struct SVGA3dCmdDXSetShaderIface {
  179. SVGA3dShaderType type;
  180. uint32 numClassInstances;
  181. uint32 index;
  182. uint32 iface;
  183. SVGA3dIfaceData data;
  184. } SVGA3dCmdDXSetShaderIface;
  185. #pragma pack(pop)
  186. #pragma pack(push, 1)
  187. typedef struct SVGA3dCmdDXBindShaderIface {
  188. uint32 cid;
  189. SVGAMobId mobid;
  190. uint32 offsetInBytes;
  191. } SVGA3dCmdDXBindShaderIface;
  192. #pragma pack(pop)
  193. #pragma pack(push, 1)
  194. typedef struct SVGA3dCmdDXSetSamplers {
  195. uint32 startSampler;
  196. SVGA3dShaderType type;
  197. } SVGA3dCmdDXSetSamplers;
  198. #pragma pack(pop)
  199. #pragma pack(push, 1)
  200. typedef struct SVGA3dCmdDXDraw {
  201. uint32 vertexCount;
  202. uint32 startVertexLocation;
  203. } SVGA3dCmdDXDraw;
  204. #pragma pack(pop)
  205. #pragma pack(push, 1)
  206. typedef struct SVGA3dCmdDXDrawIndexed {
  207. uint32 indexCount;
  208. uint32 startIndexLocation;
  209. int32 baseVertexLocation;
  210. } SVGA3dCmdDXDrawIndexed;
  211. #pragma pack(pop)
  212. #pragma pack(push, 1)
  213. typedef struct SVGA3dCmdDXDrawInstanced {
  214. uint32 vertexCountPerInstance;
  215. uint32 instanceCount;
  216. uint32 startVertexLocation;
  217. uint32 startInstanceLocation;
  218. } SVGA3dCmdDXDrawInstanced;
  219. #pragma pack(pop)
  220. #pragma pack(push, 1)
  221. typedef struct SVGA3dCmdDXDrawIndexedInstanced {
  222. uint32 indexCountPerInstance;
  223. uint32 instanceCount;
  224. uint32 startIndexLocation;
  225. int32 baseVertexLocation;
  226. uint32 startInstanceLocation;
  227. } SVGA3dCmdDXDrawIndexedInstanced;
  228. #pragma pack(pop)
  229. #pragma pack(push, 1)
  230. typedef struct SVGA3dCmdDXDrawIndexedInstancedIndirect {
  231. SVGA3dSurfaceId argsBufferSid;
  232. uint32 byteOffsetForArgs;
  233. } SVGA3dCmdDXDrawIndexedInstancedIndirect;
  234. #pragma pack(pop)
  235. #pragma pack(push, 1)
  236. typedef struct SVGA3dCmdDXDrawInstancedIndirect {
  237. SVGA3dSurfaceId argsBufferSid;
  238. uint32 byteOffsetForArgs;
  239. } SVGA3dCmdDXDrawInstancedIndirect;
  240. #pragma pack(pop)
  241. #pragma pack(push, 1)
  242. typedef struct SVGA3dCmdDXDrawAuto {
  243. uint32 pad0;
  244. } SVGA3dCmdDXDrawAuto;
  245. #pragma pack(pop)
  246. #pragma pack(push, 1)
  247. typedef struct SVGA3dCmdDXDispatch {
  248. uint32 threadGroupCountX;
  249. uint32 threadGroupCountY;
  250. uint32 threadGroupCountZ;
  251. } SVGA3dCmdDXDispatch;
  252. #pragma pack(pop)
  253. #pragma pack(push, 1)
  254. typedef struct SVGA3dCmdDXDispatchIndirect {
  255. SVGA3dSurfaceId argsBufferSid;
  256. uint32 byteOffsetForArgs;
  257. } SVGA3dCmdDXDispatchIndirect;
  258. #pragma pack(pop)
  259. #pragma pack(push, 1)
  260. typedef struct SVGA3dCmdDXSetInputLayout {
  261. SVGA3dElementLayoutId elementLayoutId;
  262. } SVGA3dCmdDXSetInputLayout;
  263. #pragma pack(pop)
  264. #pragma pack(push, 1)
  265. typedef struct SVGA3dVertexBuffer {
  266. SVGA3dSurfaceId sid;
  267. uint32 stride;
  268. uint32 offset;
  269. } SVGA3dVertexBuffer;
  270. #pragma pack(pop)
  271. #pragma pack(push, 1)
  272. typedef struct SVGA3dCmdDXSetVertexBuffers {
  273. uint32 startBuffer;
  274. } SVGA3dCmdDXSetVertexBuffers;
  275. #pragma pack(pop)
  276. #pragma pack(push, 1)
  277. typedef struct SVGA3dVertexBuffer_v2 {
  278. SVGA3dSurfaceId sid;
  279. uint32 stride;
  280. uint32 offset;
  281. uint32 sizeInBytes;
  282. } SVGA3dVertexBuffer_v2;
  283. #pragma pack(pop)
  284. #pragma pack(push, 1)
  285. typedef struct SVGA3dCmdDXSetVertexBuffers_v2 {
  286. uint32 startBuffer;
  287. } SVGA3dCmdDXSetVertexBuffers_v2;
  288. #pragma pack(pop)
  289. #pragma pack(push, 1)
  290. typedef struct SVGA3dVertexBufferOffsetAndSize {
  291. uint32 stride;
  292. uint32 offset;
  293. uint32 sizeInBytes;
  294. } SVGA3dVertexBufferOffsetAndSize;
  295. #pragma pack(pop)
  296. #pragma pack(push, 1)
  297. typedef struct SVGA3dCmdDXSetVertexBuffersOffsetAndSize {
  298. uint32 startBuffer;
  299. } SVGA3dCmdDXSetVertexBuffersOffsetAndSize;
  300. #pragma pack(pop)
  301. #pragma pack(push, 1)
  302. typedef struct SVGA3dCmdDXSetIndexBuffer {
  303. SVGA3dSurfaceId sid;
  304. SVGA3dSurfaceFormat format;
  305. uint32 offset;
  306. } SVGA3dCmdDXSetIndexBuffer;
  307. #pragma pack(pop)
  308. #pragma pack(push, 1)
  309. typedef struct SVGA3dCmdDXSetIndexBuffer_v2 {
  310. SVGA3dSurfaceId sid;
  311. SVGA3dSurfaceFormat format;
  312. uint32 offset;
  313. uint32 sizeInBytes;
  314. } SVGA3dCmdDXSetIndexBuffer_v2;
  315. #pragma pack(pop)
  316. #pragma pack(push, 1)
  317. typedef struct SVGA3dCmdDXSetIndexBufferOffsetAndSize {
  318. SVGA3dSurfaceFormat format;
  319. uint32 offset;
  320. uint32 sizeInBytes;
  321. } SVGA3dCmdDXSetIndexBufferOffsetAndSize;
  322. #pragma pack(pop)
  323. #pragma pack(push, 1)
  324. typedef struct SVGA3dCmdDXSetTopology {
  325. SVGA3dPrimitiveType topology;
  326. } SVGA3dCmdDXSetTopology;
  327. #pragma pack(pop)
  328. #pragma pack(push, 1)
  329. typedef struct SVGA3dCmdDXSetRenderTargets {
  330. SVGA3dDepthStencilViewId depthStencilViewId;
  331. } SVGA3dCmdDXSetRenderTargets;
  332. #pragma pack(pop)
  333. #pragma pack(push, 1)
  334. typedef struct SVGA3dCmdDXSetBlendState {
  335. SVGA3dBlendStateId blendId;
  336. float blendFactor[4];
  337. uint32 sampleMask;
  338. } SVGA3dCmdDXSetBlendState;
  339. #pragma pack(pop)
  340. #pragma pack(push, 1)
  341. typedef struct SVGA3dCmdDXSetDepthStencilState {
  342. SVGA3dDepthStencilStateId depthStencilId;
  343. uint32 stencilRef;
  344. } SVGA3dCmdDXSetDepthStencilState;
  345. #pragma pack(pop)
  346. #pragma pack(push, 1)
  347. typedef struct SVGA3dCmdDXSetRasterizerState {
  348. SVGA3dRasterizerStateId rasterizerId;
  349. } SVGA3dCmdDXSetRasterizerState;
  350. #pragma pack(pop)
  351. #define SVGA3D_DXQUERY_FLAG_PREDICATEHINT (1 << 0)
  352. typedef uint32 SVGA3dDXQueryFlags;
  353. #define SVGADX_QDSTATE_INVALID ((uint8)-1)
  354. #define SVGADX_QDSTATE_MIN 0
  355. #define SVGADX_QDSTATE_IDLE 0
  356. #define SVGADX_QDSTATE_ACTIVE 1
  357. #define SVGADX_QDSTATE_PENDING 2
  358. #define SVGADX_QDSTATE_FINISHED 3
  359. #define SVGADX_QDSTATE_MAX 4
  360. typedef uint8 SVGADXQueryDeviceState;
  361. #pragma pack(push, 1)
  362. typedef struct {
  363. SVGA3dQueryTypeUint8 type;
  364. uint16 pad0;
  365. SVGADXQueryDeviceState state;
  366. SVGA3dDXQueryFlags flags;
  367. SVGAMobId mobid;
  368. uint32 offset;
  369. } SVGACOTableDXQueryEntry;
  370. #pragma pack(pop)
  371. #pragma pack(push, 1)
  372. typedef struct SVGA3dCmdDXDefineQuery {
  373. SVGA3dQueryId queryId;
  374. SVGA3dQueryType type;
  375. SVGA3dDXQueryFlags flags;
  376. } SVGA3dCmdDXDefineQuery;
  377. #pragma pack(pop)
  378. #pragma pack(push, 1)
  379. typedef struct SVGA3dCmdDXDestroyQuery {
  380. SVGA3dQueryId queryId;
  381. } SVGA3dCmdDXDestroyQuery;
  382. #pragma pack(pop)
  383. #pragma pack(push, 1)
  384. typedef struct SVGA3dCmdDXBindQuery {
  385. SVGA3dQueryId queryId;
  386. SVGAMobId mobid;
  387. } SVGA3dCmdDXBindQuery;
  388. #pragma pack(pop)
  389. #pragma pack(push, 1)
  390. typedef struct SVGA3dCmdDXSetQueryOffset {
  391. SVGA3dQueryId queryId;
  392. uint32 mobOffset;
  393. } SVGA3dCmdDXSetQueryOffset;
  394. #pragma pack(pop)
  395. #pragma pack(push, 1)
  396. typedef struct SVGA3dCmdDXBeginQuery {
  397. SVGA3dQueryId queryId;
  398. } SVGA3dCmdDXBeginQuery;
  399. #pragma pack(pop)
  400. #pragma pack(push, 1)
  401. typedef struct SVGA3dCmdDXEndQuery {
  402. SVGA3dQueryId queryId;
  403. } SVGA3dCmdDXEndQuery;
  404. #pragma pack(pop)
  405. #pragma pack(push, 1)
  406. typedef struct SVGA3dCmdDXReadbackQuery {
  407. SVGA3dQueryId queryId;
  408. } SVGA3dCmdDXReadbackQuery;
  409. #pragma pack(pop)
  410. #pragma pack(push, 1)
  411. typedef struct SVGA3dCmdDXMoveQuery {
  412. SVGA3dQueryId queryId;
  413. SVGAMobId mobid;
  414. uint32 mobOffset;
  415. } SVGA3dCmdDXMoveQuery;
  416. #pragma pack(pop)
  417. #pragma pack(push, 1)
  418. typedef struct SVGA3dCmdDXBindAllQuery {
  419. uint32 cid;
  420. SVGAMobId mobid;
  421. } SVGA3dCmdDXBindAllQuery;
  422. #pragma pack(pop)
  423. #pragma pack(push, 1)
  424. typedef struct SVGA3dCmdDXReadbackAllQuery {
  425. uint32 cid;
  426. } SVGA3dCmdDXReadbackAllQuery;
  427. #pragma pack(pop)
  428. #pragma pack(push, 1)
  429. typedef struct SVGA3dCmdDXSetPredication {
  430. SVGA3dQueryId queryId;
  431. uint32 predicateValue;
  432. } SVGA3dCmdDXSetPredication;
  433. #pragma pack(pop)
  434. #pragma pack(push, 1)
  435. typedef struct SVGA3dDXSOState {
  436. uint32 offset;
  437. uint32 intOffset;
  438. uint32 dead1;
  439. uint32 dead2;
  440. } SVGA3dDXSOState;
  441. #pragma pack(pop)
  442. #define SVGA3D_DX_SO_OFFSET_APPEND ((uint32)~0u)
  443. #pragma pack(push, 1)
  444. typedef struct SVGA3dSoTarget {
  445. SVGA3dSurfaceId sid;
  446. uint32 offset;
  447. uint32 sizeInBytes;
  448. } SVGA3dSoTarget;
  449. #pragma pack(pop)
  450. #pragma pack(push, 1)
  451. typedef struct SVGA3dCmdDXSetSOTargets {
  452. uint32 pad0;
  453. } SVGA3dCmdDXSetSOTargets;
  454. #pragma pack(pop)
  455. #pragma pack(push, 1)
  456. typedef struct SVGA3dViewport {
  457. float x;
  458. float y;
  459. float width;
  460. float height;
  461. float minDepth;
  462. float maxDepth;
  463. } SVGA3dViewport;
  464. #pragma pack(pop)
  465. #pragma pack(push, 1)
  466. typedef struct SVGA3dCmdDXSetViewports {
  467. uint32 pad0;
  468. } SVGA3dCmdDXSetViewports;
  469. #pragma pack(pop)
  470. #define SVGA3D_DX_MAX_VIEWPORTS 16
  471. #pragma pack(push, 1)
  472. typedef struct SVGA3dCmdDXSetScissorRects {
  473. uint32 pad0;
  474. } SVGA3dCmdDXSetScissorRects;
  475. #pragma pack(pop)
  476. #define SVGA3D_DX_MAX_SCISSORRECTS 16
  477. #pragma pack(push, 1)
  478. typedef struct SVGA3dCmdDXClearRenderTargetView {
  479. SVGA3dRenderTargetViewId renderTargetViewId;
  480. SVGA3dRGBAFloat rgba;
  481. } SVGA3dCmdDXClearRenderTargetView;
  482. #pragma pack(pop)
  483. #pragma pack(push, 1)
  484. typedef struct SVGA3dCmdDXClearDepthStencilView {
  485. uint16 flags;
  486. uint16 stencil;
  487. SVGA3dDepthStencilViewId depthStencilViewId;
  488. float depth;
  489. } SVGA3dCmdDXClearDepthStencilView;
  490. #pragma pack(pop)
  491. #pragma pack(push, 1)
  492. typedef struct SVGA3dCmdDXPredCopyRegion {
  493. SVGA3dSurfaceId dstSid;
  494. uint32 dstSubResource;
  495. SVGA3dSurfaceId srcSid;
  496. uint32 srcSubResource;
  497. SVGA3dCopyBox box;
  498. } SVGA3dCmdDXPredCopyRegion;
  499. #pragma pack(pop)
  500. #pragma pack(push, 1)
  501. typedef struct SVGA3dCmdDXPredStagingCopyRegion {
  502. SVGA3dSurfaceId dstSid;
  503. uint32 dstSubResource;
  504. SVGA3dSurfaceId srcSid;
  505. uint32 srcSubResource;
  506. SVGA3dCopyBox box;
  507. uint8 readback;
  508. uint8 unsynchronized;
  509. uint8 mustBeZero[2];
  510. } SVGA3dCmdDXPredStagingCopyRegion;
  511. #pragma pack(pop)
  512. #pragma pack(push, 1)
  513. typedef struct SVGA3dCmdDXPredCopy {
  514. SVGA3dSurfaceId dstSid;
  515. SVGA3dSurfaceId srcSid;
  516. } SVGA3dCmdDXPredCopy;
  517. #pragma pack(pop)
  518. #pragma pack(push, 1)
  519. typedef struct SVGA3dCmdDXPredConvertRegion {
  520. SVGA3dSurfaceId dstSid;
  521. uint32 dstSubResource;
  522. SVGA3dBox destBox;
  523. SVGA3dSurfaceId srcSid;
  524. uint32 srcSubResource;
  525. SVGA3dBox srcBox;
  526. } SVGA3dCmdDXPredConvertRegion;
  527. #pragma pack(pop)
  528. #pragma pack(push, 1)
  529. typedef struct SVGA3dCmdDXPredStagingConvertRegion {
  530. SVGA3dSurfaceId dstSid;
  531. uint32 dstSubResource;
  532. SVGA3dBox destBox;
  533. SVGA3dSurfaceId srcSid;
  534. uint32 srcSubResource;
  535. SVGA3dBox srcBox;
  536. uint8 readback;
  537. uint8 unsynchronized;
  538. uint8 mustBeZero[2];
  539. } SVGA3dCmdDXPredStagingConvertRegion;
  540. #pragma pack(pop)
  541. #pragma pack(push, 1)
  542. typedef struct SVGA3dCmdDXPredConvert {
  543. SVGA3dSurfaceId dstSid;
  544. SVGA3dSurfaceId srcSid;
  545. } SVGA3dCmdDXPredConvert;
  546. #pragma pack(pop)
  547. #pragma pack(push, 1)
  548. typedef struct SVGA3dCmdDXPredStagingConvert {
  549. SVGA3dSurfaceId dstSid;
  550. SVGA3dSurfaceId srcSid;
  551. uint8 readback;
  552. uint8 unsynchronized;
  553. uint8 mustBeZero[2];
  554. } SVGA3dCmdDXPredStagingConvert;
  555. #pragma pack(pop)
  556. #pragma pack(push, 1)
  557. typedef struct SVGA3dCmdDXBufferCopy {
  558. SVGA3dSurfaceId dest;
  559. SVGA3dSurfaceId src;
  560. uint32 destX;
  561. uint32 srcX;
  562. uint32 width;
  563. } SVGA3dCmdDXBufferCopy;
  564. #pragma pack(pop)
  565. #pragma pack(push, 1)
  566. typedef struct SVGA3dCmdDXStagingBufferCopy {
  567. SVGA3dSurfaceId dest;
  568. SVGA3dSurfaceId src;
  569. uint32 destX;
  570. uint32 srcX;
  571. uint32 width;
  572. uint8 readback;
  573. uint8 unsynchronized;
  574. uint8 mustBeZero[2];
  575. } SVGA3dCmdDXStagingBufferCopy;
  576. #pragma pack(pop)
  577. #pragma pack(push, 1)
  578. typedef struct {
  579. SVGA3dSurfaceId dstSid;
  580. uint32 dstSubResource;
  581. SVGA3dSurfaceId srcSid;
  582. uint32 srcSubResource;
  583. SVGA3dSurfaceFormat copyFormat;
  584. } SVGA3dCmdDXResolveCopy;
  585. #pragma pack(pop)
  586. #pragma pack(push, 1)
  587. typedef struct {
  588. SVGA3dSurfaceId dstSid;
  589. uint32 dstSubResource;
  590. SVGA3dSurfaceId srcSid;
  591. uint32 srcSubResource;
  592. SVGA3dSurfaceFormat copyFormat;
  593. } SVGA3dCmdDXPredResolveCopy;
  594. #pragma pack(pop)
  595. typedef uint32 SVGA3dDXPresentBltMode;
  596. #define SVGADX_PRESENTBLT_LINEAR (1 << 0)
  597. #define SVGADX_PRESENTBLT_FORCE_SRC_SRGB (1 << 1)
  598. #define SVGADX_PRESENTBLT_FORCE_SRC_XRBIAS (1 << 2)
  599. #define SVGADX_PRESENTBLT_MODE_MAX (1 << 3)
  600. #pragma pack(push, 1)
  601. typedef struct SVGA3dCmdDXPresentBlt {
  602. SVGA3dSurfaceId srcSid;
  603. uint32 srcSubResource;
  604. SVGA3dSurfaceId dstSid;
  605. uint32 destSubResource;
  606. SVGA3dBox boxSrc;
  607. SVGA3dBox boxDest;
  608. SVGA3dDXPresentBltMode mode;
  609. } SVGA3dCmdDXPresentBlt;
  610. #pragma pack(pop)
  611. #pragma pack(push, 1)
  612. typedef struct SVGA3dCmdDXGenMips {
  613. SVGA3dShaderResourceViewId shaderResourceViewId;
  614. } SVGA3dCmdDXGenMips;
  615. #pragma pack(pop)
  616. #pragma pack(push, 1)
  617. typedef struct SVGA3dCmdDXUpdateSubResource {
  618. SVGA3dSurfaceId sid;
  619. uint32 subResource;
  620. SVGA3dBox box;
  621. } SVGA3dCmdDXUpdateSubResource;
  622. #pragma pack(pop)
  623. #pragma pack(push, 1)
  624. typedef struct SVGA3dCmdDXReadbackSubResource {
  625. SVGA3dSurfaceId sid;
  626. uint32 subResource;
  627. } SVGA3dCmdDXReadbackSubResource;
  628. #pragma pack(pop)
  629. #pragma pack(push, 1)
  630. typedef struct SVGA3dCmdDXInvalidateSubResource {
  631. SVGA3dSurfaceId sid;
  632. uint32 subResource;
  633. } SVGA3dCmdDXInvalidateSubResource;
  634. #pragma pack(pop)
  635. #pragma pack(push, 1)
  636. typedef struct SVGA3dCmdDXTransferFromBuffer {
  637. SVGA3dSurfaceId srcSid;
  638. uint32 srcOffset;
  639. uint32 srcPitch;
  640. uint32 srcSlicePitch;
  641. SVGA3dSurfaceId destSid;
  642. uint32 destSubResource;
  643. SVGA3dBox destBox;
  644. } SVGA3dCmdDXTransferFromBuffer;
  645. #pragma pack(pop)
  646. #define SVGA3D_TRANSFER_TO_BUFFER_READBACK (1 << 0)
  647. #define SVGA3D_TRANSFER_TO_BUFFER_FLAGS_MASK (1 << 0)
  648. typedef uint32 SVGA3dTransferToBufferFlags;
  649. #pragma pack(push, 1)
  650. typedef struct SVGA3dCmdDXTransferToBuffer {
  651. SVGA3dSurfaceId srcSid;
  652. uint32 srcSubResource;
  653. SVGA3dBox srcBox;
  654. SVGA3dSurfaceId destSid;
  655. uint32 destOffset;
  656. uint32 destPitch;
  657. uint32 destSlicePitch;
  658. SVGA3dTransferToBufferFlags flags;
  659. } SVGA3dCmdDXTransferToBuffer;
  660. #pragma pack(pop)
  661. #pragma pack(push, 1)
  662. typedef struct SVGA3dCmdDXPredTransferFromBuffer {
  663. SVGA3dSurfaceId srcSid;
  664. uint32 srcOffset;
  665. uint32 srcPitch;
  666. uint32 srcSlicePitch;
  667. SVGA3dSurfaceId destSid;
  668. uint32 destSubResource;
  669. SVGA3dBox destBox;
  670. } SVGA3dCmdDXPredTransferFromBuffer;
  671. #pragma pack(pop)
  672. #pragma pack(push, 1)
  673. typedef struct SVGA3dCmdDXSurfaceCopyAndReadback {
  674. SVGA3dSurfaceId srcSid;
  675. SVGA3dSurfaceId destSid;
  676. SVGA3dCopyBox box;
  677. } SVGA3dCmdDXSurfaceCopyAndReadback;
  678. #pragma pack(pop)
  679. typedef uint32 SVGADXHintId;
  680. #define SVGA_DX_HINT_NONE 0
  681. #define SVGA_DX_HINT_PREFETCH_OBJECT 1
  682. #define SVGA_DX_HINT_PREEVICT_OBJECT 2
  683. #define SVGA_DX_HINT_PREFETCH_COBJECT 3
  684. #define SVGA_DX_HINT_PREEVICT_COBJECT 4
  685. #define SVGA_DX_HINT_MAX 5
  686. #pragma pack(push, 1)
  687. typedef struct SVGAObjectRef {
  688. SVGAOTableType type;
  689. uint32 id;
  690. } SVGAObjectRef;
  691. #pragma pack(pop)
  692. #pragma pack(push, 1)
  693. typedef struct SVGACObjectRef {
  694. SVGACOTableType type;
  695. uint32 cid;
  696. uint32 id;
  697. } SVGACObjectRef;
  698. #pragma pack(pop)
  699. #pragma pack(push, 1)
  700. typedef struct SVGA3dCmdDXHint {
  701. SVGADXHintId hintId;
  702. } SVGA3dCmdDXHint;
  703. #pragma pack(pop)
  704. #pragma pack(push, 1)
  705. typedef struct SVGA3dCmdDXBufferUpdate {
  706. SVGA3dSurfaceId sid;
  707. uint32 x;
  708. uint32 width;
  709. } SVGA3dCmdDXBufferUpdate;
  710. #pragma pack(pop)
  711. #pragma pack(push, 1)
  712. typedef struct SVGA3dCmdDXSetConstantBufferOffset {
  713. uint32 slot;
  714. uint32 offsetInBytes;
  715. } SVGA3dCmdDXSetConstantBufferOffset;
  716. #pragma pack(pop)
  717. typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetVSConstantBufferOffset;
  718. typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetPSConstantBufferOffset;
  719. typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetGSConstantBufferOffset;
  720. typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetHSConstantBufferOffset;
  721. typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetDSConstantBufferOffset;
  722. typedef SVGA3dCmdDXSetConstantBufferOffset SVGA3dCmdDXSetCSConstantBufferOffset;
  723. #define SVGA3D_BUFFEREX_SRV_RAW (1 << 0)
  724. #define SVGA3D_BUFFEREX_SRV_FLAGS_MAX (1 << 1)
  725. #define SVGA3D_BUFFEREX_SRV_FLAGS_MASK (SVGA3D_BUFFEREX_SRV_FLAGS_MAX - 1)
  726. typedef uint32 SVGA3dBufferExFlags;
  727. #pragma pack(push, 1)
  728. typedef struct {
  729. union {
  730. struct {
  731. uint32 firstElement;
  732. uint32 numElements;
  733. uint32 pad0;
  734. uint32 pad1;
  735. } buffer;
  736. struct {
  737. uint32 mostDetailedMip;
  738. uint32 firstArraySlice;
  739. uint32 mipLevels;
  740. uint32 arraySize;
  741. } tex;
  742. struct {
  743. uint32 firstElement;
  744. uint32 numElements;
  745. SVGA3dBufferExFlags flags;
  746. uint32 pad0;
  747. } bufferex;
  748. };
  749. } SVGA3dShaderResourceViewDesc;
  750. #pragma pack(pop)
  751. #pragma pack(push, 1)
  752. typedef struct {
  753. SVGA3dSurfaceId sid;
  754. SVGA3dSurfaceFormat format;
  755. SVGA3dResourceType resourceDimension;
  756. SVGA3dShaderResourceViewDesc desc;
  757. uint32 pad;
  758. } SVGACOTableDXSRViewEntry;
  759. #pragma pack(pop)
  760. #pragma pack(push, 1)
  761. typedef struct SVGA3dCmdDXDefineShaderResourceView {
  762. SVGA3dShaderResourceViewId shaderResourceViewId;
  763. SVGA3dSurfaceId sid;
  764. SVGA3dSurfaceFormat format;
  765. SVGA3dResourceType resourceDimension;
  766. SVGA3dShaderResourceViewDesc desc;
  767. } SVGA3dCmdDXDefineShaderResourceView;
  768. #pragma pack(pop)
  769. #pragma pack(push, 1)
  770. typedef struct SVGA3dCmdDXDestroyShaderResourceView {
  771. SVGA3dShaderResourceViewId shaderResourceViewId;
  772. } SVGA3dCmdDXDestroyShaderResourceView;
  773. #pragma pack(pop)
  774. #pragma pack(push, 1)
  775. typedef struct SVGA3dRenderTargetViewDesc {
  776. union {
  777. struct {
  778. uint32 firstElement;
  779. uint32 numElements;
  780. uint32 padding0;
  781. } buffer;
  782. struct {
  783. uint32 mipSlice;
  784. uint32 firstArraySlice;
  785. uint32 arraySize;
  786. } tex;
  787. struct {
  788. uint32 mipSlice;
  789. uint32 firstW;
  790. uint32 wSize;
  791. } tex3D;
  792. };
  793. } SVGA3dRenderTargetViewDesc;
  794. #pragma pack(pop)
  795. #pragma pack(push, 1)
  796. typedef struct {
  797. SVGA3dSurfaceId sid;
  798. SVGA3dSurfaceFormat format;
  799. SVGA3dResourceType resourceDimension;
  800. SVGA3dRenderTargetViewDesc desc;
  801. uint32 pad[2];
  802. } SVGACOTableDXRTViewEntry;
  803. #pragma pack(pop)
  804. #pragma pack(push, 1)
  805. typedef struct SVGA3dCmdDXDefineRenderTargetView {
  806. SVGA3dRenderTargetViewId renderTargetViewId;
  807. SVGA3dSurfaceId sid;
  808. SVGA3dSurfaceFormat format;
  809. SVGA3dResourceType resourceDimension;
  810. SVGA3dRenderTargetViewDesc desc;
  811. } SVGA3dCmdDXDefineRenderTargetView;
  812. #pragma pack(pop)
  813. #pragma pack(push, 1)
  814. typedef struct SVGA3dCmdDXDestroyRenderTargetView {
  815. SVGA3dRenderTargetViewId renderTargetViewId;
  816. } SVGA3dCmdDXDestroyRenderTargetView;
  817. #pragma pack(pop)
  818. #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_DEPTH 0x01
  819. #define SVGA3D_DXDSVIEW_CREATE_READ_ONLY_STENCIL 0x02
  820. #define SVGA3D_DXDSVIEW_CREATE_FLAG_MASK 0x03
  821. typedef uint8 SVGA3DCreateDSViewFlags;
  822. #pragma pack(push, 1)
  823. typedef struct {
  824. SVGA3dSurfaceId sid;
  825. SVGA3dSurfaceFormat format;
  826. SVGA3dResourceType resourceDimension;
  827. uint32 mipSlice;
  828. uint32 firstArraySlice;
  829. uint32 arraySize;
  830. SVGA3DCreateDSViewFlags flags;
  831. uint8 pad0;
  832. uint16 pad1;
  833. uint32 pad2;
  834. } SVGACOTableDXDSViewEntry;
  835. #pragma pack(pop)
  836. #pragma pack(push, 1)
  837. typedef struct SVGA3dCmdDXDefineDepthStencilView {
  838. SVGA3dDepthStencilViewId depthStencilViewId;
  839. SVGA3dSurfaceId sid;
  840. SVGA3dSurfaceFormat format;
  841. SVGA3dResourceType resourceDimension;
  842. uint32 mipSlice;
  843. uint32 firstArraySlice;
  844. uint32 arraySize;
  845. SVGA3DCreateDSViewFlags flags;
  846. uint8 pad0;
  847. uint16 pad1;
  848. } SVGA3dCmdDXDefineDepthStencilView;
  849. #pragma pack(pop)
  850. #pragma pack(push, 1)
  851. typedef struct SVGA3dCmdDXDefineDepthStencilView_v2 {
  852. SVGA3dDepthStencilViewId depthStencilViewId;
  853. SVGA3dSurfaceId sid;
  854. SVGA3dSurfaceFormat format;
  855. SVGA3dResourceType resourceDimension;
  856. uint32 mipSlice;
  857. uint32 firstArraySlice;
  858. uint32 arraySize;
  859. SVGA3DCreateDSViewFlags flags;
  860. uint8 pad0;
  861. uint16 pad1;
  862. } SVGA3dCmdDXDefineDepthStencilView_v2;
  863. #pragma pack(pop)
  864. #pragma pack(push, 1)
  865. typedef struct SVGA3dCmdDXDestroyDepthStencilView {
  866. SVGA3dDepthStencilViewId depthStencilViewId;
  867. } SVGA3dCmdDXDestroyDepthStencilView;
  868. #pragma pack(pop)
  869. #define SVGA3D_UABUFFER_RAW (1 << 0)
  870. #define SVGA3D_UABUFFER_APPEND (1 << 1)
  871. #define SVGA3D_UABUFFER_COUNTER (1 << 2)
  872. typedef uint32 SVGA3dUABufferFlags;
  873. #pragma pack(push, 1)
  874. typedef struct {
  875. union {
  876. struct {
  877. uint32 firstElement;
  878. uint32 numElements;
  879. SVGA3dUABufferFlags flags;
  880. uint32 padding0;
  881. uint32 padding1;
  882. } buffer;
  883. struct {
  884. uint32 mipSlice;
  885. uint32 firstArraySlice;
  886. uint32 arraySize;
  887. uint32 padding0;
  888. uint32 padding1;
  889. } tex;
  890. struct {
  891. uint32 mipSlice;
  892. uint32 firstW;
  893. uint32 wSize;
  894. uint32 padding0;
  895. uint32 padding1;
  896. } tex3D;
  897. };
  898. } SVGA3dUAViewDesc;
  899. #pragma pack(pop)
  900. #pragma pack(push, 1)
  901. typedef struct {
  902. SVGA3dSurfaceId sid;
  903. SVGA3dSurfaceFormat format;
  904. SVGA3dResourceType resourceDimension;
  905. SVGA3dUAViewDesc desc;
  906. uint32 structureCount;
  907. uint32 pad[7];
  908. } SVGACOTableDXUAViewEntry;
  909. #pragma pack(pop)
  910. #pragma pack(push, 1)
  911. typedef struct SVGA3dCmdDXDefineUAView {
  912. SVGA3dUAViewId uaViewId;
  913. SVGA3dSurfaceId sid;
  914. SVGA3dSurfaceFormat format;
  915. SVGA3dResourceType resourceDimension;
  916. SVGA3dUAViewDesc desc;
  917. } SVGA3dCmdDXDefineUAView;
  918. #pragma pack(pop)
  919. #pragma pack(push, 1)
  920. typedef struct SVGA3dCmdDXDestroyUAView {
  921. SVGA3dUAViewId uaViewId;
  922. } SVGA3dCmdDXDestroyUAView;
  923. #pragma pack(pop)
  924. #pragma pack(push, 1)
  925. typedef struct SVGA3dCmdDXClearUAViewUint {
  926. SVGA3dUAViewId uaViewId;
  927. SVGA3dRGBAUint32 value;
  928. } SVGA3dCmdDXClearUAViewUint;
  929. #pragma pack(pop)
  930. #pragma pack(push, 1)
  931. typedef struct SVGA3dCmdDXClearUAViewFloat {
  932. SVGA3dUAViewId uaViewId;
  933. SVGA3dRGBAFloat value;
  934. } SVGA3dCmdDXClearUAViewFloat;
  935. #pragma pack(pop)
  936. #pragma pack(push, 1)
  937. typedef struct SVGA3dCmdDXCopyStructureCount {
  938. SVGA3dUAViewId srcUAViewId;
  939. SVGA3dSurfaceId destSid;
  940. uint32 destByteOffset;
  941. } SVGA3dCmdDXCopyStructureCount;
  942. #pragma pack(pop)
  943. #pragma pack(push, 1)
  944. typedef struct SVGA3dCmdDXSetStructureCount {
  945. SVGA3dUAViewId uaViewId;
  946. uint32 structureCount;
  947. } SVGA3dCmdDXSetStructureCount;
  948. #pragma pack(pop)
  949. #pragma pack(push, 1)
  950. typedef struct SVGA3dCmdDXSetUAViews {
  951. uint32 uavSpliceIndex;
  952. } SVGA3dCmdDXSetUAViews;
  953. #pragma pack(pop)
  954. #pragma pack(push, 1)
  955. typedef struct SVGA3dCmdDXSetCSUAViews {
  956. uint32 startIndex;
  957. } SVGA3dCmdDXSetCSUAViews;
  958. #pragma pack(pop)
  959. #pragma pack(push, 1)
  960. typedef struct SVGA3dInputElementDesc {
  961. uint32 inputSlot;
  962. uint32 alignedByteOffset;
  963. SVGA3dSurfaceFormat format;
  964. SVGA3dInputClassification inputSlotClass;
  965. uint32 instanceDataStepRate;
  966. uint32 inputRegister;
  967. } SVGA3dInputElementDesc;
  968. #pragma pack(pop)
  969. #pragma pack(push, 1)
  970. typedef struct {
  971. uint32 elid;
  972. uint32 numDescs;
  973. SVGA3dInputElementDesc descs[32];
  974. uint32 pad[62];
  975. } SVGACOTableDXElementLayoutEntry;
  976. #pragma pack(pop)
  977. #pragma pack(push, 1)
  978. typedef struct SVGA3dCmdDXDefineElementLayout {
  979. SVGA3dElementLayoutId elementLayoutId;
  980. } SVGA3dCmdDXDefineElementLayout;
  981. #pragma pack(pop)
  982. #pragma pack(push, 1)
  983. typedef struct SVGA3dCmdDXDestroyElementLayout {
  984. SVGA3dElementLayoutId elementLayoutId;
  985. } SVGA3dCmdDXDestroyElementLayout;
  986. #pragma pack(pop)
  987. #define SVGA3D_DX_MAX_RENDER_TARGETS 8
  988. #pragma pack(push, 1)
  989. typedef struct SVGA3dDXBlendStatePerRT {
  990. uint8 blendEnable;
  991. uint8 srcBlend;
  992. uint8 destBlend;
  993. uint8 blendOp;
  994. uint8 srcBlendAlpha;
  995. uint8 destBlendAlpha;
  996. uint8 blendOpAlpha;
  997. SVGA3dColorWriteEnable renderTargetWriteMask;
  998. uint8 logicOpEnable;
  999. uint8 logicOp;
  1000. uint16 pad0;
  1001. } SVGA3dDXBlendStatePerRT;
  1002. #pragma pack(pop)
  1003. #pragma pack(push, 1)
  1004. typedef struct {
  1005. uint8 alphaToCoverageEnable;
  1006. uint8 independentBlendEnable;
  1007. uint16 pad0;
  1008. SVGA3dDXBlendStatePerRT perRT[SVGA3D_DX_MAX_RENDER_TARGETS];
  1009. uint32 pad1[7];
  1010. } SVGACOTableDXBlendStateEntry;
  1011. #pragma pack(pop)
  1012. #pragma pack(push, 1)
  1013. typedef struct SVGA3dCmdDXDefineBlendState {
  1014. SVGA3dBlendStateId blendId;
  1015. uint8 alphaToCoverageEnable;
  1016. uint8 independentBlendEnable;
  1017. uint16 pad0;
  1018. SVGA3dDXBlendStatePerRT perRT[SVGA3D_DX_MAX_RENDER_TARGETS];
  1019. } SVGA3dCmdDXDefineBlendState;
  1020. #pragma pack(pop)
  1021. #pragma pack(push, 1)
  1022. typedef struct SVGA3dCmdDXDestroyBlendState {
  1023. SVGA3dBlendStateId blendId;
  1024. } SVGA3dCmdDXDestroyBlendState;
  1025. #pragma pack(pop)
  1026. #pragma pack(push, 1)
  1027. typedef struct {
  1028. uint8 depthEnable;
  1029. SVGA3dDepthWriteMask depthWriteMask;
  1030. SVGA3dComparisonFunc depthFunc;
  1031. uint8 stencilEnable;
  1032. uint8 frontEnable;
  1033. uint8 backEnable;
  1034. uint8 stencilReadMask;
  1035. uint8 stencilWriteMask;
  1036. uint8 frontStencilFailOp;
  1037. uint8 frontStencilDepthFailOp;
  1038. uint8 frontStencilPassOp;
  1039. SVGA3dComparisonFunc frontStencilFunc;
  1040. uint8 backStencilFailOp;
  1041. uint8 backStencilDepthFailOp;
  1042. uint8 backStencilPassOp;
  1043. SVGA3dComparisonFunc backStencilFunc;
  1044. } SVGACOTableDXDepthStencilEntry;
  1045. #pragma pack(pop)
  1046. #pragma pack(push, 1)
  1047. typedef struct SVGA3dCmdDXDefineDepthStencilState {
  1048. SVGA3dDepthStencilStateId depthStencilId;
  1049. uint8 depthEnable;
  1050. SVGA3dDepthWriteMask depthWriteMask;
  1051. SVGA3dComparisonFunc depthFunc;
  1052. uint8 stencilEnable;
  1053. uint8 frontEnable;
  1054. uint8 backEnable;
  1055. uint8 stencilReadMask;
  1056. uint8 stencilWriteMask;
  1057. uint8 frontStencilFailOp;
  1058. uint8 frontStencilDepthFailOp;
  1059. uint8 frontStencilPassOp;
  1060. SVGA3dComparisonFunc frontStencilFunc;
  1061. uint8 backStencilFailOp;
  1062. uint8 backStencilDepthFailOp;
  1063. uint8 backStencilPassOp;
  1064. SVGA3dComparisonFunc backStencilFunc;
  1065. } SVGA3dCmdDXDefineDepthStencilState;
  1066. #pragma pack(pop)
  1067. #pragma pack(push, 1)
  1068. typedef struct SVGA3dCmdDXDestroyDepthStencilState {
  1069. SVGA3dDepthStencilStateId depthStencilId;
  1070. } SVGA3dCmdDXDestroyDepthStencilState;
  1071. #pragma pack(pop)
  1072. #pragma pack(push, 1)
  1073. typedef struct {
  1074. uint8 fillMode;
  1075. SVGA3dCullMode cullMode;
  1076. uint8 frontCounterClockwise;
  1077. uint8 provokingVertexLast;
  1078. int32 depthBias;
  1079. float depthBiasClamp;
  1080. float slopeScaledDepthBias;
  1081. uint8 depthClipEnable;
  1082. uint8 scissorEnable;
  1083. SVGA3dMultisampleRastEnable multisampleEnable;
  1084. uint8 antialiasedLineEnable;
  1085. float lineWidth;
  1086. uint8 lineStippleEnable;
  1087. uint8 lineStippleFactor;
  1088. uint16 lineStipplePattern;
  1089. uint8 forcedSampleCount;
  1090. uint8 mustBeZero[3];
  1091. } SVGACOTableDXRasterizerStateEntry;
  1092. #pragma pack(pop)
  1093. #pragma pack(push, 1)
  1094. typedef struct SVGA3dCmdDXDefineRasterizerState {
  1095. SVGA3dRasterizerStateId rasterizerId;
  1096. uint8 fillMode;
  1097. SVGA3dCullMode cullMode;
  1098. uint8 frontCounterClockwise;
  1099. uint8 provokingVertexLast;
  1100. int32 depthBias;
  1101. float depthBiasClamp;
  1102. float slopeScaledDepthBias;
  1103. uint8 depthClipEnable;
  1104. uint8 scissorEnable;
  1105. SVGA3dMultisampleRastEnable multisampleEnable;
  1106. uint8 antialiasedLineEnable;
  1107. float lineWidth;
  1108. uint8 lineStippleEnable;
  1109. uint8 lineStippleFactor;
  1110. uint16 lineStipplePattern;
  1111. } SVGA3dCmdDXDefineRasterizerState;
  1112. #pragma pack(pop)
  1113. #pragma pack(push, 1)
  1114. typedef struct SVGA3dCmdDXDefineRasterizerState_v2 {
  1115. SVGA3dRasterizerStateId rasterizerId;
  1116. uint8 fillMode;
  1117. SVGA3dCullMode cullMode;
  1118. uint8 frontCounterClockwise;
  1119. uint8 provokingVertexLast;
  1120. int32 depthBias;
  1121. float depthBiasClamp;
  1122. float slopeScaledDepthBias;
  1123. uint8 depthClipEnable;
  1124. uint8 scissorEnable;
  1125. SVGA3dMultisampleRastEnable multisampleEnable;
  1126. uint8 antialiasedLineEnable;
  1127. float lineWidth;
  1128. uint8 lineStippleEnable;
  1129. uint8 lineStippleFactor;
  1130. uint16 lineStipplePattern;
  1131. uint32 forcedSampleCount;
  1132. } SVGA3dCmdDXDefineRasterizerState_v2;
  1133. #pragma pack(pop)
  1134. #pragma pack(push, 1)
  1135. typedef struct SVGA3dCmdDXDestroyRasterizerState {
  1136. SVGA3dRasterizerStateId rasterizerId;
  1137. } SVGA3dCmdDXDestroyRasterizerState;
  1138. #pragma pack(pop)
  1139. #pragma pack(push, 1)
  1140. typedef struct {
  1141. SVGA3dFilter filter;
  1142. uint8 addressU;
  1143. uint8 addressV;
  1144. uint8 addressW;
  1145. uint8 pad0;
  1146. float mipLODBias;
  1147. uint8 maxAnisotropy;
  1148. SVGA3dComparisonFunc comparisonFunc;
  1149. uint16 pad1;
  1150. SVGA3dRGBAFloat borderColor;
  1151. float minLOD;
  1152. float maxLOD;
  1153. uint32 pad2[6];
  1154. } SVGACOTableDXSamplerEntry;
  1155. #pragma pack(pop)
  1156. #pragma pack(push, 1)
  1157. typedef struct SVGA3dCmdDXDefineSamplerState {
  1158. SVGA3dSamplerId samplerId;
  1159. SVGA3dFilter filter;
  1160. uint8 addressU;
  1161. uint8 addressV;
  1162. uint8 addressW;
  1163. uint8 pad0;
  1164. float mipLODBias;
  1165. uint8 maxAnisotropy;
  1166. SVGA3dComparisonFunc comparisonFunc;
  1167. uint16 pad1;
  1168. SVGA3dRGBAFloat borderColor;
  1169. float minLOD;
  1170. float maxLOD;
  1171. } SVGA3dCmdDXDefineSamplerState;
  1172. #pragma pack(pop)
  1173. #pragma pack(push, 1)
  1174. typedef struct SVGA3dCmdDXDestroySamplerState {
  1175. SVGA3dSamplerId samplerId;
  1176. } SVGA3dCmdDXDestroySamplerState;
  1177. #pragma pack(pop)
  1178. #define SVGADX_SIGNATURE_SEMANTIC_NAME_UNDEFINED 0
  1179. #define SVGADX_SIGNATURE_SEMANTIC_NAME_POSITION 1
  1180. #define SVGADX_SIGNATURE_SEMANTIC_NAME_CLIP_DISTANCE 2
  1181. #define SVGADX_SIGNATURE_SEMANTIC_NAME_CULL_DISTANCE 3
  1182. #define SVGADX_SIGNATURE_SEMANTIC_NAME_RENDER_TARGET_ARRAY_INDEX 4
  1183. #define SVGADX_SIGNATURE_SEMANTIC_NAME_VIEWPORT_ARRAY_INDEX 5
  1184. #define SVGADX_SIGNATURE_SEMANTIC_NAME_VERTEX_ID 6
  1185. #define SVGADX_SIGNATURE_SEMANTIC_NAME_PRIMITIVE_ID 7
  1186. #define SVGADX_SIGNATURE_SEMANTIC_NAME_INSTANCE_ID 8
  1187. #define SVGADX_SIGNATURE_SEMANTIC_NAME_IS_FRONT_FACE 9
  1188. #define SVGADX_SIGNATURE_SEMANTIC_NAME_SAMPLE_INDEX 10
  1189. #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_EQ_0_EDGE_TESSFACTOR 11
  1190. #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_EQ_0_EDGE_TESSFACTOR 12
  1191. #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_EQ_1_EDGE_TESSFACTOR 13
  1192. #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_EQ_1_EDGE_TESSFACTOR 14
  1193. #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_U_INSIDE_TESSFACTOR 15
  1194. #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_QUAD_V_INSIDE_TESSFACTOR 16
  1195. #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_U_EQ_0_EDGE_TESSFACTOR 17
  1196. #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_V_EQ_0_EDGE_TESSFACTOR 18
  1197. #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_W_EQ_0_EDGE_TESSFACTOR 19
  1198. #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_TRI_INSIDE_TESSFACTOR 20
  1199. #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_LINE_DETAIL_TESSFACTOR 21
  1200. #define SVGADX_SIGNATURE_SEMANTIC_NAME_FINAL_LINE_DENSITY_TESSFACTOR 22
  1201. #define SVGADX_SIGNATURE_SEMANTIC_NAME_MAX 23
  1202. typedef uint32 SVGA3dDXSignatureSemanticName;
  1203. #define SVGADX_SIGNATURE_REGISTER_COMPONENT_UNKNOWN 0
  1204. typedef uint32 SVGA3dDXSignatureRegisterComponentType;
  1205. #define SVGADX_SIGNATURE_MIN_PRECISION_DEFAULT 0
  1206. typedef uint32 SVGA3dDXSignatureMinPrecision;
  1207. #pragma pack(push, 1)
  1208. typedef struct SVGA3dDXSignatureEntry {
  1209. uint32 registerIndex;
  1210. SVGA3dDXSignatureSemanticName semanticName;
  1211. uint32 mask;
  1212. SVGA3dDXSignatureRegisterComponentType componentType;
  1213. SVGA3dDXSignatureMinPrecision minPrecision;
  1214. } SVGA3dDXShaderSignatureEntry;
  1215. #pragma pack(pop)
  1216. #define SVGADX_SIGNATURE_HEADER_VERSION_0 0x08a92d12
  1217. #pragma pack(push, 1)
  1218. typedef struct SVGA3dDXSignatureHeader {
  1219. uint32 headerVersion;
  1220. uint32 numInputSignatures;
  1221. uint32 numOutputSignatures;
  1222. uint32 numPatchConstantSignatures;
  1223. } SVGA3dDXShaderSignatureHeader;
  1224. #pragma pack(pop)
  1225. #pragma pack(push, 1)
  1226. typedef struct SVGA3dCmdDXDefineShader {
  1227. SVGA3dShaderId shaderId;
  1228. SVGA3dShaderType type;
  1229. uint32 sizeInBytes;
  1230. } SVGA3dCmdDXDefineShader;
  1231. #pragma pack(pop)
  1232. #pragma pack(push, 1)
  1233. typedef struct SVGACOTableDXShaderEntry {
  1234. SVGA3dShaderType type;
  1235. uint32 sizeInBytes;
  1236. uint32 offsetInBytes;
  1237. SVGAMobId mobid;
  1238. uint32 pad[4];
  1239. } SVGACOTableDXShaderEntry;
  1240. #pragma pack(pop)
  1241. #pragma pack(push, 1)
  1242. typedef struct SVGA3dCmdDXDestroyShader {
  1243. SVGA3dShaderId shaderId;
  1244. } SVGA3dCmdDXDestroyShader;
  1245. #pragma pack(pop)
  1246. #pragma pack(push, 1)
  1247. typedef struct SVGA3dCmdDXBindShader {
  1248. uint32 cid;
  1249. uint32 shid;
  1250. SVGAMobId mobid;
  1251. uint32 offsetInBytes;
  1252. } SVGA3dCmdDXBindShader;
  1253. #pragma pack(pop)
  1254. #pragma pack(push, 1)
  1255. typedef struct SVGA3dCmdDXBindAllShader {
  1256. uint32 cid;
  1257. SVGAMobId mobid;
  1258. } SVGA3dCmdDXBindAllShader;
  1259. #pragma pack(pop)
  1260. #pragma pack(push, 1)
  1261. typedef struct SVGA3dCmdDXCondBindAllShader {
  1262. uint32 cid;
  1263. SVGAMobId testMobid;
  1264. SVGAMobId mobid;
  1265. } SVGA3dCmdDXCondBindAllShader;
  1266. #pragma pack(pop)
  1267. #define SVGA3D_MAX_DX10_STREAMOUT_DECLS 64
  1268. #define SVGA3D_MAX_STREAMOUT_DECLS 512
  1269. #pragma pack(push, 1)
  1270. typedef struct SVGA3dStreamOutputDeclarationEntry {
  1271. uint32 outputSlot;
  1272. uint32 registerIndex;
  1273. uint8 registerMask;
  1274. uint8 pad0;
  1275. uint16 pad1;
  1276. uint32 stream;
  1277. } SVGA3dStreamOutputDeclarationEntry;
  1278. #pragma pack(pop)
  1279. #pragma pack(push, 1)
  1280. typedef struct SVGAOTableStreamOutputEntry {
  1281. uint32 numOutputStreamEntries;
  1282. SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_DX10_STREAMOUT_DECLS];
  1283. uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
  1284. uint32 rasterizedStream;
  1285. uint32 numOutputStreamStrides;
  1286. uint32 mobid;
  1287. uint32 offsetInBytes;
  1288. uint8 usesMob;
  1289. uint8 pad0;
  1290. uint16 pad1;
  1291. uint32 pad2[246];
  1292. } SVGACOTableDXStreamOutputEntry;
  1293. #pragma pack(pop)
  1294. #pragma pack(push, 1)
  1295. typedef struct SVGA3dCmdDXDefineStreamOutput {
  1296. SVGA3dStreamOutputId soid;
  1297. uint32 numOutputStreamEntries;
  1298. SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_DX10_STREAMOUT_DECLS];
  1299. uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
  1300. uint32 rasterizedStream;
  1301. } SVGA3dCmdDXDefineStreamOutput;
  1302. #pragma pack(pop)
  1303. #define SVGA3D_DX_SO_NO_RASTERIZED_STREAM 0xFFFFFFFF
  1304. #pragma pack(push, 1)
  1305. typedef struct SVGA3dCmdDXDefineStreamOutputWithMob {
  1306. SVGA3dStreamOutputId soid;
  1307. uint32 numOutputStreamEntries;
  1308. uint32 numOutputStreamStrides;
  1309. uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS];
  1310. uint32 rasterizedStream;
  1311. } SVGA3dCmdDXDefineStreamOutputWithMob;
  1312. #pragma pack(pop)
  1313. #pragma pack(push, 1)
  1314. typedef struct SVGA3dCmdDXBindStreamOutput {
  1315. SVGA3dStreamOutputId soid;
  1316. uint32 mobid;
  1317. uint32 offsetInBytes;
  1318. uint32 sizeInBytes;
  1319. } SVGA3dCmdDXBindStreamOutput;
  1320. #pragma pack(pop)
  1321. #pragma pack(push, 1)
  1322. typedef struct SVGA3dCmdDXDestroyStreamOutput {
  1323. SVGA3dStreamOutputId soid;
  1324. } SVGA3dCmdDXDestroyStreamOutput;
  1325. #pragma pack(pop)
  1326. #pragma pack(push, 1)
  1327. typedef struct SVGA3dCmdDXSetStreamOutput {
  1328. SVGA3dStreamOutputId soid;
  1329. } SVGA3dCmdDXSetStreamOutput;
  1330. #pragma pack(pop)
  1331. #pragma pack(push, 1)
  1332. typedef struct SVGA3dCmdDXSetMinLOD {
  1333. SVGA3dSurfaceId sid;
  1334. float minLOD;
  1335. } SVGA3dCmdDXSetMinLOD;
  1336. #pragma pack(pop)
  1337. #pragma pack(push, 1)
  1338. typedef struct {
  1339. uint64 value;
  1340. uint32 mobId;
  1341. uint32 mobOffset;
  1342. } SVGA3dCmdDXMobFence64;
  1343. #pragma pack(pop)
  1344. #pragma pack(push, 1)
  1345. typedef struct SVGA3dCmdDXSetCOTable {
  1346. uint32 cid;
  1347. uint32 mobid;
  1348. SVGACOTableType type;
  1349. uint32 validSizeInBytes;
  1350. } SVGA3dCmdDXSetCOTable;
  1351. #pragma pack(pop)
  1352. #pragma pack(push, 1)
  1353. typedef struct SVGA3dCmdDXGrowCOTable {
  1354. uint32 cid;
  1355. uint32 mobid;
  1356. SVGACOTableType type;
  1357. uint32 validSizeInBytes;
  1358. } SVGA3dCmdDXGrowCOTable;
  1359. #pragma pack(pop)
  1360. #pragma pack(push, 1)
  1361. typedef struct SVGA3dCmdDXReadbackCOTable {
  1362. uint32 cid;
  1363. SVGACOTableType type;
  1364. } SVGA3dCmdDXReadbackCOTable;
  1365. #pragma pack(pop)
  1366. #pragma pack(push, 1)
  1367. typedef struct SVGA3dCmdDXCopyCOTableIntoMob {
  1368. uint32 cid;
  1369. SVGACOTableType type;
  1370. uint32 mobid;
  1371. } SVGA3dCmdDXCopyCOTableIntoMob;
  1372. #pragma pack(pop)
  1373. #pragma pack(push, 1)
  1374. typedef struct SVGA3dCmdDXPredStagingCopy {
  1375. SVGA3dSurfaceId dstSid;
  1376. SVGA3dSurfaceId srcSid;
  1377. uint8 readback;
  1378. uint8 unsynchronized;
  1379. uint8 mustBeZero[2];
  1380. } SVGA3dCmdDXPredStagingCopy;
  1381. #pragma pack(pop)
  1382. #pragma pack(push, 1)
  1383. typedef struct SVGA3dCmdDXStagingCopy {
  1384. SVGA3dSurfaceId dstSid;
  1385. SVGA3dSurfaceId srcSid;
  1386. uint8 readback;
  1387. uint8 unsynchronized;
  1388. uint8 mustBeZero[2];
  1389. } SVGA3dCmdDXStagingCopy;
  1390. #pragma pack(pop)
  1391. #pragma pack(push, 1)
  1392. typedef struct SVGA3dCOTableData {
  1393. uint32 mobid;
  1394. } SVGA3dCOTableData;
  1395. #pragma pack(pop)
  1396. #pragma pack(push, 1)
  1397. typedef struct SVGA3dBufferBinding {
  1398. uint32 bufferId;
  1399. uint32 stride;
  1400. uint32 offset;
  1401. } SVGA3dBufferBinding;
  1402. #pragma pack(pop)
  1403. #pragma pack(push, 1)
  1404. typedef struct SVGA3dConstantBufferBinding {
  1405. uint32 sid;
  1406. uint32 offsetInBytes;
  1407. uint32 sizeInBytes;
  1408. } SVGA3dConstantBufferBinding;
  1409. #pragma pack(pop)
  1410. #pragma pack(push, 1)
  1411. typedef struct SVGADXInputAssemblyMobFormat {
  1412. uint32 layoutId;
  1413. SVGA3dBufferBinding vertexBuffers[SVGA3D_DX_MAX_VERTEXBUFFERS];
  1414. uint32 indexBufferSid;
  1415. uint32 pad;
  1416. uint32 indexBufferOffset;
  1417. uint32 indexBufferFormat;
  1418. uint32 topology;
  1419. } SVGADXInputAssemblyMobFormat;
  1420. #pragma pack(pop)
  1421. #pragma pack(push, 1)
  1422. typedef struct SVGADXContextMobFormat {
  1423. SVGADXInputAssemblyMobFormat inputAssembly;
  1424. struct {
  1425. uint32 blendStateId;
  1426. uint32 blendFactor[4];
  1427. uint32 sampleMask;
  1428. uint32 depthStencilStateId;
  1429. uint32 stencilRef;
  1430. uint32 rasterizerStateId;
  1431. uint32 depthStencilViewId;
  1432. uint32 renderTargetViewIds[SVGA3D_DX_MAX_RENDER_TARGETS];
  1433. } renderState;
  1434. uint32 pad0[8];
  1435. struct {
  1436. uint32 targets[SVGA3D_DX_MAX_SOTARGETS];
  1437. uint32 soid;
  1438. } streamOut;
  1439. uint32 pad1[10];
  1440. uint32 uavSpliceIndex;
  1441. uint8 numViewports;
  1442. uint8 numScissorRects;
  1443. uint16 pad2[1];
  1444. uint32 pad3[3];
  1445. SVGA3dViewport viewports[SVGA3D_DX_MAX_VIEWPORTS];
  1446. uint32 pad4[32];
  1447. SVGASignedRect scissorRects[SVGA3D_DX_MAX_SCISSORRECTS];
  1448. uint32 pad5[64];
  1449. struct {
  1450. uint32 queryID;
  1451. uint32 value;
  1452. } predication;
  1453. SVGAMobId shaderIfaceMobid;
  1454. uint32 shaderIfaceOffset;
  1455. struct {
  1456. uint32 shaderId;
  1457. SVGA3dConstantBufferBinding
  1458. constantBuffers[SVGA3D_DX_MAX_CONSTBUFFERS];
  1459. uint32 shaderResources[SVGA3D_DX_MAX_SRVIEWS];
  1460. uint32 samplers[SVGA3D_DX_MAX_SAMPLERS];
  1461. } shaderState[SVGA3D_NUM_SHADERTYPE];
  1462. uint32 pad6[26];
  1463. SVGA3dQueryId queryID[SVGA3D_MAX_QUERY];
  1464. SVGA3dCOTableData cotables[SVGA_COTABLE_MAX];
  1465. uint32 pad7[64];
  1466. uint32 uaViewIds[SVGA3D_DX11_1_MAX_UAVIEWS];
  1467. uint32 csuaViewIds[SVGA3D_DX11_1_MAX_UAVIEWS];
  1468. uint32 pad8[188];
  1469. } SVGADXContextMobFormat;
  1470. #pragma pack(pop)
  1471. #define SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED 256
  1472. #pragma pack(push, 1)
  1473. typedef struct SVGADXShaderIfaceMobFormat {
  1474. struct {
  1475. uint32 numClassInstances;
  1476. uint32 iface[SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED];
  1477. SVGA3dIfaceData data[SVGA3D_DX_MAX_CLASS_INSTANCES_PADDED];
  1478. } shaderIfaceState[SVGA3D_NUM_SHADERTYPE];
  1479. uint32 pad0[1018];
  1480. } SVGADXShaderIfaceMobFormat;
  1481. #pragma pack(pop)
  1482. #endif