wgsl-DlxrJ_uh.js 7.4 KB

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