svga3d_reg.h 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897
  1. /**********************************************************
  2. * Copyright 1998-2009 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_reg.h --
  27. *
  28. * SVGA 3D hardware definitions
  29. */
  30. #ifndef _SVGA3D_REG_H_
  31. #define _SVGA3D_REG_H_
  32. #include "svga_reg.h"
  33. /*
  34. * 3D Hardware Version
  35. *
  36. * The hardware version is stored in the SVGA_FIFO_3D_HWVERSION fifo
  37. * register. Is set by the host and read by the guest. This lets
  38. * us make new guest drivers which are backwards-compatible with old
  39. * SVGA hardware revisions. It does not let us support old guest
  40. * drivers. Good enough for now.
  41. *
  42. */
  43. #define SVGA3D_MAKE_HWVERSION(major, minor) (((major) << 16) | ((minor) & 0xFF))
  44. #define SVGA3D_MAJOR_HWVERSION(version) ((version) >> 16)
  45. #define SVGA3D_MINOR_HWVERSION(version) ((version) & 0xFF)
  46. typedef enum {
  47. SVGA3D_HWVERSION_WS5_RC1 = SVGA3D_MAKE_HWVERSION(0, 1),
  48. SVGA3D_HWVERSION_WS5_RC2 = SVGA3D_MAKE_HWVERSION(0, 2),
  49. SVGA3D_HWVERSION_WS51_RC1 = SVGA3D_MAKE_HWVERSION(0, 3),
  50. SVGA3D_HWVERSION_WS6_B1 = SVGA3D_MAKE_HWVERSION(1, 1),
  51. SVGA3D_HWVERSION_FUSION_11 = SVGA3D_MAKE_HWVERSION(1, 4),
  52. SVGA3D_HWVERSION_WS65_B1 = SVGA3D_MAKE_HWVERSION(2, 0),
  53. SVGA3D_HWVERSION_WS8_B1 = SVGA3D_MAKE_HWVERSION(2, 1),
  54. SVGA3D_HWVERSION_CURRENT = SVGA3D_HWVERSION_WS8_B1,
  55. } SVGA3dHardwareVersion;
  56. /*
  57. * Generic Types
  58. */
  59. typedef uint32 SVGA3dBool; /* 32-bit Bool definition */
  60. #define SVGA3D_NUM_CLIPPLANES 6
  61. #define SVGA3D_MAX_SIMULTANEOUS_RENDER_TARGETS 8
  62. #define SVGA3D_MAX_CONTEXT_IDS 256
  63. #define SVGA3D_MAX_SURFACE_IDS (32 * 1024)
  64. /*
  65. * Surface formats.
  66. *
  67. * If you modify this list, be sure to keep GLUtil.c in sync. It
  68. * includes the internal format definition of each surface in
  69. * GLUtil_ConvertSurfaceFormat, and it contains a table of
  70. * human-readable names in GLUtil_GetFormatName.
  71. */
  72. typedef enum SVGA3dSurfaceFormat {
  73. SVGA3D_FORMAT_INVALID = 0,
  74. SVGA3D_X8R8G8B8 = 1,
  75. SVGA3D_A8R8G8B8 = 2,
  76. SVGA3D_R5G6B5 = 3,
  77. SVGA3D_X1R5G5B5 = 4,
  78. SVGA3D_A1R5G5B5 = 5,
  79. SVGA3D_A4R4G4B4 = 6,
  80. SVGA3D_Z_D32 = 7,
  81. SVGA3D_Z_D16 = 8,
  82. SVGA3D_Z_D24S8 = 9,
  83. SVGA3D_Z_D15S1 = 10,
  84. SVGA3D_LUMINANCE8 = 11,
  85. SVGA3D_LUMINANCE4_ALPHA4 = 12,
  86. SVGA3D_LUMINANCE16 = 13,
  87. SVGA3D_LUMINANCE8_ALPHA8 = 14,
  88. SVGA3D_DXT1 = 15,
  89. SVGA3D_DXT2 = 16,
  90. SVGA3D_DXT3 = 17,
  91. SVGA3D_DXT4 = 18,
  92. SVGA3D_DXT5 = 19,
  93. SVGA3D_BUMPU8V8 = 20,
  94. SVGA3D_BUMPL6V5U5 = 21,
  95. SVGA3D_BUMPX8L8V8U8 = 22,
  96. SVGA3D_BUMPL8V8U8 = 23,
  97. SVGA3D_ARGB_S10E5 = 24, /* 16-bit floating-point ARGB */
  98. SVGA3D_ARGB_S23E8 = 25, /* 32-bit floating-point ARGB */
  99. SVGA3D_A2R10G10B10 = 26,
  100. /* signed formats */
  101. SVGA3D_V8U8 = 27,
  102. SVGA3D_Q8W8V8U8 = 28,
  103. SVGA3D_CxV8U8 = 29,
  104. /* mixed formats */
  105. SVGA3D_X8L8V8U8 = 30,
  106. SVGA3D_A2W10V10U10 = 31,
  107. SVGA3D_ALPHA8 = 32,
  108. /* Single- and dual-component floating point formats */
  109. SVGA3D_R_S10E5 = 33,
  110. SVGA3D_R_S23E8 = 34,
  111. SVGA3D_RG_S10E5 = 35,
  112. SVGA3D_RG_S23E8 = 36,
  113. /*
  114. * Any surface can be used as a buffer object, but SVGA3D_BUFFER is
  115. * the most efficient format to use when creating new surfaces
  116. * expressly for index or vertex data.
  117. */
  118. SVGA3D_BUFFER = 37,
  119. SVGA3D_Z_D24X8 = 38,
  120. SVGA3D_V16U16 = 39,
  121. SVGA3D_G16R16 = 40,
  122. SVGA3D_A16B16G16R16 = 41,
  123. /* Packed Video formats */
  124. SVGA3D_UYVY = 42,
  125. SVGA3D_YUY2 = 43,
  126. /* Planar video formats */
  127. SVGA3D_NV12 = 44,
  128. /* Video format with alpha */
  129. SVGA3D_AYUV = 45,
  130. SVGA3D_BC4_UNORM = 108,
  131. SVGA3D_BC5_UNORM = 111,
  132. /* Advanced D3D9 depth formats. */
  133. SVGA3D_Z_DF16 = 118,
  134. SVGA3D_Z_DF24 = 119,
  135. SVGA3D_Z_D24S8_INT = 120,
  136. SVGA3D_FORMAT_MAX
  137. } SVGA3dSurfaceFormat;
  138. typedef uint32 SVGA3dColor; /* a, r, g, b */
  139. /*
  140. * These match the D3DFORMAT_OP definitions used by Direct3D. We need
  141. * them so that we can query the host for what the supported surface
  142. * operations are (when we're using the D3D backend, in particular),
  143. * and so we can send those operations to the guest.
  144. */
  145. typedef enum {
  146. SVGA3DFORMAT_OP_TEXTURE = 0x00000001,
  147. SVGA3DFORMAT_OP_VOLUMETEXTURE = 0x00000002,
  148. SVGA3DFORMAT_OP_CUBETEXTURE = 0x00000004,
  149. SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET = 0x00000008,
  150. SVGA3DFORMAT_OP_SAME_FORMAT_RENDERTARGET = 0x00000010,
  151. SVGA3DFORMAT_OP_ZSTENCIL = 0x00000040,
  152. SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH = 0x00000080,
  153. /*
  154. * This format can be used as a render target if the current display mode
  155. * is the same depth if the alpha channel is ignored. e.g. if the device
  156. * can render to A8R8G8B8 when the display mode is X8R8G8B8, then the
  157. * format op list entry for A8R8G8B8 should have this cap.
  158. */
  159. SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET = 0x00000100,
  160. /*
  161. * This format contains DirectDraw support (including Flip). This flag
  162. * should not to be set on alpha formats.
  163. */
  164. SVGA3DFORMAT_OP_DISPLAYMODE = 0x00000400,
  165. /*
  166. * The rasterizer can support some level of Direct3D support in this format
  167. * and implies that the driver can create a Context in this mode (for some
  168. * render target format). When this flag is set, the SVGA3DFORMAT_OP_DISPLAYMODE
  169. * flag must also be set.
  170. */
  171. SVGA3DFORMAT_OP_3DACCELERATION = 0x00000800,
  172. /*
  173. * This is set for a private format when the driver has put the bpp in
  174. * the structure.
  175. */
  176. SVGA3DFORMAT_OP_PIXELSIZE = 0x00001000,
  177. /*
  178. * Indicates that this format can be converted to any RGB format for which
  179. * SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB is specified
  180. */
  181. SVGA3DFORMAT_OP_CONVERT_TO_ARGB = 0x00002000,
  182. /*
  183. * Indicates that this format can be used to create offscreen plain surfaces.
  184. */
  185. SVGA3DFORMAT_OP_OFFSCREENPLAIN = 0x00004000,
  186. /*
  187. * Indicated that this format can be read as an SRGB texture (meaning that the
  188. * sampler will linearize the looked up data)
  189. */
  190. SVGA3DFORMAT_OP_SRGBREAD = 0x00008000,
  191. /*
  192. * Indicates that this format can be used in the bumpmap instructions
  193. */
  194. SVGA3DFORMAT_OP_BUMPMAP = 0x00010000,
  195. /*
  196. * Indicates that this format can be sampled by the displacement map sampler
  197. */
  198. SVGA3DFORMAT_OP_DMAP = 0x00020000,
  199. /*
  200. * Indicates that this format cannot be used with texture filtering
  201. */
  202. SVGA3DFORMAT_OP_NOFILTER = 0x00040000,
  203. /*
  204. * Indicates that format conversions are supported to this RGB format if
  205. * SVGA3DFORMAT_OP_CONVERT_TO_ARGB is specified in the source format.
  206. */
  207. SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB = 0x00080000,
  208. /*
  209. * Indicated that this format can be written as an SRGB target (meaning that the
  210. * pixel pipe will DE-linearize data on output to format)
  211. */
  212. SVGA3DFORMAT_OP_SRGBWRITE = 0x00100000,
  213. /*
  214. * Indicates that this format cannot be used with alpha blending
  215. */
  216. SVGA3DFORMAT_OP_NOALPHABLEND = 0x00200000,
  217. /*
  218. * Indicates that the device can auto-generated sublevels for resources
  219. * of this format
  220. */
  221. SVGA3DFORMAT_OP_AUTOGENMIPMAP = 0x00400000,
  222. /*
  223. * Indicates that this format can be used by vertex texture sampler
  224. */
  225. SVGA3DFORMAT_OP_VERTEXTEXTURE = 0x00800000,
  226. /*
  227. * Indicates that this format supports neither texture coordinate wrap
  228. * modes, nor mipmapping
  229. */
  230. SVGA3DFORMAT_OP_NOTEXCOORDWRAPNORMIP = 0x01000000
  231. } SVGA3dFormatOp;
  232. /*
  233. * This structure is a conversion of SVGA3DFORMAT_OP_*.
  234. * Entries must be located at the same position.
  235. */
  236. typedef union {
  237. uint32 value;
  238. struct {
  239. uint32 texture : 1;
  240. uint32 volumeTexture : 1;
  241. uint32 cubeTexture : 1;
  242. uint32 offscreenRenderTarget : 1;
  243. uint32 sameFormatRenderTarget : 1;
  244. uint32 unknown1 : 1;
  245. uint32 zStencil : 1;
  246. uint32 zStencilArbitraryDepth : 1;
  247. uint32 sameFormatUpToAlpha : 1;
  248. uint32 unknown2 : 1;
  249. uint32 displayMode : 1;
  250. uint32 acceleration3d : 1;
  251. uint32 pixelSize : 1;
  252. uint32 convertToARGB : 1;
  253. uint32 offscreenPlain : 1;
  254. uint32 sRGBRead : 1;
  255. uint32 bumpMap : 1;
  256. uint32 dmap : 1;
  257. uint32 noFilter : 1;
  258. uint32 memberOfGroupARGB : 1;
  259. uint32 sRGBWrite : 1;
  260. uint32 noAlphaBlend : 1;
  261. uint32 autoGenMipMap : 1;
  262. uint32 vertexTexture : 1;
  263. uint32 noTexCoordWrapNorMip : 1;
  264. };
  265. } SVGA3dSurfaceFormatCaps;
  266. /*
  267. * SVGA_3D_CMD_SETRENDERSTATE Types. All value types
  268. * must fit in a uint32.
  269. */
  270. typedef enum {
  271. SVGA3D_RS_INVALID = 0,
  272. SVGA3D_RS_ZENABLE = 1, /* SVGA3dBool */
  273. SVGA3D_RS_ZWRITEENABLE = 2, /* SVGA3dBool */
  274. SVGA3D_RS_ALPHATESTENABLE = 3, /* SVGA3dBool */
  275. SVGA3D_RS_DITHERENABLE = 4, /* SVGA3dBool */
  276. SVGA3D_RS_BLENDENABLE = 5, /* SVGA3dBool */
  277. SVGA3D_RS_FOGENABLE = 6, /* SVGA3dBool */
  278. SVGA3D_RS_SPECULARENABLE = 7, /* SVGA3dBool */
  279. SVGA3D_RS_STENCILENABLE = 8, /* SVGA3dBool */
  280. SVGA3D_RS_LIGHTINGENABLE = 9, /* SVGA3dBool */
  281. SVGA3D_RS_NORMALIZENORMALS = 10, /* SVGA3dBool */
  282. SVGA3D_RS_POINTSPRITEENABLE = 11, /* SVGA3dBool */
  283. SVGA3D_RS_POINTSCALEENABLE = 12, /* SVGA3dBool */
  284. SVGA3D_RS_STENCILREF = 13, /* uint32 */
  285. SVGA3D_RS_STENCILMASK = 14, /* uint32 */
  286. SVGA3D_RS_STENCILWRITEMASK = 15, /* uint32 */
  287. SVGA3D_RS_FOGSTART = 16, /* float */
  288. SVGA3D_RS_FOGEND = 17, /* float */
  289. SVGA3D_RS_FOGDENSITY = 18, /* float */
  290. SVGA3D_RS_POINTSIZE = 19, /* float */
  291. SVGA3D_RS_POINTSIZEMIN = 20, /* float */
  292. SVGA3D_RS_POINTSIZEMAX = 21, /* float */
  293. SVGA3D_RS_POINTSCALE_A = 22, /* float */
  294. SVGA3D_RS_POINTSCALE_B = 23, /* float */
  295. SVGA3D_RS_POINTSCALE_C = 24, /* float */
  296. SVGA3D_RS_FOGCOLOR = 25, /* SVGA3dColor */
  297. SVGA3D_RS_AMBIENT = 26, /* SVGA3dColor */
  298. SVGA3D_RS_CLIPPLANEENABLE = 27, /* SVGA3dClipPlanes */
  299. SVGA3D_RS_FOGMODE = 28, /* SVGA3dFogMode */
  300. SVGA3D_RS_FILLMODE = 29, /* SVGA3dFillMode */
  301. SVGA3D_RS_SHADEMODE = 30, /* SVGA3dShadeMode */
  302. SVGA3D_RS_LINEPATTERN = 31, /* SVGA3dLinePattern */
  303. SVGA3D_RS_SRCBLEND = 32, /* SVGA3dBlendOp */
  304. SVGA3D_RS_DSTBLEND = 33, /* SVGA3dBlendOp */
  305. SVGA3D_RS_BLENDEQUATION = 34, /* SVGA3dBlendEquation */
  306. SVGA3D_RS_CULLMODE = 35, /* SVGA3dFace */
  307. SVGA3D_RS_ZFUNC = 36, /* SVGA3dCmpFunc */
  308. SVGA3D_RS_ALPHAFUNC = 37, /* SVGA3dCmpFunc */
  309. SVGA3D_RS_STENCILFUNC = 38, /* SVGA3dCmpFunc */
  310. SVGA3D_RS_STENCILFAIL = 39, /* SVGA3dStencilOp */
  311. SVGA3D_RS_STENCILZFAIL = 40, /* SVGA3dStencilOp */
  312. SVGA3D_RS_STENCILPASS = 41, /* SVGA3dStencilOp */
  313. SVGA3D_RS_ALPHAREF = 42, /* float (0.0 .. 1.0) */
  314. SVGA3D_RS_FRONTWINDING = 43, /* SVGA3dFrontWinding */
  315. SVGA3D_RS_COORDINATETYPE = 44, /* SVGA3dCoordinateType */
  316. SVGA3D_RS_ZBIAS = 45, /* float */
  317. SVGA3D_RS_RANGEFOGENABLE = 46, /* SVGA3dBool */
  318. SVGA3D_RS_COLORWRITEENABLE = 47, /* SVGA3dColorMask */
  319. SVGA3D_RS_VERTEXMATERIALENABLE = 48, /* SVGA3dBool */
  320. SVGA3D_RS_DIFFUSEMATERIALSOURCE = 49, /* SVGA3dVertexMaterial */
  321. SVGA3D_RS_SPECULARMATERIALSOURCE = 50, /* SVGA3dVertexMaterial */
  322. SVGA3D_RS_AMBIENTMATERIALSOURCE = 51, /* SVGA3dVertexMaterial */
  323. SVGA3D_RS_EMISSIVEMATERIALSOURCE = 52, /* SVGA3dVertexMaterial */
  324. SVGA3D_RS_TEXTUREFACTOR = 53, /* SVGA3dColor */
  325. SVGA3D_RS_LOCALVIEWER = 54, /* SVGA3dBool */
  326. SVGA3D_RS_SCISSORTESTENABLE = 55, /* SVGA3dBool */
  327. SVGA3D_RS_BLENDCOLOR = 56, /* SVGA3dColor */
  328. SVGA3D_RS_STENCILENABLE2SIDED = 57, /* SVGA3dBool */
  329. SVGA3D_RS_CCWSTENCILFUNC = 58, /* SVGA3dCmpFunc */
  330. SVGA3D_RS_CCWSTENCILFAIL = 59, /* SVGA3dStencilOp */
  331. SVGA3D_RS_CCWSTENCILZFAIL = 60, /* SVGA3dStencilOp */
  332. SVGA3D_RS_CCWSTENCILPASS = 61, /* SVGA3dStencilOp */
  333. SVGA3D_RS_VERTEXBLEND = 62, /* SVGA3dVertexBlendFlags */
  334. SVGA3D_RS_SLOPESCALEDEPTHBIAS = 63, /* float */
  335. SVGA3D_RS_DEPTHBIAS = 64, /* float */
  336. /*
  337. * Output Gamma Level
  338. *
  339. * Output gamma effects the gamma curve of colors that are output from the
  340. * rendering pipeline. A value of 1.0 specifies a linear color space. If the
  341. * value is <= 0.0, gamma correction is ignored and linear color space is
  342. * used.
  343. */
  344. SVGA3D_RS_OUTPUTGAMMA = 65, /* float */
  345. SVGA3D_RS_ZVISIBLE = 66, /* SVGA3dBool */
  346. SVGA3D_RS_LASTPIXEL = 67, /* SVGA3dBool */
  347. SVGA3D_RS_CLIPPING = 68, /* SVGA3dBool */
  348. SVGA3D_RS_WRAP0 = 69, /* SVGA3dWrapFlags */
  349. SVGA3D_RS_WRAP1 = 70, /* SVGA3dWrapFlags */
  350. SVGA3D_RS_WRAP2 = 71, /* SVGA3dWrapFlags */
  351. SVGA3D_RS_WRAP3 = 72, /* SVGA3dWrapFlags */
  352. SVGA3D_RS_WRAP4 = 73, /* SVGA3dWrapFlags */
  353. SVGA3D_RS_WRAP5 = 74, /* SVGA3dWrapFlags */
  354. SVGA3D_RS_WRAP6 = 75, /* SVGA3dWrapFlags */
  355. SVGA3D_RS_WRAP7 = 76, /* SVGA3dWrapFlags */
  356. SVGA3D_RS_WRAP8 = 77, /* SVGA3dWrapFlags */
  357. SVGA3D_RS_WRAP9 = 78, /* SVGA3dWrapFlags */
  358. SVGA3D_RS_WRAP10 = 79, /* SVGA3dWrapFlags */
  359. SVGA3D_RS_WRAP11 = 80, /* SVGA3dWrapFlags */
  360. SVGA3D_RS_WRAP12 = 81, /* SVGA3dWrapFlags */
  361. SVGA3D_RS_WRAP13 = 82, /* SVGA3dWrapFlags */
  362. SVGA3D_RS_WRAP14 = 83, /* SVGA3dWrapFlags */
  363. SVGA3D_RS_WRAP15 = 84, /* SVGA3dWrapFlags */
  364. SVGA3D_RS_MULTISAMPLEANTIALIAS = 85, /* SVGA3dBool */
  365. SVGA3D_RS_MULTISAMPLEMASK = 86, /* uint32 */
  366. SVGA3D_RS_INDEXEDVERTEXBLENDENABLE = 87, /* SVGA3dBool */
  367. SVGA3D_RS_TWEENFACTOR = 88, /* float */
  368. SVGA3D_RS_ANTIALIASEDLINEENABLE = 89, /* SVGA3dBool */
  369. SVGA3D_RS_COLORWRITEENABLE1 = 90, /* SVGA3dColorMask */
  370. SVGA3D_RS_COLORWRITEENABLE2 = 91, /* SVGA3dColorMask */
  371. SVGA3D_RS_COLORWRITEENABLE3 = 92, /* SVGA3dColorMask */
  372. SVGA3D_RS_SEPARATEALPHABLENDENABLE = 93, /* SVGA3dBool */
  373. SVGA3D_RS_SRCBLENDALPHA = 94, /* SVGA3dBlendOp */
  374. SVGA3D_RS_DSTBLENDALPHA = 95, /* SVGA3dBlendOp */
  375. SVGA3D_RS_BLENDEQUATIONALPHA = 96, /* SVGA3dBlendEquation */
  376. SVGA3D_RS_TRANSPARENCYANTIALIAS = 97, /* SVGA3dTransparencyAntialiasType */
  377. SVGA3D_RS_LINEAA = 98, /* SVGA3dBool */
  378. SVGA3D_RS_LINEWIDTH = 99, /* float */
  379. SVGA3D_RS_MAX
  380. } SVGA3dRenderStateName;
  381. typedef enum {
  382. SVGA3D_TRANSPARENCYANTIALIAS_NORMAL = 0,
  383. SVGA3D_TRANSPARENCYANTIALIAS_ALPHATOCOVERAGE = 1,
  384. SVGA3D_TRANSPARENCYANTIALIAS_SUPERSAMPLE = 2,
  385. SVGA3D_TRANSPARENCYANTIALIAS_MAX
  386. } SVGA3dTransparencyAntialiasType;
  387. typedef enum {
  388. SVGA3D_VERTEXMATERIAL_NONE = 0, /* Use the value in the current material */
  389. SVGA3D_VERTEXMATERIAL_DIFFUSE = 1, /* Use the value in the diffuse component */
  390. SVGA3D_VERTEXMATERIAL_SPECULAR = 2, /* Use the value in the specular component */
  391. } SVGA3dVertexMaterial;
  392. typedef enum {
  393. SVGA3D_FILLMODE_INVALID = 0,
  394. SVGA3D_FILLMODE_POINT = 1,
  395. SVGA3D_FILLMODE_LINE = 2,
  396. SVGA3D_FILLMODE_FILL = 3,
  397. SVGA3D_FILLMODE_MAX
  398. } SVGA3dFillModeType;
  399. typedef
  400. union {
  401. struct {
  402. uint16 mode; /* SVGA3dFillModeType */
  403. uint16 face; /* SVGA3dFace */
  404. };
  405. uint32 uintValue;
  406. } SVGA3dFillMode;
  407. typedef enum {
  408. SVGA3D_SHADEMODE_INVALID = 0,
  409. SVGA3D_SHADEMODE_FLAT = 1,
  410. SVGA3D_SHADEMODE_SMOOTH = 2,
  411. SVGA3D_SHADEMODE_PHONG = 3, /* Not supported */
  412. SVGA3D_SHADEMODE_MAX
  413. } SVGA3dShadeMode;
  414. typedef
  415. union {
  416. struct {
  417. uint16 repeat;
  418. uint16 pattern;
  419. };
  420. uint32 uintValue;
  421. } SVGA3dLinePattern;
  422. typedef enum {
  423. SVGA3D_BLENDOP_INVALID = 0,
  424. SVGA3D_BLENDOP_ZERO = 1,
  425. SVGA3D_BLENDOP_ONE = 2,
  426. SVGA3D_BLENDOP_SRCCOLOR = 3,
  427. SVGA3D_BLENDOP_INVSRCCOLOR = 4,
  428. SVGA3D_BLENDOP_SRCALPHA = 5,
  429. SVGA3D_BLENDOP_INVSRCALPHA = 6,
  430. SVGA3D_BLENDOP_DESTALPHA = 7,
  431. SVGA3D_BLENDOP_INVDESTALPHA = 8,
  432. SVGA3D_BLENDOP_DESTCOLOR = 9,
  433. SVGA3D_BLENDOP_INVDESTCOLOR = 10,
  434. SVGA3D_BLENDOP_SRCALPHASAT = 11,
  435. SVGA3D_BLENDOP_BLENDFACTOR = 12,
  436. SVGA3D_BLENDOP_INVBLENDFACTOR = 13,
  437. SVGA3D_BLENDOP_MAX
  438. } SVGA3dBlendOp;
  439. typedef enum {
  440. SVGA3D_BLENDEQ_INVALID = 0,
  441. SVGA3D_BLENDEQ_ADD = 1,
  442. SVGA3D_BLENDEQ_SUBTRACT = 2,
  443. SVGA3D_BLENDEQ_REVSUBTRACT = 3,
  444. SVGA3D_BLENDEQ_MINIMUM = 4,
  445. SVGA3D_BLENDEQ_MAXIMUM = 5,
  446. SVGA3D_BLENDEQ_MAX
  447. } SVGA3dBlendEquation;
  448. typedef enum {
  449. SVGA3D_FRONTWINDING_INVALID = 0,
  450. SVGA3D_FRONTWINDING_CW = 1,
  451. SVGA3D_FRONTWINDING_CCW = 2,
  452. SVGA3D_FRONTWINDING_MAX
  453. } SVGA3dFrontWinding;
  454. typedef enum {
  455. SVGA3D_FACE_INVALID = 0,
  456. SVGA3D_FACE_NONE = 1,
  457. SVGA3D_FACE_FRONT = 2,
  458. SVGA3D_FACE_BACK = 3,
  459. SVGA3D_FACE_FRONT_BACK = 4,
  460. SVGA3D_FACE_MAX
  461. } SVGA3dFace;
  462. /*
  463. * The order and the values should not be changed
  464. */
  465. typedef enum {
  466. SVGA3D_CMP_INVALID = 0,
  467. SVGA3D_CMP_NEVER = 1,
  468. SVGA3D_CMP_LESS = 2,
  469. SVGA3D_CMP_EQUAL = 3,
  470. SVGA3D_CMP_LESSEQUAL = 4,
  471. SVGA3D_CMP_GREATER = 5,
  472. SVGA3D_CMP_NOTEQUAL = 6,
  473. SVGA3D_CMP_GREATEREQUAL = 7,
  474. SVGA3D_CMP_ALWAYS = 8,
  475. SVGA3D_CMP_MAX
  476. } SVGA3dCmpFunc;
  477. /*
  478. * SVGA3D_FOGFUNC_* specifies the fog equation, or PER_VERTEX which allows
  479. * the fog factor to be specified in the alpha component of the specular
  480. * (a.k.a. secondary) vertex color.
  481. */
  482. typedef enum {
  483. SVGA3D_FOGFUNC_INVALID = 0,
  484. SVGA3D_FOGFUNC_EXP = 1,
  485. SVGA3D_FOGFUNC_EXP2 = 2,
  486. SVGA3D_FOGFUNC_LINEAR = 3,
  487. SVGA3D_FOGFUNC_PER_VERTEX = 4
  488. } SVGA3dFogFunction;
  489. /*
  490. * SVGA3D_FOGTYPE_* specifies if fog factors are computed on a per-vertex
  491. * or per-pixel basis.
  492. */
  493. typedef enum {
  494. SVGA3D_FOGTYPE_INVALID = 0,
  495. SVGA3D_FOGTYPE_VERTEX = 1,
  496. SVGA3D_FOGTYPE_PIXEL = 2,
  497. SVGA3D_FOGTYPE_MAX = 3
  498. } SVGA3dFogType;
  499. /*
  500. * SVGA3D_FOGBASE_* selects depth or range-based fog. Depth-based fog is
  501. * computed using the eye Z value of each pixel (or vertex), whereas range-
  502. * based fog is computed using the actual distance (range) to the eye.
  503. */
  504. typedef enum {
  505. SVGA3D_FOGBASE_INVALID = 0,
  506. SVGA3D_FOGBASE_DEPTHBASED = 1,
  507. SVGA3D_FOGBASE_RANGEBASED = 2,
  508. SVGA3D_FOGBASE_MAX = 3
  509. } SVGA3dFogBase;
  510. typedef enum {
  511. SVGA3D_STENCILOP_INVALID = 0,
  512. SVGA3D_STENCILOP_KEEP = 1,
  513. SVGA3D_STENCILOP_ZERO = 2,
  514. SVGA3D_STENCILOP_REPLACE = 3,
  515. SVGA3D_STENCILOP_INCRSAT = 4,
  516. SVGA3D_STENCILOP_DECRSAT = 5,
  517. SVGA3D_STENCILOP_INVERT = 6,
  518. SVGA3D_STENCILOP_INCR = 7,
  519. SVGA3D_STENCILOP_DECR = 8,
  520. SVGA3D_STENCILOP_MAX
  521. } SVGA3dStencilOp;
  522. typedef enum {
  523. SVGA3D_CLIPPLANE_0 = (1 << 0),
  524. SVGA3D_CLIPPLANE_1 = (1 << 1),
  525. SVGA3D_CLIPPLANE_2 = (1 << 2),
  526. SVGA3D_CLIPPLANE_3 = (1 << 3),
  527. SVGA3D_CLIPPLANE_4 = (1 << 4),
  528. SVGA3D_CLIPPLANE_5 = (1 << 5),
  529. } SVGA3dClipPlanes;
  530. typedef enum {
  531. SVGA3D_CLEAR_COLOR = 0x1,
  532. SVGA3D_CLEAR_DEPTH = 0x2,
  533. SVGA3D_CLEAR_STENCIL = 0x4
  534. } SVGA3dClearFlag;
  535. typedef enum {
  536. SVGA3D_RT_DEPTH = 0,
  537. SVGA3D_RT_STENCIL = 1,
  538. SVGA3D_RT_COLOR0 = 2,
  539. SVGA3D_RT_COLOR1 = 3,
  540. SVGA3D_RT_COLOR2 = 4,
  541. SVGA3D_RT_COLOR3 = 5,
  542. SVGA3D_RT_COLOR4 = 6,
  543. SVGA3D_RT_COLOR5 = 7,
  544. SVGA3D_RT_COLOR6 = 8,
  545. SVGA3D_RT_COLOR7 = 9,
  546. SVGA3D_RT_MAX,
  547. SVGA3D_RT_INVALID = ((uint32)-1),
  548. } SVGA3dRenderTargetType;
  549. #define SVGA3D_MAX_RT_COLOR (SVGA3D_RT_COLOR7 - SVGA3D_RT_COLOR0 + 1)
  550. typedef
  551. union {
  552. struct {
  553. uint32 red : 1;
  554. uint32 green : 1;
  555. uint32 blue : 1;
  556. uint32 alpha : 1;
  557. };
  558. uint32 uintValue;
  559. } SVGA3dColorMask;
  560. typedef enum {
  561. SVGA3D_VBLEND_DISABLE = 0,
  562. SVGA3D_VBLEND_1WEIGHT = 1,
  563. SVGA3D_VBLEND_2WEIGHT = 2,
  564. SVGA3D_VBLEND_3WEIGHT = 3,
  565. } SVGA3dVertexBlendFlags;
  566. typedef enum {
  567. SVGA3D_WRAPCOORD_0 = 1 << 0,
  568. SVGA3D_WRAPCOORD_1 = 1 << 1,
  569. SVGA3D_WRAPCOORD_2 = 1 << 2,
  570. SVGA3D_WRAPCOORD_3 = 1 << 3,
  571. SVGA3D_WRAPCOORD_ALL = 0xF,
  572. } SVGA3dWrapFlags;
  573. /*
  574. * SVGA_3D_CMD_TEXTURESTATE Types. All value types
  575. * must fit in a uint32.
  576. */
  577. typedef enum {
  578. SVGA3D_TS_INVALID = 0,
  579. SVGA3D_TS_BIND_TEXTURE = 1, /* SVGA3dSurfaceId */
  580. SVGA3D_TS_COLOROP = 2, /* SVGA3dTextureCombiner */
  581. SVGA3D_TS_COLORARG1 = 3, /* SVGA3dTextureArgData */
  582. SVGA3D_TS_COLORARG2 = 4, /* SVGA3dTextureArgData */
  583. SVGA3D_TS_ALPHAOP = 5, /* SVGA3dTextureCombiner */
  584. SVGA3D_TS_ALPHAARG1 = 6, /* SVGA3dTextureArgData */
  585. SVGA3D_TS_ALPHAARG2 = 7, /* SVGA3dTextureArgData */
  586. SVGA3D_TS_ADDRESSU = 8, /* SVGA3dTextureAddress */
  587. SVGA3D_TS_ADDRESSV = 9, /* SVGA3dTextureAddress */
  588. SVGA3D_TS_MIPFILTER = 10, /* SVGA3dTextureFilter */
  589. SVGA3D_TS_MAGFILTER = 11, /* SVGA3dTextureFilter */
  590. SVGA3D_TS_MINFILTER = 12, /* SVGA3dTextureFilter */
  591. SVGA3D_TS_BORDERCOLOR = 13, /* SVGA3dColor */
  592. SVGA3D_TS_TEXCOORDINDEX = 14, /* uint32 */
  593. SVGA3D_TS_TEXTURETRANSFORMFLAGS = 15, /* SVGA3dTexTransformFlags */
  594. SVGA3D_TS_TEXCOORDGEN = 16, /* SVGA3dTextureCoordGen */
  595. SVGA3D_TS_BUMPENVMAT00 = 17, /* float */
  596. SVGA3D_TS_BUMPENVMAT01 = 18, /* float */
  597. SVGA3D_TS_BUMPENVMAT10 = 19, /* float */
  598. SVGA3D_TS_BUMPENVMAT11 = 20, /* float */
  599. SVGA3D_TS_TEXTURE_MIPMAP_LEVEL = 21, /* uint32 */
  600. SVGA3D_TS_TEXTURE_LOD_BIAS = 22, /* float */
  601. SVGA3D_TS_TEXTURE_ANISOTROPIC_LEVEL = 23, /* uint32 */
  602. SVGA3D_TS_ADDRESSW = 24, /* SVGA3dTextureAddress */
  603. /*
  604. * Sampler Gamma Level
  605. *
  606. * Sampler gamma effects the color of samples taken from the sampler. A
  607. * value of 1.0 will produce linear samples. If the value is <= 0.0 the
  608. * gamma value is ignored and a linear space is used.
  609. */
  610. SVGA3D_TS_GAMMA = 25, /* float */
  611. SVGA3D_TS_BUMPENVLSCALE = 26, /* float */
  612. SVGA3D_TS_BUMPENVLOFFSET = 27, /* float */
  613. SVGA3D_TS_COLORARG0 = 28, /* SVGA3dTextureArgData */
  614. SVGA3D_TS_ALPHAARG0 = 29, /* SVGA3dTextureArgData */
  615. SVGA3D_TS_MAX
  616. } SVGA3dTextureStateName;
  617. typedef enum {
  618. SVGA3D_TC_INVALID = 0,
  619. SVGA3D_TC_DISABLE = 1,
  620. SVGA3D_TC_SELECTARG1 = 2,
  621. SVGA3D_TC_SELECTARG2 = 3,
  622. SVGA3D_TC_MODULATE = 4,
  623. SVGA3D_TC_ADD = 5,
  624. SVGA3D_TC_ADDSIGNED = 6,
  625. SVGA3D_TC_SUBTRACT = 7,
  626. SVGA3D_TC_BLENDTEXTUREALPHA = 8,
  627. SVGA3D_TC_BLENDDIFFUSEALPHA = 9,
  628. SVGA3D_TC_BLENDCURRENTALPHA = 10,
  629. SVGA3D_TC_BLENDFACTORALPHA = 11,
  630. SVGA3D_TC_MODULATE2X = 12,
  631. SVGA3D_TC_MODULATE4X = 13,
  632. SVGA3D_TC_DSDT = 14,
  633. SVGA3D_TC_DOTPRODUCT3 = 15,
  634. SVGA3D_TC_BLENDTEXTUREALPHAPM = 16,
  635. SVGA3D_TC_ADDSIGNED2X = 17,
  636. SVGA3D_TC_ADDSMOOTH = 18,
  637. SVGA3D_TC_PREMODULATE = 19,
  638. SVGA3D_TC_MODULATEALPHA_ADDCOLOR = 20,
  639. SVGA3D_TC_MODULATECOLOR_ADDALPHA = 21,
  640. SVGA3D_TC_MODULATEINVALPHA_ADDCOLOR = 22,
  641. SVGA3D_TC_MODULATEINVCOLOR_ADDALPHA = 23,
  642. SVGA3D_TC_BUMPENVMAPLUMINANCE = 24,
  643. SVGA3D_TC_MULTIPLYADD = 25,
  644. SVGA3D_TC_LERP = 26,
  645. SVGA3D_TC_MAX
  646. } SVGA3dTextureCombiner;
  647. #define SVGA3D_TC_CAP_BIT(svga3d_tc_op) (svga3d_tc_op ? (1 << (svga3d_tc_op - 1)) : 0)
  648. typedef enum {
  649. SVGA3D_TEX_ADDRESS_INVALID = 0,
  650. SVGA3D_TEX_ADDRESS_WRAP = 1,
  651. SVGA3D_TEX_ADDRESS_MIRROR = 2,
  652. SVGA3D_TEX_ADDRESS_CLAMP = 3,
  653. SVGA3D_TEX_ADDRESS_BORDER = 4,
  654. SVGA3D_TEX_ADDRESS_MIRRORONCE = 5,
  655. SVGA3D_TEX_ADDRESS_EDGE = 6,
  656. SVGA3D_TEX_ADDRESS_MAX
  657. } SVGA3dTextureAddress;
  658. /*
  659. * SVGA3D_TEX_FILTER_NONE as the minification filter means mipmapping is
  660. * disabled, and the rasterizer should use the magnification filter instead.
  661. */
  662. typedef enum {
  663. SVGA3D_TEX_FILTER_NONE = 0,
  664. SVGA3D_TEX_FILTER_NEAREST = 1,
  665. SVGA3D_TEX_FILTER_LINEAR = 2,
  666. SVGA3D_TEX_FILTER_ANISOTROPIC = 3,
  667. SVGA3D_TEX_FILTER_FLATCUBIC = 4, /* Deprecated, not implemented */
  668. SVGA3D_TEX_FILTER_GAUSSIANCUBIC = 5, /* Deprecated, not implemented */
  669. SVGA3D_TEX_FILTER_PYRAMIDALQUAD = 6, /* Not currently implemented */
  670. SVGA3D_TEX_FILTER_GAUSSIANQUAD = 7, /* Not currently implemented */
  671. SVGA3D_TEX_FILTER_MAX
  672. } SVGA3dTextureFilter;
  673. typedef enum {
  674. SVGA3D_TEX_TRANSFORM_OFF = 0,
  675. SVGA3D_TEX_TRANSFORM_S = (1 << 0),
  676. SVGA3D_TEX_TRANSFORM_T = (1 << 1),
  677. SVGA3D_TEX_TRANSFORM_R = (1 << 2),
  678. SVGA3D_TEX_TRANSFORM_Q = (1 << 3),
  679. SVGA3D_TEX_PROJECTED = (1 << 15),
  680. } SVGA3dTexTransformFlags;
  681. typedef enum {
  682. SVGA3D_TEXCOORD_GEN_OFF = 0,
  683. SVGA3D_TEXCOORD_GEN_EYE_POSITION = 1,
  684. SVGA3D_TEXCOORD_GEN_EYE_NORMAL = 2,
  685. SVGA3D_TEXCOORD_GEN_REFLECTIONVECTOR = 3,
  686. SVGA3D_TEXCOORD_GEN_SPHERE = 4,
  687. SVGA3D_TEXCOORD_GEN_MAX
  688. } SVGA3dTextureCoordGen;
  689. /*
  690. * Texture argument constants for texture combiner
  691. */
  692. typedef enum {
  693. SVGA3D_TA_INVALID = 0,
  694. SVGA3D_TA_CONSTANT = 1,
  695. SVGA3D_TA_PREVIOUS = 2,
  696. SVGA3D_TA_DIFFUSE = 3,
  697. SVGA3D_TA_TEXTURE = 4,
  698. SVGA3D_TA_SPECULAR = 5,
  699. SVGA3D_TA_MAX
  700. } SVGA3dTextureArgData;
  701. #define SVGA3D_TM_MASK_LEN 4
  702. /* Modifiers for texture argument constants defined above. */
  703. typedef enum {
  704. SVGA3D_TM_NONE = 0,
  705. SVGA3D_TM_ALPHA = (1 << SVGA3D_TM_MASK_LEN),
  706. SVGA3D_TM_ONE_MINUS = (2 << SVGA3D_TM_MASK_LEN),
  707. } SVGA3dTextureArgModifier;
  708. #define SVGA3D_INVALID_ID ((uint32)-1)
  709. #define SVGA3D_MAX_CLIP_PLANES 6
  710. /*
  711. * This is the limit to the number of fixed-function texture
  712. * transforms and texture coordinates we can support. It does *not*
  713. * correspond to the number of texture image units (samplers) we
  714. * support!
  715. */
  716. #define SVGA3D_MAX_TEXTURE_COORDS 8
  717. /*
  718. * Vertex declarations
  719. *
  720. * Notes:
  721. *
  722. * SVGA3D_DECLUSAGE_POSITIONT is for pre-transformed vertices. If you
  723. * draw with any POSITIONT vertex arrays, the programmable vertex
  724. * pipeline will be implicitly disabled. Drawing will take place as if
  725. * no vertex shader was bound.
  726. */
  727. typedef enum {
  728. SVGA3D_DECLUSAGE_POSITION = 0,
  729. SVGA3D_DECLUSAGE_BLENDWEIGHT, /* 1 */
  730. SVGA3D_DECLUSAGE_BLENDINDICES, /* 2 */
  731. SVGA3D_DECLUSAGE_NORMAL, /* 3 */
  732. SVGA3D_DECLUSAGE_PSIZE, /* 4 */
  733. SVGA3D_DECLUSAGE_TEXCOORD, /* 5 */
  734. SVGA3D_DECLUSAGE_TANGENT, /* 6 */
  735. SVGA3D_DECLUSAGE_BINORMAL, /* 7 */
  736. SVGA3D_DECLUSAGE_TESSFACTOR, /* 8 */
  737. SVGA3D_DECLUSAGE_POSITIONT, /* 9 */
  738. SVGA3D_DECLUSAGE_COLOR, /* 10 */
  739. SVGA3D_DECLUSAGE_FOG, /* 11 */
  740. SVGA3D_DECLUSAGE_DEPTH, /* 12 */
  741. SVGA3D_DECLUSAGE_SAMPLE, /* 13 */
  742. SVGA3D_DECLUSAGE_MAX
  743. } SVGA3dDeclUsage;
  744. typedef enum {
  745. SVGA3D_DECLMETHOD_DEFAULT = 0,
  746. SVGA3D_DECLMETHOD_PARTIALU,
  747. SVGA3D_DECLMETHOD_PARTIALV,
  748. SVGA3D_DECLMETHOD_CROSSUV, /* Normal */
  749. SVGA3D_DECLMETHOD_UV,
  750. SVGA3D_DECLMETHOD_LOOKUP, /* Lookup a displacement map */
  751. SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED, /* Lookup a pre-sampled displacement map */
  752. } SVGA3dDeclMethod;
  753. typedef enum {
  754. SVGA3D_DECLTYPE_FLOAT1 = 0,
  755. SVGA3D_DECLTYPE_FLOAT2 = 1,
  756. SVGA3D_DECLTYPE_FLOAT3 = 2,
  757. SVGA3D_DECLTYPE_FLOAT4 = 3,
  758. SVGA3D_DECLTYPE_D3DCOLOR = 4,
  759. SVGA3D_DECLTYPE_UBYTE4 = 5,
  760. SVGA3D_DECLTYPE_SHORT2 = 6,
  761. SVGA3D_DECLTYPE_SHORT4 = 7,
  762. SVGA3D_DECLTYPE_UBYTE4N = 8,
  763. SVGA3D_DECLTYPE_SHORT2N = 9,
  764. SVGA3D_DECLTYPE_SHORT4N = 10,
  765. SVGA3D_DECLTYPE_USHORT2N = 11,
  766. SVGA3D_DECLTYPE_USHORT4N = 12,
  767. SVGA3D_DECLTYPE_UDEC3 = 13,
  768. SVGA3D_DECLTYPE_DEC3N = 14,
  769. SVGA3D_DECLTYPE_FLOAT16_2 = 15,
  770. SVGA3D_DECLTYPE_FLOAT16_4 = 16,
  771. SVGA3D_DECLTYPE_MAX,
  772. } SVGA3dDeclType;
  773. /*
  774. * This structure is used for the divisor for geometry instancing;
  775. * it's a direct translation of the Direct3D equivalent.
  776. */
  777. typedef union {
  778. struct {
  779. /*
  780. * For index data, this number represents the number of instances to draw.
  781. * For instance data, this number represents the number of
  782. * instances/vertex in this stream
  783. */
  784. uint32 count : 30;
  785. /*
  786. * This is 1 if this is supposed to be the data that is repeated for
  787. * every instance.
  788. */
  789. uint32 indexedData : 1;
  790. /*
  791. * This is 1 if this is supposed to be the per-instance data.
  792. */
  793. uint32 instanceData : 1;
  794. };
  795. uint32 value;
  796. } SVGA3dVertexDivisor;
  797. typedef enum {
  798. SVGA3D_PRIMITIVE_INVALID = 0,
  799. SVGA3D_PRIMITIVE_TRIANGLELIST = 1,
  800. SVGA3D_PRIMITIVE_POINTLIST = 2,
  801. SVGA3D_PRIMITIVE_LINELIST = 3,
  802. SVGA3D_PRIMITIVE_LINESTRIP = 4,
  803. SVGA3D_PRIMITIVE_TRIANGLESTRIP = 5,
  804. SVGA3D_PRIMITIVE_TRIANGLEFAN = 6,
  805. SVGA3D_PRIMITIVE_MAX
  806. } SVGA3dPrimitiveType;
  807. typedef enum {
  808. SVGA3D_COORDINATE_INVALID = 0,
  809. SVGA3D_COORDINATE_LEFTHANDED = 1,
  810. SVGA3D_COORDINATE_RIGHTHANDED = 2,
  811. SVGA3D_COORDINATE_MAX
  812. } SVGA3dCoordinateType;
  813. typedef enum {
  814. SVGA3D_TRANSFORM_INVALID = 0,
  815. SVGA3D_TRANSFORM_WORLD = 1,
  816. SVGA3D_TRANSFORM_VIEW = 2,
  817. SVGA3D_TRANSFORM_PROJECTION = 3,
  818. SVGA3D_TRANSFORM_TEXTURE0 = 4,
  819. SVGA3D_TRANSFORM_TEXTURE1 = 5,
  820. SVGA3D_TRANSFORM_TEXTURE2 = 6,
  821. SVGA3D_TRANSFORM_TEXTURE3 = 7,
  822. SVGA3D_TRANSFORM_TEXTURE4 = 8,
  823. SVGA3D_TRANSFORM_TEXTURE5 = 9,
  824. SVGA3D_TRANSFORM_TEXTURE6 = 10,
  825. SVGA3D_TRANSFORM_TEXTURE7 = 11,
  826. SVGA3D_TRANSFORM_WORLD1 = 12,
  827. SVGA3D_TRANSFORM_WORLD2 = 13,
  828. SVGA3D_TRANSFORM_WORLD3 = 14,
  829. SVGA3D_TRANSFORM_MAX
  830. } SVGA3dTransformType;
  831. typedef enum {
  832. SVGA3D_LIGHTTYPE_INVALID = 0,
  833. SVGA3D_LIGHTTYPE_POINT = 1,
  834. SVGA3D_LIGHTTYPE_SPOT1 = 2, /* 1-cone, in degrees */
  835. SVGA3D_LIGHTTYPE_SPOT2 = 3, /* 2-cone, in radians */
  836. SVGA3D_LIGHTTYPE_DIRECTIONAL = 4,
  837. SVGA3D_LIGHTTYPE_MAX
  838. } SVGA3dLightType;
  839. typedef enum {
  840. SVGA3D_CUBEFACE_POSX = 0,
  841. SVGA3D_CUBEFACE_NEGX = 1,
  842. SVGA3D_CUBEFACE_POSY = 2,
  843. SVGA3D_CUBEFACE_NEGY = 3,
  844. SVGA3D_CUBEFACE_POSZ = 4,
  845. SVGA3D_CUBEFACE_NEGZ = 5,
  846. } SVGA3dCubeFace;
  847. typedef enum {
  848. SVGA3D_SHADERTYPE_VS = 1,
  849. SVGA3D_SHADERTYPE_PS = 2,
  850. SVGA3D_SHADERTYPE_MAX
  851. } SVGA3dShaderType;
  852. typedef enum {
  853. SVGA3D_CONST_TYPE_FLOAT = 0,
  854. SVGA3D_CONST_TYPE_INT = 1,
  855. SVGA3D_CONST_TYPE_BOOL = 2,
  856. } SVGA3dShaderConstType;
  857. #define SVGA3D_MAX_SURFACE_FACES 6
  858. typedef enum {
  859. SVGA3D_STRETCH_BLT_POINT = 0,
  860. SVGA3D_STRETCH_BLT_LINEAR = 1,
  861. SVGA3D_STRETCH_BLT_MAX
  862. } SVGA3dStretchBltMode;
  863. typedef enum {
  864. SVGA3D_QUERYTYPE_OCCLUSION = 0,
  865. SVGA3D_QUERYTYPE_MAX
  866. } SVGA3dQueryType;
  867. typedef enum {
  868. SVGA3D_QUERYSTATE_PENDING = 0, /* Waiting on the host (set by guest) */
  869. SVGA3D_QUERYSTATE_SUCCEEDED = 1, /* Completed successfully (set by host) */
  870. SVGA3D_QUERYSTATE_FAILED = 2, /* Completed unsuccessfully (set by host) */
  871. SVGA3D_QUERYSTATE_NEW = 3, /* Never submitted (For guest use only) */
  872. } SVGA3dQueryState;
  873. typedef enum {
  874. SVGA3D_WRITE_HOST_VRAM = 1,
  875. SVGA3D_READ_HOST_VRAM = 2,
  876. } SVGA3dTransferType;
  877. /*
  878. * The maximum number of vertex arrays we're guaranteed to support in
  879. * SVGA_3D_CMD_DRAWPRIMITIVES.
  880. */
  881. #define SVGA3D_MAX_VERTEX_ARRAYS 32
  882. /*
  883. * The maximum number of primitive ranges we're guaranteed to support
  884. * in SVGA_3D_CMD_DRAWPRIMITIVES.
  885. */
  886. #define SVGA3D_MAX_DRAW_PRIMITIVE_RANGES 32
  887. /*
  888. * Identifiers for commands in the command FIFO.
  889. *
  890. * IDs between 1000 and 1039 (inclusive) were used by obsolete versions of
  891. * the SVGA3D protocol and remain reserved; they should not be used in the
  892. * future.
  893. *
  894. * IDs between 1040 and 1999 (inclusive) are available for use by the
  895. * current SVGA3D protocol.
  896. *
  897. * FIFO clients other than SVGA3D should stay below 1000, or at 2000
  898. * and up.
  899. */
  900. #define SVGA_3D_CMD_LEGACY_BASE 1000
  901. #define SVGA_3D_CMD_BASE 1040
  902. #define SVGA_3D_CMD_SURFACE_DEFINE SVGA_3D_CMD_BASE + 0 /* Deprecated */
  903. #define SVGA_3D_CMD_SURFACE_DESTROY SVGA_3D_CMD_BASE + 1
  904. #define SVGA_3D_CMD_SURFACE_COPY SVGA_3D_CMD_BASE + 2
  905. #define SVGA_3D_CMD_SURFACE_STRETCHBLT SVGA_3D_CMD_BASE + 3
  906. #define SVGA_3D_CMD_SURFACE_DMA SVGA_3D_CMD_BASE + 4
  907. #define SVGA_3D_CMD_CONTEXT_DEFINE SVGA_3D_CMD_BASE + 5
  908. #define SVGA_3D_CMD_CONTEXT_DESTROY SVGA_3D_CMD_BASE + 6
  909. #define SVGA_3D_CMD_SETTRANSFORM SVGA_3D_CMD_BASE + 7
  910. #define SVGA_3D_CMD_SETZRANGE SVGA_3D_CMD_BASE + 8
  911. #define SVGA_3D_CMD_SETRENDERSTATE SVGA_3D_CMD_BASE + 9
  912. #define SVGA_3D_CMD_SETRENDERTARGET SVGA_3D_CMD_BASE + 10
  913. #define SVGA_3D_CMD_SETTEXTURESTATE SVGA_3D_CMD_BASE + 11
  914. #define SVGA_3D_CMD_SETMATERIAL SVGA_3D_CMD_BASE + 12
  915. #define SVGA_3D_CMD_SETLIGHTDATA SVGA_3D_CMD_BASE + 13
  916. #define SVGA_3D_CMD_SETLIGHTENABLED SVGA_3D_CMD_BASE + 14
  917. #define SVGA_3D_CMD_SETVIEWPORT SVGA_3D_CMD_BASE + 15
  918. #define SVGA_3D_CMD_SETCLIPPLANE SVGA_3D_CMD_BASE + 16
  919. #define SVGA_3D_CMD_CLEAR SVGA_3D_CMD_BASE + 17
  920. #define SVGA_3D_CMD_PRESENT SVGA_3D_CMD_BASE + 18 /* Deprecated */
  921. #define SVGA_3D_CMD_SHADER_DEFINE SVGA_3D_CMD_BASE + 19
  922. #define SVGA_3D_CMD_SHADER_DESTROY SVGA_3D_CMD_BASE + 20
  923. #define SVGA_3D_CMD_SET_SHADER SVGA_3D_CMD_BASE + 21
  924. #define SVGA_3D_CMD_SET_SHADER_CONST SVGA_3D_CMD_BASE + 22
  925. #define SVGA_3D_CMD_DRAW_PRIMITIVES SVGA_3D_CMD_BASE + 23
  926. #define SVGA_3D_CMD_SETSCISSORRECT SVGA_3D_CMD_BASE + 24
  927. #define SVGA_3D_CMD_BEGIN_QUERY SVGA_3D_CMD_BASE + 25
  928. #define SVGA_3D_CMD_END_QUERY SVGA_3D_CMD_BASE + 26
  929. #define SVGA_3D_CMD_WAIT_FOR_QUERY SVGA_3D_CMD_BASE + 27
  930. #define SVGA_3D_CMD_PRESENT_READBACK SVGA_3D_CMD_BASE + 28 /* Deprecated */
  931. #define SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN SVGA_3D_CMD_BASE + 29
  932. #define SVGA_3D_CMD_SURFACE_DEFINE_V2 SVGA_3D_CMD_BASE + 30
  933. #define SVGA_3D_CMD_GENERATE_MIPMAPS SVGA_3D_CMD_BASE + 31
  934. #define SVGA_3D_CMD_ACTIVATE_SURFACE SVGA_3D_CMD_BASE + 40
  935. #define SVGA_3D_CMD_DEACTIVATE_SURFACE SVGA_3D_CMD_BASE + 41
  936. #define SVGA_3D_CMD_MAX SVGA_3D_CMD_BASE + 42
  937. #define SVGA_3D_CMD_FUTURE_MAX 2000
  938. /*
  939. * Common substructures used in multiple FIFO commands:
  940. */
  941. typedef struct {
  942. union {
  943. struct {
  944. uint16 function; /* SVGA3dFogFunction */
  945. uint8 type; /* SVGA3dFogType */
  946. uint8 base; /* SVGA3dFogBase */
  947. };
  948. uint32 uintValue;
  949. };
  950. } SVGA3dFogMode;
  951. /*
  952. * Uniquely identify one image (a 1D/2D/3D array) from a surface. This
  953. * is a surface ID as well as face/mipmap indices.
  954. */
  955. typedef
  956. struct SVGA3dSurfaceImageId {
  957. uint32 sid;
  958. uint32 face;
  959. uint32 mipmap;
  960. } SVGA3dSurfaceImageId;
  961. typedef
  962. struct SVGA3dGuestImage {
  963. SVGAGuestPtr ptr;
  964. /*
  965. * A note on interpretation of pitch: This value of pitch is the
  966. * number of bytes between vertically adjacent image
  967. * blocks. Normally this is the number of bytes between the first
  968. * pixel of two adjacent scanlines. With compressed textures,
  969. * however, this may represent the number of bytes between
  970. * compression blocks rather than between rows of pixels.
  971. *
  972. * XXX: Compressed textures currently must be tightly packed in guest memory.
  973. *
  974. * If the image is 1-dimensional, pitch is ignored.
  975. *
  976. * If 'pitch' is zero, the SVGA3D device calculates a pitch value
  977. * assuming each row of blocks is tightly packed.
  978. */
  979. uint32 pitch;
  980. } SVGA3dGuestImage;
  981. /*
  982. * FIFO command format definitions:
  983. */
  984. /*
  985. * The data size header following cmdNum for every 3d command
  986. */
  987. typedef
  988. struct {
  989. uint32 id;
  990. uint32 size;
  991. } SVGA3dCmdHeader;
  992. /*
  993. * A surface is a hierarchy of host VRAM surfaces: 1D, 2D, or 3D, with
  994. * optional mipmaps and cube faces.
  995. */
  996. typedef
  997. struct {
  998. uint32 width;
  999. uint32 height;
  1000. uint32 depth;
  1001. } SVGA3dSize;
  1002. typedef enum {
  1003. SVGA3D_SURFACE_CUBEMAP = (1 << 0),
  1004. SVGA3D_SURFACE_HINT_STATIC = (1 << 1),
  1005. SVGA3D_SURFACE_HINT_DYNAMIC = (1 << 2),
  1006. SVGA3D_SURFACE_HINT_INDEXBUFFER = (1 << 3),
  1007. SVGA3D_SURFACE_HINT_VERTEXBUFFER = (1 << 4),
  1008. SVGA3D_SURFACE_HINT_TEXTURE = (1 << 5),
  1009. SVGA3D_SURFACE_HINT_RENDERTARGET = (1 << 6),
  1010. SVGA3D_SURFACE_HINT_DEPTHSTENCIL = (1 << 7),
  1011. SVGA3D_SURFACE_HINT_WRITEONLY = (1 << 8),
  1012. SVGA3D_SURFACE_MASKABLE_ANTIALIAS = (1 << 9),
  1013. SVGA3D_SURFACE_AUTOGENMIPMAPS = (1 << 10),
  1014. } SVGA3dSurfaceFlags;
  1015. typedef
  1016. struct {
  1017. uint32 numMipLevels;
  1018. } SVGA3dSurfaceFace;
  1019. typedef
  1020. struct {
  1021. uint32 sid;
  1022. SVGA3dSurfaceFlags surfaceFlags;
  1023. SVGA3dSurfaceFormat format;
  1024. /*
  1025. * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
  1026. * structures must have the same value of numMipLevels field.
  1027. * Otherwise, all but the first SVGA3dSurfaceFace structures must have the
  1028. * numMipLevels set to 0.
  1029. */
  1030. SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
  1031. /*
  1032. * Followed by an SVGA3dSize structure for each mip level in each face.
  1033. *
  1034. * A note on surface sizes: Sizes are always specified in pixels,
  1035. * even if the true surface size is not a multiple of the minimum
  1036. * block size of the surface's format. For example, a 3x3x1 DXT1
  1037. * compressed texture would actually be stored as a 4x4x1 image in
  1038. * memory.
  1039. */
  1040. } SVGA3dCmdDefineSurface; /* SVGA_3D_CMD_SURFACE_DEFINE */
  1041. typedef
  1042. struct {
  1043. uint32 sid;
  1044. SVGA3dSurfaceFlags surfaceFlags;
  1045. SVGA3dSurfaceFormat format;
  1046. /*
  1047. * If surfaceFlags has SVGA3D_SURFACE_CUBEMAP bit set, all SVGA3dSurfaceFace
  1048. * structures must have the same value of numMipLevels field.
  1049. * Otherwise, all but the first SVGA3dSurfaceFace structures must have the
  1050. * numMipLevels set to 0.
  1051. */
  1052. SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES];
  1053. uint32 multisampleCount;
  1054. SVGA3dTextureFilter autogenFilter;
  1055. /*
  1056. * Followed by an SVGA3dSize structure for each mip level in each face.
  1057. *
  1058. * A note on surface sizes: Sizes are always specified in pixels,
  1059. * even if the true surface size is not a multiple of the minimum
  1060. * block size of the surface's format. For example, a 3x3x1 DXT1
  1061. * compressed texture would actually be stored as a 4x4x1 image in
  1062. * memory.
  1063. */
  1064. } SVGA3dCmdDefineSurface_v2; /* SVGA_3D_CMD_SURFACE_DEFINE_V2 */
  1065. typedef
  1066. struct {
  1067. uint32 sid;
  1068. } SVGA3dCmdDestroySurface; /* SVGA_3D_CMD_SURFACE_DESTROY */
  1069. typedef
  1070. struct {
  1071. uint32 cid;
  1072. } SVGA3dCmdDefineContext; /* SVGA_3D_CMD_CONTEXT_DEFINE */
  1073. typedef
  1074. struct {
  1075. uint32 cid;
  1076. } SVGA3dCmdDestroyContext; /* SVGA_3D_CMD_CONTEXT_DESTROY */
  1077. typedef
  1078. struct {
  1079. uint32 cid;
  1080. SVGA3dClearFlag clearFlag;
  1081. uint32 color;
  1082. float depth;
  1083. uint32 stencil;
  1084. /* Followed by variable number of SVGA3dRect structures */
  1085. } SVGA3dCmdClear; /* SVGA_3D_CMD_CLEAR */
  1086. typedef
  1087. struct SVGA3dCopyRect {
  1088. uint32 x;
  1089. uint32 y;
  1090. uint32 w;
  1091. uint32 h;
  1092. uint32 srcx;
  1093. uint32 srcy;
  1094. } SVGA3dCopyRect;
  1095. typedef
  1096. struct SVGA3dCopyBox {
  1097. uint32 x;
  1098. uint32 y;
  1099. uint32 z;
  1100. uint32 w;
  1101. uint32 h;
  1102. uint32 d;
  1103. uint32 srcx;
  1104. uint32 srcy;
  1105. uint32 srcz;
  1106. } SVGA3dCopyBox;
  1107. typedef
  1108. struct {
  1109. uint32 x;
  1110. uint32 y;
  1111. uint32 w;
  1112. uint32 h;
  1113. } SVGA3dRect;
  1114. typedef
  1115. struct {
  1116. uint32 x;
  1117. uint32 y;
  1118. uint32 z;
  1119. uint32 w;
  1120. uint32 h;
  1121. uint32 d;
  1122. } SVGA3dBox;
  1123. typedef
  1124. struct {
  1125. uint32 x;
  1126. uint32 y;
  1127. uint32 z;
  1128. } SVGA3dPoint;
  1129. typedef
  1130. struct {
  1131. SVGA3dLightType type;
  1132. SVGA3dBool inWorldSpace;
  1133. float diffuse[4];
  1134. float specular[4];
  1135. float ambient[4];
  1136. float position[4];
  1137. float direction[4];
  1138. float range;
  1139. float falloff;
  1140. float attenuation0;
  1141. float attenuation1;
  1142. float attenuation2;
  1143. float theta;
  1144. float phi;
  1145. } SVGA3dLightData;
  1146. typedef
  1147. struct {
  1148. uint32 sid;
  1149. /* Followed by variable number of SVGA3dCopyRect structures */
  1150. } SVGA3dCmdPresent; /* SVGA_3D_CMD_PRESENT */
  1151. typedef
  1152. struct {
  1153. SVGA3dRenderStateName state;
  1154. union {
  1155. uint32 uintValue;
  1156. float floatValue;
  1157. };
  1158. } SVGA3dRenderState;
  1159. typedef
  1160. struct {
  1161. uint32 cid;
  1162. /* Followed by variable number of SVGA3dRenderState structures */
  1163. } SVGA3dCmdSetRenderState; /* SVGA_3D_CMD_SETRENDERSTATE */
  1164. typedef
  1165. struct {
  1166. uint32 cid;
  1167. SVGA3dRenderTargetType type;
  1168. SVGA3dSurfaceImageId target;
  1169. } SVGA3dCmdSetRenderTarget; /* SVGA_3D_CMD_SETRENDERTARGET */
  1170. typedef
  1171. struct {
  1172. SVGA3dSurfaceImageId src;
  1173. SVGA3dSurfaceImageId dest;
  1174. /* Followed by variable number of SVGA3dCopyBox structures */
  1175. } SVGA3dCmdSurfaceCopy; /* SVGA_3D_CMD_SURFACE_COPY */
  1176. typedef
  1177. struct {
  1178. SVGA3dSurfaceImageId src;
  1179. SVGA3dSurfaceImageId dest;
  1180. SVGA3dBox boxSrc;
  1181. SVGA3dBox boxDest;
  1182. SVGA3dStretchBltMode mode;
  1183. } SVGA3dCmdSurfaceStretchBlt; /* SVGA_3D_CMD_SURFACE_STRETCHBLT */
  1184. typedef
  1185. struct {
  1186. /*
  1187. * If the discard flag is present in a surface DMA operation, the host may
  1188. * discard the contents of the current mipmap level and face of the target
  1189. * surface before applying the surface DMA contents.
  1190. */
  1191. uint32 discard : 1;
  1192. /*
  1193. * If the unsynchronized flag is present, the host may perform this upload
  1194. * without syncing to pending reads on this surface.
  1195. */
  1196. uint32 unsynchronized : 1;
  1197. /*
  1198. * Guests *MUST* set the reserved bits to 0 before submitting the command
  1199. * suffix as future flags may occupy these bits.
  1200. */
  1201. uint32 reserved : 30;
  1202. } SVGA3dSurfaceDMAFlags;
  1203. typedef
  1204. struct {
  1205. SVGA3dGuestImage guest;
  1206. SVGA3dSurfaceImageId host;
  1207. SVGA3dTransferType transfer;
  1208. /*
  1209. * Followed by variable number of SVGA3dCopyBox structures. For consistency
  1210. * in all clipping logic and coordinate translation, we define the
  1211. * "source" in each copyBox as the guest image and the
  1212. * "destination" as the host image, regardless of transfer
  1213. * direction.
  1214. *
  1215. * For efficiency, the SVGA3D device is free to copy more data than
  1216. * specified. For example, it may round copy boxes outwards such
  1217. * that they lie on particular alignment boundaries.
  1218. */
  1219. } SVGA3dCmdSurfaceDMA; /* SVGA_3D_CMD_SURFACE_DMA */
  1220. /*
  1221. * SVGA3dCmdSurfaceDMASuffix --
  1222. *
  1223. * This is a command suffix that will appear after a SurfaceDMA command in
  1224. * the FIFO. It contains some extra information that hosts may use to
  1225. * optimize performance or protect the guest. This suffix exists to preserve
  1226. * backwards compatibility while also allowing for new functionality to be
  1227. * implemented.
  1228. */
  1229. typedef
  1230. struct {
  1231. uint32 suffixSize;
  1232. /*
  1233. * The maximum offset is used to determine the maximum offset from the
  1234. * guestPtr base address that will be accessed or written to during this
  1235. * surfaceDMA. If the suffix is supported, the host will respect this
  1236. * boundary while performing surface DMAs.
  1237. *
  1238. * Defaults to MAX_UINT32
  1239. */
  1240. uint32 maximumOffset;
  1241. /*
  1242. * A set of flags that describes optimizations that the host may perform
  1243. * while performing this surface DMA operation. The guest should never rely
  1244. * on behaviour that is different when these flags are set for correctness.
  1245. *
  1246. * Defaults to 0
  1247. */
  1248. SVGA3dSurfaceDMAFlags flags;
  1249. } SVGA3dCmdSurfaceDMASuffix;
  1250. /*
  1251. * SVGA_3D_CMD_DRAW_PRIMITIVES --
  1252. *
  1253. * This command is the SVGA3D device's generic drawing entry point.
  1254. * It can draw multiple ranges of primitives, optionally using an
  1255. * index buffer, using an arbitrary collection of vertex buffers.
  1256. *
  1257. * Each SVGA3dVertexDecl defines a distinct vertex array to bind
  1258. * during this draw call. The declarations specify which surface
  1259. * the vertex data lives in, what that vertex data is used for,
  1260. * and how to interpret it.
  1261. *
  1262. * Each SVGA3dPrimitiveRange defines a collection of primitives
  1263. * to render using the same vertex arrays. An index buffer is
  1264. * optional.
  1265. */
  1266. typedef
  1267. struct {
  1268. /*
  1269. * A range hint is an optional specification for the range of indices
  1270. * in an SVGA3dArray that will be used. If 'last' is zero, it is assumed
  1271. * that the entire array will be used.
  1272. *
  1273. * These are only hints. The SVGA3D device may use them for
  1274. * performance optimization if possible, but it's also allowed to
  1275. * ignore these values.
  1276. */
  1277. uint32 first;
  1278. uint32 last;
  1279. } SVGA3dArrayRangeHint;
  1280. typedef
  1281. struct {
  1282. /*
  1283. * Define the origin and shape of a vertex or index array. Both
  1284. * 'offset' and 'stride' are in bytes. The provided surface will be
  1285. * reinterpreted as a flat array of bytes in the same format used
  1286. * by surface DMA operations. To avoid unnecessary conversions, the
  1287. * surface should be created with the SVGA3D_BUFFER format.
  1288. *
  1289. * Index 0 in the array starts 'offset' bytes into the surface.
  1290. * Index 1 begins at byte 'offset + stride', etc. Array indices may
  1291. * not be negative.
  1292. */
  1293. uint32 surfaceId;
  1294. uint32 offset;
  1295. uint32 stride;
  1296. } SVGA3dArray;
  1297. typedef
  1298. struct {
  1299. /*
  1300. * Describe a vertex array's data type, and define how it is to be
  1301. * used by the fixed function pipeline or the vertex shader. It
  1302. * isn't useful to have two VertexDecls with the same
  1303. * VertexArrayIdentity in one draw call.
  1304. */
  1305. SVGA3dDeclType type;
  1306. SVGA3dDeclMethod method;
  1307. SVGA3dDeclUsage usage;
  1308. uint32 usageIndex;
  1309. } SVGA3dVertexArrayIdentity;
  1310. typedef
  1311. struct {
  1312. SVGA3dVertexArrayIdentity identity;
  1313. SVGA3dArray array;
  1314. SVGA3dArrayRangeHint rangeHint;
  1315. } SVGA3dVertexDecl;
  1316. typedef
  1317. struct {
  1318. /*
  1319. * Define a group of primitives to render, from sequential indices.
  1320. *
  1321. * The value of 'primitiveType' and 'primitiveCount' imply the
  1322. * total number of vertices that will be rendered.
  1323. */
  1324. SVGA3dPrimitiveType primType;
  1325. uint32 primitiveCount;
  1326. /*
  1327. * Optional index buffer. If indexArray.surfaceId is
  1328. * SVGA3D_INVALID_ID, we render without an index buffer. Rendering
  1329. * without an index buffer is identical to rendering with an index
  1330. * buffer containing the sequence [0, 1, 2, 3, ...].
  1331. *
  1332. * If an index buffer is in use, indexWidth specifies the width in
  1333. * bytes of each index value. It must be less than or equal to
  1334. * indexArray.stride.
  1335. *
  1336. * (Currently, the SVGA3D device requires index buffers to be tightly
  1337. * packed. In other words, indexWidth == indexArray.stride)
  1338. */
  1339. SVGA3dArray indexArray;
  1340. uint32 indexWidth;
  1341. /*
  1342. * Optional index bias. This number is added to all indices from
  1343. * indexArray before they are used as vertex array indices. This
  1344. * can be used in multiple ways:
  1345. *
  1346. * - When not using an indexArray, this bias can be used to
  1347. * specify where in the vertex arrays to begin rendering.
  1348. *
  1349. * - A positive number here is equivalent to increasing the
  1350. * offset in each vertex array.
  1351. *
  1352. * - A negative number can be used to render using a small
  1353. * vertex array and an index buffer that contains large
  1354. * values. This may be used by some applications that
  1355. * crop a vertex buffer without modifying their index
  1356. * buffer.
  1357. *
  1358. * Note that rendering with a negative bias value may be slower and
  1359. * use more memory than rendering with a positive or zero bias.
  1360. */
  1361. int32 indexBias;
  1362. } SVGA3dPrimitiveRange;
  1363. typedef
  1364. struct {
  1365. uint32 cid;
  1366. uint32 numVertexDecls;
  1367. uint32 numRanges;
  1368. /*
  1369. * There are two variable size arrays after the
  1370. * SVGA3dCmdDrawPrimitives structure. In order,
  1371. * they are:
  1372. *
  1373. * 1. SVGA3dVertexDecl, quantity 'numVertexDecls', but no more than
  1374. * SVGA3D_MAX_VERTEX_ARRAYS;
  1375. * 2. SVGA3dPrimitiveRange, quantity 'numRanges', but no more than
  1376. * SVGA3D_MAX_DRAW_PRIMITIVE_RANGES;
  1377. * 3. Optionally, SVGA3dVertexDivisor, quantity 'numVertexDecls' (contains
  1378. * the frequency divisor for the corresponding vertex decl).
  1379. */
  1380. } SVGA3dCmdDrawPrimitives; /* SVGA_3D_CMD_DRAWPRIMITIVES */
  1381. typedef
  1382. struct {
  1383. uint32 stage;
  1384. SVGA3dTextureStateName name;
  1385. union {
  1386. uint32 value;
  1387. float floatValue;
  1388. };
  1389. } SVGA3dTextureState;
  1390. typedef
  1391. struct {
  1392. uint32 cid;
  1393. /* Followed by variable number of SVGA3dTextureState structures */
  1394. } SVGA3dCmdSetTextureState; /* SVGA_3D_CMD_SETTEXTURESTATE */
  1395. typedef
  1396. struct {
  1397. uint32 cid;
  1398. SVGA3dTransformType type;
  1399. float matrix[16];
  1400. } SVGA3dCmdSetTransform; /* SVGA_3D_CMD_SETTRANSFORM */
  1401. typedef
  1402. struct {
  1403. float min;
  1404. float max;
  1405. } SVGA3dZRange;
  1406. typedef
  1407. struct {
  1408. uint32 cid;
  1409. SVGA3dZRange zRange;
  1410. } SVGA3dCmdSetZRange; /* SVGA_3D_CMD_SETZRANGE */
  1411. typedef
  1412. struct {
  1413. float diffuse[4];
  1414. float ambient[4];
  1415. float specular[4];
  1416. float emissive[4];
  1417. float shininess;
  1418. } SVGA3dMaterial;
  1419. typedef
  1420. struct {
  1421. uint32 cid;
  1422. SVGA3dFace face;
  1423. SVGA3dMaterial material;
  1424. } SVGA3dCmdSetMaterial; /* SVGA_3D_CMD_SETMATERIAL */
  1425. typedef
  1426. struct {
  1427. uint32 cid;
  1428. uint32 index;
  1429. SVGA3dLightData data;
  1430. } SVGA3dCmdSetLightData; /* SVGA_3D_CMD_SETLIGHTDATA */
  1431. typedef
  1432. struct {
  1433. uint32 cid;
  1434. uint32 index;
  1435. uint32 enabled;
  1436. } SVGA3dCmdSetLightEnabled; /* SVGA_3D_CMD_SETLIGHTENABLED */
  1437. typedef
  1438. struct {
  1439. uint32 cid;
  1440. SVGA3dRect rect;
  1441. } SVGA3dCmdSetViewport; /* SVGA_3D_CMD_SETVIEWPORT */
  1442. typedef
  1443. struct {
  1444. uint32 cid;
  1445. SVGA3dRect rect;
  1446. } SVGA3dCmdSetScissorRect; /* SVGA_3D_CMD_SETSCISSORRECT */
  1447. typedef
  1448. struct {
  1449. uint32 cid;
  1450. uint32 index;
  1451. float plane[4];
  1452. } SVGA3dCmdSetClipPlane; /* SVGA_3D_CMD_SETCLIPPLANE */
  1453. typedef
  1454. struct {
  1455. uint32 cid;
  1456. uint32 shid;
  1457. SVGA3dShaderType type;
  1458. /* Followed by variable number of DWORDs for shader bycode */
  1459. } SVGA3dCmdDefineShader; /* SVGA_3D_CMD_SHADER_DEFINE */
  1460. typedef
  1461. struct {
  1462. uint32 cid;
  1463. uint32 shid;
  1464. SVGA3dShaderType type;
  1465. } SVGA3dCmdDestroyShader; /* SVGA_3D_CMD_SHADER_DESTROY */
  1466. typedef
  1467. struct {
  1468. uint32 cid;
  1469. uint32 reg; /* register number */
  1470. SVGA3dShaderType type;
  1471. SVGA3dShaderConstType ctype;
  1472. uint32 values[4];
  1473. } SVGA3dCmdSetShaderConst; /* SVGA_3D_CMD_SET_SHADER_CONST */
  1474. typedef
  1475. struct {
  1476. uint32 cid;
  1477. SVGA3dShaderType type;
  1478. uint32 shid;
  1479. } SVGA3dCmdSetShader; /* SVGA_3D_CMD_SET_SHADER */
  1480. typedef
  1481. struct {
  1482. uint32 cid;
  1483. SVGA3dQueryType type;
  1484. } SVGA3dCmdBeginQuery; /* SVGA_3D_CMD_BEGIN_QUERY */
  1485. typedef
  1486. struct {
  1487. uint32 cid;
  1488. SVGA3dQueryType type;
  1489. SVGAGuestPtr guestResult; /* Points to an SVGA3dQueryResult structure */
  1490. } SVGA3dCmdEndQuery; /* SVGA_3D_CMD_END_QUERY */
  1491. typedef
  1492. struct {
  1493. uint32 cid; /* Same parameters passed to END_QUERY */
  1494. SVGA3dQueryType type;
  1495. SVGAGuestPtr guestResult;
  1496. } SVGA3dCmdWaitForQuery; /* SVGA_3D_CMD_WAIT_FOR_QUERY */
  1497. typedef
  1498. struct {
  1499. uint32 totalSize; /* Set by guest before query is ended. */
  1500. SVGA3dQueryState state; /* Set by host or guest. See SVGA3dQueryState. */
  1501. union { /* Set by host on exit from PENDING state */
  1502. uint32 result32;
  1503. };
  1504. } SVGA3dQueryResult;
  1505. /*
  1506. * SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN --
  1507. *
  1508. * This is a blit from an SVGA3D surface to a Screen Object. Just
  1509. * like GMR-to-screen blits, this blit may be directed at a
  1510. * specific screen or to the virtual coordinate space.
  1511. *
  1512. * The blit copies from a rectangular region of an SVGA3D surface
  1513. * image to a rectangular region of a screen or screens.
  1514. *
  1515. * This command takes an optional variable-length list of clipping
  1516. * rectangles after the body of the command. If no rectangles are
  1517. * specified, there is no clipping region. The entire destRect is
  1518. * drawn to. If one or more rectangles are included, they describe
  1519. * a clipping region. The clip rectangle coordinates are measured
  1520. * relative to the top-left corner of destRect.
  1521. *
  1522. * This clipping region serves multiple purposes:
  1523. *
  1524. * - It can be used to perform an irregularly shaped blit more
  1525. * efficiently than by issuing many separate blit commands.
  1526. *
  1527. * - It is equivalent to allowing blits with non-integer
  1528. * source coordinates. You could blit just one half-pixel
  1529. * of a source, for example, by specifying a larger
  1530. * destination rectangle than you need, then removing
  1531. * part of it using a clip rectangle.
  1532. *
  1533. * Availability:
  1534. * SVGA_FIFO_CAP_SCREEN_OBJECT
  1535. *
  1536. * Limitations:
  1537. *
  1538. * - Currently, no backend supports blits from a mipmap or face
  1539. * other than the first one.
  1540. */
  1541. typedef
  1542. struct {
  1543. SVGA3dSurfaceImageId srcImage;
  1544. SVGASignedRect srcRect;
  1545. uint32 destScreenId; /* Screen ID or SVGA_ID_INVALID for virt. coords */
  1546. SVGASignedRect destRect; /* Supports scaling if src/rest different size */
  1547. /* Clipping: zero or more SVGASignedRects follow */
  1548. } SVGA3dCmdBlitSurfaceToScreen; /* SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN */
  1549. typedef
  1550. struct {
  1551. uint32 sid;
  1552. SVGA3dTextureFilter filter;
  1553. } SVGA3dCmdGenerateMipmaps; /* SVGA_3D_CMD_GENERATE_MIPMAPS */
  1554. /*
  1555. * Capability query index.
  1556. *
  1557. * Notes:
  1558. *
  1559. * 1. SVGA3D_DEVCAP_MAX_TEXTURES reflects the maximum number of
  1560. * fixed-function texture units available. Each of these units
  1561. * work in both FFP and Shader modes, and they support texture
  1562. * transforms and texture coordinates. The host may have additional
  1563. * texture image units that are only usable with shaders.
  1564. *
  1565. * 2. The BUFFER_FORMAT capabilities are deprecated, and they always
  1566. * return TRUE. Even on physical hardware that does not support
  1567. * these formats natively, the SVGA3D device will provide an emulation
  1568. * which should be invisible to the guest OS.
  1569. *
  1570. * In general, the SVGA3D device should support any operation on
  1571. * any surface format, it just may perform some of these
  1572. * operations in software depending on the capabilities of the
  1573. * available physical hardware.
  1574. *
  1575. * XXX: In the future, we will add capabilities that describe in
  1576. * detail what formats are supported in hardware for what kinds
  1577. * of operations.
  1578. */
  1579. typedef enum {
  1580. SVGA3D_DEVCAP_3D = 0,
  1581. SVGA3D_DEVCAP_MAX_LIGHTS = 1,
  1582. SVGA3D_DEVCAP_MAX_TEXTURES = 2, /* See note (1) */
  1583. SVGA3D_DEVCAP_MAX_CLIP_PLANES = 3,
  1584. SVGA3D_DEVCAP_VERTEX_SHADER_VERSION = 4,
  1585. SVGA3D_DEVCAP_VERTEX_SHADER = 5,
  1586. SVGA3D_DEVCAP_FRAGMENT_SHADER_VERSION = 6,
  1587. SVGA3D_DEVCAP_FRAGMENT_SHADER = 7,
  1588. SVGA3D_DEVCAP_MAX_RENDER_TARGETS = 8,
  1589. SVGA3D_DEVCAP_S23E8_TEXTURES = 9,
  1590. SVGA3D_DEVCAP_S10E5_TEXTURES = 10,
  1591. SVGA3D_DEVCAP_MAX_FIXED_VERTEXBLEND = 11,
  1592. SVGA3D_DEVCAP_D16_BUFFER_FORMAT = 12, /* See note (2) */
  1593. SVGA3D_DEVCAP_D24S8_BUFFER_FORMAT = 13, /* See note (2) */
  1594. SVGA3D_DEVCAP_D24X8_BUFFER_FORMAT = 14, /* See note (2) */
  1595. SVGA3D_DEVCAP_QUERY_TYPES = 15,
  1596. SVGA3D_DEVCAP_TEXTURE_GRADIENT_SAMPLING = 16,
  1597. SVGA3D_DEVCAP_MAX_POINT_SIZE = 17,
  1598. SVGA3D_DEVCAP_MAX_SHADER_TEXTURES = 18,
  1599. SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH = 19,
  1600. SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT = 20,
  1601. SVGA3D_DEVCAP_MAX_VOLUME_EXTENT = 21,
  1602. SVGA3D_DEVCAP_MAX_TEXTURE_REPEAT = 22,
  1603. SVGA3D_DEVCAP_MAX_TEXTURE_ASPECT_RATIO = 23,
  1604. SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY = 24,
  1605. SVGA3D_DEVCAP_MAX_PRIMITIVE_COUNT = 25,
  1606. SVGA3D_DEVCAP_MAX_VERTEX_INDEX = 26,
  1607. SVGA3D_DEVCAP_MAX_VERTEX_SHADER_INSTRUCTIONS = 27,
  1608. SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_INSTRUCTIONS = 28,
  1609. SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS = 29,
  1610. SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS = 30,
  1611. SVGA3D_DEVCAP_TEXTURE_OPS = 31,
  1612. SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8 = 32,
  1613. SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8 = 33,
  1614. SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10 = 34,
  1615. SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5 = 35,
  1616. SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5 = 36,
  1617. SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4 = 37,
  1618. SVGA3D_DEVCAP_SURFACEFMT_R5G6B5 = 38,
  1619. SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE16 = 39,
  1620. SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8_ALPHA8 = 40,
  1621. SVGA3D_DEVCAP_SURFACEFMT_ALPHA8 = 41,
  1622. SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8 = 42,
  1623. SVGA3D_DEVCAP_SURFACEFMT_Z_D16 = 43,
  1624. SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8 = 44,
  1625. SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8 = 45,
  1626. SVGA3D_DEVCAP_SURFACEFMT_DXT1 = 46,
  1627. SVGA3D_DEVCAP_SURFACEFMT_DXT2 = 47,
  1628. SVGA3D_DEVCAP_SURFACEFMT_DXT3 = 48,
  1629. SVGA3D_DEVCAP_SURFACEFMT_DXT4 = 49,
  1630. SVGA3D_DEVCAP_SURFACEFMT_DXT5 = 50,
  1631. SVGA3D_DEVCAP_SURFACEFMT_BUMPX8L8V8U8 = 51,
  1632. SVGA3D_DEVCAP_SURFACEFMT_A2W10V10U10 = 52,
  1633. SVGA3D_DEVCAP_SURFACEFMT_BUMPU8V8 = 53,
  1634. SVGA3D_DEVCAP_SURFACEFMT_Q8W8V8U8 = 54,
  1635. SVGA3D_DEVCAP_SURFACEFMT_CxV8U8 = 55,
  1636. SVGA3D_DEVCAP_SURFACEFMT_R_S10E5 = 56,
  1637. SVGA3D_DEVCAP_SURFACEFMT_R_S23E8 = 57,
  1638. SVGA3D_DEVCAP_SURFACEFMT_RG_S10E5 = 58,
  1639. SVGA3D_DEVCAP_SURFACEFMT_RG_S23E8 = 59,
  1640. SVGA3D_DEVCAP_SURFACEFMT_ARGB_S10E5 = 60,
  1641. SVGA3D_DEVCAP_SURFACEFMT_ARGB_S23E8 = 61,
  1642. SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEXTURES = 63,
  1643. /*
  1644. * Note that MAX_SIMULTANEOUS_RENDER_TARGETS is a maximum count of color
  1645. * render targets. This does no include the depth or stencil targets.
  1646. */
  1647. SVGA3D_DEVCAP_MAX_SIMULTANEOUS_RENDER_TARGETS = 64,
  1648. SVGA3D_DEVCAP_SURFACEFMT_V16U16 = 65,
  1649. SVGA3D_DEVCAP_SURFACEFMT_G16R16 = 66,
  1650. SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16 = 67,
  1651. SVGA3D_DEVCAP_SURFACEFMT_UYVY = 68,
  1652. SVGA3D_DEVCAP_SURFACEFMT_YUY2 = 69,
  1653. SVGA3D_DEVCAP_MULTISAMPLE_NONMASKABLESAMPLES = 70,
  1654. SVGA3D_DEVCAP_MULTISAMPLE_MASKABLESAMPLES = 71,
  1655. SVGA3D_DEVCAP_ALPHATOCOVERAGE = 72,
  1656. SVGA3D_DEVCAP_SUPERSAMPLE = 73,
  1657. SVGA3D_DEVCAP_AUTOGENMIPMAPS = 74,
  1658. SVGA3D_DEVCAP_SURFACEFMT_NV12 = 75,
  1659. SVGA3D_DEVCAP_SURFACEFMT_AYUV = 76,
  1660. /*
  1661. * This is the maximum number of SVGA context IDs that the guest
  1662. * can define using SVGA_3D_CMD_CONTEXT_DEFINE.
  1663. */
  1664. SVGA3D_DEVCAP_MAX_CONTEXT_IDS = 77,
  1665. /*
  1666. * This is the maximum number of SVGA surface IDs that the guest
  1667. * can define using SVGA_3D_CMD_SURFACE_DEFINE*.
  1668. */
  1669. SVGA3D_DEVCAP_MAX_SURFACE_IDS = 78,
  1670. SVGA3D_DEVCAP_SURFACEFMT_Z_DF16 = 79,
  1671. SVGA3D_DEVCAP_SURFACEFMT_Z_DF24 = 80,
  1672. SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT = 81,
  1673. SVGA3D_DEVCAP_SURFACEFMT_BC4_UNORM = 82,
  1674. SVGA3D_DEVCAP_SURFACEFMT_BC5_UNORM = 83,
  1675. /*
  1676. * Don't add new caps into the previous section; the values in this
  1677. * enumeration must not change. You can put new values right before
  1678. * SVGA3D_DEVCAP_MAX.
  1679. */
  1680. SVGA3D_DEVCAP_MAX /* This must be the last index. */
  1681. } SVGA3dDevCapIndex;
  1682. typedef union {
  1683. Bool b;
  1684. uint32 u;
  1685. int32 i;
  1686. float f;
  1687. } SVGA3dDevCapResult;
  1688. #endif /* _SVGA3D_REG_H_ */