enums.go 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909
  1. // Code generated by github.com/cogentcore/webgpu/cmd/enums; DO NOT EDIT.
  2. package wgpu
  3. type AdapterType uint32
  4. const (
  5. AdapterTypeDiscreteGPU AdapterType = 0x00000000
  6. AdapterTypeIntegratedGPU AdapterType = 0x00000001
  7. AdapterTypeCPU AdapterType = 0x00000002
  8. AdapterTypeUnknown AdapterType = 0x00000003
  9. )
  10. func (v AdapterType) String() string {
  11. switch v {
  12. case AdapterTypeDiscreteGPU:
  13. return "discrete-gpu"
  14. case AdapterTypeIntegratedGPU:
  15. return "integrated-gpu"
  16. case AdapterTypeCPU:
  17. return "cpu"
  18. case AdapterTypeUnknown:
  19. return "unknown"
  20. default:
  21. return ""
  22. }
  23. }
  24. type AddressMode uint32
  25. const (
  26. AddressModeRepeat AddressMode = 0x00000000
  27. AddressModeMirrorRepeat AddressMode = 0x00000001
  28. AddressModeClampToEdge AddressMode = 0x00000002
  29. )
  30. func (v AddressMode) String() string {
  31. switch v {
  32. case AddressModeRepeat:
  33. return "repeat"
  34. case AddressModeMirrorRepeat:
  35. return "mirror-repeat"
  36. case AddressModeClampToEdge:
  37. return "clamp-to-edge"
  38. default:
  39. return ""
  40. }
  41. }
  42. type BackendType uint32
  43. const (
  44. BackendTypeUndefined BackendType = 0x00000000
  45. BackendTypeNull BackendType = 0x00000001
  46. BackendTypeWebGPU BackendType = 0x00000002
  47. BackendTypeD3D11 BackendType = 0x00000003
  48. BackendTypeD3D12 BackendType = 0x00000004
  49. BackendTypeMetal BackendType = 0x00000005
  50. BackendTypeVulkan BackendType = 0x00000006
  51. BackendTypeOpenGL BackendType = 0x00000007
  52. BackendTypeOpenGLES BackendType = 0x00000008
  53. )
  54. func (v BackendType) String() string {
  55. switch v {
  56. case BackendTypeUndefined:
  57. return "undefined"
  58. case BackendTypeNull:
  59. return "null"
  60. case BackendTypeWebGPU:
  61. return "web-gpu"
  62. case BackendTypeD3D11:
  63. return "d3d11"
  64. case BackendTypeD3D12:
  65. return "d3d12"
  66. case BackendTypeMetal:
  67. return "metal"
  68. case BackendTypeVulkan:
  69. return "vulkan"
  70. case BackendTypeOpenGL:
  71. return "open-gl"
  72. case BackendTypeOpenGLES:
  73. return "open-gles"
  74. default:
  75. return ""
  76. }
  77. }
  78. type BlendFactor uint32
  79. const (
  80. BlendFactorZero BlendFactor = 0x00000000
  81. BlendFactorOne BlendFactor = 0x00000001
  82. BlendFactorSrc BlendFactor = 0x00000002
  83. BlendFactorOneMinusSrc BlendFactor = 0x00000003
  84. BlendFactorSrcAlpha BlendFactor = 0x00000004
  85. BlendFactorOneMinusSrcAlpha BlendFactor = 0x00000005
  86. BlendFactorDst BlendFactor = 0x00000006
  87. BlendFactorOneMinusDst BlendFactor = 0x00000007
  88. BlendFactorDstAlpha BlendFactor = 0x00000008
  89. BlendFactorOneMinusDstAlpha BlendFactor = 0x00000009
  90. BlendFactorSrcAlphaSaturated BlendFactor = 0x0000000A
  91. BlendFactorConstant BlendFactor = 0x0000000B
  92. BlendFactorOneMinusConstant BlendFactor = 0x0000000C
  93. )
  94. func (v BlendFactor) String() string {
  95. switch v {
  96. case BlendFactorZero:
  97. return "zero"
  98. case BlendFactorOne:
  99. return "one"
  100. case BlendFactorSrc:
  101. return "src"
  102. case BlendFactorOneMinusSrc:
  103. return "one-minus-src"
  104. case BlendFactorSrcAlpha:
  105. return "src-alpha"
  106. case BlendFactorOneMinusSrcAlpha:
  107. return "one-minus-src-alpha"
  108. case BlendFactorDst:
  109. return "dst"
  110. case BlendFactorOneMinusDst:
  111. return "one-minus-dst"
  112. case BlendFactorDstAlpha:
  113. return "dst-alpha"
  114. case BlendFactorOneMinusDstAlpha:
  115. return "one-minus-dst-alpha"
  116. case BlendFactorSrcAlphaSaturated:
  117. return "src-alpha-saturated"
  118. case BlendFactorConstant:
  119. return "constant"
  120. case BlendFactorOneMinusConstant:
  121. return "one-minus-constant"
  122. default:
  123. return ""
  124. }
  125. }
  126. type BlendOperation uint32
  127. const (
  128. BlendOperationAdd BlendOperation = 0x00000000
  129. BlendOperationSubtract BlendOperation = 0x00000001
  130. BlendOperationReverseSubtract BlendOperation = 0x00000002
  131. BlendOperationMin BlendOperation = 0x00000003
  132. BlendOperationMax BlendOperation = 0x00000004
  133. )
  134. func (v BlendOperation) String() string {
  135. switch v {
  136. case BlendOperationAdd:
  137. return "add"
  138. case BlendOperationSubtract:
  139. return "subtract"
  140. case BlendOperationReverseSubtract:
  141. return "reverse-subtract"
  142. case BlendOperationMin:
  143. return "min"
  144. case BlendOperationMax:
  145. return "max"
  146. default:
  147. return ""
  148. }
  149. }
  150. type BufferBindingType uint32
  151. const (
  152. BufferBindingTypeUndefined BufferBindingType = 0x00000000
  153. BufferBindingTypeUniform BufferBindingType = 0x00000001
  154. BufferBindingTypeStorage BufferBindingType = 0x00000002
  155. BufferBindingTypeReadOnlyStorage BufferBindingType = 0x00000003
  156. )
  157. func (v BufferBindingType) String() string {
  158. switch v {
  159. case BufferBindingTypeUndefined:
  160. return "undefined"
  161. case BufferBindingTypeUniform:
  162. return "uniform"
  163. case BufferBindingTypeStorage:
  164. return "storage"
  165. case BufferBindingTypeReadOnlyStorage:
  166. return "read-only-storage"
  167. default:
  168. return ""
  169. }
  170. }
  171. type BufferMapAsyncStatus uint32
  172. const (
  173. BufferMapAsyncStatusSuccess BufferMapAsyncStatus = 0x00000000
  174. BufferMapAsyncStatusValidationError BufferMapAsyncStatus = 0x00000001
  175. BufferMapAsyncStatusUnknown BufferMapAsyncStatus = 0x00000002
  176. BufferMapAsyncStatusDeviceLost BufferMapAsyncStatus = 0x00000003
  177. BufferMapAsyncStatusDestroyedBeforeCallback BufferMapAsyncStatus = 0x00000004
  178. BufferMapAsyncStatusUnmappedBeforeCallback BufferMapAsyncStatus = 0x00000005
  179. BufferMapAsyncStatusMappingAlreadyPending BufferMapAsyncStatus = 0x00000006
  180. BufferMapAsyncStatusOffsetOutOfRange BufferMapAsyncStatus = 0x00000007
  181. BufferMapAsyncStatusSizeOutOfRange BufferMapAsyncStatus = 0x00000008
  182. )
  183. func (v BufferMapAsyncStatus) String() string {
  184. switch v {
  185. case BufferMapAsyncStatusSuccess:
  186. return "success"
  187. case BufferMapAsyncStatusValidationError:
  188. return "validation-error"
  189. case BufferMapAsyncStatusUnknown:
  190. return "unknown"
  191. case BufferMapAsyncStatusDeviceLost:
  192. return "device-lost"
  193. case BufferMapAsyncStatusDestroyedBeforeCallback:
  194. return "destroyed-before-callback"
  195. case BufferMapAsyncStatusUnmappedBeforeCallback:
  196. return "unmapped-before-callback"
  197. case BufferMapAsyncStatusMappingAlreadyPending:
  198. return "mapping-already-pending"
  199. case BufferMapAsyncStatusOffsetOutOfRange:
  200. return "offset-out-of-range"
  201. case BufferMapAsyncStatusSizeOutOfRange:
  202. return "size-out-of-range"
  203. default:
  204. return ""
  205. }
  206. }
  207. type BufferMapState uint32
  208. const (
  209. BufferMapStateUnmapped BufferMapState = 0x00000000
  210. BufferMapStatePending BufferMapState = 0x00000001
  211. BufferMapStateMapped BufferMapState = 0x00000002
  212. )
  213. func (v BufferMapState) String() string {
  214. switch v {
  215. case BufferMapStateUnmapped:
  216. return "unmapped"
  217. case BufferMapStatePending:
  218. return "pending"
  219. case BufferMapStateMapped:
  220. return "mapped"
  221. default:
  222. return ""
  223. }
  224. }
  225. type BufferUsage uint32
  226. const (
  227. BufferUsageNone BufferUsage = 0x00000000
  228. BufferUsageMapRead BufferUsage = 0x00000001
  229. BufferUsageMapWrite BufferUsage = 0x00000002
  230. BufferUsageCopySrc BufferUsage = 0x00000004
  231. BufferUsageCopyDst BufferUsage = 0x00000008
  232. BufferUsageIndex BufferUsage = 0x00000010
  233. BufferUsageVertex BufferUsage = 0x00000020
  234. BufferUsageUniform BufferUsage = 0x00000040
  235. BufferUsageStorage BufferUsage = 0x00000080
  236. BufferUsageIndirect BufferUsage = 0x00000100
  237. BufferUsageQueryResolve BufferUsage = 0x00000200
  238. )
  239. func (v BufferUsage) String() string {
  240. switch v {
  241. case BufferUsageNone:
  242. return "none"
  243. case BufferUsageMapRead:
  244. return "map-read"
  245. case BufferUsageMapWrite:
  246. return "map-write"
  247. case BufferUsageCopySrc:
  248. return "copy-src"
  249. case BufferUsageCopyDst:
  250. return "copy-dst"
  251. case BufferUsageIndex:
  252. return "index"
  253. case BufferUsageVertex:
  254. return "vertex"
  255. case BufferUsageUniform:
  256. return "uniform"
  257. case BufferUsageStorage:
  258. return "storage"
  259. case BufferUsageIndirect:
  260. return "indirect"
  261. case BufferUsageQueryResolve:
  262. return "query-resolve"
  263. default:
  264. return ""
  265. }
  266. }
  267. type ColorWriteMask uint32
  268. const (
  269. ColorWriteMaskNone ColorWriteMask = 0x00000000
  270. ColorWriteMaskRed ColorWriteMask = 0x00000001
  271. ColorWriteMaskGreen ColorWriteMask = 0x00000002
  272. ColorWriteMaskBlue ColorWriteMask = 0x00000004
  273. ColorWriteMaskAlpha ColorWriteMask = 0x00000008
  274. ColorWriteMaskAll ColorWriteMask = 0x0000000F
  275. )
  276. func (v ColorWriteMask) String() string {
  277. switch v {
  278. case ColorWriteMaskNone:
  279. return "none"
  280. case ColorWriteMaskRed:
  281. return "red"
  282. case ColorWriteMaskGreen:
  283. return "green"
  284. case ColorWriteMaskBlue:
  285. return "blue"
  286. case ColorWriteMaskAlpha:
  287. return "alpha"
  288. case ColorWriteMaskAll:
  289. return "all"
  290. default:
  291. return ""
  292. }
  293. }
  294. type CompareFunction uint32
  295. const (
  296. CompareFunctionUndefined CompareFunction = 0x00000000
  297. CompareFunctionNever CompareFunction = 0x00000001
  298. CompareFunctionLess CompareFunction = 0x00000002
  299. CompareFunctionLessEqual CompareFunction = 0x00000003
  300. CompareFunctionGreater CompareFunction = 0x00000004
  301. CompareFunctionGreaterEqual CompareFunction = 0x00000005
  302. CompareFunctionEqual CompareFunction = 0x00000006
  303. CompareFunctionNotEqual CompareFunction = 0x00000007
  304. CompareFunctionAlways CompareFunction = 0x00000008
  305. )
  306. func (v CompareFunction) String() string {
  307. switch v {
  308. case CompareFunctionUndefined:
  309. return "undefined"
  310. case CompareFunctionNever:
  311. return "never"
  312. case CompareFunctionLess:
  313. return "less"
  314. case CompareFunctionLessEqual:
  315. return "less-equal"
  316. case CompareFunctionGreater:
  317. return "greater"
  318. case CompareFunctionGreaterEqual:
  319. return "greater-equal"
  320. case CompareFunctionEqual:
  321. return "equal"
  322. case CompareFunctionNotEqual:
  323. return "not-equal"
  324. case CompareFunctionAlways:
  325. return "always"
  326. default:
  327. return ""
  328. }
  329. }
  330. type CompilationInfoRequestStatus uint32
  331. const (
  332. CompilationInfoRequestStatusSuccess CompilationInfoRequestStatus = 0x00000000
  333. CompilationInfoRequestStatusError CompilationInfoRequestStatus = 0x00000001
  334. CompilationInfoRequestStatusDeviceLost CompilationInfoRequestStatus = 0x00000002
  335. CompilationInfoRequestStatusUnknown CompilationInfoRequestStatus = 0x00000003
  336. )
  337. func (v CompilationInfoRequestStatus) String() string {
  338. switch v {
  339. case CompilationInfoRequestStatusSuccess:
  340. return "success"
  341. case CompilationInfoRequestStatusError:
  342. return "error"
  343. case CompilationInfoRequestStatusDeviceLost:
  344. return "device-lost"
  345. case CompilationInfoRequestStatusUnknown:
  346. return "unknown"
  347. default:
  348. return ""
  349. }
  350. }
  351. type CompilationMessageType uint32
  352. const (
  353. CompilationMessageTypeError CompilationMessageType = 0x00000000
  354. CompilationMessageTypeWarning CompilationMessageType = 0x00000001
  355. CompilationMessageTypeInfo CompilationMessageType = 0x00000002
  356. )
  357. func (v CompilationMessageType) String() string {
  358. switch v {
  359. case CompilationMessageTypeError:
  360. return "error"
  361. case CompilationMessageTypeWarning:
  362. return "warning"
  363. case CompilationMessageTypeInfo:
  364. return "info"
  365. default:
  366. return ""
  367. }
  368. }
  369. type CompositeAlphaMode uint32
  370. const (
  371. CompositeAlphaModeAuto CompositeAlphaMode = 0x00000000
  372. CompositeAlphaModeOpaque CompositeAlphaMode = 0x00000001
  373. CompositeAlphaModePremultiplied CompositeAlphaMode = 0x00000002
  374. CompositeAlphaModeUnpremultiplied CompositeAlphaMode = 0x00000003
  375. CompositeAlphaModeInherit CompositeAlphaMode = 0x00000004
  376. )
  377. func (v CompositeAlphaMode) String() string {
  378. switch v {
  379. case CompositeAlphaModeAuto:
  380. return "auto"
  381. case CompositeAlphaModeOpaque:
  382. return "opaque"
  383. case CompositeAlphaModePremultiplied:
  384. return "premultiplied"
  385. case CompositeAlphaModeUnpremultiplied:
  386. return "unpremultiplied"
  387. case CompositeAlphaModeInherit:
  388. return "inherit"
  389. default:
  390. return ""
  391. }
  392. }
  393. type CreatePipelineAsyncStatus uint32
  394. const (
  395. CreatePipelineAsyncStatusSuccess CreatePipelineAsyncStatus = 0x00000000
  396. CreatePipelineAsyncStatusValidationError CreatePipelineAsyncStatus = 0x00000001
  397. CreatePipelineAsyncStatusInternalError CreatePipelineAsyncStatus = 0x00000002
  398. CreatePipelineAsyncStatusDeviceLost CreatePipelineAsyncStatus = 0x00000003
  399. CreatePipelineAsyncStatusDeviceDestroyed CreatePipelineAsyncStatus = 0x00000004
  400. CreatePipelineAsyncStatusUnknown CreatePipelineAsyncStatus = 0x00000005
  401. )
  402. func (v CreatePipelineAsyncStatus) String() string {
  403. switch v {
  404. case CreatePipelineAsyncStatusSuccess:
  405. return "success"
  406. case CreatePipelineAsyncStatusValidationError:
  407. return "validation-error"
  408. case CreatePipelineAsyncStatusInternalError:
  409. return "internal-error"
  410. case CreatePipelineAsyncStatusDeviceLost:
  411. return "device-lost"
  412. case CreatePipelineAsyncStatusDeviceDestroyed:
  413. return "device-destroyed"
  414. case CreatePipelineAsyncStatusUnknown:
  415. return "unknown"
  416. default:
  417. return ""
  418. }
  419. }
  420. type CullMode uint32
  421. const (
  422. CullModeNone CullMode = 0x00000000
  423. CullModeFront CullMode = 0x00000001
  424. CullModeBack CullMode = 0x00000002
  425. )
  426. func (v CullMode) String() string {
  427. switch v {
  428. case CullModeNone:
  429. return "none"
  430. case CullModeFront:
  431. return "front"
  432. case CullModeBack:
  433. return "back"
  434. default:
  435. return ""
  436. }
  437. }
  438. type DeviceLostReason uint32
  439. const (
  440. DeviceLostReasonUnknown DeviceLostReason = 0x00000001
  441. DeviceLostReasonDestroyed DeviceLostReason = 0x00000002
  442. )
  443. func (v DeviceLostReason) String() string {
  444. switch v {
  445. case DeviceLostReasonUnknown:
  446. return "unknown"
  447. case DeviceLostReasonDestroyed:
  448. return "destroyed"
  449. default:
  450. return ""
  451. }
  452. }
  453. type Dx12Compiler uint32
  454. const (
  455. Dx12CompilerUndefined Dx12Compiler = 0x00000000
  456. Dx12CompilerFxc Dx12Compiler = 0x00000001
  457. Dx12CompilerDxc Dx12Compiler = 0x00000002
  458. )
  459. func (v Dx12Compiler) String() string {
  460. switch v {
  461. case Dx12CompilerUndefined:
  462. return "undefined"
  463. case Dx12CompilerFxc:
  464. return "fxc"
  465. case Dx12CompilerDxc:
  466. return "dxc"
  467. default:
  468. return ""
  469. }
  470. }
  471. type ErrorFilter uint32
  472. const (
  473. ErrorFilterValidation ErrorFilter = 0x00000000
  474. ErrorFilterOutOfMemory ErrorFilter = 0x00000001
  475. ErrorFilterInternal ErrorFilter = 0x00000002
  476. )
  477. func (v ErrorFilter) String() string {
  478. switch v {
  479. case ErrorFilterValidation:
  480. return "validation"
  481. case ErrorFilterOutOfMemory:
  482. return "out-of-memory"
  483. case ErrorFilterInternal:
  484. return "internal"
  485. default:
  486. return ""
  487. }
  488. }
  489. type ErrorType uint32
  490. const (
  491. ErrorTypeNoError ErrorType = 0x00000000
  492. ErrorTypeValidation ErrorType = 0x00000001
  493. ErrorTypeOutOfMemory ErrorType = 0x00000002
  494. ErrorTypeInternal ErrorType = 0x00000003
  495. ErrorTypeUnknown ErrorType = 0x00000004
  496. ErrorTypeDeviceLost ErrorType = 0x00000005
  497. )
  498. func (v ErrorType) String() string {
  499. switch v {
  500. case ErrorTypeNoError:
  501. return "no-error"
  502. case ErrorTypeValidation:
  503. return "validation"
  504. case ErrorTypeOutOfMemory:
  505. return "out-of-memory"
  506. case ErrorTypeInternal:
  507. return "internal"
  508. case ErrorTypeUnknown:
  509. return "unknown"
  510. case ErrorTypeDeviceLost:
  511. return "device-lost"
  512. default:
  513. return "unknown"
  514. }
  515. }
  516. type FeatureName uint32
  517. const (
  518. FeatureNameUndefined FeatureName = 0x00000000
  519. FeatureNameDepthClipControl FeatureName = 0x00000001
  520. FeatureNameDepth32FloatStencil8 FeatureName = 0x00000002
  521. FeatureNameTimestampQuery FeatureName = 0x00000003
  522. FeatureNameTextureCompressionBC FeatureName = 0x00000004
  523. FeatureNameTextureCompressionETC2 FeatureName = 0x00000005
  524. FeatureNameTextureCompressionASTC FeatureName = 0x00000006
  525. FeatureNameIndirectFirstInstance FeatureName = 0x00000007
  526. FeatureNameShaderF16 FeatureName = 0x00000008
  527. FeatureNameRG11B10UfloatRenderable FeatureName = 0x00000009
  528. FeatureNameBGRA8UnormStorage FeatureName = 0x0000000A
  529. FeatureNameFloat32Filterable FeatureName = 0x0000000B
  530. NativeFeaturePushConstants FeatureName = 0x00030001
  531. NativeFeatureTextureAdapterSpecificFormatFeatures FeatureName = 0x00030002
  532. NativeFeatureMultiDrawIndirect FeatureName = 0x00030003
  533. NativeFeatureMultiDrawIndirectCount FeatureName = 0x00030004
  534. NativeFeatureVertexWritableStorage FeatureName = 0x00030005
  535. NativeFeatureTextureBindingArray FeatureName = 0x00030006
  536. NativeFeatureSampledTextureAndStorageBufferArrayNonUniformIndexing FeatureName = 0x00030007
  537. NativeFeaturePipelineStatisticsQuery FeatureName = 0x00030008
  538. NativeFeatureStorageResourceBindingArray FeatureName = 0x00030009
  539. NativeFeaturePartiallyBoundBindingArray FeatureName = 0x0003000A
  540. NativeFeatureTextureFormat16bitNorm FeatureName = 0x0003000B
  541. NativeFeatureTextureCompressionAstcHdr FeatureName = 0x0003000C
  542. NativeFeatureMappablePrimaryBuffers FeatureName = 0x0003000E
  543. NativeFeatureBufferBindingArray FeatureName = 0x0003000F
  544. NativeFeatureUniformBufferAndStorageTextureArrayNonUniformIndexing FeatureName = 0x00030010
  545. NativeFeatureVertexAttribute64bit FeatureName = 0x00030019
  546. NativeFeatureShaderUnusedVertexOutput FeatureName = 0x0003001A
  547. NativeFeatureTextureFormatNv12 FeatureName = 0x0003001B
  548. NativeFeatureRayTracingAccelerationStructure FeatureName = 0x0003001C
  549. NativeFeatureRayQuery FeatureName = 0x0003001D
  550. NativeFeatureShaderF64 FeatureName = 0x0003001E
  551. NativeFeatureShaderI16 FeatureName = 0x0003001F
  552. NativeFeatureShaderPrimitiveIndex FeatureName = 0x00030020
  553. NativeFeatureShaderEarlyDepthTest FeatureName = 0x00030021
  554. )
  555. func (v FeatureName) String() string {
  556. switch v {
  557. case FeatureNameUndefined:
  558. return "undefined"
  559. case FeatureNameDepthClipControl:
  560. return "depth-clip-control"
  561. case FeatureNameDepth32FloatStencil8:
  562. return "depth32float-stencil8"
  563. case FeatureNameTimestampQuery:
  564. return "timestamp-query"
  565. case FeatureNameTextureCompressionBC:
  566. return "texture-compression-bc"
  567. case FeatureNameTextureCompressionETC2:
  568. return "texture-compression-etc2"
  569. case FeatureNameTextureCompressionASTC:
  570. return "texture-compression-astc"
  571. case FeatureNameIndirectFirstInstance:
  572. return "indirect-first-instance"
  573. case FeatureNameShaderF16:
  574. return "shader-f16"
  575. case FeatureNameRG11B10UfloatRenderable:
  576. return "rg11b10ufloat-renderable"
  577. case FeatureNameBGRA8UnormStorage:
  578. return "bgra8unorm-storage"
  579. case FeatureNameFloat32Filterable:
  580. return "float32filterable"
  581. case NativeFeaturePushConstants:
  582. return "native-feature-push-constants"
  583. case NativeFeatureTextureAdapterSpecificFormatFeatures:
  584. return "native-feature-texture-adapter-specific-format-features"
  585. case NativeFeatureMultiDrawIndirect:
  586. return "native-feature-multi-draw-indirect"
  587. case NativeFeatureMultiDrawIndirectCount:
  588. return "native-feature-multi-draw-indirect-count"
  589. case NativeFeatureVertexWritableStorage:
  590. return "native-feature-vertex-writable-storage"
  591. case NativeFeatureTextureBindingArray:
  592. return "native-feature-texture-binding-array"
  593. case NativeFeatureSampledTextureAndStorageBufferArrayNonUniformIndexing:
  594. return "native-feature-sampled-texture-and-storage-buffer-array-non-uniform-indexing"
  595. case NativeFeaturePipelineStatisticsQuery:
  596. return "native-feature-pipeline-statistics-query"
  597. case NativeFeatureStorageResourceBindingArray:
  598. return "native-feature-storage-resource-binding-array"
  599. case NativeFeaturePartiallyBoundBindingArray:
  600. return "native-feature-partially-bound-binding-array"
  601. case NativeFeatureTextureFormat16bitNorm:
  602. return "native-feature-texture-format16bit-norm"
  603. case NativeFeatureTextureCompressionAstcHdr:
  604. return "native-feature-texture-compression-astc-hdr"
  605. case NativeFeatureMappablePrimaryBuffers:
  606. return "native-feature-mappable-primary-buffers"
  607. case NativeFeatureBufferBindingArray:
  608. return "native-feature-buffer-binding-array"
  609. case NativeFeatureUniformBufferAndStorageTextureArrayNonUniformIndexing:
  610. return "native-feature-uniform-buffer-and-storage-texture-array-non-uniform-indexing"
  611. case NativeFeatureVertexAttribute64bit:
  612. return "native-feature-vertex-attribute64bit"
  613. case NativeFeatureShaderUnusedVertexOutput:
  614. return "native-feature-shader-unused-vertex-output"
  615. case NativeFeatureTextureFormatNv12:
  616. return "native-feature-texture-format-nv12"
  617. case NativeFeatureRayTracingAccelerationStructure:
  618. return "native-feature-ray-tracing-acceleration-structure"
  619. case NativeFeatureRayQuery:
  620. return "native-feature-ray-query"
  621. case NativeFeatureShaderF64:
  622. return "native-feature-shader-f64"
  623. case NativeFeatureShaderI16:
  624. return "native-feature-shader-i16"
  625. case NativeFeatureShaderPrimitiveIndex:
  626. return "native-feature-shader-primitive-index"
  627. case NativeFeatureShaderEarlyDepthTest:
  628. return "native-feature-shader-early-depth-test"
  629. default:
  630. return ""
  631. }
  632. }
  633. type FilterMode uint32
  634. const (
  635. FilterModeNearest FilterMode = 0x00000000
  636. FilterModeLinear FilterMode = 0x00000001
  637. )
  638. func (v FilterMode) String() string {
  639. switch v {
  640. case FilterModeNearest:
  641. return "nearest"
  642. case FilterModeLinear:
  643. return "linear"
  644. default:
  645. return ""
  646. }
  647. }
  648. type FrontFace uint32
  649. const (
  650. FrontFaceCCW FrontFace = 0x00000000
  651. FrontFaceCW FrontFace = 0x00000001
  652. )
  653. func (v FrontFace) String() string {
  654. switch v {
  655. case FrontFaceCCW:
  656. return "ccw"
  657. case FrontFaceCW:
  658. return "cw"
  659. default:
  660. return ""
  661. }
  662. }
  663. type Gles3MinorVersion uint32
  664. const (
  665. Gles3MinorVersionAutomatic Gles3MinorVersion = 0x00000000
  666. Gles3MinorVersionVersion0 Gles3MinorVersion = 0x00000001
  667. Gles3MinorVersionVersion1 Gles3MinorVersion = 0x00000002
  668. Gles3MinorVersionVersion2 Gles3MinorVersion = 0x00000003
  669. )
  670. func (v Gles3MinorVersion) String() string {
  671. switch v {
  672. case Gles3MinorVersionAutomatic:
  673. return "automatic"
  674. case Gles3MinorVersionVersion0:
  675. return "version0"
  676. case Gles3MinorVersionVersion1:
  677. return "version1"
  678. case Gles3MinorVersionVersion2:
  679. return "version2"
  680. default:
  681. return ""
  682. }
  683. }
  684. type IndexFormat uint32
  685. const (
  686. IndexFormatUndefined IndexFormat = 0x00000000
  687. IndexFormatUint16 IndexFormat = 0x00000001
  688. IndexFormatUint32 IndexFormat = 0x00000002
  689. )
  690. func (v IndexFormat) String() string {
  691. switch v {
  692. case IndexFormatUndefined:
  693. return "undefined"
  694. case IndexFormatUint16:
  695. return "uint16"
  696. case IndexFormatUint32:
  697. return "uint32"
  698. default:
  699. return ""
  700. }
  701. }
  702. type InstanceBackend uint32
  703. const (
  704. InstanceBackendAll InstanceBackend = 0x00000000
  705. InstanceBackendVulkan InstanceBackend = 0x00000001
  706. InstanceBackendGL InstanceBackend = 0x00000002
  707. InstanceBackendMetal InstanceBackend = 0x00000004
  708. InstanceBackendDX12 InstanceBackend = 0x00000008
  709. InstanceBackendDX11 InstanceBackend = 0x00000010
  710. InstanceBackendSecondary InstanceBackend = 0x00000012
  711. InstanceBackendBrowserWebGPU InstanceBackend = 0x00000020
  712. InstanceBackendPrimary InstanceBackend = 0x0000002D
  713. )
  714. func (v InstanceBackend) String() string {
  715. switch v {
  716. case InstanceBackendAll:
  717. return "all"
  718. case InstanceBackendVulkan:
  719. return "vulkan"
  720. case InstanceBackendGL:
  721. return "gl"
  722. case InstanceBackendMetal:
  723. return "metal"
  724. case InstanceBackendDX12:
  725. return "dx12"
  726. case InstanceBackendDX11:
  727. return "dx11"
  728. case InstanceBackendSecondary:
  729. return "secondary"
  730. case InstanceBackendBrowserWebGPU:
  731. return "browser-web-gpu"
  732. case InstanceBackendPrimary:
  733. return "primary"
  734. default:
  735. return ""
  736. }
  737. }
  738. type InstanceFlag uint32
  739. const (
  740. InstanceFlagDefault InstanceFlag = 0x00000000
  741. InstanceFlagDebug InstanceFlag = 0x00000001
  742. InstanceFlagValidation InstanceFlag = 0x00000002
  743. InstanceFlagDiscardHalLabels InstanceFlag = 0x00000004
  744. )
  745. func (v InstanceFlag) String() string {
  746. switch v {
  747. case InstanceFlagDefault:
  748. return "default"
  749. case InstanceFlagDebug:
  750. return "debug"
  751. case InstanceFlagValidation:
  752. return "validation"
  753. case InstanceFlagDiscardHalLabels:
  754. return "discard-hal-labels"
  755. default:
  756. return ""
  757. }
  758. }
  759. type LoadOp uint32
  760. const (
  761. LoadOpUndefined LoadOp = 0x00000000
  762. LoadOpClear LoadOp = 0x00000001
  763. LoadOpLoad LoadOp = 0x00000002
  764. )
  765. func (v LoadOp) String() string {
  766. switch v {
  767. case LoadOpUndefined:
  768. return "undefined"
  769. case LoadOpClear:
  770. return "clear"
  771. case LoadOpLoad:
  772. return "load"
  773. default:
  774. return ""
  775. }
  776. }
  777. type LogLevel uint32
  778. const (
  779. LogLevelOff LogLevel = 0x00000000
  780. LogLevelError LogLevel = 0x00000001
  781. LogLevelWarn LogLevel = 0x00000002
  782. LogLevelInfo LogLevel = 0x00000003
  783. LogLevelDebug LogLevel = 0x00000004
  784. LogLevelTrace LogLevel = 0x00000005
  785. )
  786. func (v LogLevel) String() string {
  787. switch v {
  788. case LogLevelOff:
  789. return "off"
  790. case LogLevelError:
  791. return "error"
  792. case LogLevelWarn:
  793. return "warn"
  794. case LogLevelInfo:
  795. return "info"
  796. case LogLevelDebug:
  797. return "debug"
  798. case LogLevelTrace:
  799. return "trace"
  800. default:
  801. return ""
  802. }
  803. }
  804. type MapMode uint32
  805. const (
  806. MapModeNone MapMode = 0x00000000
  807. MapModeRead MapMode = 0x00000001
  808. MapModeWrite MapMode = 0x00000002
  809. )
  810. func (v MapMode) String() string {
  811. switch v {
  812. case MapModeNone:
  813. return "none"
  814. case MapModeRead:
  815. return "read"
  816. case MapModeWrite:
  817. return "write"
  818. default:
  819. return ""
  820. }
  821. }
  822. type MipmapFilterMode uint32
  823. const (
  824. MipmapFilterModeNearest MipmapFilterMode = 0x00000000
  825. MipmapFilterModeLinear MipmapFilterMode = 0x00000001
  826. )
  827. func (v MipmapFilterMode) String() string {
  828. switch v {
  829. case MipmapFilterModeNearest:
  830. return "nearest"
  831. case MipmapFilterModeLinear:
  832. return "linear"
  833. default:
  834. return ""
  835. }
  836. }
  837. type NativeQueryType uint32
  838. const NativeQueryTypePipelineStatistics NativeQueryType = 0x00030000
  839. func (v NativeQueryType) String() string {
  840. switch v {
  841. case NativeQueryTypePipelineStatistics:
  842. return "pipeline-statistics"
  843. default:
  844. return ""
  845. }
  846. }
  847. type NativeTextureFormat uint32
  848. const (
  849. NativeTextureFormatR16Unorm NativeTextureFormat = 0x00030001
  850. NativeTextureFormatR16Snorm NativeTextureFormat = 0x00030002
  851. NativeTextureFormatRg16Unorm NativeTextureFormat = 0x00030003
  852. NativeTextureFormatRg16Snorm NativeTextureFormat = 0x00030004
  853. NativeTextureFormatRgba16Unorm NativeTextureFormat = 0x00030005
  854. NativeTextureFormatRgba16Snorm NativeTextureFormat = 0x00030006
  855. NativeTextureFormatNV12 NativeTextureFormat = 0x00030007
  856. )
  857. func (v NativeTextureFormat) String() string {
  858. switch v {
  859. case NativeTextureFormatR16Unorm:
  860. return "r16unorm"
  861. case NativeTextureFormatR16Snorm:
  862. return "r16snorm"
  863. case NativeTextureFormatRg16Unorm:
  864. return "rg16unorm"
  865. case NativeTextureFormatRg16Snorm:
  866. return "rg16snorm"
  867. case NativeTextureFormatRgba16Unorm:
  868. return "rgba16unorm"
  869. case NativeTextureFormatRgba16Snorm:
  870. return "rgba16snorm"
  871. case NativeTextureFormatNV12:
  872. return "nv12"
  873. default:
  874. return ""
  875. }
  876. }
  877. type PipelineStatisticName uint32
  878. const (
  879. PipelineStatisticNameVertexShaderInvocations PipelineStatisticName = 0x00000000
  880. PipelineStatisticNameClipperInvocations PipelineStatisticName = 0x00000001
  881. PipelineStatisticNameClipperPrimitivesOut PipelineStatisticName = 0x00000002
  882. PipelineStatisticNameFragmentShaderInvocations PipelineStatisticName = 0x00000003
  883. PipelineStatisticNameComputeShaderInvocations PipelineStatisticName = 0x00000004
  884. )
  885. func (v PipelineStatisticName) String() string {
  886. switch v {
  887. case PipelineStatisticNameVertexShaderInvocations:
  888. return "vertex-shader-invocations"
  889. case PipelineStatisticNameClipperInvocations:
  890. return "clipper-invocations"
  891. case PipelineStatisticNameClipperPrimitivesOut:
  892. return "clipper-primitives-out"
  893. case PipelineStatisticNameFragmentShaderInvocations:
  894. return "fragment-shader-invocations"
  895. case PipelineStatisticNameComputeShaderInvocations:
  896. return "compute-shader-invocations"
  897. default:
  898. return ""
  899. }
  900. }
  901. type PowerPreference uint32
  902. const (
  903. PowerPreferenceUndefined PowerPreference = 0x00000000
  904. PowerPreferenceLowPower PowerPreference = 0x00000001
  905. PowerPreferenceHighPerformance PowerPreference = 0x00000002
  906. )
  907. func (v PowerPreference) String() string {
  908. switch v {
  909. case PowerPreferenceUndefined:
  910. return "undefined"
  911. case PowerPreferenceLowPower:
  912. return "low-power"
  913. case PowerPreferenceHighPerformance:
  914. return "high-performance"
  915. default:
  916. return ""
  917. }
  918. }
  919. type PresentMode uint32
  920. const (
  921. PresentModeFifo PresentMode = 0x00000000
  922. PresentModeFifoRelaxed PresentMode = 0x00000001
  923. PresentModeImmediate PresentMode = 0x00000002
  924. PresentModeMailbox PresentMode = 0x00000003
  925. )
  926. func (v PresentMode) String() string {
  927. switch v {
  928. case PresentModeFifo:
  929. return "fifo"
  930. case PresentModeFifoRelaxed:
  931. return "fifo-relaxed"
  932. case PresentModeImmediate:
  933. return "immediate"
  934. case PresentModeMailbox:
  935. return "mailbox"
  936. default:
  937. return ""
  938. }
  939. }
  940. type PrimitiveTopology uint32
  941. const (
  942. PrimitiveTopologyPointList PrimitiveTopology = 0x00000000
  943. PrimitiveTopologyLineList PrimitiveTopology = 0x00000001
  944. PrimitiveTopologyLineStrip PrimitiveTopology = 0x00000002
  945. PrimitiveTopologyTriangleList PrimitiveTopology = 0x00000003
  946. PrimitiveTopologyTriangleStrip PrimitiveTopology = 0x00000004
  947. )
  948. func (v PrimitiveTopology) String() string {
  949. switch v {
  950. case PrimitiveTopologyPointList:
  951. return "point-list"
  952. case PrimitiveTopologyLineList:
  953. return "line-list"
  954. case PrimitiveTopologyLineStrip:
  955. return "line-strip"
  956. case PrimitiveTopologyTriangleList:
  957. return "triangle-list"
  958. case PrimitiveTopologyTriangleStrip:
  959. return "triangle-strip"
  960. default:
  961. return ""
  962. }
  963. }
  964. type QueryType uint32
  965. const (
  966. QueryTypeOcclusion QueryType = 0x00000000
  967. QueryTypeTimestamp QueryType = 0x00000001
  968. )
  969. func (v QueryType) String() string {
  970. switch v {
  971. case QueryTypeOcclusion:
  972. return "occlusion"
  973. case QueryTypeTimestamp:
  974. return "timestamp"
  975. default:
  976. return ""
  977. }
  978. }
  979. type QueueWorkDoneStatus uint32
  980. const (
  981. QueueWorkDoneStatusSuccess QueueWorkDoneStatus = 0x00000000
  982. QueueWorkDoneStatusError QueueWorkDoneStatus = 0x00000001
  983. QueueWorkDoneStatusUnknown QueueWorkDoneStatus = 0x00000002
  984. QueueWorkDoneStatusDeviceLost QueueWorkDoneStatus = 0x00000003
  985. )
  986. func (v QueueWorkDoneStatus) String() string {
  987. switch v {
  988. case QueueWorkDoneStatusSuccess:
  989. return "success"
  990. case QueueWorkDoneStatusError:
  991. return "error"
  992. case QueueWorkDoneStatusUnknown:
  993. return "unknown"
  994. case QueueWorkDoneStatusDeviceLost:
  995. return "device-lost"
  996. default:
  997. return ""
  998. }
  999. }
  1000. type RequestAdapterStatus uint32
  1001. const (
  1002. RequestAdapterStatusSuccess RequestAdapterStatus = 0x00000000
  1003. RequestAdapterStatusUnavailable RequestAdapterStatus = 0x00000001
  1004. RequestAdapterStatusError RequestAdapterStatus = 0x00000002
  1005. RequestAdapterStatusUnknown RequestAdapterStatus = 0x00000003
  1006. )
  1007. func (v RequestAdapterStatus) String() string {
  1008. switch v {
  1009. case RequestAdapterStatusSuccess:
  1010. return "success"
  1011. case RequestAdapterStatusUnavailable:
  1012. return "unavailable"
  1013. case RequestAdapterStatusError:
  1014. return "error"
  1015. case RequestAdapterStatusUnknown:
  1016. return "unknown"
  1017. default:
  1018. return ""
  1019. }
  1020. }
  1021. type RequestDeviceStatus uint32
  1022. const (
  1023. RequestDeviceStatusSuccess RequestDeviceStatus = 0x00000000
  1024. RequestDeviceStatusError RequestDeviceStatus = 0x00000001
  1025. RequestDeviceStatusUnknown RequestDeviceStatus = 0x00000002
  1026. )
  1027. func (v RequestDeviceStatus) String() string {
  1028. switch v {
  1029. case RequestDeviceStatusSuccess:
  1030. return "success"
  1031. case RequestDeviceStatusError:
  1032. return "error"
  1033. case RequestDeviceStatusUnknown:
  1034. return "unknown"
  1035. default:
  1036. return ""
  1037. }
  1038. }
  1039. type SamplerBindingType uint32
  1040. const (
  1041. SamplerBindingTypeUndefined SamplerBindingType = 0x00000000
  1042. SamplerBindingTypeFiltering SamplerBindingType = 0x00000001
  1043. SamplerBindingTypeNonFiltering SamplerBindingType = 0x00000002
  1044. SamplerBindingTypeComparison SamplerBindingType = 0x00000003
  1045. )
  1046. func (v SamplerBindingType) String() string {
  1047. switch v {
  1048. case SamplerBindingTypeUndefined:
  1049. return "undefined"
  1050. case SamplerBindingTypeFiltering:
  1051. return "filtering"
  1052. case SamplerBindingTypeNonFiltering:
  1053. return "non-filtering"
  1054. case SamplerBindingTypeComparison:
  1055. return "comparison"
  1056. default:
  1057. return ""
  1058. }
  1059. }
  1060. type ShaderStage uint32
  1061. const (
  1062. ShaderStageNone ShaderStage = 0x00000000
  1063. ShaderStageVertex ShaderStage = 0x00000001
  1064. ShaderStageFragment ShaderStage = 0x00000002
  1065. ShaderStageCompute ShaderStage = 0x00000004
  1066. )
  1067. func (v ShaderStage) String() string {
  1068. switch v {
  1069. case ShaderStageNone:
  1070. return "none"
  1071. case ShaderStageVertex:
  1072. return "vertex"
  1073. case ShaderStageFragment:
  1074. return "fragment"
  1075. case ShaderStageCompute:
  1076. return "compute"
  1077. default:
  1078. return ""
  1079. }
  1080. }
  1081. type StencilOperation uint32
  1082. const (
  1083. StencilOperationKeep StencilOperation = 0x00000000
  1084. StencilOperationZero StencilOperation = 0x00000001
  1085. StencilOperationReplace StencilOperation = 0x00000002
  1086. StencilOperationInvert StencilOperation = 0x00000003
  1087. StencilOperationIncrementClamp StencilOperation = 0x00000004
  1088. StencilOperationDecrementClamp StencilOperation = 0x00000005
  1089. StencilOperationIncrementWrap StencilOperation = 0x00000006
  1090. StencilOperationDecrementWrap StencilOperation = 0x00000007
  1091. )
  1092. func (v StencilOperation) String() string {
  1093. switch v {
  1094. case StencilOperationKeep:
  1095. return "keep"
  1096. case StencilOperationZero:
  1097. return "zero"
  1098. case StencilOperationReplace:
  1099. return "replace"
  1100. case StencilOperationInvert:
  1101. return "invert"
  1102. case StencilOperationIncrementClamp:
  1103. return "increment-clamp"
  1104. case StencilOperationDecrementClamp:
  1105. return "decrement-clamp"
  1106. case StencilOperationIncrementWrap:
  1107. return "increment-wrap"
  1108. case StencilOperationDecrementWrap:
  1109. return "decrement-wrap"
  1110. default:
  1111. return ""
  1112. }
  1113. }
  1114. type StorageTextureAccess uint32
  1115. const (
  1116. StorageTextureAccessUndefined StorageTextureAccess = 0x00000000
  1117. StorageTextureAccessWriteOnly StorageTextureAccess = 0x00000001
  1118. StorageTextureAccessReadOnly StorageTextureAccess = 0x00000002
  1119. StorageTextureAccessReadWrite StorageTextureAccess = 0x00000003
  1120. )
  1121. func (v StorageTextureAccess) String() string {
  1122. switch v {
  1123. case StorageTextureAccessUndefined:
  1124. return "undefined"
  1125. case StorageTextureAccessWriteOnly:
  1126. return "write-only"
  1127. case StorageTextureAccessReadOnly:
  1128. return "read-only"
  1129. case StorageTextureAccessReadWrite:
  1130. return "read-write"
  1131. default:
  1132. return ""
  1133. }
  1134. }
  1135. type StoreOp uint32
  1136. const (
  1137. StoreOpUndefined StoreOp = 0x00000000
  1138. StoreOpStore StoreOp = 0x00000001
  1139. StoreOpDiscard StoreOp = 0x00000002
  1140. )
  1141. func (v StoreOp) String() string {
  1142. switch v {
  1143. case StoreOpUndefined:
  1144. return "undefined"
  1145. case StoreOpStore:
  1146. return "store"
  1147. case StoreOpDiscard:
  1148. return "discard"
  1149. default:
  1150. return ""
  1151. }
  1152. }
  1153. type SurfaceGetCurrentTextureStatus uint32
  1154. const (
  1155. SurfaceGetCurrentTextureStatusSuccess SurfaceGetCurrentTextureStatus = 0x00000000
  1156. SurfaceGetCurrentTextureStatusTimeout SurfaceGetCurrentTextureStatus = 0x00000001
  1157. SurfaceGetCurrentTextureStatusOutdated SurfaceGetCurrentTextureStatus = 0x00000002
  1158. SurfaceGetCurrentTextureStatusLost SurfaceGetCurrentTextureStatus = 0x00000003
  1159. SurfaceGetCurrentTextureStatusOutOfMemory SurfaceGetCurrentTextureStatus = 0x00000004
  1160. SurfaceGetCurrentTextureStatusDeviceLost SurfaceGetCurrentTextureStatus = 0x00000005
  1161. )
  1162. func (v SurfaceGetCurrentTextureStatus) String() string {
  1163. switch v {
  1164. case SurfaceGetCurrentTextureStatusSuccess:
  1165. return "success"
  1166. case SurfaceGetCurrentTextureStatusTimeout:
  1167. return "timeout"
  1168. case SurfaceGetCurrentTextureStatusOutdated:
  1169. return "outdated"
  1170. case SurfaceGetCurrentTextureStatusLost:
  1171. return "lost"
  1172. case SurfaceGetCurrentTextureStatusOutOfMemory:
  1173. return "out-of-memory"
  1174. case SurfaceGetCurrentTextureStatusDeviceLost:
  1175. return "device-lost"
  1176. default:
  1177. return ""
  1178. }
  1179. }
  1180. type TextureAspect uint32
  1181. const (
  1182. TextureAspectAll TextureAspect = 0x00000000
  1183. TextureAspectStencilOnly TextureAspect = 0x00000001
  1184. TextureAspectDepthOnly TextureAspect = 0x00000002
  1185. )
  1186. func (v TextureAspect) String() string {
  1187. switch v {
  1188. case TextureAspectAll:
  1189. return "all"
  1190. case TextureAspectStencilOnly:
  1191. return "stencil-only"
  1192. case TextureAspectDepthOnly:
  1193. return "depth-only"
  1194. default:
  1195. return ""
  1196. }
  1197. }
  1198. type TextureDimension uint32
  1199. const (
  1200. TextureDimension1D TextureDimension = 0x00000000
  1201. TextureDimension2D TextureDimension = 0x00000001
  1202. TextureDimension3D TextureDimension = 0x00000002
  1203. )
  1204. func (v TextureDimension) String() string {
  1205. switch v {
  1206. case TextureDimension1D:
  1207. return "1d"
  1208. case TextureDimension2D:
  1209. return "2d"
  1210. case TextureDimension3D:
  1211. return "3d"
  1212. default:
  1213. return ""
  1214. }
  1215. }
  1216. type TextureFormat uint32
  1217. const (
  1218. TextureFormatUndefined TextureFormat = 0x00000000
  1219. TextureFormatR8Unorm TextureFormat = 0x00000001
  1220. TextureFormatR8Snorm TextureFormat = 0x00000002
  1221. TextureFormatR8Uint TextureFormat = 0x00000003
  1222. TextureFormatR8Sint TextureFormat = 0x00000004
  1223. TextureFormatR16Uint TextureFormat = 0x00000005
  1224. TextureFormatR16Sint TextureFormat = 0x00000006
  1225. TextureFormatR16Float TextureFormat = 0x00000007
  1226. TextureFormatRG8Unorm TextureFormat = 0x00000008
  1227. TextureFormatRG8Snorm TextureFormat = 0x00000009
  1228. TextureFormatRG8Uint TextureFormat = 0x0000000A
  1229. TextureFormatRG8Sint TextureFormat = 0x0000000B
  1230. TextureFormatR32Float TextureFormat = 0x0000000C
  1231. TextureFormatR32Uint TextureFormat = 0x0000000D
  1232. TextureFormatR32Sint TextureFormat = 0x0000000E
  1233. TextureFormatRG16Uint TextureFormat = 0x0000000F
  1234. TextureFormatRG16Sint TextureFormat = 0x00000010
  1235. TextureFormatRG16Float TextureFormat = 0x00000011
  1236. TextureFormatRGBA8Unorm TextureFormat = 0x00000012
  1237. TextureFormatRGBA8UnormSrgb TextureFormat = 0x00000013
  1238. TextureFormatRGBA8Snorm TextureFormat = 0x00000014
  1239. TextureFormatRGBA8Uint TextureFormat = 0x00000015
  1240. TextureFormatRGBA8Sint TextureFormat = 0x00000016
  1241. TextureFormatBGRA8Unorm TextureFormat = 0x00000017
  1242. TextureFormatBGRA8UnormSrgb TextureFormat = 0x00000018
  1243. TextureFormatRGB10A2Uint TextureFormat = 0x00000019
  1244. TextureFormatRGB10A2Unorm TextureFormat = 0x0000001A
  1245. TextureFormatRG11B10Ufloat TextureFormat = 0x0000001B
  1246. TextureFormatRGB9E5Ufloat TextureFormat = 0x0000001C
  1247. TextureFormatRG32Float TextureFormat = 0x0000001D
  1248. TextureFormatRG32Uint TextureFormat = 0x0000001E
  1249. TextureFormatRG32Sint TextureFormat = 0x0000001F
  1250. TextureFormatRGBA16Uint TextureFormat = 0x00000020
  1251. TextureFormatRGBA16Sint TextureFormat = 0x00000021
  1252. TextureFormatRGBA16Float TextureFormat = 0x00000022
  1253. TextureFormatRGBA32Float TextureFormat = 0x00000023
  1254. TextureFormatRGBA32Uint TextureFormat = 0x00000024
  1255. TextureFormatRGBA32Sint TextureFormat = 0x00000025
  1256. TextureFormatStencil8 TextureFormat = 0x00000026
  1257. TextureFormatDepth16Unorm TextureFormat = 0x00000027
  1258. TextureFormatDepth24Plus TextureFormat = 0x00000028
  1259. TextureFormatDepth24PlusStencil8 TextureFormat = 0x00000029
  1260. TextureFormatDepth32Float TextureFormat = 0x0000002A
  1261. TextureFormatDepth32FloatStencil8 TextureFormat = 0x0000002B
  1262. TextureFormatBC1RGBAUnorm TextureFormat = 0x0000002C
  1263. TextureFormatBC1RGBAUnormSrgb TextureFormat = 0x0000002D
  1264. TextureFormatBC2RGBAUnorm TextureFormat = 0x0000002E
  1265. TextureFormatBC2RGBAUnormSrgb TextureFormat = 0x0000002F
  1266. TextureFormatBC3RGBAUnorm TextureFormat = 0x00000030
  1267. TextureFormatBC3RGBAUnormSrgb TextureFormat = 0x00000031
  1268. TextureFormatBC4RUnorm TextureFormat = 0x00000032
  1269. TextureFormatBC4RSnorm TextureFormat = 0x00000033
  1270. TextureFormatBC5RGUnorm TextureFormat = 0x00000034
  1271. TextureFormatBC5RGSnorm TextureFormat = 0x00000035
  1272. TextureFormatBC6HRGBUfloat TextureFormat = 0x00000036
  1273. TextureFormatBC6HRGBFloat TextureFormat = 0x00000037
  1274. TextureFormatBC7RGBAUnorm TextureFormat = 0x00000038
  1275. TextureFormatBC7RGBAUnormSrgb TextureFormat = 0x00000039
  1276. TextureFormatETC2RGB8Unorm TextureFormat = 0x0000003A
  1277. TextureFormatETC2RGB8UnormSrgb TextureFormat = 0x0000003B
  1278. TextureFormatETC2RGB8A1Unorm TextureFormat = 0x0000003C
  1279. TextureFormatETC2RGB8A1UnormSrgb TextureFormat = 0x0000003D
  1280. TextureFormatETC2RGBA8Unorm TextureFormat = 0x0000003E
  1281. TextureFormatETC2RGBA8UnormSrgb TextureFormat = 0x0000003F
  1282. TextureFormatEACR11Unorm TextureFormat = 0x00000040
  1283. TextureFormatEACR11Snorm TextureFormat = 0x00000041
  1284. TextureFormatEACRG11Unorm TextureFormat = 0x00000042
  1285. TextureFormatEACRG11Snorm TextureFormat = 0x00000043
  1286. TextureFormatASTC4x4Unorm TextureFormat = 0x00000044
  1287. TextureFormatASTC4x4UnormSrgb TextureFormat = 0x00000045
  1288. TextureFormatASTC5x4Unorm TextureFormat = 0x00000046
  1289. TextureFormatASTC5x4UnormSrgb TextureFormat = 0x00000047
  1290. TextureFormatASTC5x5Unorm TextureFormat = 0x00000048
  1291. TextureFormatASTC5x5UnormSrgb TextureFormat = 0x00000049
  1292. TextureFormatASTC6x5Unorm TextureFormat = 0x0000004A
  1293. TextureFormatASTC6x5UnormSrgb TextureFormat = 0x0000004B
  1294. TextureFormatASTC6x6Unorm TextureFormat = 0x0000004C
  1295. TextureFormatASTC6x6UnormSrgb TextureFormat = 0x0000004D
  1296. TextureFormatASTC8x5Unorm TextureFormat = 0x0000004E
  1297. TextureFormatASTC8x5UnormSrgb TextureFormat = 0x0000004F
  1298. TextureFormatASTC8x6Unorm TextureFormat = 0x00000050
  1299. TextureFormatASTC8x6UnormSrgb TextureFormat = 0x00000051
  1300. TextureFormatASTC8x8Unorm TextureFormat = 0x00000052
  1301. TextureFormatASTC8x8UnormSrgb TextureFormat = 0x00000053
  1302. TextureFormatASTC10x5Unorm TextureFormat = 0x00000054
  1303. TextureFormatASTC10x5UnormSrgb TextureFormat = 0x00000055
  1304. TextureFormatASTC10x6Unorm TextureFormat = 0x00000056
  1305. TextureFormatASTC10x6UnormSrgb TextureFormat = 0x00000057
  1306. TextureFormatASTC10x8Unorm TextureFormat = 0x00000058
  1307. TextureFormatASTC10x8UnormSrgb TextureFormat = 0x00000059
  1308. TextureFormatASTC10x10Unorm TextureFormat = 0x0000005A
  1309. TextureFormatASTC10x10UnormSrgb TextureFormat = 0x0000005B
  1310. TextureFormatASTC12x10Unorm TextureFormat = 0x0000005C
  1311. TextureFormatASTC12x10UnormSrgb TextureFormat = 0x0000005D
  1312. TextureFormatASTC12x12Unorm TextureFormat = 0x0000005E
  1313. TextureFormatASTC12x12UnormSrgb TextureFormat = 0x0000005F
  1314. )
  1315. func (v TextureFormat) String() string {
  1316. switch v {
  1317. case TextureFormatUndefined:
  1318. return "undefined"
  1319. case TextureFormatR8Unorm:
  1320. return "r8unorm"
  1321. case TextureFormatR8Snorm:
  1322. return "r8snorm"
  1323. case TextureFormatR8Uint:
  1324. return "r8uint"
  1325. case TextureFormatR8Sint:
  1326. return "r8sint"
  1327. case TextureFormatR16Uint:
  1328. return "r16uint"
  1329. case TextureFormatR16Sint:
  1330. return "r16sint"
  1331. case TextureFormatR16Float:
  1332. return "r16float"
  1333. case TextureFormatRG8Unorm:
  1334. return "rg8unorm"
  1335. case TextureFormatRG8Snorm:
  1336. return "rg8snorm"
  1337. case TextureFormatRG8Uint:
  1338. return "rg8uint"
  1339. case TextureFormatRG8Sint:
  1340. return "rg8sint"
  1341. case TextureFormatR32Float:
  1342. return "r32float"
  1343. case TextureFormatR32Uint:
  1344. return "r32uint"
  1345. case TextureFormatR32Sint:
  1346. return "r32sint"
  1347. case TextureFormatRG16Uint:
  1348. return "rg16uint"
  1349. case TextureFormatRG16Sint:
  1350. return "rg16sint"
  1351. case TextureFormatRG16Float:
  1352. return "rg16float"
  1353. case TextureFormatRGBA8Unorm:
  1354. return "rgba8unorm"
  1355. case TextureFormatRGBA8UnormSrgb:
  1356. return "rgba8unorm-srgb"
  1357. case TextureFormatRGBA8Snorm:
  1358. return "rgba8snorm"
  1359. case TextureFormatRGBA8Uint:
  1360. return "rgba8uint"
  1361. case TextureFormatRGBA8Sint:
  1362. return "rgba8sint"
  1363. case TextureFormatBGRA8Unorm:
  1364. return "bgra8unorm"
  1365. case TextureFormatBGRA8UnormSrgb:
  1366. return "bgra8unorm-srgb"
  1367. case TextureFormatRGB10A2Uint:
  1368. return "rgb10a2uint"
  1369. case TextureFormatRGB10A2Unorm:
  1370. return "rgb10a2unorm"
  1371. case TextureFormatRG11B10Ufloat:
  1372. return "rg11b10ufloat"
  1373. case TextureFormatRGB9E5Ufloat:
  1374. return "rgb9e5ufloat"
  1375. case TextureFormatRG32Float:
  1376. return "rg32float"
  1377. case TextureFormatRG32Uint:
  1378. return "rg32uint"
  1379. case TextureFormatRG32Sint:
  1380. return "rg32sint"
  1381. case TextureFormatRGBA16Uint:
  1382. return "rgba16uint"
  1383. case TextureFormatRGBA16Sint:
  1384. return "rgba16sint"
  1385. case TextureFormatRGBA16Float:
  1386. return "rgba16float"
  1387. case TextureFormatRGBA32Float:
  1388. return "rgba32float"
  1389. case TextureFormatRGBA32Uint:
  1390. return "rgba32uint"
  1391. case TextureFormatRGBA32Sint:
  1392. return "rgba32sint"
  1393. case TextureFormatStencil8:
  1394. return "stencil8"
  1395. case TextureFormatDepth16Unorm:
  1396. return "depth16unorm"
  1397. case TextureFormatDepth24Plus:
  1398. return "depth24plus"
  1399. case TextureFormatDepth24PlusStencil8:
  1400. return "depth24plus-stencil8"
  1401. case TextureFormatDepth32Float:
  1402. return "depth32float"
  1403. case TextureFormatDepth32FloatStencil8:
  1404. return "depth32float-stencil8"
  1405. case TextureFormatBC1RGBAUnorm:
  1406. return "bc1rgba-unorm"
  1407. case TextureFormatBC1RGBAUnormSrgb:
  1408. return "bc1rgba-unorm-srgb"
  1409. case TextureFormatBC2RGBAUnorm:
  1410. return "bc2rgba-unorm"
  1411. case TextureFormatBC2RGBAUnormSrgb:
  1412. return "bc2rgba-unorm-srgb"
  1413. case TextureFormatBC3RGBAUnorm:
  1414. return "bc3rgba-unorm"
  1415. case TextureFormatBC3RGBAUnormSrgb:
  1416. return "bc3rgba-unorm-srgb"
  1417. case TextureFormatBC4RUnorm:
  1418. return "bc4r-unorm"
  1419. case TextureFormatBC4RSnorm:
  1420. return "bc4r-snorm"
  1421. case TextureFormatBC5RGUnorm:
  1422. return "bc5rg-unorm"
  1423. case TextureFormatBC5RGSnorm:
  1424. return "bc5rg-snorm"
  1425. case TextureFormatBC6HRGBUfloat:
  1426. return "bc6hrgb-ufloat"
  1427. case TextureFormatBC6HRGBFloat:
  1428. return "bc6hrgb-float"
  1429. case TextureFormatBC7RGBAUnorm:
  1430. return "bc7rgba-unorm"
  1431. case TextureFormatBC7RGBAUnormSrgb:
  1432. return "bc7rgba-unorm-srgb"
  1433. case TextureFormatETC2RGB8Unorm:
  1434. return "etc2rgb8unorm"
  1435. case TextureFormatETC2RGB8UnormSrgb:
  1436. return "etc2rgb8unorm-srgb"
  1437. case TextureFormatETC2RGB8A1Unorm:
  1438. return "etc2rgb8a1unorm"
  1439. case TextureFormatETC2RGB8A1UnormSrgb:
  1440. return "etc2rgb8a1unorm-srgb"
  1441. case TextureFormatETC2RGBA8Unorm:
  1442. return "etc2rgba8unorm"
  1443. case TextureFormatETC2RGBA8UnormSrgb:
  1444. return "etc2rgba8unorm-srgb"
  1445. case TextureFormatEACR11Unorm:
  1446. return "eacr11unorm"
  1447. case TextureFormatEACR11Snorm:
  1448. return "eacr11snorm"
  1449. case TextureFormatEACRG11Unorm:
  1450. return "eacrg11unorm"
  1451. case TextureFormatEACRG11Snorm:
  1452. return "eacrg11snorm"
  1453. case TextureFormatASTC4x4Unorm:
  1454. return "astc4x4unorm"
  1455. case TextureFormatASTC4x4UnormSrgb:
  1456. return "astc4x4unorm-srgb"
  1457. case TextureFormatASTC5x4Unorm:
  1458. return "astc5x4unorm"
  1459. case TextureFormatASTC5x4UnormSrgb:
  1460. return "astc5x4unorm-srgb"
  1461. case TextureFormatASTC5x5Unorm:
  1462. return "astc5x5unorm"
  1463. case TextureFormatASTC5x5UnormSrgb:
  1464. return "astc5x5unorm-srgb"
  1465. case TextureFormatASTC6x5Unorm:
  1466. return "astc6x5unorm"
  1467. case TextureFormatASTC6x5UnormSrgb:
  1468. return "astc6x5unorm-srgb"
  1469. case TextureFormatASTC6x6Unorm:
  1470. return "astc6x6unorm"
  1471. case TextureFormatASTC6x6UnormSrgb:
  1472. return "astc6x6unorm-srgb"
  1473. case TextureFormatASTC8x5Unorm:
  1474. return "astc8x5unorm"
  1475. case TextureFormatASTC8x5UnormSrgb:
  1476. return "astc8x5unorm-srgb"
  1477. case TextureFormatASTC8x6Unorm:
  1478. return "astc8x6unorm"
  1479. case TextureFormatASTC8x6UnormSrgb:
  1480. return "astc8x6unorm-srgb"
  1481. case TextureFormatASTC8x8Unorm:
  1482. return "astc8x8unorm"
  1483. case TextureFormatASTC8x8UnormSrgb:
  1484. return "astc8x8unorm-srgb"
  1485. case TextureFormatASTC10x5Unorm:
  1486. return "astc10x5unorm"
  1487. case TextureFormatASTC10x5UnormSrgb:
  1488. return "astc10x5unorm-srgb"
  1489. case TextureFormatASTC10x6Unorm:
  1490. return "astc10x6unorm"
  1491. case TextureFormatASTC10x6UnormSrgb:
  1492. return "astc10x6unorm-srgb"
  1493. case TextureFormatASTC10x8Unorm:
  1494. return "astc10x8unorm"
  1495. case TextureFormatASTC10x8UnormSrgb:
  1496. return "astc10x8unorm-srgb"
  1497. case TextureFormatASTC10x10Unorm:
  1498. return "astc10x10unorm"
  1499. case TextureFormatASTC10x10UnormSrgb:
  1500. return "astc10x10unorm-srgb"
  1501. case TextureFormatASTC12x10Unorm:
  1502. return "astc12x10unorm"
  1503. case TextureFormatASTC12x10UnormSrgb:
  1504. return "astc12x10unorm-srgb"
  1505. case TextureFormatASTC12x12Unorm:
  1506. return "astc12x12unorm"
  1507. case TextureFormatASTC12x12UnormSrgb:
  1508. return "astc12x12unorm-srgb"
  1509. default:
  1510. return ""
  1511. }
  1512. }
  1513. type TextureSampleType uint32
  1514. const (
  1515. TextureSampleTypeUndefined TextureSampleType = 0x00000000
  1516. TextureSampleTypeFloat TextureSampleType = 0x00000001
  1517. TextureSampleTypeUnfilterableFloat TextureSampleType = 0x00000002
  1518. TextureSampleTypeDepth TextureSampleType = 0x00000003
  1519. TextureSampleTypeSint TextureSampleType = 0x00000004
  1520. TextureSampleTypeUint TextureSampleType = 0x00000005
  1521. )
  1522. func (v TextureSampleType) String() string {
  1523. switch v {
  1524. case TextureSampleTypeUndefined:
  1525. return "undefined"
  1526. case TextureSampleTypeFloat:
  1527. return "float"
  1528. case TextureSampleTypeUnfilterableFloat:
  1529. return "unfilterable-float"
  1530. case TextureSampleTypeDepth:
  1531. return "depth"
  1532. case TextureSampleTypeSint:
  1533. return "sint"
  1534. case TextureSampleTypeUint:
  1535. return "uint"
  1536. default:
  1537. return ""
  1538. }
  1539. }
  1540. type TextureUsage uint32
  1541. const (
  1542. TextureUsageNone TextureUsage = 0x00000000
  1543. TextureUsageCopySrc TextureUsage = 0x00000001
  1544. TextureUsageCopyDst TextureUsage = 0x00000002
  1545. TextureUsageTextureBinding TextureUsage = 0x00000004
  1546. TextureUsageStorageBinding TextureUsage = 0x00000008
  1547. TextureUsageRenderAttachment TextureUsage = 0x00000010
  1548. )
  1549. func (v TextureUsage) String() string {
  1550. switch v {
  1551. case TextureUsageNone:
  1552. return "none"
  1553. case TextureUsageCopySrc:
  1554. return "copy-src"
  1555. case TextureUsageCopyDst:
  1556. return "copy-dst"
  1557. case TextureUsageTextureBinding:
  1558. return "texture-binding"
  1559. case TextureUsageStorageBinding:
  1560. return "storage-binding"
  1561. case TextureUsageRenderAttachment:
  1562. return "render-attachment"
  1563. default:
  1564. return ""
  1565. }
  1566. }
  1567. type TextureViewDimension uint32
  1568. const (
  1569. TextureViewDimensionUndefined TextureViewDimension = 0x00000000
  1570. TextureViewDimension1D TextureViewDimension = 0x00000001
  1571. TextureViewDimension2D TextureViewDimension = 0x00000002
  1572. TextureViewDimension2DArray TextureViewDimension = 0x00000003
  1573. TextureViewDimensionCube TextureViewDimension = 0x00000004
  1574. TextureViewDimensionCubeArray TextureViewDimension = 0x00000005
  1575. TextureViewDimension3D TextureViewDimension = 0x00000006
  1576. )
  1577. func (v TextureViewDimension) String() string {
  1578. switch v {
  1579. case TextureViewDimensionUndefined:
  1580. return "undefined"
  1581. case TextureViewDimension1D:
  1582. return "1d"
  1583. case TextureViewDimension2D:
  1584. return "2d"
  1585. case TextureViewDimension2DArray:
  1586. return "2d-array"
  1587. case TextureViewDimensionCube:
  1588. return "cube"
  1589. case TextureViewDimensionCubeArray:
  1590. return "cube-array"
  1591. case TextureViewDimension3D:
  1592. return "3d"
  1593. default:
  1594. return ""
  1595. }
  1596. }
  1597. type VertexFormat uint32
  1598. const (
  1599. VertexFormatUndefined VertexFormat = 0x00000000
  1600. VertexFormatUint8x2 VertexFormat = 0x00000001
  1601. VertexFormatUint8x4 VertexFormat = 0x00000002
  1602. VertexFormatSint8x2 VertexFormat = 0x00000003
  1603. VertexFormatSint8x4 VertexFormat = 0x00000004
  1604. VertexFormatUnorm8x2 VertexFormat = 0x00000005
  1605. VertexFormatUnorm8x4 VertexFormat = 0x00000006
  1606. VertexFormatSnorm8x2 VertexFormat = 0x00000007
  1607. VertexFormatSnorm8x4 VertexFormat = 0x00000008
  1608. VertexFormatUint16x2 VertexFormat = 0x00000009
  1609. VertexFormatUint16x4 VertexFormat = 0x0000000A
  1610. VertexFormatSint16x2 VertexFormat = 0x0000000B
  1611. VertexFormatSint16x4 VertexFormat = 0x0000000C
  1612. VertexFormatUnorm16x2 VertexFormat = 0x0000000D
  1613. VertexFormatUnorm16x4 VertexFormat = 0x0000000E
  1614. VertexFormatSnorm16x2 VertexFormat = 0x0000000F
  1615. VertexFormatSnorm16x4 VertexFormat = 0x00000010
  1616. VertexFormatFloat16x2 VertexFormat = 0x00000011
  1617. VertexFormatFloat16x4 VertexFormat = 0x00000012
  1618. VertexFormatFloat32 VertexFormat = 0x00000013
  1619. VertexFormatFloat32x2 VertexFormat = 0x00000014
  1620. VertexFormatFloat32x3 VertexFormat = 0x00000015
  1621. VertexFormatFloat32x4 VertexFormat = 0x00000016
  1622. VertexFormatUint32 VertexFormat = 0x00000017
  1623. VertexFormatUint32x2 VertexFormat = 0x00000018
  1624. VertexFormatUint32x3 VertexFormat = 0x00000019
  1625. VertexFormatUint32x4 VertexFormat = 0x0000001A
  1626. VertexFormatSint32 VertexFormat = 0x0000001B
  1627. VertexFormatSint32x2 VertexFormat = 0x0000001C
  1628. VertexFormatSint32x3 VertexFormat = 0x0000001D
  1629. VertexFormatSint32x4 VertexFormat = 0x0000001E
  1630. )
  1631. func (v VertexFormat) String() string {
  1632. switch v {
  1633. case VertexFormatUndefined:
  1634. return "undefined"
  1635. case VertexFormatUint8x2:
  1636. return "uint8x2"
  1637. case VertexFormatUint8x4:
  1638. return "uint8x4"
  1639. case VertexFormatSint8x2:
  1640. return "sint8x2"
  1641. case VertexFormatSint8x4:
  1642. return "sint8x4"
  1643. case VertexFormatUnorm8x2:
  1644. return "unorm8x2"
  1645. case VertexFormatUnorm8x4:
  1646. return "unorm8x4"
  1647. case VertexFormatSnorm8x2:
  1648. return "snorm8x2"
  1649. case VertexFormatSnorm8x4:
  1650. return "snorm8x4"
  1651. case VertexFormatUint16x2:
  1652. return "uint16x2"
  1653. case VertexFormatUint16x4:
  1654. return "uint16x4"
  1655. case VertexFormatSint16x2:
  1656. return "sint16x2"
  1657. case VertexFormatSint16x4:
  1658. return "sint16x4"
  1659. case VertexFormatUnorm16x2:
  1660. return "unorm16x2"
  1661. case VertexFormatUnorm16x4:
  1662. return "unorm16x4"
  1663. case VertexFormatSnorm16x2:
  1664. return "snorm16x2"
  1665. case VertexFormatSnorm16x4:
  1666. return "snorm16x4"
  1667. case VertexFormatFloat16x2:
  1668. return "float16x2"
  1669. case VertexFormatFloat16x4:
  1670. return "float16x4"
  1671. case VertexFormatFloat32:
  1672. return "float32"
  1673. case VertexFormatFloat32x2:
  1674. return "float32x2"
  1675. case VertexFormatFloat32x3:
  1676. return "float32x3"
  1677. case VertexFormatFloat32x4:
  1678. return "float32x4"
  1679. case VertexFormatUint32:
  1680. return "uint32"
  1681. case VertexFormatUint32x2:
  1682. return "uint32x2"
  1683. case VertexFormatUint32x3:
  1684. return "uint32x3"
  1685. case VertexFormatUint32x4:
  1686. return "uint32x4"
  1687. case VertexFormatSint32:
  1688. return "sint32"
  1689. case VertexFormatSint32x2:
  1690. return "sint32x2"
  1691. case VertexFormatSint32x3:
  1692. return "sint32x3"
  1693. case VertexFormatSint32x4:
  1694. return "sint32x4"
  1695. default:
  1696. return ""
  1697. }
  1698. }
  1699. type VertexStepMode uint32
  1700. const (
  1701. VertexStepModeVertex VertexStepMode = 0x00000000
  1702. VertexStepModeInstance VertexStepMode = 0x00000001
  1703. VertexStepModeVertexBufferNotUsed VertexStepMode = 0x00000002
  1704. )
  1705. func (v VertexStepMode) String() string {
  1706. switch v {
  1707. case VertexStepModeVertex:
  1708. return "vertex"
  1709. case VertexStepModeInstance:
  1710. return "instance"
  1711. case VertexStepModeVertexBufferNotUsed:
  1712. return "vertex-buffer-not-used"
  1713. default:
  1714. return ""
  1715. }
  1716. }
  1717. type WGSLFeatureName uint32
  1718. const (
  1719. WGSLFeatureNameUndefined WGSLFeatureName = 0x00000000
  1720. WGSLFeatureNameReadonlyAndReadwriteStorageTextures WGSLFeatureName = 0x00000001
  1721. WGSLFeatureNamePacked4x8IntegerDotProduct WGSLFeatureName = 0x00000002
  1722. WGSLFeatureNameUnrestrictedPointerParameters WGSLFeatureName = 0x00000003
  1723. WGSLFeatureNamePointerCompositeAccess WGSLFeatureName = 0x00000004
  1724. )
  1725. func (v WGSLFeatureName) String() string {
  1726. switch v {
  1727. case WGSLFeatureNameUndefined:
  1728. return "undefined"
  1729. case WGSLFeatureNameReadonlyAndReadwriteStorageTextures:
  1730. return "readonly-and-readwrite-storage-textures"
  1731. case WGSLFeatureNamePacked4x8IntegerDotProduct:
  1732. return "packed4x8integer-dot-product"
  1733. case WGSLFeatureNameUnrestrictedPointerParameters:
  1734. return "unrestricted-pointer-parameters"
  1735. case WGSLFeatureNamePointerCompositeAccess:
  1736. return "pointer-composite-access"
  1737. default:
  1738. return ""
  1739. }
  1740. }