wgsl.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. /*!-----------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Version: 0.46.0(21007360cad28648bdf46282a2592cb47c3a7a6f)
  4. * Released under the MIT license
  5. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  6. *-----------------------------------------------------------------------------*/
  7. define("vs/basic-languages/wgsl/wgsl", ["require","require"],(require)=>{
  8. "use strict";var moduleExports=(()=>{var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var a in e)s(t,a,{get:e[a],enumerable:!0})},d=(t,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l(e))!u.call(t,i)&&i!==a&&s(t,i,{get:()=>e[i],enumerable:!(o=m(e,i))||o.enumerable});return t};var x=t=>d(s({},"__esModule",{value:!0}),t);var F={};p(F,{conf:()=>f,language:()=>L});var f={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"}]};function r(t){let e=[],a=t.split(/\t+|\r+|\n+| +/);for(let o=0;o<a.length;++o)a[o].length>0&&e.push(a[o]);return e}var g=r("true false"),_=r(`
  9. alias
  10. break
  11. case
  12. const
  13. const_assert
  14. continue
  15. continuing
  16. default
  17. diagnostic
  18. discard
  19. else
  20. enable
  21. fn
  22. for
  23. if
  24. let
  25. loop
  26. override
  27. requires
  28. return
  29. struct
  30. switch
  31. var
  32. while
  33. `),h=r(`
  34. NULL
  35. Self
  36. abstract
  37. active
  38. alignas
  39. alignof
  40. as
  41. asm
  42. asm_fragment
  43. async
  44. attribute
  45. auto
  46. await
  47. become
  48. binding_array
  49. cast
  50. catch
  51. class
  52. co_await
  53. co_return
  54. co_yield
  55. coherent
  56. column_major
  57. common
  58. compile
  59. compile_fragment
  60. concept
  61. const_cast
  62. consteval
  63. constexpr
  64. constinit
  65. crate
  66. debugger
  67. decltype
  68. delete
  69. demote
  70. demote_to_helper
  71. do
  72. dynamic_cast
  73. enum
  74. explicit
  75. export
  76. extends
  77. extern
  78. external
  79. fallthrough
  80. filter
  81. final
  82. finally
  83. friend
  84. from
  85. fxgroup
  86. get
  87. goto
  88. groupshared
  89. highp
  90. impl
  91. implements
  92. import
  93. inline
  94. instanceof
  95. interface
  96. layout
  97. lowp
  98. macro
  99. macro_rules
  100. match
  101. mediump
  102. meta
  103. mod
  104. module
  105. move
  106. mut
  107. mutable
  108. namespace
  109. new
  110. nil
  111. noexcept
  112. noinline
  113. nointerpolation
  114. noperspective
  115. null
  116. nullptr
  117. of
  118. operator
  119. package
  120. packoffset
  121. partition
  122. pass
  123. patch
  124. pixelfragment
  125. precise
  126. precision
  127. premerge
  128. priv
  129. protected
  130. pub
  131. public
  132. readonly
  133. ref
  134. regardless
  135. register
  136. reinterpret_cast
  137. require
  138. resource
  139. restrict
  140. self
  141. set
  142. shared
  143. sizeof
  144. smooth
  145. snorm
  146. static
  147. static_assert
  148. static_cast
  149. std
  150. subroutine
  151. super
  152. target
  153. template
  154. this
  155. thread_local
  156. throw
  157. trait
  158. try
  159. type
  160. typedef
  161. typeid
  162. typename
  163. typeof
  164. union
  165. unless
  166. unorm
  167. unsafe
  168. unsized
  169. use
  170. using
  171. varying
  172. virtual
  173. volatile
  174. wgsl
  175. where
  176. with
  177. writeonly
  178. yield
  179. `),b=r(`
  180. read write read_write
  181. function private workgroup uniform storage
  182. perspective linear flat
  183. center centroid sample
  184. vertex_index instance_index position front_facing frag_depth
  185. local_invocation_id local_invocation_index
  186. global_invocation_id workgroup_id num_workgroups
  187. sample_index sample_mask
  188. rgba8unorm
  189. rgba8snorm
  190. rgba8uint
  191. rgba8sint
  192. rgba16uint
  193. rgba16sint
  194. rgba16float
  195. r32uint
  196. r32sint
  197. r32float
  198. rg32uint
  199. rg32sint
  200. rg32float
  201. rgba32uint
  202. rgba32sint
  203. rgba32float
  204. bgra8unorm
  205. `),v=r(`
  206. bool
  207. f16
  208. f32
  209. i32
  210. sampler sampler_comparison
  211. texture_depth_2d
  212. texture_depth_2d_array
  213. texture_depth_cube
  214. texture_depth_cube_array
  215. texture_depth_multisampled_2d
  216. texture_external
  217. texture_external
  218. u32
  219. `),y=r(`
  220. array
  221. atomic
  222. mat2x2
  223. mat2x3
  224. mat2x4
  225. mat3x2
  226. mat3x3
  227. mat3x4
  228. mat4x2
  229. mat4x3
  230. mat4x4
  231. ptr
  232. texture_1d
  233. texture_2d
  234. texture_2d_array
  235. texture_3d
  236. texture_cube
  237. texture_cube_array
  238. texture_multisampled_2d
  239. texture_storage_1d
  240. texture_storage_2d
  241. texture_storage_2d_array
  242. texture_storage_3d
  243. vec2
  244. vec3
  245. vec4
  246. `),k=r(`
  247. vec2i vec3i vec4i
  248. vec2u vec3u vec4u
  249. vec2f vec3f vec4f
  250. vec2h vec3h vec4h
  251. mat2x2f mat2x3f mat2x4f
  252. mat3x2f mat3x3f mat3x4f
  253. mat4x2f mat4x3f mat4x4f
  254. mat2x2h mat2x3h mat2x4h
  255. mat3x2h mat3x3h mat3x4h
  256. mat4x2h mat4x3h mat4x4h
  257. `),w=r(`
  258. bitcast all any select arrayLength abs acos acosh asin asinh atan atanh atan2
  259. ceil clamp cos cosh countLeadingZeros countOneBits countTrailingZeros cross
  260. degrees determinant distance dot exp exp2 extractBits faceForward firstLeadingBit
  261. firstTrailingBit floor fma fract frexp inverseBits inverseSqrt ldexp length
  262. log log2 max min mix modf normalize pow quantizeToF16 radians reflect refract
  263. reverseBits round saturate sign sin sinh smoothstep sqrt step tan tanh transpose
  264. trunc dpdx dpdxCoarse dpdxFine dpdy dpdyCoarse dpdyFine fwidth fwidthCoarse fwidthFine
  265. textureDimensions textureGather textureGatherCompare textureLoad textureNumLayers
  266. textureNumLevels textureNumSamples textureSample textureSampleBias textureSampleCompare
  267. textureSampleCompareLevel textureSampleGrad textureSampleLevel textureSampleBaseClampToEdge
  268. textureStore atomicLoad atomicStore atomicAdd atomicSub atomicMax atomicMin
  269. atomicAnd atomicOr atomicXor atomicExchange atomicCompareExchangeWeak pack4x8snorm
  270. pack4x8unorm pack2x16snorm pack2x16unorm pack2x16float unpack4x8snorm unpack4x8unorm
  271. unpack2x16snorm unpack2x16unorm unpack2x16float storageBarrier workgroupBarrier
  272. workgroupUniformLoad
  273. `),S=r(`
  274. &
  275. &&
  276. ->
  277. /
  278. =
  279. ==
  280. !=
  281. >
  282. >=
  283. <
  284. <=
  285. %
  286. -
  287. --
  288. +
  289. ++
  290. |
  291. ||
  292. *
  293. <<
  294. >>
  295. +=
  296. -=
  297. *=
  298. /=
  299. %=
  300. &=
  301. |=
  302. ^=
  303. >>=
  304. <<=
  305. `),C=/enable|requires|diagnostic/,c=/[_\p{XID_Start}]\p{XID_Continue}*/u,n="variable.predefined",L={tokenPostfix:".wgsl",defaultToken:"invalid",unicode:!0,atoms:g,keywords:_,reserved:h,predeclared_enums:b,predeclared_types:v,predeclared_type_generators:y,predeclared_type_aliases:k,predeclared_intrinsics:w,operators:S,symbols:/[!%&*+\-\.\/:;<=>^|_~,]+/,tokenizer:{root:[[C,"keyword","@directive"],[c,{cases:{"@atoms":n,"@keywords":"keyword","@reserved":"invalid","@predeclared_enums":n,"@predeclared_types":n,"@predeclared_type_generators":n,"@predeclared_type_aliases":n,"@predeclared_intrinsics":n,"@default":"identifier"}}],{include:"@commentOrSpace"},{include:"@numbers"},[/[{}()\[\]]/,"@brackets"],["@","annotation","@attribute"],[/@symbols/,{cases:{"@operators":"operator","@default":"delimiter"}}],[/./,"invalid"]],commentOrSpace:[[/\s+/,"white"],[/\/\*/,"comment","@blockComment"],[/\/\/.*$/,"comment"]],blockComment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment","@push"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],attribute:[{include:"@commentOrSpace"},[/\w+/,"annotation","@pop"]],directive:[{include:"@commentOrSpace"},[/[()]/,"@brackets"],[/,/,"delimiter"],[c,"meta.content"],[/;/,"delimiter","@pop"]],numbers:[[/0[fh]/,"number.float"],[/[1-9][0-9]*[fh]/,"number.float"],[/[0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[fh]?/,"number.float"],[/[0-9]+\.[0-9]*([eE][+-]?[0-9]+)?[fh]?/,"number.float"],[/[0-9]+[eE][+-]?[0-9]+[fh]?/,"number.float"],[/0[xX][0-9a-fA-F]*\.[0-9a-fA-F]+(?:[pP][+-]?[0-9]+[fh]?)?/,"number.hex"],[/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*(?:[pP][+-]?[0-9]+[fh]?)?/,"number.hex"],[/0[xX][0-9a-fA-F]+[pP][+-]?[0-9]+[fh]?/,"number.hex"],[/0[xX][0-9a-fA-F]+[iu]?/,"number.hex"],[/[1-9][0-9]*[iu]?/,"number"],[/0[iu]?/,"number"]]}};return x(F);})();
  306. return moduleExports;
  307. });