@lampdotdev/lamp 0.0.0-stage → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (464) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +357 -2
  3. package/Resources/Devices/roku.json +410 -0
  4. package/Resources/Devices/xbox-one.json +367 -0
  5. package/Resources/GameKit/NOTICE.md +63 -0
  6. package/Resources/GameKit/apple/LampPage.swift +1646 -0
  7. package/Resources/GameKit/apple/LampPlayer.swift +46 -0
  8. package/Resources/GameKit/apple/LampWebApp.swift +63 -0
  9. package/Resources/GameKit/apple/LampWebGame.swift +87 -0
  10. package/Resources/GameKit/apple/Native.swift +12 -0
  11. package/Resources/GameKit/build.sh +55 -0
  12. package/Resources/GameKit/lamp_game.h +116 -0
  13. package/Resources/GameKit/lamp_host.h +19 -0
  14. package/Resources/GameKit/lamp_kit.cpp +61 -0
  15. package/Resources/GameKit/lamp_sound.cpp +455 -0
  16. package/Resources/GameKit/lamp_xbox.cpp +374 -0
  17. package/Resources/GameKit/libraries/HandmadeMath.h +3940 -0
  18. package/Resources/GameKit/libraries/cgltf.h +7240 -0
  19. package/Resources/GameKit/libraries/dr_mp3.h +5430 -0
  20. package/Resources/GameKit/libraries/dr_wav.h +9209 -0
  21. package/Resources/GameKit/libraries/sokol_debugtext.h +4754 -0
  22. package/Resources/GameKit/libraries/sokol_gfx.h +29558 -0
  23. package/Resources/GameKit/libraries/sokol_gl.h +4538 -0
  24. package/Resources/GameKit/libraries/sokol_log.h +335 -0
  25. package/Resources/GameKit/libraries/sokol_shape.h +1531 -0
  26. package/Resources/GameKit/libraries/stb_image.h +7988 -0
  27. package/Resources/GameKit/libraries/stb_vorbis.c +5584 -0
  28. package/Resources/GameKit/scaffold/Game/game.cpp +142 -0
  29. package/Resources/GameKit/scaffold/Game/scene.glsl +49 -0
  30. package/Resources/GameKit/scaffold-web/Web/game.js +31 -0
  31. package/Resources/GameKit/scaffold-web/Web/index.html +13 -0
  32. package/Resources/GameKit/scaffold-web/Web/making.js +33 -0
  33. package/Resources/GameKit/scaffold-web/Web/world.js +33 -0
  34. package/Resources/GameKit/web/lamp-game.js +3036 -0
  35. package/Resources/GameKit/web/lamp-phaser.js +128 -0
  36. package/Resources/WebHost/App.exe +0 -0
  37. package/Resources/WebHost/Microsoft.Web.WebView2.Core.dll +0 -0
  38. package/Resources/WebHost/WebView2-LICENSE.txt +27 -0
  39. package/Resources/WebHost/lamp_controllers.h +1506 -0
  40. package/Resources/WebHost/lamp_web_host.cpp +1173 -0
  41. package/Resources/WebLibraries/earlier.txt +318 -0
  42. package/Resources/WebLibraries/phaser/LICENSE.md +20 -0
  43. package/Resources/WebLibraries/phaser/NOTICE.md +2 -0
  44. package/Resources/WebLibraries/phaser/phaser.esm.min.js +1 -0
  45. package/Resources/WebLibraries/qrcode/LICENSE +21 -0
  46. package/Resources/WebLibraries/qrcode/NOTICE.md +4 -0
  47. package/Resources/WebLibraries/qrcode/qrcode.js +2297 -0
  48. package/Resources/WebLibraries/rapier/LICENSE +201 -0
  49. package/Resources/WebLibraries/rapier/NOTICE.md +3 -0
  50. package/Resources/WebLibraries/rapier/rapier.js +2 -0
  51. package/Resources/WebLibraries/three/LICENSE +21 -0
  52. package/Resources/WebLibraries/three/NOTICE.md +4 -0
  53. package/Resources/WebLibraries/three/addons/animation/AnimationClipCreator.js +168 -0
  54. package/Resources/WebLibraries/three/addons/animation/CCDIKSolver.js +607 -0
  55. package/Resources/WebLibraries/three/addons/controls/ArcballControls.js +3543 -0
  56. package/Resources/WebLibraries/three/addons/controls/DragControls.js +452 -0
  57. package/Resources/WebLibraries/three/addons/controls/FirstPersonControls.js +512 -0
  58. package/Resources/WebLibraries/three/addons/controls/FlyControls.js +384 -0
  59. package/Resources/WebLibraries/three/addons/controls/MapControls.js +116 -0
  60. package/Resources/WebLibraries/three/addons/controls/OrbitControls.js +1985 -0
  61. package/Resources/WebLibraries/three/addons/controls/PointerLockControls.js +264 -0
  62. package/Resources/WebLibraries/three/addons/controls/TrackballControls.js +1106 -0
  63. package/Resources/WebLibraries/three/addons/controls/TransformControls.js +2003 -0
  64. package/Resources/WebLibraries/three/addons/curves/CurveExtras.js +694 -0
  65. package/Resources/WebLibraries/three/addons/curves/NURBSCurve.js +169 -0
  66. package/Resources/WebLibraries/three/addons/curves/NURBSSurface.js +98 -0
  67. package/Resources/WebLibraries/three/addons/curves/NURBSUtils.js +532 -0
  68. package/Resources/WebLibraries/three/addons/curves/NURBSVolume.js +82 -0
  69. package/Resources/WebLibraries/three/addons/effects/AnaglyphEffect.js +274 -0
  70. package/Resources/WebLibraries/three/addons/effects/AsciiEffect.js +323 -0
  71. package/Resources/WebLibraries/three/addons/effects/OutlineEffect.js +489 -0
  72. package/Resources/WebLibraries/three/addons/effects/ParallaxBarrierEffect.js +155 -0
  73. package/Resources/WebLibraries/three/addons/effects/StereoEffect.js +91 -0
  74. package/Resources/WebLibraries/three/addons/environments/ColorEnvironment.js +59 -0
  75. package/Resources/WebLibraries/three/addons/environments/DebugEnvironment.js +102 -0
  76. package/Resources/WebLibraries/three/addons/environments/RoomEnvironment.js +185 -0
  77. package/Resources/WebLibraries/three/addons/geometries/BoxLineGeometry.js +92 -0
  78. package/Resources/WebLibraries/three/addons/geometries/ConvexGeometry.js +72 -0
  79. package/Resources/WebLibraries/three/addons/geometries/DecalGeometry.js +420 -0
  80. package/Resources/WebLibraries/three/addons/geometries/LoftGeometry.js +355 -0
  81. package/Resources/WebLibraries/three/addons/geometries/ParametricFunctions.js +100 -0
  82. package/Resources/WebLibraries/three/addons/geometries/ParametricGeometry.js +172 -0
  83. package/Resources/WebLibraries/three/addons/geometries/RoundedBoxGeometry.js +216 -0
  84. package/Resources/WebLibraries/three/addons/geometries/TeapotGeometry.js +689 -0
  85. package/Resources/WebLibraries/three/addons/geometries/TextGeometry.js +102 -0
  86. package/Resources/WebLibraries/three/addons/helpers/AnimationPathHelper.js +302 -0
  87. package/Resources/WebLibraries/three/addons/helpers/LightProbeGridHelper.js +166 -0
  88. package/Resources/WebLibraries/three/addons/helpers/LightProbeGridHelperWebGL.js +221 -0
  89. package/Resources/WebLibraries/three/addons/helpers/LightProbeHelper.js +166 -0
  90. package/Resources/WebLibraries/three/addons/helpers/LightProbeHelperGPU.js +102 -0
  91. package/Resources/WebLibraries/three/addons/helpers/OctreeHelper.js +109 -0
  92. package/Resources/WebLibraries/three/addons/helpers/PositionalAudioHelper.js +169 -0
  93. package/Resources/WebLibraries/three/addons/helpers/RapierHelper.js +59 -0
  94. package/Resources/WebLibraries/three/addons/helpers/RectAreaLightHelper.js +118 -0
  95. package/Resources/WebLibraries/three/addons/helpers/TextureHelper.js +265 -0
  96. package/Resources/WebLibraries/three/addons/helpers/TextureHelperGPU.js +214 -0
  97. package/Resources/WebLibraries/three/addons/helpers/VertexNormalsHelper.js +155 -0
  98. package/Resources/WebLibraries/three/addons/helpers/VertexTangentsHelper.js +133 -0
  99. package/Resources/WebLibraries/three/addons/helpers/ViewHelper.js +529 -0
  100. package/Resources/WebLibraries/three/addons/interactive/HTMLMesh.js +617 -0
  101. package/Resources/WebLibraries/three/addons/interactive/InteractiveGroup.js +224 -0
  102. package/Resources/WebLibraries/three/addons/interactive/SelectionBox.js +324 -0
  103. package/Resources/WebLibraries/three/addons/interactive/SelectionHelper.js +150 -0
  104. package/Resources/WebLibraries/three/addons/libs/fflate.module.js +2699 -0
  105. package/Resources/WebLibraries/three/addons/libs/lil-gui.module.min.js +8 -0
  106. package/Resources/WebLibraries/three/addons/libs/meshopt_decoder.module.js +196 -0
  107. package/Resources/WebLibraries/three/addons/libs/potpack.module.js +125 -0
  108. package/Resources/WebLibraries/three/addons/libs/stats.module.js +167 -0
  109. package/Resources/WebLibraries/three/addons/libs/tween.module.js +876 -0
  110. package/Resources/WebLibraries/three/addons/lighting/ClusteredLighting.js +153 -0
  111. package/Resources/WebLibraries/three/addons/lighting/DynamicLighting.js +82 -0
  112. package/Resources/WebLibraries/three/addons/lighting/LightMapper.js +295 -0
  113. package/Resources/WebLibraries/three/addons/lighting/LightProbeGrid.js +923 -0
  114. package/Resources/WebLibraries/three/addons/lighting/LightProbeGridUtils.js +107 -0
  115. package/Resources/WebLibraries/three/addons/lighting/LightProbeGridWebGL.js +846 -0
  116. package/Resources/WebLibraries/three/addons/lighting/vxgi/VXGIConeTracer.js +243 -0
  117. package/Resources/WebLibraries/three/addons/lighting/vxgi/VXGIIrradiance.js +43 -0
  118. package/Resources/WebLibraries/three/addons/lighting/vxgi/VXGINode.js +617 -0
  119. package/Resources/WebLibraries/three/addons/lighting/vxgi/VXGISceneCollector.js +793 -0
  120. package/Resources/WebLibraries/three/addons/lighting/vxgi/VXGIVolume.js +1440 -0
  121. package/Resources/WebLibraries/three/addons/lights/LightProbeGenerator.js +337 -0
  122. package/Resources/WebLibraries/three/addons/lights/RectAreaLightTexturesLib.js +127 -0
  123. package/Resources/WebLibraries/three/addons/lights/RectAreaLightUniformsLib.js +40 -0
  124. package/Resources/WebLibraries/three/addons/lights/SunLight.js +100 -0
  125. package/Resources/WebLibraries/three/addons/lights/SunLightNode.js +56 -0
  126. package/Resources/WebLibraries/three/addons/lights/SunLightShadow.js +319 -0
  127. package/Resources/WebLibraries/three/addons/lights/SunShadowNode.js +312 -0
  128. package/Resources/WebLibraries/three/addons/lines/Line2.js +56 -0
  129. package/Resources/WebLibraries/three/addons/lines/LineGeometry.js +157 -0
  130. package/Resources/WebLibraries/three/addons/lines/LineMaterial.js +742 -0
  131. package/Resources/WebLibraries/three/addons/lines/LineSegments2.js +434 -0
  132. package/Resources/WebLibraries/three/addons/lines/LineSegmentsGeometry.js +298 -0
  133. package/Resources/WebLibraries/three/addons/lines/Wireframe.js +108 -0
  134. package/Resources/WebLibraries/three/addons/lines/WireframeGeometry2.js +49 -0
  135. package/Resources/WebLibraries/three/addons/lines/webgpu/Line2.js +46 -0
  136. package/Resources/WebLibraries/three/addons/lines/webgpu/LineSegments2.js +419 -0
  137. package/Resources/WebLibraries/three/addons/lines/webgpu/Wireframe.js +86 -0
  138. package/Resources/WebLibraries/three/addons/loaders/EXRLoader.js +3411 -0
  139. package/Resources/WebLibraries/three/addons/loaders/FBXLoader.js +4660 -0
  140. package/Resources/WebLibraries/three/addons/loaders/FontLoader.js +262 -0
  141. package/Resources/WebLibraries/three/addons/loaders/GLTFLoader.js +5006 -0
  142. package/Resources/WebLibraries/three/addons/loaders/HDRLoader.js +463 -0
  143. package/Resources/WebLibraries/three/addons/loaders/MTLLoader.js +601 -0
  144. package/Resources/WebLibraries/three/addons/loaders/OBJLoader.js +961 -0
  145. package/Resources/WebLibraries/three/addons/loaders/PLYLoader.js +992 -0
  146. package/Resources/WebLibraries/three/addons/loaders/RGBELoader.js +18 -0
  147. package/Resources/WebLibraries/three/addons/loaders/STLLoader.js +423 -0
  148. package/Resources/WebLibraries/three/addons/loaders/SVGLoader.js +3297 -0
  149. package/Resources/WebLibraries/three/addons/loaders/TGALoader.js +539 -0
  150. package/Resources/WebLibraries/three/addons/loaders/UltraHDRLoader.js +757 -0
  151. package/Resources/WebLibraries/three/addons/math/Capsule.js +159 -0
  152. package/Resources/WebLibraries/three/addons/math/ColorConverter.js +62 -0
  153. package/Resources/WebLibraries/three/addons/math/ColorSpaces.js +147 -0
  154. package/Resources/WebLibraries/three/addons/math/ConvexHull.js +1695 -0
  155. package/Resources/WebLibraries/three/addons/math/ImprovedNoise.js +88 -0
  156. package/Resources/WebLibraries/three/addons/math/Lut.js +317 -0
  157. package/Resources/WebLibraries/three/addons/math/MeshSurfaceSampler.js +315 -0
  158. package/Resources/WebLibraries/three/addons/math/OBB.js +535 -0
  159. package/Resources/WebLibraries/three/addons/math/Octree.js +825 -0
  160. package/Resources/WebLibraries/three/addons/math/SimplexNoise.js +470 -0
  161. package/Resources/WebLibraries/three/addons/misc/ConvexObjectBreaker.js +539 -0
  162. package/Resources/WebLibraries/three/addons/misc/GPUComputationRenderer.js +508 -0
  163. package/Resources/WebLibraries/three/addons/misc/Gyroscope.js +78 -0
  164. package/Resources/WebLibraries/three/addons/misc/MorphAnimMesh.js +119 -0
  165. package/Resources/WebLibraries/three/addons/misc/MorphBlendMesh.js +425 -0
  166. package/Resources/WebLibraries/three/addons/misc/ProgressiveLightMap.js +370 -0
  167. package/Resources/WebLibraries/three/addons/misc/ProgressiveLightMapGPU.js +322 -0
  168. package/Resources/WebLibraries/three/addons/misc/RollerCoaster.js +661 -0
  169. package/Resources/WebLibraries/three/addons/misc/Sculptor.js +1679 -0
  170. package/Resources/WebLibraries/three/addons/misc/SculptorMesh.js +1504 -0
  171. package/Resources/WebLibraries/three/addons/misc/SculptorTools.js +1180 -0
  172. package/Resources/WebLibraries/three/addons/misc/SculptorUtils.js +345 -0
  173. package/Resources/WebLibraries/three/addons/misc/TileCreasedNormalsPlugin.js +270 -0
  174. package/Resources/WebLibraries/three/addons/misc/TubePainter.js +611 -0
  175. package/Resources/WebLibraries/three/addons/misc/Volume.js +520 -0
  176. package/Resources/WebLibraries/three/addons/misc/VolumeSlice.js +275 -0
  177. package/Resources/WebLibraries/three/addons/modifiers/CurveModifier.js +374 -0
  178. package/Resources/WebLibraries/three/addons/modifiers/CurveModifierGPU.js +256 -0
  179. package/Resources/WebLibraries/three/addons/modifiers/EdgeSplitModifier.js +299 -0
  180. package/Resources/WebLibraries/three/addons/modifiers/TessellateModifier.js +340 -0
  181. package/Resources/WebLibraries/three/addons/objects/GroundedSkybox.js +69 -0
  182. package/Resources/WebLibraries/three/addons/objects/Lensflare.js +489 -0
  183. package/Resources/WebLibraries/three/addons/objects/LensflareMesh.js +376 -0
  184. package/Resources/WebLibraries/three/addons/objects/MarchingCubes.js +1261 -0
  185. package/Resources/WebLibraries/three/addons/objects/Reflector.js +390 -0
  186. package/Resources/WebLibraries/three/addons/objects/ReflectorForSSRPass.js +393 -0
  187. package/Resources/WebLibraries/three/addons/objects/Refractor.js +389 -0
  188. package/Resources/WebLibraries/three/addons/objects/ShadowMesh.js +130 -0
  189. package/Resources/WebLibraries/three/addons/objects/Sky.js +342 -0
  190. package/Resources/WebLibraries/three/addons/objects/SkyMesh.js +403 -0
  191. package/Resources/WebLibraries/three/addons/objects/Water.js +374 -0
  192. package/Resources/WebLibraries/three/addons/objects/Water2.js +403 -0
  193. package/Resources/WebLibraries/three/addons/objects/Water2Mesh.js +199 -0
  194. package/Resources/WebLibraries/three/addons/objects/WaterMesh.js +194 -0
  195. package/Resources/WebLibraries/three/addons/postprocessing/AfterimagePass.js +187 -0
  196. package/Resources/WebLibraries/three/addons/postprocessing/BloomPass.js +274 -0
  197. package/Resources/WebLibraries/three/addons/postprocessing/BokehPass.js +218 -0
  198. package/Resources/WebLibraries/three/addons/postprocessing/ClearPass.js +97 -0
  199. package/Resources/WebLibraries/three/addons/postprocessing/CubeTexturePass.js +146 -0
  200. package/Resources/WebLibraries/three/addons/postprocessing/DotScreenPass.js +114 -0
  201. package/Resources/WebLibraries/three/addons/postprocessing/EffectComposer.js +365 -0
  202. package/Resources/WebLibraries/three/addons/postprocessing/FXAAPass.js +40 -0
  203. package/Resources/WebLibraries/three/addons/postprocessing/FilmPass.js +113 -0
  204. package/Resources/WebLibraries/three/addons/postprocessing/GTAOPass.js +735 -0
  205. package/Resources/WebLibraries/three/addons/postprocessing/GlitchPass.js +177 -0
  206. package/Resources/WebLibraries/three/addons/postprocessing/HalftonePass.js +134 -0
  207. package/Resources/WebLibraries/three/addons/postprocessing/LUTPass.js +138 -0
  208. package/Resources/WebLibraries/three/addons/postprocessing/MaskPass.js +195 -0
  209. package/Resources/WebLibraries/three/addons/postprocessing/OutlinePass.js +776 -0
  210. package/Resources/WebLibraries/three/addons/postprocessing/OutputPass.js +148 -0
  211. package/Resources/WebLibraries/three/addons/postprocessing/Pass.js +191 -0
  212. package/Resources/WebLibraries/three/addons/postprocessing/RenderPass.js +193 -0
  213. package/Resources/WebLibraries/three/addons/postprocessing/RenderPixelatedPass.js +314 -0
  214. package/Resources/WebLibraries/three/addons/postprocessing/RenderTransitionPass.js +267 -0
  215. package/Resources/WebLibraries/three/addons/postprocessing/SAOPass.js +407 -0
  216. package/Resources/WebLibraries/three/addons/postprocessing/SMAAPass.js +230 -0
  217. package/Resources/WebLibraries/three/addons/postprocessing/SSAARenderPass.js +313 -0
  218. package/Resources/WebLibraries/three/addons/postprocessing/SSAOPass.js +527 -0
  219. package/Resources/WebLibraries/three/addons/postprocessing/SSRPass.js +858 -0
  220. package/Resources/WebLibraries/three/addons/postprocessing/SavePass.js +132 -0
  221. package/Resources/WebLibraries/three/addons/postprocessing/ShaderPass.js +135 -0
  222. package/Resources/WebLibraries/three/addons/postprocessing/TAARenderPass.js +243 -0
  223. package/Resources/WebLibraries/three/addons/postprocessing/TexturePass.js +131 -0
  224. package/Resources/WebLibraries/three/addons/postprocessing/UnrealBloomPass.js +541 -0
  225. package/Resources/WebLibraries/three/addons/shaders/ACESFilmicToneMappingShader.js +96 -0
  226. package/Resources/WebLibraries/three/addons/shaders/AfterimageShader.js +63 -0
  227. package/Resources/WebLibraries/three/addons/shaders/BasicShader.js +36 -0
  228. package/Resources/WebLibraries/three/addons/shaders/BleachBypassShader.js +68 -0
  229. package/Resources/WebLibraries/three/addons/shaders/BlendShader.js +56 -0
  230. package/Resources/WebLibraries/three/addons/shaders/BokehShader.js +151 -0
  231. package/Resources/WebLibraries/three/addons/shaders/BokehShader2.js +404 -0
  232. package/Resources/WebLibraries/three/addons/shaders/BrightnessContrastShader.js +62 -0
  233. package/Resources/WebLibraries/three/addons/shaders/ColorCorrectionShader.js +59 -0
  234. package/Resources/WebLibraries/three/addons/shaders/ColorifyShader.js +57 -0
  235. package/Resources/WebLibraries/three/addons/shaders/ConvolutionShader.js +74 -0
  236. package/Resources/WebLibraries/three/addons/shaders/CopyShader.js +52 -0
  237. package/Resources/WebLibraries/three/addons/shaders/DOFMipMapShader.js +63 -0
  238. package/Resources/WebLibraries/three/addons/shaders/DepthLimitedBlurShader.js +183 -0
  239. package/Resources/WebLibraries/three/addons/shaders/DigitalGlitch.js +104 -0
  240. package/Resources/WebLibraries/three/addons/shaders/DotScreenShader.js +75 -0
  241. package/Resources/WebLibraries/three/addons/shaders/ExposureShader.js +51 -0
  242. package/Resources/WebLibraries/three/addons/shaders/FXAAShader.js +298 -0
  243. package/Resources/WebLibraries/three/addons/shaders/FilmShader.js +73 -0
  244. package/Resources/WebLibraries/three/addons/shaders/FocusShader.js +94 -0
  245. package/Resources/WebLibraries/three/addons/shaders/FreiChenShader.js +103 -0
  246. package/Resources/WebLibraries/three/addons/shaders/GTAOShader.js +437 -0
  247. package/Resources/WebLibraries/three/addons/shaders/GammaCorrectionShader.js +52 -0
  248. package/Resources/WebLibraries/three/addons/shaders/HalftoneShader.js +332 -0
  249. package/Resources/WebLibraries/three/addons/shaders/HorizontalBlurShader.js +68 -0
  250. package/Resources/WebLibraries/three/addons/shaders/HorizontalTiltShiftShader.js +70 -0
  251. package/Resources/WebLibraries/three/addons/shaders/HueSaturationShader.js +74 -0
  252. package/Resources/WebLibraries/three/addons/shaders/KaleidoShader.js +65 -0
  253. package/Resources/WebLibraries/three/addons/shaders/LuminosityHighPassShader.js +68 -0
  254. package/Resources/WebLibraries/three/addons/shaders/LuminosityShader.js +54 -0
  255. package/Resources/WebLibraries/three/addons/shaders/MirrorShader.js +62 -0
  256. package/Resources/WebLibraries/three/addons/shaders/NormalMapShader.js +60 -0
  257. package/Resources/WebLibraries/three/addons/shaders/OutputShader.js +103 -0
  258. package/Resources/WebLibraries/three/addons/shaders/PoissonDenoiseShader.js +230 -0
  259. package/Resources/WebLibraries/three/addons/shaders/RGBShiftShader.js +61 -0
  260. package/Resources/WebLibraries/three/addons/shaders/SAOShader.js +201 -0
  261. package/Resources/WebLibraries/three/addons/shaders/SMAAShader.js +489 -0
  262. package/Resources/WebLibraries/three/addons/shaders/SSAOShader.js +331 -0
  263. package/Resources/WebLibraries/three/addons/shaders/SSRShader.js +396 -0
  264. package/Resources/WebLibraries/three/addons/shaders/SepiaShader.js +57 -0
  265. package/Resources/WebLibraries/three/addons/shaders/SobelOperatorShader.js +98 -0
  266. package/Resources/WebLibraries/three/addons/shaders/SubsurfaceScatteringShader.js +95 -0
  267. package/Resources/WebLibraries/three/addons/shaders/TechnicolorShader.js +51 -0
  268. package/Resources/WebLibraries/three/addons/shaders/ToonShader.js +349 -0
  269. package/Resources/WebLibraries/three/addons/shaders/TriangleBlurShader.js +79 -0
  270. package/Resources/WebLibraries/three/addons/shaders/UnpackDepthRGBAShader.js +60 -0
  271. package/Resources/WebLibraries/three/addons/shaders/VelocityShader.js +137 -0
  272. package/Resources/WebLibraries/three/addons/shaders/VerticalBlurShader.js +66 -0
  273. package/Resources/WebLibraries/three/addons/shaders/VerticalTiltShiftShader.js +70 -0
  274. package/Resources/WebLibraries/three/addons/shaders/VignetteShader.js +56 -0
  275. package/Resources/WebLibraries/three/addons/shaders/VolumeShader.js +285 -0
  276. package/Resources/WebLibraries/three/addons/shaders/WaterRefractionShader.js +106 -0
  277. package/Resources/WebLibraries/three/addons/textures/FlakesTexture.js +54 -0
  278. package/Resources/WebLibraries/three/addons/tsl/WebGLNodesHandler.js +607 -0
  279. package/Resources/WebLibraries/three/addons/tsl/display/AfterImageNode.js +256 -0
  280. package/Resources/WebLibraries/three/addons/tsl/display/AnaglyphPassNode.js +550 -0
  281. package/Resources/WebLibraries/three/addons/tsl/display/BilateralBlurNode.js +377 -0
  282. package/Resources/WebLibraries/three/addons/tsl/display/BleachBypass.js +33 -0
  283. package/Resources/WebLibraries/three/addons/tsl/display/BloomNode.js +599 -0
  284. package/Resources/WebLibraries/three/addons/tsl/display/CRT.js +150 -0
  285. package/Resources/WebLibraries/three/addons/tsl/display/ChromaticAberrationNode.js +163 -0
  286. package/Resources/WebLibraries/three/addons/tsl/display/DenoiseNode.js +354 -0
  287. package/Resources/WebLibraries/three/addons/tsl/display/DepthOfFieldNode.js +572 -0
  288. package/Resources/WebLibraries/three/addons/tsl/display/DotScreenNode.js +104 -0
  289. package/Resources/WebLibraries/three/addons/tsl/display/FSR1Node.js +481 -0
  290. package/Resources/WebLibraries/three/addons/tsl/display/FXAANode.js +357 -0
  291. package/Resources/WebLibraries/three/addons/tsl/display/FilmNode.js +101 -0
  292. package/Resources/WebLibraries/three/addons/tsl/display/GTAONode.js +727 -0
  293. package/Resources/WebLibraries/three/addons/tsl/display/GaussianBlurNode.js +412 -0
  294. package/Resources/WebLibraries/three/addons/tsl/display/GodraysNode.js +604 -0
  295. package/Resources/WebLibraries/three/addons/tsl/display/ImportanceSampledEnvironment.js +564 -0
  296. package/Resources/WebLibraries/three/addons/tsl/display/LensflareNode.js +282 -0
  297. package/Resources/WebLibraries/three/addons/tsl/display/Lut3DNode.js +109 -0
  298. package/Resources/WebLibraries/three/addons/tsl/display/MotionBlur.js +33 -0
  299. package/Resources/WebLibraries/three/addons/tsl/display/OITPassNode.js +341 -0
  300. package/Resources/WebLibraries/three/addons/tsl/display/OutlineNode.js +916 -0
  301. package/Resources/WebLibraries/three/addons/tsl/display/ParallaxBarrierPassNode.js +90 -0
  302. package/Resources/WebLibraries/three/addons/tsl/display/PixelationPassNode.js +227 -0
  303. package/Resources/WebLibraries/three/addons/tsl/display/RGBShiftNode.js +96 -0
  304. package/Resources/WebLibraries/three/addons/tsl/display/RecurrentDenoiseNode.js +812 -0
  305. package/Resources/WebLibraries/three/addons/tsl/display/RetroPassNode.js +263 -0
  306. package/Resources/WebLibraries/three/addons/tsl/display/SMAANode.js +729 -0
  307. package/Resources/WebLibraries/three/addons/tsl/display/SSAAPassNode.js +344 -0
  308. package/Resources/WebLibraries/three/addons/tsl/display/SSAONode.js +422 -0
  309. package/Resources/WebLibraries/three/addons/tsl/display/SSGINode.js +698 -0
  310. package/Resources/WebLibraries/three/addons/tsl/display/SSRNode.js +1430 -0
  311. package/Resources/WebLibraries/three/addons/tsl/display/SSSNode.js +479 -0
  312. package/Resources/WebLibraries/three/addons/tsl/display/Sepia.js +24 -0
  313. package/Resources/WebLibraries/three/addons/tsl/display/Shape.js +29 -0
  314. package/Resources/WebLibraries/three/addons/tsl/display/SharpenNode.js +284 -0
  315. package/Resources/WebLibraries/three/addons/tsl/display/SobelOperatorNode.js +168 -0
  316. package/Resources/WebLibraries/three/addons/tsl/display/StereoCompositePassNode.js +190 -0
  317. package/Resources/WebLibraries/three/addons/tsl/display/StereoPassNode.js +117 -0
  318. package/Resources/WebLibraries/three/addons/tsl/display/TAAUNode.js +700 -0
  319. package/Resources/WebLibraries/three/addons/tsl/display/TRAANode.js +609 -0
  320. package/Resources/WebLibraries/three/addons/tsl/display/TemporalReprojectNode.js +1024 -0
  321. package/Resources/WebLibraries/three/addons/tsl/display/TransitionNode.js +141 -0
  322. package/Resources/WebLibraries/three/addons/tsl/display/boxBlur.js +65 -0
  323. package/Resources/WebLibraries/three/addons/tsl/display/depthAwareBlend.js +80 -0
  324. package/Resources/WebLibraries/three/addons/tsl/display/depthAwareBlur.js +63 -0
  325. package/Resources/WebLibraries/three/addons/tsl/display/hashBlur.js +55 -0
  326. package/Resources/WebLibraries/three/addons/tsl/display/lensDirt.js +30 -0
  327. package/Resources/WebLibraries/three/addons/tsl/display/radialBlur.js +68 -0
  328. package/Resources/WebLibraries/three/addons/tsl/lighting/ClusteredLightsNode.js +994 -0
  329. package/Resources/WebLibraries/three/addons/tsl/lighting/DynamicLightsNode.js +201 -0
  330. package/Resources/WebLibraries/three/addons/tsl/lighting/LightProbeGridNode.js +183 -0
  331. package/Resources/WebLibraries/three/addons/tsl/lighting/data/AmbientLightDataNode.js +67 -0
  332. package/Resources/WebLibraries/three/addons/tsl/lighting/data/DirectionalLightDataNode.js +117 -0
  333. package/Resources/WebLibraries/three/addons/tsl/lighting/data/HemisphereLightDataNode.js +105 -0
  334. package/Resources/WebLibraries/three/addons/tsl/lighting/data/PointLightDataNode.js +140 -0
  335. package/Resources/WebLibraries/three/addons/tsl/lighting/data/SpotLightDataNode.js +167 -0
  336. package/Resources/WebLibraries/three/addons/tsl/math/Bayer.js +84 -0
  337. package/Resources/WebLibraries/three/addons/tsl/math/curlNoise.js +107 -0
  338. package/Resources/WebLibraries/three/addons/tsl/math/voronoiNoise.js +112 -0
  339. package/Resources/WebLibraries/three/addons/tsl/shadows/TileShadowNode.js +542 -0
  340. package/Resources/WebLibraries/three/addons/tsl/shadows/TileShadowNodeHelper.js +212 -0
  341. package/Resources/WebLibraries/three/addons/tsl/utils/GroundedSkybox.js +62 -0
  342. package/Resources/WebLibraries/three/addons/tsl/utils/RNoise.js +51 -0
  343. package/Resources/WebLibraries/three/addons/tsl/utils/Raymarching.js +70 -0
  344. package/Resources/WebLibraries/three/addons/tsl/utils/SoftParticles.js +53 -0
  345. package/Resources/WebLibraries/three/addons/tsl/utils/SpecularHelpers.js +302 -0
  346. package/Resources/WebLibraries/three/addons/tsl/utils/TAAUtils.js +184 -0
  347. package/Resources/WebLibraries/three/addons/utils/BufferGeometryUtils.js +1523 -0
  348. package/Resources/WebLibraries/three/addons/utils/CameraUtils.js +82 -0
  349. package/Resources/WebLibraries/three/addons/utils/ColorUtils.js +76 -0
  350. package/Resources/WebLibraries/three/addons/utils/GaussianSplatUtils.js +229 -0
  351. package/Resources/WebLibraries/three/addons/utils/GeometryCompressionUtils.js +547 -0
  352. package/Resources/WebLibraries/three/addons/utils/GeometryUtils.js +226 -0
  353. package/Resources/WebLibraries/three/addons/utils/LDrawUtils.js +211 -0
  354. package/Resources/WebLibraries/three/addons/utils/SceneOptimizer.js +459 -0
  355. package/Resources/WebLibraries/three/addons/utils/SceneUtils.js +363 -0
  356. package/Resources/WebLibraries/three/addons/utils/ShadowMapViewer.js +244 -0
  357. package/Resources/WebLibraries/three/addons/utils/ShadowMapViewerGPU.js +233 -0
  358. package/Resources/WebLibraries/three/addons/utils/SkeletonUtils.js +496 -0
  359. package/Resources/WebLibraries/three/addons/utils/SortUtils.js +175 -0
  360. package/Resources/WebLibraries/three/addons/utils/UVsDebug.js +173 -0
  361. package/Resources/WebLibraries/three/addons/utils/WebGLTextureUtils.js +115 -0
  362. package/Resources/WebLibraries/three/addons/utils/WebGPUTextureUtils.js +81 -0
  363. package/Resources/WebLibraries/three/addons/utils/WorkerPool.js +167 -0
  364. package/Resources/WebLibraries/three/addons/utils/unwrapUVs.js +865 -0
  365. package/Resources/WebLibraries/three/three.core.js +61162 -0
  366. package/Resources/WebLibraries/three/three.module.js +19537 -0
  367. package/Resources/WebLibraries/three/three.tsl.js +41903 -0
  368. package/Resources/WebLibraries/three/three.webgpu.js +53714 -0
  369. package/Resources/skills/2d-game/SKILL.md +305 -0
  370. package/Resources/skills/3d-game/SKILL.md +274 -0
  371. package/Resources/skills/accounts/SKILL.md +41 -0
  372. package/Resources/skills/android-design/SKILL.md +159 -0
  373. package/Resources/skills/app-ai/SKILL.md +154 -0
  374. package/Resources/skills/app-intents/SKILL.md +31 -0
  375. package/Resources/skills/app-kinds/SKILL.md +122 -0
  376. package/Resources/skills/apple-watch/SKILL.md +43 -0
  377. package/Resources/skills/assets/SKILL.md +183 -0
  378. package/Resources/skills/building-blocks/SKILL.md +97 -0
  379. package/Resources/skills/device-control/SKILL.md +56 -0
  380. package/Resources/skills/device-integrations/SKILL.md +278 -0
  381. package/Resources/skills/finder-files/SKILL.md +19 -0
  382. package/Resources/skills/game/SKILL.md +414 -0
  383. package/Resources/skills/game-3d/SKILL.md +12 -0
  384. package/Resources/skills/game-art/SKILL.md +11 -0
  385. package/Resources/skills/game-feel/SKILL.md +13 -0
  386. package/Resources/skills/game-levels/SKILL.md +12 -0
  387. package/Resources/skills/game-live/SKILL.md +12 -0
  388. package/Resources/skills/game-physics/SKILL.md +13 -0
  389. package/Resources/skills/game-playtest/SKILL.md +26 -0
  390. package/Resources/skills/game-ui/SKILL.md +278 -0
  391. package/Resources/skills/github-projects/SKILL.md +59 -0
  392. package/Resources/skills/icloud-sync/SKILL.md +30 -0
  393. package/Resources/skills/iphone-hardware/SKILL.md +57 -0
  394. package/Resources/skills/iphone-widgets/SKILL.md +53 -0
  395. package/Resources/skills/lg-developer-mode/SKILL.md +152 -0
  396. package/Resources/skills/mac-widgets/SKILL.md +60 -0
  397. package/Resources/skills/maps/SKILL.md +8 -0
  398. package/Resources/skills/menu-bar/SKILL.md +36 -0
  399. package/Resources/skills/more-apps/SKILL.md +53 -0
  400. package/Resources/skills/phone-controllers/SKILL.md +79 -0
  401. package/Resources/skills/phone-pages/SKILL.md +173 -0
  402. package/Resources/skills/roku-developer-mode/SKILL.md +106 -0
  403. package/Resources/skills/scene-3d/SKILL.md +27 -0
  404. package/Resources/skills/scripting/SKILL.md +17 -0
  405. package/Resources/skills/share-extension/SKILL.md +22 -0
  406. package/Resources/skills/tv-design/SKILL.md +72 -0
  407. package/Resources/skills/web-app/SKILL.md +136 -0
  408. package/Resources/skills/web-game/SKILL.md +95 -0
  409. package/Resources/skills/web-or-native/SKILL.md +103 -0
  410. package/Resources/skills/wish-links/SKILL.md +156 -0
  411. package/THIRD_PARTY_NOTICES.md +170 -0
  412. package/cli/android.mjs +941 -0
  413. package/cli/browser.mjs +268 -0
  414. package/cli/calls.mjs +390 -0
  415. package/cli/dev.mjs +773 -0
  416. package/cli/devices.mjs +984 -0
  417. package/cli/lamp.mjs +1016 -0
  418. package/cli/lampapp.mjs +332 -0
  419. package/cli/lamps/android-host/LampPageGateway.kt +345 -0
  420. package/cli/lamps/android-host/app/build.gradle.kts +40 -0
  421. package/cli/lamps/android-host/build.gradle.kts +4 -0
  422. package/cli/lamps/android-host/game/AndroidManifest.xml +33 -0
  423. package/cli/lamps/android-host/game/MainActivity.kt +173 -0
  424. package/cli/lamps/android-host/gradle/libs.versions.toml +39 -0
  425. package/cli/lamps/android-host/gradle.properties +8 -0
  426. package/cli/lamps/android-host/page/AndroidManifest.xml +35 -0
  427. package/cli/lamps/android-host/page/MainActivity.kt +193 -0
  428. package/cli/lamps/android-host/settings.gradle.kts +30 -0
  429. package/cli/lamps/android-host/tools.json +43 -0
  430. package/cli/lamps/lamp-controllers.js +2 -0
  431. package/cli/lamps/lamp-for-games.js +6863 -0
  432. package/cli/lamps/lamp.js +7023 -0
  433. package/cli/lamps/mac-starter/.lamp/meta.json +1 -0
  434. package/cli/lamps/mac-starter/APP.md +12 -0
  435. package/cli/lamps/mac-starter/Package.swift +8 -0
  436. package/cli/lamps/mac-starter/Sources/App.swift +11 -0
  437. package/cli/lamps/mac-starter/Sources/ContentView.swift +17 -0
  438. package/cli/lamps/mac-starter/Sources/LampSupport.swift +18097 -0
  439. package/cli/lamps/mac-starter/build.sh +336 -0
  440. package/cli/lamps/mac-starter/gitignore +3 -0
  441. package/cli/lamps/mac-starter/lamp-starter.json +6 -0
  442. package/cli/lamps/web-starter/APP.md +8 -0
  443. package/cli/lamps/web-starter/app.js +1 -0
  444. package/cli/lamps/web-starter/index.html +17 -0
  445. package/cli/lamps/web-starter/lamp-starter.json +5 -0
  446. package/cli/lamps/web-starter/lamp.js +7023 -0
  447. package/cli/lamps/web-starter/style.css +25 -0
  448. package/cli/link.mjs +138 -0
  449. package/cli/mac.mjs +621 -0
  450. package/cli/mdns.mjs +205 -0
  451. package/cli/msix.mjs +413 -0
  452. package/cli/network.mjs +209 -0
  453. package/cli/outside.mjs +140 -0
  454. package/cli/page.js +165 -0
  455. package/cli/place.mjs +298 -0
  456. package/cli/png.mjs +184 -0
  457. package/cli/share.mjs +202 -0
  458. package/cli/skill/SKILL.md +255 -0
  459. package/cli/skills.mjs +71 -0
  460. package/cli/state.mjs +173 -0
  461. package/cli/update.mjs +57 -0
  462. package/package.json +20 -4
  463. package/site/lib/quota.js +59 -0
  464. package/site/lib/shared-wishes.js +996 -0
@@ -0,0 +1,4538 @@
1
+ #if defined(SOKOL_IMPL) && !defined(SOKOL_GL_IMPL)
2
+ #define SOKOL_GL_IMPL
3
+ #endif
4
+ #ifndef SOKOL_GL_INCLUDED
5
+ /*
6
+ sokol_gl.h -- OpenGL 1.x style rendering on top of sokol_gfx.h
7
+
8
+ Project URL: https://github.com/floooh/sokol
9
+
10
+ Do this:
11
+ #define SOKOL_IMPL or
12
+ #define SOKOL_GL_IMPL
13
+ before you include this file in *one* C or C++ file to create the
14
+ implementation.
15
+
16
+ The following defines are used by the implementation to select the
17
+ platform-specific embedded shader code (these are the same defines as
18
+ used by sokol_gfx.h and sokol_app.h):
19
+
20
+ SOKOL_GLCORE
21
+ SOKOL_GLES3
22
+ SOKOL_D3D11
23
+ SOKOL_METAL
24
+ SOKOL_WGPU
25
+ SOKOL_VULKAN
26
+
27
+ ...optionally provide the following macros to override defaults:
28
+
29
+ SOKOL_ASSERT(c) - your own assert macro (default: assert(c))
30
+ SOKOL_GL_API_DECL - public function declaration prefix (default: extern)
31
+ SOKOL_API_DECL - same as SOKOL_GL_API_DECL
32
+ SOKOL_API_IMPL - public function implementation prefix (default: -)
33
+ SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false))
34
+
35
+ If sokol_gl.h is compiled as a DLL, define the following before
36
+ including the declaration or implementation:
37
+
38
+ SOKOL_DLL
39
+
40
+ On Windows, SOKOL_DLL will define SOKOL_GL_API_DECL as __declspec(dllexport)
41
+ or __declspec(dllimport) as needed.
42
+
43
+ Include the following headers before including sokol_gl.h:
44
+
45
+ sokol_gfx.h
46
+
47
+ Matrix functions have been taken from MESA and Regal.
48
+
49
+ FEATURE OVERVIEW:
50
+ =================
51
+ sokol_gl.h implements a subset of the OpenGLES 1.x feature set useful for
52
+ when you just want to quickly render a bunch of triangles or
53
+ lines without having to mess with buffers and shaders.
54
+
55
+ The current feature set is mostly useful for debug visualizations
56
+ and simple UI-style 2D rendering:
57
+
58
+ What's implemented:
59
+ - vertex components:
60
+ - position (x, y, z)
61
+ - 2D texture coords (u, v)
62
+ - color (r, g, b, a)
63
+ - primitive types:
64
+ - triangle list and strip
65
+ - line list and strip
66
+ - quad list (TODO: quad strips)
67
+ - point list
68
+ - one texture layer (no multi-texturing)
69
+ - viewport and scissor-rect with selectable origin (top-left or bottom-left)
70
+ - all GL 1.x matrix stack functions, and additionally equivalent
71
+ functions for gluPerspective and gluLookat
72
+
73
+ Notable GLES 1.x features that are *NOT* implemented:
74
+ - vertex lighting (this is the most likely GL feature that might be added later)
75
+ - vertex arrays (although providing whole chunks of vertex data at once
76
+ might be a useful feature for a later version)
77
+ - texture coordinate generation
78
+ - line width
79
+ - all pixel store functions
80
+ - no ALPHA_TEST
81
+ - no clear functions (clearing is handled by the sokol-gfx render pass)
82
+ - fog
83
+
84
+ Notable differences to GL:
85
+ - No "enum soup" for render states etc, instead there's a
86
+ 'pipeline stack', this is similar to GL's matrix stack,
87
+ but for pipeline-state-objects. The pipeline object at
88
+ the top of the pipeline stack defines the active set of render states
89
+ - All angles are in radians, not degrees (note the sgl_rad() and
90
+ sgl_deg() conversion functions)
91
+ - No enable/disable state for scissor test, this is always enabled
92
+
93
+ STEP BY STEP:
94
+ =============
95
+ --- To initialize sokol-gl, call:
96
+
97
+ sgl_setup(const sgl_desc_t* desc)
98
+
99
+ NOTE that sgl_setup() must be called *after* initializing sokol-gfx
100
+ (via sg_setup). This is because sgl_setup() needs to create
101
+ sokol-gfx resource objects.
102
+
103
+ If you're intending to render to the default pass, and also don't
104
+ want to tweak memory usage, and don't want any logging output you can
105
+ just keep sgl_desc_t zero-initialized:
106
+
107
+ sgl_setup(&(sgl_desc_t*){ 0 });
108
+
109
+ In this case, sokol-gl will create internal sg_pipeline objects that
110
+ are compatible with the sokol-app default framebuffer.
111
+
112
+ I would recommend to at least install a logging callback so that
113
+ you'll see any warnings and errors. The easiest way is through
114
+ sokol_log.h:
115
+
116
+ #include "sokol_log.h"
117
+
118
+ sgl_setup(&(sgl_desc_t){
119
+ .logger.func = slog_func.
120
+ });
121
+
122
+ If you want to render into a framebuffer with different pixel-format
123
+ and MSAA attributes you need to provide the matching attributes in the
124
+ sgl_setup() call:
125
+
126
+ sgl_setup(&(sgl_desc_t*){
127
+ .color_format = SG_PIXELFORMAT_...,
128
+ .depth_format = SG_PIXELFORMAT_...,
129
+ .sample_count = ...,
130
+ });
131
+
132
+ To reduce memory usage, or if you need to create more then the default number of
133
+ contexts, pipelines, vertices or draw commands, set the following sgl_desc_t
134
+ members:
135
+
136
+ .context_pool_size (default: 4)
137
+ .pipeline_pool_size (default: 64)
138
+ .max_vertices (default: 64k)
139
+ .max_commands (default: 16k)
140
+
141
+ Finally you can change the face winding for front-facing triangles
142
+ and quads:
143
+
144
+ .face_winding - default is SG_FACEWINDING_CCW
145
+
146
+ The default winding for front faces is counter-clock-wise. This is
147
+ the same as OpenGL's default, but different from sokol-gfx.
148
+
149
+ --- Optionally create additional context objects if you want to render into
150
+ multiple sokol-gfx render passes (or generally if you want to
151
+ use multiple independent sokol-gl "state buckets")
152
+
153
+ sgl_context ctx = sgl_make_context(const sgl_context_desc_t* desc)
154
+
155
+ For details on rendering with sokol-gl contexts, search below for
156
+ WORKING WITH CONTEXTS.
157
+
158
+ --- Optionally create pipeline-state-objects if you need render state
159
+ that differs from sokol-gl's default state:
160
+
161
+ sgl_pipeline pip = sgl_make_pipeline(const sg_pipeline_desc* desc)
162
+
163
+ ...this creates a pipeline object that's compatible with the currently
164
+ active context, alternatively call:
165
+
166
+ sgl_pipeline_pip = sgl_context_make_pipeline(sgl_context ctx, const sg_pipeline_desc* desc)
167
+
168
+ ...to create a pipeline object that's compatible with an explicitly
169
+ provided context.
170
+
171
+ The similarity with sokol_gfx.h's sg_pipeline type and sg_make_pipeline()
172
+ function is intended. sgl_make_pipeline() also takes a standard
173
+ sokol-gfx sg_pipeline_desc object to describe the render state, but
174
+ without:
175
+ - shader
176
+ - vertex layout
177
+ - color- and depth-pixel-formats
178
+ - primitive type (lines, triangles, ...)
179
+ - MSAA sample count
180
+ Those will be filled in by sgl_make_pipeline(). Note that each
181
+ call to sgl_make_pipeline() needs to create several sokol-gfx
182
+ pipeline objects (one for each primitive type).
183
+
184
+ 'depth.write_enabled' will be forced to 'false' if the context this
185
+ pipeline object is intended for has its depth pixel format set to
186
+ SG_PIXELFORMAT_NONE (which means the framebuffer this context is used
187
+ with doesn't have a depth-stencil surface).
188
+
189
+ --- if you need to destroy sgl_pipeline objects before sgl_shutdown():
190
+
191
+ sgl_destroy_pipeline(sgl_pipeline pip)
192
+
193
+ --- After sgl_setup() you can call any of the sokol-gl functions anywhere
194
+ in a frame, *except* sgl_draw(). The 'vanilla' functions
195
+ will only change internal sokol-gl state, and not call any sokol-gfx
196
+ functions.
197
+
198
+ --- Unlike OpenGL, sokol-gl has a function to reset internal state to
199
+ a known default. This is useful at the start of a sequence of
200
+ rendering operations:
201
+
202
+ void sgl_defaults(void)
203
+
204
+ This will set the following default state:
205
+
206
+ - current texture coordinate to u=0.0f, v=0.0f
207
+ - current color to white (rgba all 1.0f)
208
+ - current point size to 1.0f
209
+ - unbind the current texture and texturing will be disabled
210
+ - *all* matrices will be set to identity (also the projection matrix)
211
+ - the default render state will be set by loading the 'default pipeline'
212
+ into the top of the pipeline stack
213
+
214
+ The current matrix- and pipeline-stack-depths will not be changed by
215
+ sgl_defaults().
216
+
217
+ --- change the currently active renderstate through the
218
+ pipeline-stack functions, this works similar to the
219
+ traditional GL matrix stack:
220
+
221
+ ...load the default pipeline state on the top of the pipeline stack:
222
+
223
+ sgl_load_default_pipeline()
224
+
225
+ ...load a specific pipeline on the top of the pipeline stack:
226
+
227
+ sgl_load_pipeline(sgl_pipeline pip)
228
+
229
+ ...push and pop the pipeline stack:
230
+ sgl_push_pipeline()
231
+ sgl_pop_pipeline()
232
+
233
+ --- control texturing with:
234
+
235
+ sgl_enable_texture()
236
+ sgl_disable_texture()
237
+ sgl_texture(sg_view tex_view, sg_sampler smp)
238
+
239
+ NOTE: the tex_view and smp handles can be invalid (SG_INVALID_ID), in this
240
+ case, sokol-gl will fall back to the internal default (white) texture
241
+ and sampler.
242
+
243
+ --- set the current viewport and scissor rect with:
244
+
245
+ sgl_viewport(int x, int y, int w, int h, bool origin_top_left)
246
+ sgl_scissor_rect(int x, int y, int w, int h, bool origin_top_left)
247
+
248
+ ...or call these alternatives which take float arguments (this might allow
249
+ to avoid casting between float and integer in more strongly typed languages
250
+ when floating point pixel coordinates are used):
251
+
252
+ sgl_viewportf(float x, float y, float w, float h, bool origin_top_left)
253
+ sgl_scissor_rectf(float x, float y, float w, float h, bool origin_top_left)
254
+
255
+ ...these calls add a new command to the internal command queue, so
256
+ that the viewport or scissor rect are set at the right time relative
257
+ to other sokol-gl calls.
258
+
259
+ --- adjust the transform matrices, matrix manipulation works just like
260
+ the OpenGL matrix stack:
261
+
262
+ ...set the current matrix mode:
263
+
264
+ sgl_matrix_mode_modelview()
265
+ sgl_matrix_mode_projection()
266
+ sgl_matrix_mode_texture()
267
+
268
+ ...load the identity matrix into the current matrix:
269
+
270
+ sgl_load_identity()
271
+
272
+ ...translate, rotate and scale the current matrix:
273
+
274
+ sgl_translate(float x, float y, float z)
275
+ sgl_rotate(float angle_rad, float x, float y, float z)
276
+ sgl_scale(float x, float y, float z)
277
+
278
+ NOTE that all angles in sokol-gl are in radians, not in degree.
279
+ Convert between radians and degree with the helper functions:
280
+
281
+ float sgl_rad(float deg) - degrees to radians
282
+ float sgl_deg(float rad) - radians to degrees
283
+
284
+ ...directly load the current matrix from a float[16] array:
285
+
286
+ sgl_load_matrix(const float m[16])
287
+ sgl_load_transpose_matrix(const float m[16])
288
+
289
+ ...directly multiply the current matrix from a float[16] array:
290
+
291
+ sgl_mult_matrix(const float m[16])
292
+ sgl_mult_transpose_matrix(const float m[16])
293
+
294
+ The memory layout of those float[16] arrays is the same as in OpenGL.
295
+
296
+ ...more matrix functions:
297
+
298
+ sgl_frustum(float left, float right, float bottom, float top, float near, float far)
299
+ sgl_ortho(float left, float right, float bottom, float top, float near, float far)
300
+ sgl_perspective(float fov_y, float aspect, float near, float far)
301
+ sgl_lookat(float eye_x, float eye_y, float eye_z, float center_x, float center_y, float center_z, float up_x, float up_y, float up_z)
302
+
303
+ These functions work the same as glFrustum(), glOrtho(), gluPerspective()
304
+ and gluLookAt().
305
+
306
+ ...and finally to push / pop the current matrix stack:
307
+
308
+ sgl_push_matrix(void)
309
+ sgl_pop_matrix(void)
310
+
311
+ Again, these work the same as glPushMatrix() and glPopMatrix().
312
+
313
+ --- perform primitive rendering:
314
+
315
+ ...set the current texture coordinate and color 'registers' with or
316
+ point size with:
317
+
318
+ sgl_t2f(float u, float v) - set current texture coordinate
319
+ sgl_c*(...) - set current color
320
+ sgl_point_size(float size) - set current point size
321
+
322
+ There are several functions for setting the color (as float values,
323
+ unsigned byte values, packed as unsigned 32-bit integer, with
324
+ and without alpha).
325
+
326
+ NOTE that these are the only functions that can be called both inside
327
+ sgl_begin_*() / sgl_end() and outside.
328
+
329
+ Also NOTE that point size is currently hardwired to 1.0f if the D3D11
330
+ backend is used.
331
+
332
+ ...start a primitive vertex sequence with:
333
+
334
+ sgl_begin_points()
335
+ sgl_begin_lines()
336
+ sgl_begin_line_strip()
337
+ sgl_begin_triangles()
338
+ sgl_begin_triangle_strip()
339
+ sgl_begin_quads()
340
+
341
+ ...after sgl_begin_*() specify vertices:
342
+
343
+ sgl_v*(...)
344
+ sgl_v*_t*(...)
345
+ sgl_v*_c*(...)
346
+ sgl_v*_t*_c*(...)
347
+
348
+ These functions write a new vertex to sokol-gl's internal vertex buffer,
349
+ optionally with texture-coords and color. If the texture coordinate
350
+ and/or color is missing, it will be taken from the current texture-coord
351
+ and color 'register'.
352
+
353
+ ...finally, after specifying vertices, call:
354
+
355
+ sgl_end()
356
+
357
+ This will record a new draw command in sokol-gl's internal command
358
+ list, or it will extend the previous draw command if no relevant
359
+ state has changed since the last sgl_begin/end pair.
360
+
361
+ --- inside a sokol-gfx rendering pass, call the sgl_draw() function
362
+ to render the currently active context:
363
+
364
+ sgl_draw()
365
+
366
+ ...or alternatively call:
367
+
368
+ sgl_context_draw(ctx)
369
+
370
+ ...to render an explicitly provided context.
371
+
372
+ This will render everything that has been recorded in the context since
373
+ the last call to sgl_draw() through sokol-gfx, and will 'rewind' the internal
374
+ vertex-, uniform- and command-buffers.
375
+
376
+ --- each sokol-gl context tracks internal error states which can
377
+ be obtains via:
378
+
379
+ sgl_error_t sgl_error()
380
+
381
+ ...alternatively with an explicit context argument:
382
+
383
+ sgl_error_t sgl_context_error(ctx);
384
+
385
+ ...this returns a struct with the following booleans:
386
+
387
+ .any - true if any of the below errors is true
388
+ .vertices_full - internal vertex buffer is full (checked in sgl_end())
389
+ .uniforms_full - the internal uniforms buffer is full (checked in sgl_end())
390
+ .commands_full - the internal command buffer is full (checked in sgl_end())
391
+ .stack_overflow - matrix- or pipeline-stack overflow
392
+ .stack_underflow - matrix- or pipeline-stack underflow
393
+ .no_context - the active context no longer exists
394
+
395
+ ...depending on the above error state, sgl_draw() may skip rendering
396
+ completely, or only draw partial geometry
397
+
398
+ --- you can get the number of recorded vertices and draw commands in the current
399
+ frame and active sokol-gl context via:
400
+
401
+ int sgl_num_vertices()
402
+ int sgl_num_commands()
403
+
404
+ ...this allows you to check whether the vertex or command pools are running
405
+ full before the overflow actually happens (in this case you could also
406
+ check the error booleans in the result of sgl_error()).
407
+
408
+ RENDER LAYERS
409
+ =============
410
+ Render layers allow to split sokol-gl rendering into separate draw-command
411
+ groups which can then be rendered separately in a sokol-gfx draw pass. This
412
+ allows to mix/interleave sokol-gl rendering with other render operations.
413
+
414
+ Layered rendering is controlled through two functions:
415
+
416
+ sgl_layer(int layer_id)
417
+ sgl_draw_layer(int layer_id)
418
+
419
+ (and the context-variant sgl_draw_layer(): sgl_context_draw_layer()
420
+
421
+ The sgl_layer() function sets the 'current layer', any sokol-gl calls
422
+ which internally record draw commands will also store the current layer
423
+ in the draw command, and later in a sokol-gfx render pass, a call
424
+ to sgl_draw_layer() will only render the draw commands that have
425
+ a matching layer.
426
+
427
+ The default layer is '0', this is active after sokol-gl setup, and
428
+ is also restored at the start of a new frame (but *not* by calling
429
+ sgl_defaults()).
430
+
431
+ NOTE that calling sgl_draw() is equivalent with sgl_draw_layer(0)
432
+ (in general you should either use either use sgl_draw() or
433
+ sgl_draw_layer() in an application, but not both).
434
+
435
+ WORKING WITH CONTEXTS:
436
+ ======================
437
+ If you want to render to more than one sokol-gfx render pass you need to
438
+ work with additional sokol-gl context objects (one context object for
439
+ each offscreen rendering pass, in addition to the implicitly created
440
+ 'default context'.
441
+
442
+ All sokol-gl state is tracked per context, and there is always a "current
443
+ context" (with the notable exception that the currently set context is
444
+ destroyed, more on that later).
445
+
446
+ Using multiple contexts can also be useful if you only render in
447
+ a single pass, but want to maintain multiple independent "state buckets".
448
+
449
+ To create new context object, call:
450
+
451
+ sgl_context ctx = sgl_make_context(&(sgl_context_desc){
452
+ .max_vertices = ..., // default: 64k
453
+ .max_commands = ..., // default: 16k
454
+ .color_format = ...,
455
+ .depth_format = ...,
456
+ .sample_count = ...,
457
+ });
458
+
459
+ The color_format, depth_format and sample_count items must be compatible
460
+ with the render pass the sgl_draw() or sgL_context_draw() function
461
+ will be called in.
462
+
463
+ Creating a context does *not* make the context current. To do this, call:
464
+
465
+ sgl_set_context(ctx);
466
+
467
+ The currently active context will implicitly be used by most sokol-gl functions
468
+ which don't take an explicit context handle as argument.
469
+
470
+ To switch back to the default context, pass the global constant SGL_DEFAULT_CONTEXT:
471
+
472
+ sgl_set_context(SGL_DEFAULT_CONTEXT);
473
+
474
+ ...or alternatively use the function sgl_default_context() instead of the
475
+ global constant:
476
+
477
+ sgl_set_context(sgl_default_context());
478
+
479
+ To get the currently active context, call:
480
+
481
+ sgl_context cur_ctx = sgl_get_context();
482
+
483
+ The following functions exist in two variants, one which use the currently
484
+ active context (set with sgl_set_context()), and another version which
485
+ takes an explicit context handle instead:
486
+
487
+ sgl_make_pipeline() vs sgl_context_make_pipeline()
488
+ sgl_error() vs sgl_context_error();
489
+ sgl_draw() vs sgl_context_draw();
490
+
491
+ Except for using the currently active context versus a provided context
492
+ handle, the two variants are exactlyidentical, e.g. the following
493
+ code sequences do the same thing:
494
+
495
+ sgl_set_context(ctx);
496
+ sgl_pipeline pip = sgl_make_pipeline(...);
497
+ sgl_error_t err = sgl_error();
498
+ sgl_draw();
499
+
500
+ vs
501
+
502
+ sgl_pipeline pip = sgl_context_make_pipeline(ctx, ...);
503
+ sgl_error_t err = sgl_context_error(ctx);
504
+ sgl_context_draw(ctx);
505
+
506
+ Destroying the currently active context is a 'soft error'. All following
507
+ calls which require a currently active context will silently fail,
508
+ and sgl_error() will return SGL_ERROR_NO_CONTEXT.
509
+
510
+ UNDER THE HOOD:
511
+ ===============
512
+ sokol_gl.h works by recording vertex data and rendering commands into
513
+ memory buffers, and then drawing the recorded commands via sokol_gfx.h
514
+
515
+ The only functions which call into sokol_gfx.h are:
516
+ - sgl_setup()
517
+ - sgl_shutdown()
518
+ - sgl_draw() (and variants)
519
+
520
+ sgl_setup() must be called after initializing sokol-gfx.
521
+ sgl_shutdown() must be called before shutting down sokol-gfx.
522
+ sgl_draw() must be called once per frame inside a sokol-gfx render pass.
523
+
524
+ All other sokol-gl function can be called anywhere in a frame, since
525
+ they just record data into memory buffers owned by sokol-gl.
526
+
527
+ What happens in:
528
+
529
+ sgl_setup():
530
+ Unique resources shared by all contexts are created:
531
+ - a shader object (using embedded shader source or byte code)
532
+ - an 8x8 white default texture
533
+ The default context is created, which involves:
534
+ - 3 memory buffers are created, one for vertex data,
535
+ one for uniform data, and one for commands
536
+ - a dynamic vertex buffer is created
537
+ - the default sgl_pipeline object is created, which involves
538
+ creating 5 sg_pipeline objects
539
+
540
+ One vertex is 24 bytes:
541
+ - float3 position
542
+ - float2 texture coords
543
+ - uint32_t color
544
+
545
+ One uniform block is 128 bytes:
546
+ - mat4 model-view-projection matrix
547
+ - mat4 texture matrix
548
+
549
+ One draw command is ca. 24 bytes for the actual
550
+ command code plus command arguments.
551
+
552
+ Each sgl_end() consumes one command, and one uniform block
553
+ (only when the matrices have changed).
554
+ The required size for one sgl_begin/end pair is (at most):
555
+
556
+ (152 + 24 * num_verts) bytes
557
+
558
+ sgl_shutdown():
559
+ - all sokol-gfx resources (buffer, shader, default-texture and
560
+ all pipeline objects) are destroyed
561
+ - the 3 memory buffers are freed
562
+
563
+ sgl_draw() (and variants)
564
+ - copy all recorded vertex data into the dynamic sokol-gfx buffer
565
+ via a call to sg_write_buffer_transient()
566
+ - for each recorded command:
567
+ - if the layer number stored in the command doesn't match
568
+ the layer that's to be rendered, skip to the next
569
+ command
570
+ - if it's a viewport command, call sg_apply_viewport()
571
+ - if it's a scissor-rect command, call sg_apply_scissor_rect()
572
+ - if it's a draw command:
573
+ - depending on what has changed since the last draw command,
574
+ call sg_apply_pipeline(), sg_apply_bindings() and
575
+ sg_apply_uniforms()
576
+ - finally call sg_draw()
577
+
578
+ All other functions only modify the internally tracked state, add
579
+ data to the vertex, uniform and command buffers, or manipulate
580
+ the matrix stack.
581
+
582
+ ON DRAW COMMAND MERGING
583
+ =======================
584
+ Not every call to sgl_end() will automatically record a new draw command.
585
+ If possible, the previous draw command will simply be extended,
586
+ resulting in fewer actual draw calls later in sgl_draw().
587
+
588
+ A draw command will be merged with the previous command if "no relevant
589
+ state has changed" since the last sgl_end(), meaning:
590
+
591
+ - no calls to sgl_viewport() and sgl_scissor_rect()
592
+ - the primitive type hasn't changed
593
+ - the primitive type isn't a 'strip type' (no line or triangle strip)
594
+ - the pipeline state object hasn't changed
595
+ - the current layer hasn't changed
596
+ - none of the matrices has changed
597
+ - none of the texture state has changed
598
+
599
+ Merging a draw command simply means that the number of vertices
600
+ to render in the previous draw command will be incremented by the
601
+ number of vertices in the new draw command.
602
+
603
+ MEMORY ALLOCATION OVERRIDE
604
+ ==========================
605
+ You can override the memory allocation functions at initialization time
606
+ like this:
607
+
608
+ void* my_alloc(size_t size, void* user_data) {
609
+ return malloc(size);
610
+ }
611
+
612
+ void my_free(void* ptr, void* user_data) {
613
+ free(ptr);
614
+ }
615
+
616
+ ...
617
+ sgl_setup(&(sgl_desc_t){
618
+ // ...
619
+ .allocator = {
620
+ .alloc_fn = my_alloc,
621
+ .free_fn = my_free,
622
+ .user_data = ...;
623
+ }
624
+ });
625
+ ...
626
+
627
+ If no overrides are provided, malloc and free will be used.
628
+
629
+
630
+ ERROR REPORTING AND LOGGING
631
+ ===========================
632
+ To get any logging information at all you need to provide a logging callback in the setup call,
633
+ the easiest way is to use sokol_log.h:
634
+
635
+ #include "sokol_log.h"
636
+
637
+ sgl_setup(&(sgl_desc_t){
638
+ // ...
639
+ .logger.func = slog_func
640
+ });
641
+
642
+ To override logging with your own callback, first write a logging function like this:
643
+
644
+ void my_log(const char* tag, // e.g. 'sgl'
645
+ uint32_t log_level, // 0=panic, 1=error, 2=warn, 3=info
646
+ uint32_t log_item_id, // SGL_LOGITEM_*
647
+ const char* message_or_null, // a message string, may be nullptr in release mode
648
+ uint32_t line_nr, // line number in sokol_gl.h
649
+ const char* filename_or_null, // source filename, may be nullptr in release mode
650
+ void* user_data)
651
+ {
652
+ ...
653
+ }
654
+
655
+ ...and then setup sokol-gl like this:
656
+
657
+ sgl_setup(&(sgl_desc_t){
658
+ .logger = {
659
+ .func = my_log,
660
+ .user_data = my_user_data,
661
+ }
662
+ });
663
+
664
+ The provided logging function must be reentrant (e.g. be callable from
665
+ different threads).
666
+
667
+ If you don't want to provide your own custom logger it is highly recommended to use
668
+ the standard logger in sokol_log.h instead, otherwise you won't see any warnings or
669
+ errors.
670
+
671
+
672
+ LICENSE
673
+ =======
674
+ zlib/libpng license
675
+
676
+ Copyright (c) 2018 Andre Weissflog
677
+
678
+ This software is provided 'as-is', without any express or implied warranty.
679
+ In no event will the authors be held liable for any damages arising from the
680
+ use of this software.
681
+
682
+ Permission is granted to anyone to use this software for any purpose,
683
+ including commercial applications, and to alter it and redistribute it
684
+ freely, subject to the following restrictions:
685
+
686
+ 1. The origin of this software must not be misrepresented; you must not
687
+ claim that you wrote the original software. If you use this software in a
688
+ product, an acknowledgment in the product documentation would be
689
+ appreciated but is not required.
690
+
691
+ 2. Altered source versions must be plainly marked as such, and must not
692
+ be misrepresented as being the original software.
693
+
694
+ 3. This notice may not be removed or altered from any source
695
+ distribution.
696
+ */
697
+ #define SOKOL_GL_INCLUDED (1)
698
+ #include <stdint.h>
699
+ #include <stdbool.h>
700
+ #include <stddef.h> // size_t, offsetof
701
+
702
+ #if !defined(SOKOL_GFX_INCLUDED)
703
+ #error "Please include sokol_gfx.h before sokol_gl.h"
704
+ #endif
705
+
706
+ #if defined(SOKOL_API_DECL) && !defined(SOKOL_GL_API_DECL)
707
+ #define SOKOL_GL_API_DECL SOKOL_API_DECL
708
+ #endif
709
+ #ifndef SOKOL_GL_API_DECL
710
+ #if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_GL_IMPL)
711
+ #define SOKOL_GL_API_DECL __declspec(dllexport)
712
+ #elif defined(_WIN32) && defined(SOKOL_DLL)
713
+ #define SOKOL_GL_API_DECL __declspec(dllimport)
714
+ #else
715
+ #define SOKOL_GL_API_DECL extern
716
+ #endif
717
+ #endif
718
+
719
+ #ifdef __cplusplus
720
+ extern "C" {
721
+ #endif
722
+
723
+ /*
724
+ sgl_log_item_t
725
+
726
+ Log items are defined via X-Macros, and expanded to an
727
+ enum 'sgl_log_item' - and in debug mode only - corresponding strings.
728
+
729
+ Used as parameter in the logging callback.
730
+ */
731
+ #define _SGL_LOG_ITEMS \
732
+ _SGL_LOGITEM_XMACRO(OK, "Ok") \
733
+ _SGL_LOGITEM_XMACRO(MALLOC_FAILED, "memory allocation failed") \
734
+ _SGL_LOGITEM_XMACRO(MAKE_PIPELINE_FAILED, "sg_make_pipeline() failed") \
735
+ _SGL_LOGITEM_XMACRO(PIPELINE_POOL_EXHAUSTED, "pipeline pool exhausted (use sgl_desc_t.pipeline_pool_size to adjust)") \
736
+ _SGL_LOGITEM_XMACRO(ADD_COMMIT_LISTENER_FAILED, "sg_add_commit_listener() failed") \
737
+ _SGL_LOGITEM_XMACRO(CONTEXT_POOL_EXHAUSTED, "context pool exhausted (use sgl_desc_t.context_pool_size to adjust)") \
738
+ _SGL_LOGITEM_XMACRO(CANNOT_DESTROY_DEFAULT_CONTEXT, "cannot destroy default context") \
739
+
740
+ #define _SGL_LOGITEM_XMACRO(item,msg) SGL_LOGITEM_##item,
741
+ typedef enum sgl_log_item_t {
742
+ _SGL_LOG_ITEMS
743
+ } sgl_log_item_t;
744
+ #undef _SGL_LOGITEM_XMACRO
745
+
746
+ /*
747
+ sgl_logger_t
748
+
749
+ Used in sgl_desc_t to provide a custom logging and error reporting
750
+ callback to sokol-gl.
751
+ */
752
+ typedef struct sgl_logger_t {
753
+ void (*func)(
754
+ const char* tag, // always "sgl"
755
+ uint32_t log_level, // 0=panic, 1=error, 2=warning, 3=info
756
+ uint32_t log_item_id, // SGL_LOGITEM_*
757
+ const char* message_or_null, // a message string, may be nullptr in release mode
758
+ uint32_t line_nr, // line number in sokol_gl.h
759
+ const char* filename_or_null, // source filename, may be nullptr in release mode
760
+ void* user_data);
761
+ void* user_data;
762
+ } sgl_logger_t;
763
+
764
+ /* sokol_gl pipeline handle (created with sgl_make_pipeline()) */
765
+ typedef struct sgl_pipeline { uint32_t id; } sgl_pipeline;
766
+
767
+ /* a context handle (created with sgl_make_context()) */
768
+ typedef struct sgl_context { uint32_t id; } sgl_context;
769
+
770
+ /*
771
+ sgl_error_t
772
+
773
+ Errors are reset each frame after calling sgl_draw(),
774
+ get the last error code with sgl_error()
775
+ */
776
+ typedef struct sgl_error_t {
777
+ bool any;
778
+ bool vertices_full;
779
+ bool uniforms_full;
780
+ bool commands_full;
781
+ bool stack_overflow;
782
+ bool stack_underflow;
783
+ bool no_context;
784
+ } sgl_error_t;
785
+
786
+ /*
787
+ sgl_context_desc_t
788
+
789
+ Describes the initialization parameters of a rendering context.
790
+ Creating additional contexts is useful if you want to render
791
+ in separate sokol-gfx passes.
792
+ */
793
+ typedef struct sgl_context_desc_t {
794
+ int max_vertices; // default: 64k
795
+ int max_commands; // default: 16k
796
+ sg_pixel_format color_format;
797
+ sg_pixel_format depth_format;
798
+ int sample_count;
799
+ } sgl_context_desc_t;
800
+
801
+ /*
802
+ sgl_allocator_t
803
+
804
+ Used in sgl_desc_t to provide custom memory-alloc and -free functions
805
+ to sokol_gl.h. If memory management should be overridden, both the
806
+ alloc and free function must be provided (e.g. it's not valid to
807
+ override one function but not the other).
808
+ */
809
+ typedef struct sgl_allocator_t {
810
+ void* (*alloc_fn)(size_t size, void* user_data);
811
+ void (*free_fn)(void* ptr, void* user_data);
812
+ void* user_data;
813
+ } sgl_allocator_t;
814
+
815
+ typedef struct sgl_desc_t {
816
+ int max_vertices; // default: 64k
817
+ int max_commands; // default: 16k
818
+ int context_pool_size; // max number of contexts (including default context), default: 4
819
+ int pipeline_pool_size; // size of internal pipeline pool, default: 64
820
+ sg_pixel_format color_format;
821
+ sg_pixel_format depth_format;
822
+ int sample_count;
823
+ sg_face_winding face_winding; // default: SG_FACEWINDING_CCW
824
+ sgl_allocator_t allocator; // optional memory allocation overrides (default: malloc/free)
825
+ sgl_logger_t logger; // optional log function override (default: NO LOGGING)
826
+ } sgl_desc_t;
827
+
828
+ /* the default context handle */
829
+ static const sgl_context SGL_DEFAULT_CONTEXT = { 0x00010001 };
830
+
831
+ /* setup/shutdown/misc */
832
+ SOKOL_GL_API_DECL void sgl_setup(const sgl_desc_t* desc);
833
+ SOKOL_GL_API_DECL void sgl_shutdown(void);
834
+ SOKOL_GL_API_DECL float sgl_rad(float deg);
835
+ SOKOL_GL_API_DECL float sgl_deg(float rad);
836
+ SOKOL_GL_API_DECL sgl_error_t sgl_error(void);
837
+ SOKOL_GL_API_DECL sgl_error_t sgl_context_error(sgl_context ctx);
838
+
839
+ /* context functions */
840
+ SOKOL_GL_API_DECL sgl_context sgl_make_context(const sgl_context_desc_t* desc);
841
+ SOKOL_GL_API_DECL void sgl_destroy_context(sgl_context ctx);
842
+ SOKOL_GL_API_DECL void sgl_set_context(sgl_context ctx);
843
+ SOKOL_GL_API_DECL sgl_context sgl_get_context(void);
844
+ SOKOL_GL_API_DECL sgl_context sgl_default_context(void);
845
+
846
+ /* get information about recorded vertices and commands in current context */
847
+ SOKOL_GL_API_DECL int sgl_num_vertices(void);
848
+ SOKOL_GL_API_DECL int sgl_num_commands(void);
849
+
850
+ /* draw recorded commands (call inside a sokol-gfx render pass) */
851
+ SOKOL_GL_API_DECL void sgl_draw(void);
852
+ SOKOL_GL_API_DECL void sgl_context_draw(sgl_context ctx);
853
+ SOKOL_GL_API_DECL void sgl_draw_layer(int layer_id);
854
+ SOKOL_GL_API_DECL void sgl_context_draw_layer(sgl_context ctx, int layer_id);
855
+
856
+ /* create and destroy pipeline objects */
857
+ SOKOL_GL_API_DECL sgl_pipeline sgl_make_pipeline(const sg_pipeline_desc* desc);
858
+ SOKOL_GL_API_DECL sgl_pipeline sgl_context_make_pipeline(sgl_context ctx, const sg_pipeline_desc* desc);
859
+ SOKOL_GL_API_DECL void sgl_destroy_pipeline(sgl_pipeline pip);
860
+
861
+ /* render state functions */
862
+ SOKOL_GL_API_DECL void sgl_defaults(void);
863
+ SOKOL_GL_API_DECL void sgl_viewport(int x, int y, int w, int h, bool origin_top_left);
864
+ SOKOL_GL_API_DECL void sgl_viewportf(float x, float y, float w, float h, bool origin_top_left);
865
+ SOKOL_GL_API_DECL void sgl_scissor_rect(int x, int y, int w, int h, bool origin_top_left);
866
+ SOKOL_GL_API_DECL void sgl_scissor_rectf(float x, float y, float w, float h, bool origin_top_left);
867
+ SOKOL_GL_API_DECL void sgl_enable_texture(void);
868
+ SOKOL_GL_API_DECL void sgl_disable_texture(void);
869
+ SOKOL_GL_API_DECL void sgl_texture(sg_view tex_view, sg_sampler smp);
870
+ SOKOL_GL_API_DECL void sgl_layer(int layer_id);
871
+
872
+ /* pipeline stack functions */
873
+ SOKOL_GL_API_DECL void sgl_load_default_pipeline(void);
874
+ SOKOL_GL_API_DECL void sgl_load_pipeline(sgl_pipeline pip);
875
+ SOKOL_GL_API_DECL void sgl_push_pipeline(void);
876
+ SOKOL_GL_API_DECL void sgl_pop_pipeline(void);
877
+
878
+ /* matrix stack functions */
879
+ SOKOL_GL_API_DECL void sgl_matrix_mode_modelview(void);
880
+ SOKOL_GL_API_DECL void sgl_matrix_mode_projection(void);
881
+ SOKOL_GL_API_DECL void sgl_matrix_mode_texture(void);
882
+ SOKOL_GL_API_DECL void sgl_load_identity(void);
883
+ SOKOL_GL_API_DECL void sgl_load_matrix(const float m[16]);
884
+ SOKOL_GL_API_DECL void sgl_load_transpose_matrix(const float m[16]);
885
+ SOKOL_GL_API_DECL void sgl_mult_matrix(const float m[16]);
886
+ SOKOL_GL_API_DECL void sgl_mult_transpose_matrix(const float m[16]);
887
+ SOKOL_GL_API_DECL void sgl_rotate(float angle_rad, float x, float y, float z);
888
+ SOKOL_GL_API_DECL void sgl_scale(float x, float y, float z);
889
+ SOKOL_GL_API_DECL void sgl_translate(float x, float y, float z);
890
+ SOKOL_GL_API_DECL void sgl_frustum(float l, float r, float b, float t, float n, float f);
891
+ SOKOL_GL_API_DECL void sgl_ortho(float l, float r, float b, float t, float n, float f);
892
+ SOKOL_GL_API_DECL void sgl_perspective(float fov_y, float aspect, float z_near, float z_far);
893
+ SOKOL_GL_API_DECL void sgl_lookat(float eye_x, float eye_y, float eye_z, float center_x, float center_y, float center_z, float up_x, float up_y, float up_z);
894
+ SOKOL_GL_API_DECL void sgl_push_matrix(void);
895
+ SOKOL_GL_API_DECL void sgl_pop_matrix(void);
896
+
897
+ /* these functions only set the internal 'current texcoord / color / point size' (valid inside or outside begin/end) */
898
+ SOKOL_GL_API_DECL void sgl_t2f(float u, float v);
899
+ SOKOL_GL_API_DECL void sgl_c3f(float r, float g, float b);
900
+ SOKOL_GL_API_DECL void sgl_c4f(float r, float g, float b, float a);
901
+ SOKOL_GL_API_DECL void sgl_c3b(uint8_t r, uint8_t g, uint8_t b);
902
+ SOKOL_GL_API_DECL void sgl_c4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
903
+ SOKOL_GL_API_DECL void sgl_c1i(uint32_t rgba);
904
+ SOKOL_GL_API_DECL void sgl_point_size(float s);
905
+
906
+ /* define primitives, each begin/end is one draw command */
907
+ SOKOL_GL_API_DECL void sgl_begin_points(void);
908
+ SOKOL_GL_API_DECL void sgl_begin_lines(void);
909
+ SOKOL_GL_API_DECL void sgl_begin_line_strip(void);
910
+ SOKOL_GL_API_DECL void sgl_begin_triangles(void);
911
+ SOKOL_GL_API_DECL void sgl_begin_triangle_strip(void);
912
+ SOKOL_GL_API_DECL void sgl_begin_quads(void);
913
+ SOKOL_GL_API_DECL void sgl_v2f(float x, float y);
914
+ SOKOL_GL_API_DECL void sgl_v3f(float x, float y, float z);
915
+ SOKOL_GL_API_DECL void sgl_v2f_t2f(float x, float y, float u, float v);
916
+ SOKOL_GL_API_DECL void sgl_v3f_t2f(float x, float y, float z, float u, float v);
917
+ SOKOL_GL_API_DECL void sgl_v2f_c3f(float x, float y, float r, float g, float b);
918
+ SOKOL_GL_API_DECL void sgl_v2f_c3b(float x, float y, uint8_t r, uint8_t g, uint8_t b);
919
+ SOKOL_GL_API_DECL void sgl_v2f_c4f(float x, float y, float r, float g, float b, float a);
920
+ SOKOL_GL_API_DECL void sgl_v2f_c4b(float x, float y, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
921
+ SOKOL_GL_API_DECL void sgl_v2f_c1i(float x, float y, uint32_t rgba);
922
+ SOKOL_GL_API_DECL void sgl_v3f_c3f(float x, float y, float z, float r, float g, float b);
923
+ SOKOL_GL_API_DECL void sgl_v3f_c3b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b);
924
+ SOKOL_GL_API_DECL void sgl_v3f_c4f(float x, float y, float z, float r, float g, float b, float a);
925
+ SOKOL_GL_API_DECL void sgl_v3f_c4b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
926
+ SOKOL_GL_API_DECL void sgl_v3f_c1i(float x, float y, float z, uint32_t rgba);
927
+ SOKOL_GL_API_DECL void sgl_v2f_t2f_c3f(float x, float y, float u, float v, float r, float g, float b);
928
+ SOKOL_GL_API_DECL void sgl_v2f_t2f_c3b(float x, float y, float u, float v, uint8_t r, uint8_t g, uint8_t b);
929
+ SOKOL_GL_API_DECL void sgl_v2f_t2f_c4f(float x, float y, float u, float v, float r, float g, float b, float a);
930
+ SOKOL_GL_API_DECL void sgl_v2f_t2f_c4b(float x, float y, float u, float v, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
931
+ SOKOL_GL_API_DECL void sgl_v2f_t2f_c1i(float x, float y, float u, float v, uint32_t rgba);
932
+ SOKOL_GL_API_DECL void sgl_v3f_t2f_c3f(float x, float y, float z, float u, float v, float r, float g, float b);
933
+ SOKOL_GL_API_DECL void sgl_v3f_t2f_c3b(float x, float y, float z, float u, float v, uint8_t r, uint8_t g, uint8_t b);
934
+ SOKOL_GL_API_DECL void sgl_v3f_t2f_c4f(float x, float y, float z, float u, float v, float r, float g, float b, float a);
935
+ SOKOL_GL_API_DECL void sgl_v3f_t2f_c4b(float x, float y, float z, float u, float v, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
936
+ SOKOL_GL_API_DECL void sgl_v3f_t2f_c1i(float x, float y, float z, float u, float v, uint32_t rgba);
937
+ SOKOL_GL_API_DECL void sgl_end(void);
938
+
939
+ #ifdef __cplusplus
940
+ } /* extern "C" */
941
+
942
+ /* reference-based equivalents for C++ */
943
+ inline void sgl_setup(const sgl_desc_t& desc) { return sgl_setup(&desc); }
944
+ inline sgl_context sgl_make_context(const sgl_context_desc_t& desc) { return sgl_make_context(&desc); }
945
+ inline sgl_pipeline sgl_make_pipeline(const sg_pipeline_desc& desc) { return sgl_make_pipeline(&desc); }
946
+ inline sgl_pipeline sgl_context_make_pipeline(sgl_context ctx, const sg_pipeline_desc& desc) { return sgl_context_make_pipeline(ctx, &desc); }
947
+ #endif
948
+ #endif /* SOKOL_GL_INCLUDED */
949
+
950
+ // ██ ███ ███ ██████ ██ ███████ ███ ███ ███████ ███ ██ ████████ █████ ████████ ██ ██████ ███ ██
951
+ // ██ ████ ████ ██ ██ ██ ██ ████ ████ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██
952
+ // ██ ██ ████ ██ ██████ ██ █████ ██ ████ ██ █████ ██ ██ ██ ██ ███████ ██ ██ ██ ██ ██ ██ ██
953
+ // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
954
+ // ██ ██ ██ ██ ███████ ███████ ██ ██ ███████ ██ ████ ██ ██ ██ ██ ██ ██████ ██ ████
955
+ //
956
+ // >>implementation
957
+ #ifdef SOKOL_GL_IMPL
958
+ #define SOKOL_GL_IMPL_INCLUDED (1)
959
+
960
+ #if defined(SOKOL_MALLOC) || defined(SOKOL_CALLOC) || defined(SOKOL_FREE)
961
+ #error "SOKOL_MALLOC/CALLOC/FREE macros are no longer supported, please use sgl_desc_t.allocator to override memory allocation functions"
962
+ #endif
963
+
964
+ #include <stdlib.h> // malloc/free
965
+ #include <string.h> // memset
966
+ #include <math.h> // M_PI, sqrtf, sinf, cosf
967
+
968
+ #ifndef M_PI
969
+ #define M_PI 3.14159265358979323846264338327
970
+ #endif
971
+
972
+ #ifndef SOKOL_API_IMPL
973
+ #define SOKOL_API_IMPL
974
+ #endif
975
+ #ifndef SOKOL_DEBUG
976
+ #ifndef NDEBUG
977
+ #define SOKOL_DEBUG
978
+ #endif
979
+ #endif
980
+ #ifndef SOKOL_ASSERT
981
+ #include <assert.h>
982
+ #define SOKOL_ASSERT(c) assert(c)
983
+ #endif
984
+
985
+ #define _sgl_def(val, def) (((val) == 0) ? (def) : (val))
986
+ #define _SGL_INIT_COOKIE (0xABCDABCD)
987
+
988
+ //>#shdgen
989
+ #if defined(SOKOL_GLCORE)
990
+ static const uint8_t _sgl_shd_vs_source_glsl410[520] = {
991
+ 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e,
992
+ 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
993
+ 0x72,0x61,0x6d,0x73,0x5b,0x38,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,
994
+ 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,
995
+ 0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
996
+ 0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,
997
+ 0x3d,0x20,0x33,0x29,0x20,0x69,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x73,
998
+ 0x69,0x7a,0x65,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,
999
+ 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,
1000
+ 0x63,0x34,0x20,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,
1001
+ 0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,
1002
+ 0x65,0x63,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x6c,
1003
+ 0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,
1004
+ 0x20,0x31,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,
1005
+ 0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,
1006
+ 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,
1007
+ 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,
1008
+ 0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,
1009
+ 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,
1010
+ 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,
1011
+ 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,
1012
+ 0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,
1013
+ 0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
1014
+ 0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,
1015
+ 0x69,0x7a,0x65,0x20,0x3d,0x20,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20,
1016
+ 0x20,0x75,0x76,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,
1017
+ 0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,
1018
+ 0x6d,0x73,0x5b,0x35,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
1019
+ 0x5b,0x36,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x37,
1020
+ 0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x74,0x65,0x78,0x63,0x6f,0x6f,
1021
+ 0x72,0x64,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,
1022
+ 0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,
1023
+ 0x72,0x30,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
1024
+ };
1025
+ static const uint8_t _sgl_shd_fs_source_glsl410[222] = {
1026
+ 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e,
1027
+ 0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,
1028
+ 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,
1029
+ 0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,
1030
+ 0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,
1031
+ 0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,
1032
+ 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,
1033
+ 0x20,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,
1034
+ 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,
1035
+ 0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,
1036
+ 0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,
1037
+ 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,
1038
+ 0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x2e,0x78,0x79,0x29,
1039
+ 0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
1040
+ };
1041
+ #elif defined(SOKOL_GLES3)
1042
+ static const uint8_t _sgl_shd_vs_source_glsl300es[481] = {
1043
+ 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
1044
+ 0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,
1045
+ 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x38,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,
1046
+ 0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,
1047
+ 0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
1048
+ 0x6e,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,
1049
+ 0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,0x69,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,
1050
+ 0x20,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,
1051
+ 0x20,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,
1052
+ 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,
1053
+ 0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x6f,0x75,0x74,
1054
+ 0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,
1055
+ 0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,
1056
+ 0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,
1057
+ 0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,
1058
+ 0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
1059
+ 0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
1060
+ 0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
1061
+ 0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,
1062
+ 0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,
1063
+ 0x2a,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,
1064
+ 0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x20,0x3d,0x20,0x70,
1065
+ 0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x6d,
1066
+ 0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,
1067
+ 0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x35,0x5d,0x2c,0x20,
1068
+ 0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x36,0x5d,0x2c,0x20,0x76,0x73,
1069
+ 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x37,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,
1070
+ 0x63,0x34,0x28,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x2c,0x20,0x30,0x2e,
1071
+ 0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,
1072
+ 0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x7d,0x0a,0x0a,
1073
+ 0x00,
1074
+ };
1075
+ static const uint8_t _sgl_shd_fs_source_glsl300es[253] = {
1076
+ 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
1077
+ 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,
1078
+ 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69,
1079
+ 0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75,
1080
+ 0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,
1081
+ 0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,
1082
+ 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,
1083
+ 0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x68,0x69,0x67,0x68,0x70,0x20,
1084
+ 0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,
1085
+ 0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x75,
1086
+ 0x76,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,
1087
+ 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,
1088
+ 0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,
1089
+ 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,
1090
+ 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x2e,0x78,0x79,0x29,0x20,
1091
+ 0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
1092
+ };
1093
+ #elif defined(SOKOL_METAL)
1094
+ static const uint8_t _sgl_shd_vs_bytecode_metal_macos[3395] = {
1095
+ 0x4d,0x54,0x4c,0x42,0x01,0x80,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1096
+ 0x43,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1097
+ 0x7b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1098
+ 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1b,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
1099
+ 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
1100
+ 0x20,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x7b,0x00,0x00,0x00,
1101
+ 0x4e,0x41,0x4d,0x45,0x06,0x00,0x6d,0x61,0x69,0x6e,0x30,0x00,0x54,0x59,0x50,0x45,
1102
+ 0x01,0x00,0x00,0x48,0x41,0x53,0x48,0x20,0x00,0x39,0xdf,0x57,0xc6,0x21,0x73,0xfa,
1103
+ 0x0f,0x92,0x92,0x15,0x90,0x75,0xcf,0x51,0x04,0xac,0xfb,0x7c,0xb6,0x6b,0x79,0x92,
1104
+ 0x3b,0xbd,0x03,0x99,0xd5,0x60,0x8d,0x4c,0x12,0x4d,0x44,0x53,0x5a,0x08,0x00,0x20,
1105
+ 0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x4f,0x46,0x46,0x54,0x18,0x00,0x00,0x00,0x00,
1106
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1107
+ 0x00,0x00,0x00,0x00,0x00,0x56,0x45,0x52,0x53,0x08,0x00,0x01,0x00,0x0b,0x00,0x01,
1108
+ 0x00,0x02,0x00,0x45,0x4e,0x44,0x54,0x40,0x00,0x00,0x00,0x56,0x41,0x54,0x54,0x2a,
1109
+ 0x00,0x04,0x00,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x00,0x80,0x74,0x65,
1110
+ 0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x00,0x01,0x80,0x63,0x6f,0x6c,0x6f,0x72,0x30,
1111
+ 0x00,0x02,0x80,0x70,0x73,0x69,0x7a,0x65,0x00,0x03,0x80,0x56,0x41,0x54,0x59,0x06,
1112
+ 0x00,0x04,0x00,0x06,0x04,0x06,0x03,0x45,0x4e,0x44,0x54,0x04,0x00,0x00,0x00,0x45,
1113
+ 0x4e,0x44,0x54,0xde,0xc0,0x17,0x0b,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x04,
1114
+ 0x0c,0x00,0x00,0xff,0xff,0xff,0xff,0x42,0x43,0xc0,0xde,0x21,0x0c,0x00,0x00,0xfe,
1115
+ 0x02,0x00,0x00,0x0b,0x82,0x20,0x00,0x02,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x07,
1116
+ 0x81,0x23,0x91,0x41,0xc8,0x04,0x49,0x06,0x10,0x32,0x39,0x92,0x01,0x84,0x0c,0x25,
1117
+ 0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,0x80,0x14,0x45,0x02,0x42,0x92,0x0b,0x42,0xa4,
1118
+ 0x10,0x32,0x14,0x38,0x08,0x18,0x49,0x0a,0x32,0x44,0x24,0x48,0x0a,0x90,0x21,0x23,
1119
+ 0xc4,0x52,0x80,0x0c,0x19,0x21,0x72,0x24,0x07,0xc8,0x48,0x11,0x62,0xa8,0xa0,0xa8,
1120
+ 0x40,0xc6,0xf0,0x01,0x00,0x00,0x00,0x51,0x18,0x00,0x00,0x68,0x00,0x00,0x00,0x1b,
1121
+ 0x7e,0x24,0xf8,0xff,0xff,0xff,0xff,0x01,0x90,0x00,0x8a,0x08,0x07,0x78,0x80,0x07,
1122
+ 0x79,0x78,0x07,0x7c,0x68,0x03,0x73,0xa8,0x07,0x77,0x18,0x87,0x36,0x30,0x07,0x78,
1123
+ 0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,
1124
+ 0xda,0x21,0x1d,0xdc,0xa1,0x0d,0xd8,0xa1,0x1c,0xce,0x21,0x1c,0xd8,0xa1,0x0d,0xec,
1125
+ 0xa1,0x1c,0xc6,0x81,0x1e,0xde,0x41,0x1e,0xda,0xe0,0x1e,0xd2,0x81,0x1c,0xe8,0x01,
1126
+ 0x1d,0x80,0x38,0x90,0x03,0x3c,0x00,0x06,0x77,0x78,0x87,0x36,0x10,0x87,0x7a,0x48,
1127
+ 0x07,0x76,0xa0,0x87,0x74,0x70,0x87,0x79,0x00,0x08,0x77,0x78,0x87,0x36,0x30,0x07,
1128
+ 0x79,0x08,0x87,0x76,0x28,0x87,0x36,0x80,0x87,0x77,0x48,0x07,0x77,0xa0,0x87,0x72,
1129
+ 0x90,0x87,0x36,0x28,0x07,0x76,0x48,0x87,0x76,0x00,0xe8,0x41,0x1e,0xea,0xa1,0x1c,
1130
+ 0x00,0xc2,0x1d,0xde,0xa1,0x0d,0xcc,0x41,0x1e,0xc2,0xa1,0x1d,0xca,0xa1,0x0d,0xe0,
1131
+ 0xe1,0x1d,0xd2,0xc1,0x1d,0xe8,0xa1,0x1c,0xe4,0xa1,0x0d,0xca,0x81,0x1d,0xd2,0xa1,
1132
+ 0x1d,0xda,0xc0,0x1d,0xde,0xc1,0x1d,0xda,0x80,0x1d,0xca,0x21,0x1c,0xcc,0x01,0xa0,
1133
+ 0x07,0x79,0xa8,0x87,0x72,0x00,0x08,0x77,0x78,0x87,0x36,0x48,0x07,0x77,0x30,0x87,
1134
+ 0x79,0x68,0x03,0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,
1135
+ 0x1e,0xea,0xa1,0x1c,0x00,0xc2,0x1d,0xde,0xa1,0x0d,0xdc,0x21,0x1c,0xdc,0x61,0x1e,
1136
+ 0xda,0xc0,0x1c,0xe0,0xa1,0x0d,0xda,0x21,0x1c,0xe8,0x01,0x1d,0x00,0x7a,0x90,0x87,
1137
+ 0x7a,0x28,0x07,0x80,0x70,0x87,0x77,0x68,0x83,0x79,0x48,0x87,0x73,0x70,0x87,0x72,
1138
+ 0x20,0x87,0x36,0xd0,0x87,0x72,0x90,0x87,0x77,0x98,0x87,0x36,0x30,0x07,0x78,0x68,
1139
+ 0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,0xdc,
1140
+ 0xe1,0x1d,0xda,0x80,0x1e,0xe4,0x21,0x1c,0xe0,0x01,0x1e,0xd2,0xc1,0x1d,0xce,0xa1,
1141
+ 0x0d,0xda,0x21,0x1c,0xe8,0x01,0x1d,0x00,0x7a,0x90,0x87,0x7a,0x28,0x07,0x80,0x98,
1142
+ 0x07,0x7a,0x08,0x87,0x71,0x58,0x87,0x36,0x80,0x07,0x79,0x78,0x07,0x7a,0x28,0x87,
1143
+ 0x71,0xa0,0x87,0x77,0x90,0x87,0x36,0x10,0x87,0x7a,0x30,0x07,0x73,0x28,0x07,0x79,
1144
+ 0x68,0x83,0x79,0x48,0x07,0x7d,0x28,0x07,0x00,0x0f,0x00,0xa2,0x1e,0xdc,0x61,0x1e,
1145
+ 0xc2,0xc1,0x1c,0xca,0xa1,0x0d,0xcc,0x01,0x1e,0xda,0xa0,0x1d,0xc2,0x81,0x1e,0xd0,
1146
+ 0x01,0xa0,0x07,0x79,0xa8,0x87,0x72,0x00,0x36,0x18,0x42,0x01,0x2c,0x40,0x05,0x49,
1147
+ 0x18,0x00,0x00,0x01,0x00,0x00,0x00,0x13,0x84,0x40,0x00,0x89,0x20,0x00,0x00,0x20,
1148
+ 0x00,0x00,0x00,0x32,0x22,0x48,0x09,0x20,0x64,0x85,0x04,0x93,0x22,0xa4,0x84,0x04,
1149
+ 0x93,0x22,0xe3,0x84,0xa1,0x90,0x14,0x12,0x4c,0x8a,0x8c,0x0b,0x84,0xa4,0x4c,0x10,
1150
+ 0x44,0x33,0x00,0xc3,0x08,0x04,0x60,0x89,0x10,0x02,0x18,0x46,0x10,0x80,0x24,0x08,
1151
+ 0x33,0x51,0xf3,0x40,0x0f,0xf2,0x50,0x0f,0xe3,0x40,0x0f,0x6e,0xd0,0x0e,0xe5,0x40,
1152
+ 0x0f,0xe1,0xc0,0x0e,0x7a,0xa0,0x07,0xed,0x10,0x0e,0xf4,0x20,0x0f,0xe9,0x80,0x0f,
1153
+ 0x28,0x20,0x07,0x49,0x53,0x44,0x09,0x93,0x5f,0x49,0xff,0x03,0x44,0x00,0x23,0x21,
1154
+ 0xa1,0x94,0x41,0x04,0x43,0x28,0x86,0x08,0x23,0x80,0x43,0x68,0x20,0x60,0x8e,0x00,
1155
+ 0x0c,0x52,0x60,0xcd,0x11,0x80,0xc2,0x20,0x42,0x20,0x0c,0x23,0x10,0xcb,0x08,0x00,
1156
+ 0x00,0x00,0x00,0x13,0xb2,0x70,0x48,0x07,0x79,0xb0,0x03,0x3a,0x68,0x83,0x70,0x80,
1157
+ 0x07,0x78,0x60,0x87,0x72,0x68,0x83,0x76,0x08,0x87,0x71,0x78,0x87,0x79,0xc0,0x87,
1158
+ 0x38,0x80,0x03,0x37,0x88,0x03,0x39,0x70,0x03,0x38,0xd8,0x70,0x1b,0xe5,0xd0,0x06,
1159
+ 0xf0,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,
1160
+ 0x90,0x0e,0x71,0xa0,0x07,0x78,0xa0,0x07,0x78,0xd0,0x06,0xe9,0x80,0x07,0x7a,0x80,
1161
+ 0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xa0,0x07,
1162
+ 0x71,0x60,0x07,0x6d,0x90,0x0e,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,
1163
+ 0x20,0x07,0x6d,0x90,0x0e,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,
1164
+ 0x07,0x6d,0x60,0x0e,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,
1165
+ 0x6d,0x60,0x0e,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,
1166
+ 0x60,0x0f,0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x6d,0x60,
1167
+ 0x0f,0x72,0x40,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x60,0x0f,
1168
+ 0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x60,0x0f,0x74,
1169
+ 0x80,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,0x76,0x40,
1170
+ 0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,0x79,0x60,0x07,
1171
+ 0x7a,0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x6d,0x60,0x0f,0x71,
1172
+ 0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xd0,
1173
+ 0x06,0xf6,0x10,0x07,0x79,0x20,0x07,0x7a,0x20,0x07,0x75,0x60,0x07,0x7a,0x20,0x07,
1174
+ 0x75,0x60,0x07,0x6d,0x60,0x0f,0x72,0x50,0x07,0x76,0xa0,0x07,0x72,0x50,0x07,0x76,
1175
+ 0xa0,0x07,0x72,0x50,0x07,0x76,0xd0,0x06,0xf6,0x50,0x07,0x71,0x20,0x07,0x7a,0x50,
1176
+ 0x07,0x71,0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07,0x6d,0x60,0x0f,0x71,0x00,0x07,
1177
+ 0x72,0x40,0x07,0x7a,0x10,0x07,0x70,0x20,0x07,0x74,0xa0,0x07,0x71,0x00,0x07,0x72,
1178
+ 0x40,0x07,0x6d,0xe0,0x0e,0x78,0xa0,0x07,0x71,0x60,0x07,0x7a,0x30,0x07,0x72,0x30,
1179
+ 0x84,0x49,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xc8,0x02,0x01,0x00,0x00,0x0b,
1180
+ 0x00,0x00,0x00,0x32,0x1e,0x98,0x10,0x19,0x11,0x4c,0x90,0x8c,0x09,0x26,0x47,0xc6,
1181
+ 0x04,0x43,0x5a,0x25,0x30,0x02,0x50,0x04,0x05,0x18,0x50,0x08,0x65,0x50,0x80,0x02,
1182
+ 0x65,0x51,0x20,0xd4,0x46,0x00,0x88,0x8d,0x25,0x68,0x04,0x00,0x00,0x00,0x00,0x79,
1183
+ 0x18,0x00,0x00,0x01,0x01,0x00,0x00,0x1a,0x03,0x4c,0x10,0x97,0x29,0xa2,0x25,0x10,
1184
+ 0xab,0x32,0xb9,0xb9,0xb4,0x37,0xb7,0x21,0xc6,0x32,0x28,0x00,0xb3,0x50,0xb9,0x1b,
1185
+ 0x43,0x0b,0x93,0xfb,0x9a,0x4b,0xd3,0x2b,0x1b,0x62,0x2c,0x81,0x22,0x2c,0x05,0xe3,
1186
+ 0x20,0x08,0x0e,0x8e,0xad,0x0c,0xa4,0xad,0x8c,0x2e,0x8c,0x0d,0xc4,0xae,0x4c,0x6e,
1187
+ 0x2e,0xed,0xcd,0x0d,0x64,0x46,0x06,0x46,0x66,0xc6,0x05,0x07,0x67,0x06,0x04,0xa5,
1188
+ 0xad,0x8c,0x2e,0x8c,0xcd,0xac,0xac,0x65,0x46,0x06,0x46,0x66,0xc6,0x05,0x07,0x67,
1189
+ 0x26,0x65,0x88,0xa0,0x10,0x43,0x8c,0x25,0x58,0x90,0x45,0x60,0xd1,0x54,0x46,0x17,
1190
+ 0xc6,0x36,0x04,0x51,0x8e,0x25,0x58,0x86,0x45,0xe0,0x16,0x96,0x26,0xe7,0x32,0xf6,
1191
+ 0xd6,0x06,0x97,0xc6,0x56,0xe6,0x42,0x56,0xe6,0xf6,0x26,0xd7,0x36,0xf7,0x45,0x96,
1192
+ 0x36,0x17,0x26,0xc6,0x56,0x36,0x44,0x50,0x12,0x72,0x61,0x69,0x72,0x2e,0x63,0x6f,
1193
+ 0x6d,0x70,0x69,0x6c,0x65,0x2e,0x66,0x61,0x73,0x74,0x5f,0x6d,0x61,0x74,0x68,0x5f,
1194
+ 0x65,0x6e,0x61,0x62,0x6c,0x65,0x43,0x04,0x65,0x61,0x19,0x84,0xa5,0xc9,0xb9,0x8c,
1195
+ 0xbd,0xb5,0xc1,0xa5,0xb1,0x95,0xb9,0x98,0xc9,0x85,0xb5,0x95,0x89,0xd5,0x99,0x99,
1196
+ 0x95,0xc9,0x7d,0x99,0x95,0xd1,0x8d,0xa1,0x7d,0x91,0xa5,0xcd,0x85,0x89,0xb1,0x95,
1197
+ 0x0d,0x11,0x94,0x86,0x51,0x58,0x9a,0x9c,0x8b,0x5d,0x99,0x1c,0x5d,0x19,0xde,0xd7,
1198
+ 0x5b,0x1d,0x1d,0x5c,0x1d,0x1d,0x97,0xba,0xb9,0x32,0x39,0x14,0xb6,0xb7,0x31,0x37,
1199
+ 0x98,0x14,0x46,0x61,0x69,0x72,0x2e,0x61,0x72,0x67,0x5f,0x74,0x79,0x70,0x65,0x5f,
1200
+ 0x6e,0x61,0x6d,0x65,0x34,0xcc,0xd8,0xde,0xc2,0xe8,0x68,0xc8,0x84,0xa5,0xc9,0xb9,
1201
+ 0x84,0xc9,0x9d,0x7d,0xb9,0x85,0xb5,0x95,0x51,0xa8,0xb3,0x1b,0xc2,0x28,0x8f,0x02,
1202
+ 0x29,0x91,0x22,0x29,0x93,0x42,0x71,0xa9,0x9b,0x2b,0x93,0x43,0x61,0x7b,0x1b,0x73,
1203
+ 0x8b,0x49,0x61,0x31,0xf6,0xc6,0xf6,0x26,0x37,0x84,0x51,0x1e,0xc5,0x52,0x22,0x45,
1204
+ 0x52,0x26,0xe5,0x22,0x13,0x96,0x26,0xe7,0x02,0xf7,0x36,0x97,0x46,0x97,0xf6,0xe6,
1205
+ 0xc6,0xe5,0x8c,0xed,0x0b,0xea,0x6d,0x2e,0x8d,0x2e,0xed,0xcd,0x6d,0x88,0xa2,0x64,
1206
+ 0x4a,0xa4,0x48,0xca,0xa4,0x68,0x74,0xc2,0xd2,0xe4,0x5c,0xe0,0xde,0xd2,0xdc,0xe8,
1207
+ 0xbe,0xe6,0xd2,0xf4,0xca,0x58,0x98,0xb1,0xbd,0x85,0xd1,0x91,0x39,0x63,0xfb,0x82,
1208
+ 0x7a,0x4b,0x73,0xa3,0x9b,0x4a,0xd3,0x2b,0x1b,0xa2,0x28,0x9c,0x12,0x29,0x9d,0x32,
1209
+ 0x29,0xde,0x10,0x44,0xa9,0x14,0x4c,0xd9,0x94,0x8f,0x50,0x58,0x9a,0x9c,0x8b,0x5d,
1210
+ 0x99,0x1c,0x5d,0x19,0xde,0x57,0x9a,0x1b,0x5c,0x1d,0x1d,0xa5,0xb0,0x34,0x39,0x17,
1211
+ 0xb6,0xb7,0xb1,0x30,0xba,0xb4,0x37,0xb7,0xaf,0x34,0x37,0xb2,0x32,0x3c,0x7a,0x67,
1212
+ 0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x64,0x28,0x5f,0x5f,0x61,0x69,0x72,0x5f,0x70,
1213
+ 0x6c,0x61,0x63,0x65,0x68,0x6f,0x6c,0x64,0x65,0x72,0x5f,0x5f,0x29,0x44,0xe0,0xde,
1214
+ 0xe6,0xd2,0xe8,0xd2,0xde,0xdc,0x86,0x50,0x8b,0xa0,0x84,0x81,0x22,0x06,0x8b,0xb0,
1215
+ 0x04,0xca,0x18,0x28,0x91,0x22,0x29,0x93,0x42,0x06,0x34,0xcc,0xd8,0xde,0xc2,0xe8,
1216
+ 0x64,0x98,0xd0,0x95,0xe1,0x8d,0xbd,0xbd,0xc9,0x91,0xc1,0x0c,0xa1,0x96,0x40,0x09,
1217
+ 0x03,0x45,0x0c,0x96,0x60,0x09,0x94,0x31,0x50,0x22,0xc5,0x0c,0x94,0x49,0x39,0x03,
1218
+ 0x1a,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x43,0xa8,0x65,0x50,0xc2,0x40,0x11,0x83,0x65,
1219
+ 0x58,0x02,0x65,0x0c,0x94,0x48,0x91,0x94,0x49,0x49,0x03,0x16,0x70,0x73,0x69,0x7a,
1220
+ 0x65,0x43,0xa8,0xc5,0x50,0xc2,0x40,0x11,0x83,0xc5,0x58,0x02,0x65,0x0c,0x94,0x48,
1221
+ 0xe9,0x94,0x49,0x59,0x03,0x2a,0x61,0x69,0x72,0x2e,0x62,0x75,0x66,0x66,0x65,0x72,
1222
+ 0x7c,0xc2,0xd2,0xe4,0x5c,0xc4,0xea,0xcc,0xcc,0xca,0xe4,0xbe,0xe6,0xd2,0xf4,0xca,
1223
+ 0x88,0x84,0xa5,0xc9,0xb9,0xc8,0x95,0x85,0x91,0x91,0x0a,0x4b,0x93,0x73,0x99,0xa3,
1224
+ 0x93,0xab,0x1b,0xa3,0xfb,0xa2,0xcb,0x83,0x2b,0xfb,0x4a,0x73,0x33,0x7b,0x23,0x62,
1225
+ 0xc6,0xf6,0x16,0x46,0x47,0x83,0x47,0xc3,0xa1,0xcd,0x0e,0x8e,0x02,0x5d,0xdb,0x10,
1226
+ 0x6a,0x11,0x16,0x62,0x11,0x94,0x38,0x50,0xe4,0x60,0x21,0x16,0x62,0x11,0x94,0x38,
1227
+ 0x50,0xe6,0x80,0x51,0x58,0x9a,0x9c,0x4b,0x98,0xdc,0xd9,0x17,0x5d,0x1e,0x5c,0xd9,
1228
+ 0xd7,0x5c,0x9a,0x5e,0x19,0xaf,0xb0,0x34,0x39,0x97,0x30,0xb9,0xb3,0x2f,0xba,0x3c,
1229
+ 0xb8,0xb2,0xaf,0x30,0xb6,0xb4,0x33,0xb7,0xaf,0xb9,0x34,0xbd,0x32,0x26,0x76,0x73,
1230
+ 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x1c,0xbe,0x62,0x72,0x86,0x90,0xc1,0x52,0x28,
1231
+ 0x6d,0xa0,0xb8,0xc1,0x72,0x28,0x62,0xb0,0x08,0x4b,0xa0,0xbc,0x81,0x02,0x07,0x0a,
1232
+ 0x1d,0x28,0x75,0xb0,0x1c,0x8a,0x1d,0x2c,0x89,0x12,0x29,0x77,0xa0,0x4c,0x0a,0x1e,
1233
+ 0x0c,0x51,0x94,0x32,0x50,0xd0,0x40,0x51,0x03,0x85,0x0d,0x94,0x3c,0x18,0x62,0x24,
1234
+ 0x80,0x02,0x06,0x8a,0x1e,0xf0,0x79,0x6b,0x73,0x4b,0x83,0x7b,0xa3,0x2b,0x73,0xa3,
1235
+ 0x03,0x19,0x43,0x0b,0x93,0xe3,0x33,0x95,0xd6,0x06,0xc7,0x56,0x06,0x32,0xb4,0xb2,
1236
+ 0x02,0x42,0x25,0x14,0x14,0x34,0x44,0x50,0xfa,0x60,0x88,0xa1,0xf0,0x81,0xe2,0x07,
1237
+ 0x8d,0x32,0xc4,0x50,0xfe,0x40,0xf9,0x83,0x46,0x19,0x11,0xb1,0x03,0x3b,0xd8,0x43,
1238
+ 0x3b,0xb8,0x41,0x3b,0xbc,0x03,0x39,0xd4,0x03,0x3b,0x94,0x83,0x1b,0x98,0x03,0x3b,
1239
+ 0x84,0xc3,0x39,0xcc,0xc3,0x14,0x21,0x18,0x46,0x28,0xec,0xc0,0x0e,0xf6,0xd0,0x0e,
1240
+ 0x6e,0x90,0x0e,0xe4,0x50,0x0e,0xee,0x40,0x0f,0x53,0x82,0x62,0xc4,0x12,0x0e,0xe9,
1241
+ 0x20,0x0f,0x6e,0x60,0x0f,0xe5,0x20,0x0f,0xf3,0x90,0x0e,0xef,0xe0,0x0e,0x53,0x02,
1242
+ 0x63,0x04,0x15,0x0e,0xe9,0x20,0x0f,0x6e,0xc0,0x0e,0xe1,0xe0,0x0e,0xe7,0x50,0x0f,
1243
+ 0xe1,0x70,0x0e,0xe5,0xf0,0x0b,0xf6,0x50,0x0e,0xf2,0x30,0x0f,0xe9,0xf0,0x0e,0xee,
1244
+ 0x30,0x25,0x40,0x46,0x4c,0xe1,0x90,0x0e,0xf2,0xe0,0x06,0xe3,0xf0,0x0e,0xed,0x00,
1245
+ 0x0f,0xe9,0xc0,0x0e,0xe5,0xf0,0x0b,0xef,0x00,0x0f,0xf4,0x90,0x0e,0xef,0xe0,0x0e,
1246
+ 0xf3,0x30,0x65,0x50,0x18,0x67,0x84,0x12,0x0e,0xe9,0x20,0x0f,0x6e,0x60,0x0f,0xe5,
1247
+ 0x20,0x0f,0xf4,0x50,0x0e,0xf8,0x30,0x25,0xd8,0x03,0x00,0x79,0x18,0x00,0x00,0xa5,
1248
+ 0x00,0x00,0x00,0x33,0x08,0x80,0x1c,0xc4,0xe1,0x1c,0x66,0x14,0x01,0x3d,0x88,0x43,
1249
+ 0x38,0x84,0xc3,0x8c,0x42,0x80,0x07,0x79,0x78,0x07,0x73,0x98,0x71,0x0c,0xe6,0x00,
1250
+ 0x0f,0xed,0x10,0x0e,0xf4,0x80,0x0e,0x33,0x0c,0x42,0x1e,0xc2,0xc1,0x1d,0xce,0xa1,
1251
+ 0x1c,0x66,0x30,0x05,0x3d,0x88,0x43,0x38,0x84,0x83,0x1b,0xcc,0x03,0x3d,0xc8,0x43,
1252
+ 0x3d,0x8c,0x03,0x3d,0xcc,0x78,0x8c,0x74,0x70,0x07,0x7b,0x08,0x07,0x79,0x48,0x87,
1253
+ 0x70,0x70,0x07,0x7a,0x70,0x03,0x76,0x78,0x87,0x70,0x20,0x87,0x19,0xcc,0x11,0x0e,
1254
+ 0xec,0x90,0x0e,0xe1,0x30,0x0f,0x6e,0x30,0x0f,0xe3,0xf0,0x0e,0xf0,0x50,0x0e,0x33,
1255
+ 0x10,0xc4,0x1d,0xde,0x21,0x1c,0xd8,0x21,0x1d,0xc2,0x61,0x1e,0x66,0x30,0x89,0x3b,
1256
+ 0xbc,0x83,0x3b,0xd0,0x43,0x39,0xb4,0x03,0x3c,0xbc,0x83,0x3c,0x84,0x03,0x3b,0xcc,
1257
+ 0xf0,0x14,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x68,0x87,0x72,0x68,0x07,0x37,0x80,
1258
+ 0x87,0x70,0x90,0x87,0x70,0x60,0x07,0x76,0x28,0x07,0x76,0xf8,0x05,0x76,0x78,0x87,
1259
+ 0x77,0x80,0x87,0x5f,0x08,0x87,0x71,0x18,0x87,0x72,0x98,0x87,0x79,0x98,0x81,0x2c,
1260
+ 0xee,0xf0,0x0e,0xee,0xe0,0x0e,0xf5,0xc0,0x0e,0xec,0x30,0x03,0x62,0xc8,0xa1,0x1c,
1261
+ 0xe4,0xa1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x1c,0xdc,0x61,0x1c,0xca,0x21,0x1c,0xc4,
1262
+ 0x81,0x1d,0xca,0x61,0x06,0xd6,0x90,0x43,0x39,0xc8,0x43,0x39,0x98,0x43,0x39,0xc8,
1263
+ 0x43,0x39,0xb8,0xc3,0x38,0x94,0x43,0x38,0x88,0x03,0x3b,0x94,0xc3,0x2f,0xbc,0x83,
1264
+ 0x3c,0xfc,0x82,0x3b,0xd4,0x03,0x3b,0xb0,0xc3,0x0c,0xc7,0x69,0x87,0x70,0x58,0x87,
1265
+ 0x72,0x70,0x83,0x74,0x68,0x07,0x78,0x60,0x87,0x74,0x18,0x87,0x74,0xa0,0x87,0x19,
1266
+ 0xce,0x53,0x0f,0xee,0x00,0x0f,0xf2,0x50,0x0e,0xe4,0x90,0x0e,0xe3,0x40,0x0f,0xe1,
1267
+ 0x20,0x0e,0xec,0x50,0x0e,0x33,0x20,0x28,0x1d,0xdc,0xc1,0x1e,0xc2,0x41,0x1e,0xd2,
1268
+ 0x21,0x1c,0xdc,0x81,0x1e,0xdc,0xe0,0x1c,0xe4,0xe1,0x1d,0xea,0x01,0x1e,0x66,0x18,
1269
+ 0x51,0x38,0xb0,0x43,0x3a,0x9c,0x83,0x3b,0xcc,0x50,0x24,0x76,0x60,0x07,0x7b,0x68,
1270
+ 0x07,0x37,0x60,0x87,0x77,0x78,0x07,0x78,0x98,0x51,0x4c,0xf4,0x90,0x0f,0xf0,0x50,
1271
+ 0x0e,0x33,0x1e,0x6a,0x1e,0xca,0x61,0x1c,0xe8,0x21,0x1d,0xde,0xc1,0x1d,0x7e,0x01,
1272
+ 0x1e,0xe4,0xa1,0x1c,0xcc,0x21,0x1d,0xf0,0x61,0x06,0x54,0x85,0x83,0x38,0xcc,0xc3,
1273
+ 0x3b,0xb0,0x43,0x3d,0xd0,0x43,0x39,0xfc,0xc2,0x3c,0xe4,0x43,0x3b,0x88,0xc3,0x3b,
1274
+ 0xb0,0xc3,0x8c,0xc5,0x0a,0x87,0x79,0x98,0x87,0x77,0x18,0x87,0x74,0x08,0x07,0x7a,
1275
+ 0x28,0x07,0x72,0x98,0x81,0x5c,0xe3,0x10,0x0e,0xec,0xc0,0x0e,0xe5,0x50,0x0e,0xf3,
1276
+ 0x30,0x23,0xc1,0xd2,0x41,0x1e,0xe4,0xe1,0x17,0xd8,0xe1,0x1d,0xde,0x01,0x1e,0x66,
1277
+ 0x48,0x19,0x3b,0xb0,0x83,0x3d,0xb4,0x83,0x1b,0x84,0xc3,0x38,0x8c,0x43,0x39,0xcc,
1278
+ 0xc3,0x3c,0xb8,0xc1,0x39,0xc8,0xc3,0x3b,0xd4,0x03,0x3c,0xcc,0x48,0xb4,0x71,0x08,
1279
+ 0x07,0x76,0x60,0x07,0x71,0x08,0x87,0x71,0x58,0x87,0x19,0xdb,0xc6,0x0e,0xec,0x60,
1280
+ 0x0f,0xed,0xe0,0x06,0xf0,0x20,0x0f,0xe5,0x30,0x0f,0xe5,0x20,0x0f,0xf6,0x50,0x0e,
1281
+ 0x6e,0x10,0x0e,0xe3,0x30,0x0e,0xe5,0x30,0x0f,0xf3,0xe0,0x06,0xe9,0xe0,0x0e,0xe4,
1282
+ 0x50,0x0e,0xf8,0x30,0x23,0xe2,0xec,0x61,0x1c,0xc2,0x81,0x1d,0xd8,0xe1,0x17,0xec,
1283
+ 0x21,0x1d,0xe6,0x21,0x1d,0xc4,0x21,0x1d,0xd8,0x21,0x1d,0xe8,0x21,0x1f,0x66,0x20,
1284
+ 0x9d,0x3b,0xbc,0x43,0x3d,0xb8,0x03,0x39,0x94,0x83,0x39,0xcc,0x58,0xbc,0x70,0x70,
1285
+ 0x07,0x77,0x78,0x07,0x7a,0x08,0x07,0x7a,0x48,0x87,0x77,0x70,0x87,0x19,0xce,0x87,
1286
+ 0x0e,0xe5,0x10,0x0e,0xf0,0x10,0x0e,0xec,0xc0,0x0e,0xef,0x30,0x0e,0xf3,0x90,0x0e,
1287
+ 0xf4,0x50,0x0e,0x33,0x28,0x30,0x08,0x87,0x74,0x90,0x07,0x37,0x30,0x87,0x7a,0x70,
1288
+ 0x87,0x71,0xa0,0x87,0x74,0x78,0x07,0x77,0xf8,0x85,0x73,0x90,0x87,0x77,0xa8,0x07,
1289
+ 0x78,0x98,0x07,0x00,0x00,0x00,0x00,0x71,0x20,0x00,0x00,0x02,0x00,0x00,0x00,0x06,
1290
+ 0x50,0x30,0x00,0xd2,0xd0,0x00,0x00,0x61,0x20,0x00,0x00,0x3e,0x00,0x00,0x00,0x13,
1291
+ 0x04,0x41,0x2c,0x10,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0xf4,0xc6,0x22,0x86,0x61,
1292
+ 0x18,0xc6,0x22,0x04,0x41,0x10,0xc6,0x22,0x82,0x20,0x08,0x46,0x00,0xa8,0x95,0x40,
1293
+ 0x19,0x14,0x01,0x8d,0x19,0x00,0x12,0x33,0x00,0x14,0x66,0x00,0x66,0x00,0x00,0xe3,
1294
+ 0x15,0x8c,0xa4,0x69,0x12,0x05,0x65,0x90,0x41,0x22,0x14,0x13,0x02,0xf9,0x8c,0x57,
1295
+ 0x40,0x96,0xe7,0x2d,0x14,0x94,0x41,0x06,0xeb,0x78,0x4c,0x08,0xe4,0x63,0x41,0x01,
1296
+ 0x9f,0xf1,0x8a,0x6a,0x1b,0x83,0x31,0x70,0x28,0x28,0x83,0x0c,0x1b,0x53,0x99,0x10,
1297
+ 0xc8,0xc7,0x8a,0x00,0x3e,0xe3,0x15,0x1a,0x18,0xa0,0x01,0x1a,0x50,0x14,0x94,0x41,
1298
+ 0x06,0x30,0x88,0x36,0x13,0x02,0xf9,0x58,0x11,0xc0,0x67,0xbc,0xe2,0x2b,0x03,0x37,
1299
+ 0x68,0x83,0x32,0xa0,0xa0,0x0c,0x32,0x90,0x41,0xd6,0x99,0x10,0xc8,0x67,0xbc,0x62,
1300
+ 0x0c,0xd2,0x40,0x0e,0xe2,0xc0,0xa3,0xa0,0x0c,0x32,0xa0,0x41,0x27,0x06,0x26,0x04,
1301
+ 0xf2,0xb1,0xa0,0x80,0xcf,0x78,0x05,0x1a,0xb8,0xc1,0x1d,0xd8,0x81,0x18,0x50,0x50,
1302
+ 0x6c,0x08,0xe0,0x33,0xdb,0x20,0x06,0x01,0x30,0xdb,0x10,0xb8,0x41,0x30,0xdb,0x10,
1303
+ 0x3c,0xc2,0x6c,0x43,0xf0,0x06,0x43,0x06,0x01,0x31,0x00,0x09,0x00,0x00,0x00,0x5b,
1304
+ 0x86,0x20,0x00,0x85,0x2d,0x43,0x11,0x80,0xc2,0x96,0x41,0x09,0x40,0x61,0xcb,0xf0,
1305
+ 0x04,0xa0,0xb0,0x65,0xa0,0x02,0x50,0xd8,0x32,0x60,0x01,0x28,0x6c,0x19,0xba,0x00,
1306
+ 0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1307
+ 0x00,0x00,0x00,
1308
+ };
1309
+ static const uint8_t _sgl_shd_fs_bytecode_metal_macos[3047] = {
1310
+ 0x4d,0x54,0x4c,0x42,0x01,0x80,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1311
+ 0xe7,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1312
+ 0x7b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1313
+ 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1314
+ 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1315
+ 0x00,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x7b,0x00,0x00,0x00,
1316
+ 0x4e,0x41,0x4d,0x45,0x06,0x00,0x6d,0x61,0x69,0x6e,0x30,0x00,0x54,0x59,0x50,0x45,
1317
+ 0x01,0x00,0x01,0x48,0x41,0x53,0x48,0x20,0x00,0x0a,0x2e,0x15,0x06,0x57,0xa3,0x2b,
1318
+ 0xd3,0xce,0xa6,0x79,0x54,0xe7,0x70,0xd2,0x98,0xd6,0xcf,0xf9,0xb9,0xb7,0xb8,0xd7,
1319
+ 0xcd,0xf4,0xad,0x92,0x10,0x28,0x7e,0xce,0xa3,0x4d,0x44,0x53,0x5a,0x08,0x00,0x00,
1320
+ 0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x4f,0x46,0x46,0x54,0x18,0x00,0x00,0x00,0x00,
1321
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1322
+ 0x00,0x00,0x00,0x00,0x00,0x56,0x45,0x52,0x53,0x08,0x00,0x01,0x00,0x0b,0x00,0x01,
1323
+ 0x00,0x02,0x00,0x45,0x4e,0x44,0x54,0x04,0x00,0x00,0x00,0x45,0x4e,0x44,0x54,0x04,
1324
+ 0x00,0x00,0x00,0x45,0x4e,0x44,0x54,0xde,0xc0,0x17,0x0b,0x00,0x00,0x00,0x00,0x14,
1325
+ 0x00,0x00,0x00,0xe4,0x0a,0x00,0x00,0xff,0xff,0xff,0xff,0x42,0x43,0xc0,0xde,0x21,
1326
+ 0x0c,0x00,0x00,0xb6,0x02,0x00,0x00,0x0b,0x82,0x20,0x00,0x02,0x00,0x00,0x00,0x12,
1327
+ 0x00,0x00,0x00,0x07,0x81,0x23,0x91,0x41,0xc8,0x04,0x49,0x06,0x10,0x32,0x39,0x92,
1328
+ 0x01,0x84,0x0c,0x25,0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,0x80,0x14,0x45,0x02,0x42,
1329
+ 0x92,0x0b,0x42,0xa4,0x10,0x32,0x14,0x38,0x08,0x18,0x49,0x0a,0x32,0x44,0x24,0x48,
1330
+ 0x0a,0x90,0x21,0x23,0xc4,0x52,0x80,0x0c,0x19,0x21,0x72,0x24,0x07,0xc8,0x48,0x11,
1331
+ 0x62,0xa8,0xa0,0xa8,0x40,0xc6,0xf0,0x01,0x00,0x00,0x00,0x51,0x18,0x00,0x00,0x74,
1332
+ 0x00,0x00,0x00,0x1b,0xc2,0x24,0xf8,0xff,0xff,0xff,0xff,0x01,0x60,0x00,0x09,0xa8,
1333
+ 0x88,0x70,0x80,0x07,0x78,0x90,0x87,0x77,0xc0,0x87,0x36,0x30,0x87,0x7a,0x70,0x87,
1334
+ 0x71,0x68,0x03,0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,
1335
+ 0x1e,0xea,0xa1,0x1c,0x00,0xa2,0x1d,0xd2,0xc1,0x1d,0xda,0x80,0x1d,0xca,0xe1,0x1c,
1336
+ 0xc2,0x81,0x1d,0xda,0xc0,0x1e,0xca,0x61,0x1c,0xe8,0xe1,0x1d,0xe4,0xa1,0x0d,0xee,
1337
+ 0x21,0x1d,0xc8,0x81,0x1e,0xd0,0x01,0x88,0x03,0x39,0xc0,0x03,0x60,0x70,0x87,0x77,
1338
+ 0x68,0x03,0x71,0xa8,0x87,0x74,0x60,0x07,0x7a,0x48,0x07,0x77,0x98,0x07,0x80,0x70,
1339
+ 0x87,0x77,0x68,0x03,0x73,0x90,0x87,0x70,0x68,0x87,0x72,0x68,0x03,0x78,0x78,0x87,
1340
+ 0x74,0x70,0x07,0x7a,0x28,0x07,0x79,0x68,0x83,0x72,0x60,0x87,0x74,0x68,0x07,0x80,
1341
+ 0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,0xdc,0xe1,0x1d,0xda,0xc0,0x1c,0xe4,0x21,0x1c,
1342
+ 0xda,0xa1,0x1c,0xda,0x00,0x1e,0xde,0x21,0x1d,0xdc,0x81,0x1e,0xca,0x41,0x1e,0xda,
1343
+ 0xa0,0x1c,0xd8,0x21,0x1d,0xda,0xa1,0x0d,0xdc,0xe1,0x1d,0xdc,0xa1,0x0d,0xd8,0xa1,
1344
+ 0x1c,0xc2,0xc1,0x1c,0x00,0x7a,0x90,0x87,0x7a,0x28,0x07,0x80,0x70,0x87,0x77,0x68,
1345
+ 0x83,0x74,0x70,0x07,0x73,0x98,0x87,0x36,0x30,0x07,0x78,0x68,0x83,0x76,0x08,0x07,
1346
+ 0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,0xdc,0xe1,0x1d,0xda,0xc0,
1347
+ 0x1d,0xc2,0xc1,0x1d,0xe6,0xa1,0x0d,0xcc,0x01,0x1e,0xda,0xa0,0x1d,0xc2,0x81,0x1e,
1348
+ 0xd0,0x01,0xa0,0x07,0x79,0xa8,0x87,0x72,0x00,0x08,0x77,0x78,0x87,0x36,0x98,0x87,
1349
+ 0x74,0x38,0x07,0x77,0x28,0x07,0x72,0x68,0x03,0x7d,0x28,0x07,0x79,0x78,0x87,0x79,
1350
+ 0x68,0x03,0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,
1351
+ 0xea,0xa1,0x1c,0x00,0xc2,0x1d,0xde,0xa1,0x0d,0xe8,0x41,0x1e,0xc2,0x01,0x1e,0xe0,
1352
+ 0x21,0x1d,0xdc,0xe1,0x1c,0xda,0xa0,0x1d,0xc2,0x81,0x1e,0xd0,0x01,0xa0,0x07,0x79,
1353
+ 0xa8,0x87,0x72,0x00,0x88,0x79,0xa0,0x87,0x70,0x18,0x87,0x75,0x68,0x03,0x78,0x90,
1354
+ 0x87,0x77,0xa0,0x87,0x72,0x18,0x07,0x7a,0x78,0x07,0x79,0x68,0x03,0x71,0xa8,0x07,
1355
+ 0x73,0x30,0x87,0x72,0x90,0x87,0x36,0x98,0x87,0x74,0xd0,0x87,0x72,0x00,0xf0,0x00,
1356
+ 0x20,0xea,0xc1,0x1d,0xe6,0x21,0x1c,0xcc,0xa1,0x1c,0xda,0xc0,0x1c,0xe0,0xa1,0x0d,
1357
+ 0xda,0x21,0x1c,0xe8,0x01,0x1d,0x00,0x7a,0x90,0x87,0x7a,0x28,0x07,0x60,0x83,0x21,
1358
+ 0x0c,0xc0,0x02,0x54,0x1b,0x8c,0x81,0x00,0x16,0xa0,0xda,0x80,0x10,0xff,0xff,0xff,
1359
+ 0xff,0x3f,0x00,0x0c,0x20,0x01,0xd5,0x06,0xa3,0x08,0x80,0x05,0xa8,0x36,0x18,0x86,
1360
+ 0x00,0x2c,0x40,0xb5,0x01,0x39,0xfe,0xff,0xff,0xff,0x7f,0x00,0x18,0x40,0x02,0x2a,
1361
+ 0x00,0x00,0x00,0x49,0x18,0x00,0x00,0x04,0x00,0x00,0x00,0x13,0x86,0x40,0x18,0x26,
1362
+ 0x0c,0x44,0x61,0x4c,0x18,0x8e,0xc2,0x00,0x00,0x00,0x00,0x89,0x20,0x00,0x00,0x1d,
1363
+ 0x00,0x00,0x00,0x32,0x22,0x48,0x09,0x20,0x64,0x85,0x04,0x93,0x22,0xa4,0x84,0x04,
1364
+ 0x93,0x22,0xe3,0x84,0xa1,0x90,0x14,0x12,0x4c,0x8a,0x8c,0x0b,0x84,0xa4,0x4c,0x10,
1365
+ 0x48,0x33,0x00,0xc3,0x08,0x04,0x60,0x83,0x70,0x94,0x34,0x45,0x94,0x30,0xf9,0xff,
1366
+ 0x44,0x5c,0x13,0x15,0x11,0xbf,0x3d,0xfc,0xd3,0x18,0x01,0x30,0x88,0x30,0x04,0x17,
1367
+ 0x49,0x53,0x44,0x09,0x93,0xff,0x4b,0x00,0xf3,0x2c,0x44,0xf4,0x4f,0x63,0x04,0xc0,
1368
+ 0x20,0x42,0x21,0x94,0x42,0x84,0x40,0x0c,0x9d,0x61,0x04,0x01,0x98,0x23,0x08,0xe6,
1369
+ 0x08,0xc0,0x60,0x18,0x41,0x58,0x0a,0x12,0x88,0x49,0x8a,0x29,0x40,0x6d,0x20,0x20,
1370
+ 0x05,0xd6,0x08,0x00,0x00,0x00,0x00,0x13,0xb2,0x70,0x48,0x07,0x79,0xb0,0x03,0x3a,
1371
+ 0x68,0x83,0x70,0x80,0x07,0x78,0x60,0x87,0x72,0x68,0x83,0x76,0x08,0x87,0x71,0x78,
1372
+ 0x87,0x79,0xc0,0x87,0x38,0x80,0x03,0x37,0x88,0x03,0x39,0x70,0x03,0x38,0xd8,0x70,
1373
+ 0x1b,0xe5,0xd0,0x06,0xf0,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,
1374
+ 0x76,0x40,0x07,0x6d,0x90,0x0e,0x71,0xa0,0x07,0x78,0xa0,0x07,0x78,0xd0,0x06,0xe9,
1375
+ 0x80,0x07,0x7a,0x80,0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,0x71,0x60,0x07,0x7a,0x10,
1376
+ 0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x6d,0x90,0x0e,0x73,0x20,0x07,0x7a,0x30,0x07,
1377
+ 0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x90,0x0e,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,
1378
+ 0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0e,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,
1379
+ 0x07,0x73,0x20,0x07,0x6d,0x60,0x0e,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,
1380
+ 0x76,0x40,0x07,0x6d,0x60,0x0f,0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xa0,0x07,0x71,
1381
+ 0x60,0x07,0x6d,0x60,0x0f,0x72,0x40,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,
1382
+ 0x07,0x6d,0x60,0x0f,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,
1383
+ 0x6d,0x60,0x0f,0x74,0x80,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,
1384
+ 0x60,0x0f,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,
1385
+ 0x0f,0x79,0x60,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,
1386
+ 0x6d,0x60,0x0f,0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xa0,0x07,0x71,
1387
+ 0x20,0x07,0x78,0xd0,0x06,0xf6,0x10,0x07,0x79,0x20,0x07,0x7a,0x20,0x07,0x75,0x60,
1388
+ 0x07,0x7a,0x20,0x07,0x75,0x60,0x07,0x6d,0x60,0x0f,0x72,0x50,0x07,0x76,0xa0,0x07,
1389
+ 0x72,0x50,0x07,0x76,0xa0,0x07,0x72,0x50,0x07,0x76,0xd0,0x06,0xf6,0x50,0x07,0x71,
1390
+ 0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07,0x6d,0x60,
1391
+ 0x0f,0x71,0x00,0x07,0x72,0x40,0x07,0x7a,0x10,0x07,0x70,0x20,0x07,0x74,0xa0,0x07,
1392
+ 0x71,0x00,0x07,0x72,0x40,0x07,0x6d,0xe0,0x0e,0x78,0xa0,0x07,0x71,0x60,0x07,0x7a,
1393
+ 0x30,0x07,0x72,0x30,0x84,0x41,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x18,0xc2,
1394
+ 0x38,0x40,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x64,0x81,0x00,0x00,0x00,0x00,0x08,
1395
+ 0x00,0x00,0x00,0x32,0x1e,0x98,0x10,0x19,0x11,0x4c,0x90,0x8c,0x09,0x26,0x47,0xc6,
1396
+ 0x04,0x43,0x5a,0x23,0x00,0x25,0x50,0x04,0x85,0x50,0x16,0x65,0x40,0x70,0x2c,0x41,
1397
+ 0x23,0x00,0x00,0x79,0x18,0x00,0x00,0xd1,0x00,0x00,0x00,0x1a,0x03,0x4c,0x10,0x97,
1398
+ 0x29,0xa2,0x25,0x10,0xab,0x32,0xb9,0xb9,0xb4,0x37,0xb7,0x21,0xc6,0x42,0x3c,0x00,
1399
+ 0x84,0x50,0xb9,0x1b,0x43,0x0b,0x93,0xfb,0x9a,0x4b,0xd3,0x2b,0x1b,0x62,0x2c,0xc3,
1400
+ 0x23,0x2c,0x05,0xe3,0x20,0x08,0x0e,0x8e,0xad,0x0c,0xa4,0xad,0x8c,0x2e,0x8c,0x0d,
1401
+ 0xc4,0xae,0x4c,0x6e,0x2e,0xed,0xcd,0x0d,0x64,0x46,0x06,0x46,0x66,0xc6,0x05,0x07,
1402
+ 0x67,0x06,0x04,0xa5,0xad,0x8c,0x2e,0x8c,0xcd,0xac,0xac,0x65,0x46,0x06,0x46,0x66,
1403
+ 0xc6,0x05,0x07,0x67,0x26,0x65,0x88,0xf0,0x10,0x43,0x8c,0x65,0x58,0x8c,0x45,0x60,
1404
+ 0xd1,0x54,0x46,0x17,0xc6,0x36,0x04,0x79,0x8e,0x65,0x58,0x88,0x45,0xe0,0x16,0x96,
1405
+ 0x26,0xe7,0x32,0xf6,0xd6,0x06,0x97,0xc6,0x56,0xe6,0x42,0x56,0xe6,0xf6,0x26,0xd7,
1406
+ 0x36,0xf7,0x45,0x96,0x36,0x17,0x26,0xc6,0x56,0x36,0x44,0x78,0x12,0x72,0x61,0x69,
1407
+ 0x72,0x2e,0x63,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x2e,0x66,0x61,0x73,0x74,0x5f,0x6d,
1408
+ 0x61,0x74,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x43,0x84,0x67,0x61,0x19,0x84,
1409
+ 0xa5,0xc9,0xb9,0x8c,0xbd,0xb5,0xc1,0xa5,0xb1,0x95,0xb9,0x98,0xc9,0x85,0xb5,0x95,
1410
+ 0x89,0xd5,0x99,0x99,0x95,0xc9,0x7d,0x99,0x95,0xd1,0x8d,0xa1,0x7d,0x91,0xa5,0xcd,
1411
+ 0x85,0x89,0xb1,0x95,0x0d,0x11,0x9e,0x86,0x51,0x58,0x9a,0x9c,0x8b,0x5c,0x99,0x1b,
1412
+ 0x59,0x99,0xdc,0x17,0x5d,0x98,0xdc,0x59,0x19,0x1d,0xa3,0xb0,0x34,0x39,0x97,0x30,
1413
+ 0xb9,0xb3,0x2f,0xba,0x3c,0xb8,0xb2,0x2f,0xb7,0xb0,0xb6,0x32,0x1a,0x66,0x6c,0x6f,
1414
+ 0x61,0x74,0x34,0x64,0xc2,0xd2,0xe4,0x5c,0xc2,0xe4,0xce,0xbe,0xdc,0xc2,0xda,0xca,
1415
+ 0xa8,0x98,0xc9,0x85,0x9d,0x7d,0x8d,0xbd,0xb1,0xbd,0xc9,0x0d,0x71,0x9e,0x67,0x11,
1416
+ 0x16,0xe1,0x81,0x9e,0xe8,0x91,0x9e,0x69,0x88,0xf0,0x50,0x94,0xc2,0xd2,0xe4,0x5c,
1417
+ 0xcc,0xe4,0xc2,0xce,0xda,0xca,0xdc,0xe8,0xbe,0xd2,0xdc,0xe0,0xea,0xe8,0xb8,0xd4,
1418
+ 0xcd,0x95,0xc9,0xa1,0xb0,0xbd,0x8d,0xb9,0xc1,0xa4,0x50,0x09,0x4b,0x93,0x73,0x19,
1419
+ 0x2b,0x73,0xa3,0x2b,0x93,0xe3,0x13,0x96,0x26,0xe7,0x02,0x57,0x26,0x37,0x07,0x57,
1420
+ 0x36,0x46,0x97,0x66,0x57,0x46,0xa1,0xce,0x6e,0x88,0xb4,0x08,0x8f,0xf5,0x5c,0x0f,
1421
+ 0xf6,0x64,0x0f,0xf4,0x44,0x8f,0xf4,0x68,0x5c,0xea,0xe6,0xca,0xe4,0x50,0xd8,0xde,
1422
+ 0xc6,0xdc,0x62,0x52,0x58,0x8c,0xbd,0xb1,0xbd,0xc9,0x0d,0x91,0x96,0xe1,0xb1,0x1e,
1423
+ 0xee,0xc1,0x9e,0xec,0x81,0x9e,0xe8,0x91,0x9e,0x8e,0x4b,0x58,0x9a,0x9c,0x0b,0x5d,
1424
+ 0x19,0x1e,0x5d,0x9d,0x5c,0x19,0xa5,0xb0,0x34,0x39,0x17,0xb6,0xb7,0xb1,0x30,0xba,
1425
+ 0xb4,0x37,0xb7,0xaf,0x34,0x37,0xb2,0x32,0x3c,0x2a,0x61,0x69,0x72,0x2e,0x73,0x61,
1426
+ 0x6d,0x70,0x6c,0x65,0xc4,0xe8,0xca,0xf0,0xe8,0xea,0xe4,0xca,0x64,0xc8,0x78,0xcc,
1427
+ 0xd8,0xde,0xc2,0xe8,0x58,0x40,0xe6,0xc2,0xda,0xe0,0xd8,0xca,0x7c,0x38,0xd0,0x95,
1428
+ 0xe1,0x0d,0xa1,0x16,0xe2,0xf9,0x1e,0x30,0x58,0x84,0x65,0x78,0xc2,0xe0,0x81,0x1e,
1429
+ 0x31,0x78,0xa4,0x67,0x0c,0xb8,0x84,0xa5,0xc9,0xb9,0xcc,0x85,0xb5,0xc1,0xb1,0x95,
1430
+ 0xc9,0xf1,0x98,0x0b,0x6b,0x83,0x63,0x2b,0x93,0xe3,0x30,0xd7,0x06,0x37,0x44,0x5a,
1431
+ 0x8e,0xa7,0x0c,0x1e,0x30,0x58,0x84,0x65,0x78,0xa0,0xc7,0x0c,0x1e,0xe9,0x39,0x83,
1432
+ 0x21,0xc8,0xb3,0x3d,0xde,0x43,0x06,0x0f,0x1a,0x0c,0x31,0x10,0xe0,0xa9,0x9e,0x34,
1433
+ 0xe0,0x15,0x96,0x26,0xd7,0x12,0xc6,0x96,0x16,0x36,0xd7,0x32,0x37,0xf6,0x06,0x57,
1434
+ 0x36,0x87,0xd2,0x16,0x96,0xe6,0x06,0x93,0x32,0x84,0x78,0xd8,0xe0,0x59,0x03,0x62,
1435
+ 0x61,0x69,0x72,0x2d,0x61,0x6c,0x69,0x61,0x73,0x2d,0x73,0x63,0x6f,0x70,0x65,0x2d,
1436
+ 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x73,0x43,0x8c,0xc7,0x0d,0x1e,0x36,0x78,0xda,
1437
+ 0x80,0x58,0x58,0x9a,0x5c,0x4b,0x18,0x5b,0x5a,0xd8,0x5c,0xcb,0xdc,0xd8,0x1b,0x5c,
1438
+ 0x59,0xcb,0x5c,0x58,0x1b,0x1c,0x5b,0x99,0xdc,0xdc,0x10,0xe3,0x81,0x83,0x87,0x0d,
1439
+ 0x9e,0x37,0x18,0x42,0x3c,0x6e,0xf0,0xc0,0xc1,0x88,0x88,0x1d,0xd8,0xc1,0x1e,0xda,
1440
+ 0xc1,0x0d,0xda,0xe1,0x1d,0xc8,0xa1,0x1e,0xd8,0xa1,0x1c,0xdc,0xc0,0x1c,0xd8,0x21,
1441
+ 0x1c,0xce,0x61,0x1e,0xa6,0x08,0xc1,0x30,0x42,0x61,0x07,0x76,0xb0,0x87,0x76,0x70,
1442
+ 0x83,0x74,0x20,0x87,0x72,0x70,0x07,0x7a,0x98,0x12,0x14,0x23,0x96,0x70,0x48,0x07,
1443
+ 0x79,0x70,0x03,0x7b,0x28,0x07,0x79,0x98,0x87,0x74,0x78,0x07,0x77,0x98,0x12,0x18,
1444
+ 0x23,0xa8,0x70,0x48,0x07,0x79,0x70,0x03,0x76,0x08,0x07,0x77,0x38,0x87,0x7a,0x08,
1445
+ 0x87,0x73,0x28,0x87,0x5f,0xb0,0x87,0x72,0x90,0x87,0x79,0x48,0x87,0x77,0x70,0x87,
1446
+ 0x29,0x01,0x32,0x62,0x0a,0x87,0x74,0x90,0x07,0x37,0x18,0x87,0x77,0x68,0x07,0x78,
1447
+ 0x48,0x07,0x76,0x28,0x87,0x5f,0x78,0x07,0x78,0xa0,0x87,0x74,0x78,0x07,0x77,0x98,
1448
+ 0x87,0x29,0x83,0xc2,0x38,0x23,0x98,0x70,0x48,0x07,0x79,0x70,0x03,0x73,0x90,0x87,
1449
+ 0x70,0x38,0x87,0x76,0x28,0x07,0x77,0xa0,0x87,0x29,0x81,0x1a,0x00,0x00,0x00,0x79,
1450
+ 0x18,0x00,0x00,0xa5,0x00,0x00,0x00,0x33,0x08,0x80,0x1c,0xc4,0xe1,0x1c,0x66,0x14,
1451
+ 0x01,0x3d,0x88,0x43,0x38,0x84,0xc3,0x8c,0x42,0x80,0x07,0x79,0x78,0x07,0x73,0x98,
1452
+ 0x71,0x0c,0xe6,0x00,0x0f,0xed,0x10,0x0e,0xf4,0x80,0x0e,0x33,0x0c,0x42,0x1e,0xc2,
1453
+ 0xc1,0x1d,0xce,0xa1,0x1c,0x66,0x30,0x05,0x3d,0x88,0x43,0x38,0x84,0x83,0x1b,0xcc,
1454
+ 0x03,0x3d,0xc8,0x43,0x3d,0x8c,0x03,0x3d,0xcc,0x78,0x8c,0x74,0x70,0x07,0x7b,0x08,
1455
+ 0x07,0x79,0x48,0x87,0x70,0x70,0x07,0x7a,0x70,0x03,0x76,0x78,0x87,0x70,0x20,0x87,
1456
+ 0x19,0xcc,0x11,0x0e,0xec,0x90,0x0e,0xe1,0x30,0x0f,0x6e,0x30,0x0f,0xe3,0xf0,0x0e,
1457
+ 0xf0,0x50,0x0e,0x33,0x10,0xc4,0x1d,0xde,0x21,0x1c,0xd8,0x21,0x1d,0xc2,0x61,0x1e,
1458
+ 0x66,0x30,0x89,0x3b,0xbc,0x83,0x3b,0xd0,0x43,0x39,0xb4,0x03,0x3c,0xbc,0x83,0x3c,
1459
+ 0x84,0x03,0x3b,0xcc,0xf0,0x14,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x68,0x87,0x72,
1460
+ 0x68,0x07,0x37,0x80,0x87,0x70,0x90,0x87,0x70,0x60,0x07,0x76,0x28,0x07,0x76,0xf8,
1461
+ 0x05,0x76,0x78,0x87,0x77,0x80,0x87,0x5f,0x08,0x87,0x71,0x18,0x87,0x72,0x98,0x87,
1462
+ 0x79,0x98,0x81,0x2c,0xee,0xf0,0x0e,0xee,0xe0,0x0e,0xf5,0xc0,0x0e,0xec,0x30,0x03,
1463
+ 0x62,0xc8,0xa1,0x1c,0xe4,0xa1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x1c,0xdc,0x61,0x1c,
1464
+ 0xca,0x21,0x1c,0xc4,0x81,0x1d,0xca,0x61,0x06,0xd6,0x90,0x43,0x39,0xc8,0x43,0x39,
1465
+ 0x98,0x43,0x39,0xc8,0x43,0x39,0xb8,0xc3,0x38,0x94,0x43,0x38,0x88,0x03,0x3b,0x94,
1466
+ 0xc3,0x2f,0xbc,0x83,0x3c,0xfc,0x82,0x3b,0xd4,0x03,0x3b,0xb0,0xc3,0x0c,0xc7,0x69,
1467
+ 0x87,0x70,0x58,0x87,0x72,0x70,0x83,0x74,0x68,0x07,0x78,0x60,0x87,0x74,0x18,0x87,
1468
+ 0x74,0xa0,0x87,0x19,0xce,0x53,0x0f,0xee,0x00,0x0f,0xf2,0x50,0x0e,0xe4,0x90,0x0e,
1469
+ 0xe3,0x40,0x0f,0xe1,0x20,0x0e,0xec,0x50,0x0e,0x33,0x20,0x28,0x1d,0xdc,0xc1,0x1e,
1470
+ 0xc2,0x41,0x1e,0xd2,0x21,0x1c,0xdc,0x81,0x1e,0xdc,0xe0,0x1c,0xe4,0xe1,0x1d,0xea,
1471
+ 0x01,0x1e,0x66,0x18,0x51,0x38,0xb0,0x43,0x3a,0x9c,0x83,0x3b,0xcc,0x50,0x24,0x76,
1472
+ 0x60,0x07,0x7b,0x68,0x07,0x37,0x60,0x87,0x77,0x78,0x07,0x78,0x98,0x51,0x4c,0xf4,
1473
+ 0x90,0x0f,0xf0,0x50,0x0e,0x33,0x1e,0x6a,0x1e,0xca,0x61,0x1c,0xe8,0x21,0x1d,0xde,
1474
+ 0xc1,0x1d,0x7e,0x01,0x1e,0xe4,0xa1,0x1c,0xcc,0x21,0x1d,0xf0,0x61,0x06,0x54,0x85,
1475
+ 0x83,0x38,0xcc,0xc3,0x3b,0xb0,0x43,0x3d,0xd0,0x43,0x39,0xfc,0xc2,0x3c,0xe4,0x43,
1476
+ 0x3b,0x88,0xc3,0x3b,0xb0,0xc3,0x8c,0xc5,0x0a,0x87,0x79,0x98,0x87,0x77,0x18,0x87,
1477
+ 0x74,0x08,0x07,0x7a,0x28,0x07,0x72,0x98,0x81,0x5c,0xe3,0x10,0x0e,0xec,0xc0,0x0e,
1478
+ 0xe5,0x50,0x0e,0xf3,0x30,0x23,0xc1,0xd2,0x41,0x1e,0xe4,0xe1,0x17,0xd8,0xe1,0x1d,
1479
+ 0xde,0x01,0x1e,0x66,0x48,0x19,0x3b,0xb0,0x83,0x3d,0xb4,0x83,0x1b,0x84,0xc3,0x38,
1480
+ 0x8c,0x43,0x39,0xcc,0xc3,0x3c,0xb8,0xc1,0x39,0xc8,0xc3,0x3b,0xd4,0x03,0x3c,0xcc,
1481
+ 0x48,0xb4,0x71,0x08,0x07,0x76,0x60,0x07,0x71,0x08,0x87,0x71,0x58,0x87,0x19,0xdb,
1482
+ 0xc6,0x0e,0xec,0x60,0x0f,0xed,0xe0,0x06,0xf0,0x20,0x0f,0xe5,0x30,0x0f,0xe5,0x20,
1483
+ 0x0f,0xf6,0x50,0x0e,0x6e,0x10,0x0e,0xe3,0x30,0x0e,0xe5,0x30,0x0f,0xf3,0xe0,0x06,
1484
+ 0xe9,0xe0,0x0e,0xe4,0x50,0x0e,0xf8,0x30,0x23,0xe2,0xec,0x61,0x1c,0xc2,0x81,0x1d,
1485
+ 0xd8,0xe1,0x17,0xec,0x21,0x1d,0xe6,0x21,0x1d,0xc4,0x21,0x1d,0xd8,0x21,0x1d,0xe8,
1486
+ 0x21,0x1f,0x66,0x20,0x9d,0x3b,0xbc,0x43,0x3d,0xb8,0x03,0x39,0x94,0x83,0x39,0xcc,
1487
+ 0x58,0xbc,0x70,0x70,0x07,0x77,0x78,0x07,0x7a,0x08,0x07,0x7a,0x48,0x87,0x77,0x70,
1488
+ 0x87,0x19,0xce,0x87,0x0e,0xe5,0x10,0x0e,0xf0,0x10,0x0e,0xec,0xc0,0x0e,0xef,0x30,
1489
+ 0x0e,0xf3,0x90,0x0e,0xf4,0x50,0x0e,0x33,0x28,0x30,0x08,0x87,0x74,0x90,0x07,0x37,
1490
+ 0x30,0x87,0x7a,0x70,0x87,0x71,0xa0,0x87,0x74,0x78,0x07,0x77,0xf8,0x85,0x73,0x90,
1491
+ 0x87,0x77,0xa8,0x07,0x78,0x98,0x07,0x00,0x00,0x00,0x00,0x71,0x20,0x00,0x00,0x08,
1492
+ 0x00,0x00,0x00,0x16,0xb0,0x01,0x48,0xe4,0x4b,0x00,0xf3,0x2c,0xc4,0x3f,0x11,0xd7,
1493
+ 0x44,0x45,0xc4,0x6f,0x0f,0x7e,0x85,0x17,0xb7,0x6d,0x00,0x05,0x03,0x20,0x0d,0x0d,
1494
+ 0x00,0x00,0x00,0x61,0x20,0x00,0x00,0x14,0x00,0x00,0x00,0x13,0x04,0x41,0x2c,0x10,
1495
+ 0x00,0x00,0x00,0x06,0x00,0x00,0x00,0xc4,0x46,0x00,0xc6,0x12,0x80,0x80,0xd4,0x08,
1496
+ 0x40,0x0d,0x90,0x98,0x01,0xa0,0x30,0x03,0x40,0x60,0x04,0x00,0x00,0x00,0x00,0x83,
1497
+ 0x0c,0x8b,0x60,0x8c,0x18,0x28,0x43,0x40,0x29,0x49,0x50,0x20,0x86,0x60,0x01,0x23,
1498
+ 0x9f,0xd9,0x06,0x23,0x00,0x32,0x08,0x88,0x01,0x00,0x00,0x02,0x00,0x00,0x00,0x5b,
1499
+ 0x86,0xe0,0x88,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1500
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1501
+ };
1502
+ static const uint8_t _sgl_shd_vs_bytecode_metal_ios[3667] = {
1503
+ 0x4d,0x54,0x4c,0x42,0x01,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1504
+ 0x53,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1505
+ 0x7b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1506
+ 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1b,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
1507
+ 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
1508
+ 0x30,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x7b,0x00,0x00,0x00,
1509
+ 0x4e,0x41,0x4d,0x45,0x06,0x00,0x6d,0x61,0x69,0x6e,0x30,0x00,0x54,0x59,0x50,0x45,
1510
+ 0x01,0x00,0x00,0x48,0x41,0x53,0x48,0x20,0x00,0xa2,0x5e,0x9d,0xf2,0xd2,0xe4,0xeb,
1511
+ 0xd7,0xb6,0x9a,0xa2,0x8d,0xba,0x51,0x92,0x3f,0xdc,0xef,0x56,0x74,0xd1,0x56,0xec,
1512
+ 0xda,0xe4,0xd2,0xbb,0x04,0xdc,0x93,0x29,0xa5,0x4d,0x44,0x53,0x5a,0x08,0x00,0x30,
1513
+ 0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x4f,0x46,0x46,0x54,0x18,0x00,0x00,0x00,0x00,
1514
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1515
+ 0x00,0x00,0x00,0x00,0x00,0x56,0x45,0x52,0x53,0x08,0x00,0x02,0x00,0x00,0x00,0x02,
1516
+ 0x00,0x00,0x00,0x45,0x4e,0x44,0x54,0x40,0x00,0x00,0x00,0x56,0x41,0x54,0x54,0x2a,
1517
+ 0x00,0x04,0x00,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x00,0x80,0x74,0x65,
1518
+ 0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x00,0x01,0x80,0x63,0x6f,0x6c,0x6f,0x72,0x30,
1519
+ 0x00,0x02,0x80,0x70,0x73,0x69,0x7a,0x65,0x00,0x03,0x80,0x56,0x41,0x54,0x59,0x06,
1520
+ 0x00,0x04,0x00,0x06,0x04,0x06,0x03,0x45,0x4e,0x44,0x54,0x04,0x00,0x00,0x00,0x45,
1521
+ 0x4e,0x44,0x54,0xde,0xc0,0x17,0x0b,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x10,
1522
+ 0x0d,0x00,0x00,0xff,0xff,0xff,0xff,0x42,0x43,0xc0,0xde,0x35,0x14,0x00,0x00,0x03,
1523
+ 0x00,0x00,0x00,0x62,0x0c,0x30,0x24,0x80,0x10,0x05,0xc8,0x14,0x00,0x00,0x00,0x21,
1524
+ 0x0c,0x00,0x00,0x3c,0x03,0x00,0x00,0x0b,0x82,0x20,0x00,0x02,0x00,0x00,0x00,0x13,
1525
+ 0x00,0x00,0x00,0x07,0x81,0x23,0x91,0x41,0xc8,0x04,0x49,0x06,0x10,0x32,0x39,0x92,
1526
+ 0x01,0x84,0x0c,0x25,0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,0x80,0x14,0x45,0x02,0x42,
1527
+ 0x92,0x0b,0x42,0xa4,0x10,0x32,0x14,0x38,0x08,0x18,0x4b,0x0a,0x32,0x52,0x88,0x48,
1528
+ 0x90,0x14,0x20,0x43,0x46,0x88,0xa5,0x00,0x19,0x32,0x42,0xe4,0x48,0x0e,0x90,0x91,
1529
+ 0x22,0xc4,0x50,0x41,0x51,0x81,0x8c,0xe1,0x83,0xe5,0x8a,0x04,0x29,0x46,0x06,0x51,
1530
+ 0x18,0x00,0x00,0x71,0x00,0x00,0x00,0x1b,0xc2,0x24,0xf8,0xff,0xff,0xff,0xff,0x01,
1531
+ 0x80,0x03,0x40,0x02,0x28,0x22,0x1c,0xe0,0x01,0x1e,0xe4,0xe1,0x1d,0xf0,0xa1,0x0d,
1532
+ 0xcc,0xa1,0x1e,0xdc,0x61,0x1c,0xda,0xc0,0x1c,0xe0,0xa1,0x0d,0xda,0x21,0x1c,0xe8,
1533
+ 0x01,0x1d,0x00,0x7a,0x90,0x87,0x7a,0x28,0x07,0x80,0x68,0x87,0x74,0x70,0x87,0x36,
1534
+ 0x60,0x87,0x72,0x38,0x87,0x70,0x60,0x87,0x36,0xb0,0x87,0x72,0x18,0x07,0x7a,0x78,
1535
+ 0x07,0x79,0x68,0x83,0x7b,0x48,0x07,0x72,0xa0,0x07,0x74,0x00,0xe2,0x40,0x0e,0xf0,
1536
+ 0x00,0x18,0xdc,0xe1,0x1d,0xda,0x40,0x1c,0xea,0x21,0x1d,0xd8,0x81,0x1e,0xd2,0xc1,
1537
+ 0x1d,0xe6,0x01,0x20,0xdc,0xe1,0x1d,0xda,0xc0,0x1c,0xe4,0x21,0x1c,0xda,0xa1,0x1c,
1538
+ 0xda,0x00,0x1e,0xde,0x21,0x1d,0xdc,0x81,0x1e,0xca,0x41,0x1e,0xda,0xa0,0x1c,0xd8,
1539
+ 0x21,0x1d,0xda,0x01,0xa0,0x07,0x79,0xa8,0x87,0x72,0x00,0x08,0x77,0x78,0x87,0x36,
1540
+ 0x30,0x07,0x79,0x08,0x87,0x76,0x28,0x87,0x36,0x80,0x87,0x77,0x48,0x07,0x77,0xa0,
1541
+ 0x87,0x72,0x90,0x87,0x36,0x28,0x07,0x76,0x48,0x87,0x76,0x68,0x03,0x77,0x78,0x07,
1542
+ 0x77,0x68,0x03,0x76,0x28,0x87,0x70,0x30,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,
1543
+ 0x20,0xdc,0xe1,0x1d,0xda,0x20,0x1d,0xdc,0xc1,0x1c,0xe6,0xa1,0x0d,0xcc,0x01,0x1e,
1544
+ 0xda,0xa0,0x1d,0xc2,0x81,0x1e,0xd0,0x01,0xa0,0x07,0x79,0xa8,0x87,0x72,0x00,0x08,
1545
+ 0x77,0x78,0x87,0x36,0x70,0x87,0x70,0x70,0x87,0x79,0x68,0x03,0x73,0x80,0x87,0x36,
1546
+ 0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1,0x1c,0x00,0xc2,0x1d,
1547
+ 0xde,0xa1,0x0d,0xe6,0x21,0x1d,0xce,0xc1,0x1d,0xca,0x81,0x1c,0xda,0x40,0x1f,0xca,
1548
+ 0x41,0x1e,0xde,0x61,0x1e,0xda,0xc0,0x1c,0xe0,0xa1,0x0d,0xda,0x21,0x1c,0xe8,0x01,
1549
+ 0x1d,0x00,0x7a,0x90,0x87,0x7a,0x28,0x07,0x80,0x70,0x87,0x77,0x68,0x03,0x7a,0x90,
1550
+ 0x87,0x70,0x80,0x07,0x78,0x48,0x07,0x77,0x38,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,
1551
+ 0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1,0x1c,0x00,0x62,0x1e,0xe8,0x21,0x1c,0xc6,0x61,
1552
+ 0x1d,0xda,0x00,0x1e,0xe4,0xe1,0x1d,0xe8,0xa1,0x1c,0xc6,0x81,0x1e,0xde,0x41,0x1e,
1553
+ 0xda,0x40,0x1c,0xea,0xc1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x0d,0xe6,0x21,0x1d,0xf4,
1554
+ 0xa1,0x1c,0x00,0x3c,0x00,0x88,0x7a,0x70,0x87,0x79,0x08,0x07,0x73,0x28,0x87,0x36,
1555
+ 0x30,0x07,0x78,0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,
1556
+ 0xca,0x01,0xd8,0xe0,0x09,0x05,0xb0,0x00,0x55,0x90,0x06,0x20,0x31,0x84,0x43,0x3a,
1557
+ 0xc8,0x43,0x1b,0x88,0x43,0x3d,0x98,0x83,0x39,0x94,0x83,0x3c,0xb4,0x81,0x3b,0xbc,
1558
+ 0x43,0x1b,0x84,0x03,0x3b,0xa4,0x43,0x38,0xcc,0x03,0x00,0x49,0x18,0x00,0x00,0x01,
1559
+ 0x00,0x00,0x00,0x13,0x84,0x40,0x00,0x89,0x20,0x00,0x00,0x20,0x00,0x00,0x00,0x32,
1560
+ 0x22,0x48,0x09,0x20,0x64,0x85,0x04,0x93,0x22,0xa4,0x84,0x04,0x93,0x22,0xe3,0x84,
1561
+ 0xa1,0x90,0x14,0x12,0x4c,0x8a,0x8c,0x0b,0x84,0xa4,0x4c,0x10,0x44,0x33,0x00,0xc3,
1562
+ 0x08,0x04,0x60,0x89,0x10,0x02,0x18,0x46,0x10,0x80,0x24,0x08,0x33,0x51,0xf3,0x40,
1563
+ 0x0f,0xf2,0x50,0x0f,0xe3,0x40,0x0f,0x6e,0xd0,0x0e,0xe5,0x40,0x0f,0xe1,0xc0,0x0e,
1564
+ 0x7a,0xa0,0x07,0xed,0x10,0x0e,0xf4,0x20,0x0f,0xe9,0x80,0x0f,0x28,0x20,0x07,0x49,
1565
+ 0x53,0x44,0x09,0x93,0x5f,0x49,0xff,0x03,0x44,0x00,0x23,0x21,0xa1,0x94,0x41,0x04,
1566
+ 0x43,0x28,0x86,0x08,0x23,0x80,0x43,0x68,0x20,0x60,0x8e,0x00,0x0c,0x52,0x60,0xcd,
1567
+ 0x11,0x80,0xc2,0x20,0x42,0x20,0x0c,0x23,0x10,0xcb,0x08,0x00,0x00,0x00,0x00,0x13,
1568
+ 0xaa,0x70,0x48,0x07,0x79,0xb0,0x03,0x3a,0x68,0x83,0x70,0x80,0x07,0x78,0x60,0x87,
1569
+ 0x72,0x68,0x83,0x74,0x78,0x87,0x79,0x88,0x83,0x38,0x70,0x03,0x38,0x70,0x03,0x38,
1570
+ 0xd8,0x70,0x1b,0xe5,0xd0,0x06,0xf0,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,
1571
+ 0xa0,0x07,0x76,0x40,0x07,0x6d,0x90,0x0e,0x71,0xa0,0x07,0x78,0xa0,0x07,0x78,0xd0,
1572
+ 0x06,0xe9,0x80,0x07,0x7a,0x80,0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,0x71,0x60,0x07,
1573
+ 0x7a,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x6d,0x90,0x0e,0x73,0x20,0x07,0x7a,
1574
+ 0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x90,0x0e,0x76,0x40,0x07,0x7a,0x60,
1575
+ 0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0e,0x73,0x20,0x07,0x7a,0x30,0x07,
1576
+ 0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x60,0x0e,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,
1577
+ 0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xa0,
1578
+ 0x07,0x71,0x60,0x07,0x6d,0x60,0x0f,0x72,0x40,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,
1579
+ 0x73,0x20,0x07,0x6d,0x60,0x0f,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,
1580
+ 0x20,0x07,0x6d,0x60,0x0f,0x74,0x80,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,
1581
+ 0x07,0x6d,0x60,0x0f,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,
1582
+ 0x6d,0x60,0x0f,0x79,0x60,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72,
1583
+ 0x80,0x07,0x6d,0x60,0x0f,0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xa0,
1584
+ 0x07,0x71,0x20,0x07,0x78,0xd0,0x06,0xf6,0x10,0x07,0x79,0x20,0x07,0x7a,0x20,0x07,
1585
+ 0x75,0x60,0x07,0x7a,0x20,0x07,0x75,0x60,0x07,0x6d,0x60,0x0f,0x72,0x50,0x07,0x76,
1586
+ 0xa0,0x07,0x72,0x50,0x07,0x76,0xa0,0x07,0x72,0x50,0x07,0x76,0xd0,0x06,0xf6,0x50,
1587
+ 0x07,0x71,0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07,
1588
+ 0x6d,0x60,0x0f,0x71,0x00,0x07,0x72,0x40,0x07,0x7a,0x10,0x07,0x70,0x20,0x07,0x74,
1589
+ 0xa0,0x07,0x71,0x00,0x07,0x72,0x40,0x07,0x6d,0xe0,0x0e,0x78,0xa0,0x07,0x71,0x60,
1590
+ 0x07,0x7a,0x30,0x07,0x72,0x30,0xe4,0x41,0x00,0x00,0x08,0x00,0x00,0x00,0x04,0x00,
1591
+ 0x00,0x00,0x40,0x23,0x84,0x21,0x0b,0x06,0x40,0x1a,0x5a,0x62,0x83,0x40,0x51,0x9d,
1592
+ 0x01,0x00,0x80,0x2c,0x10,0x00,0x00,0x0a,0x00,0x00,0x00,0x32,0x1e,0x98,0x10,0x19,
1593
+ 0x11,0x4c,0x90,0x8c,0x09,0x26,0x47,0xc6,0x04,0x43,0x5a,0x45,0x50,0x02,0x85,0x30,
1594
+ 0x02,0x50,0x06,0x05,0x28,0x50,0x80,0x01,0x05,0x42,0x6d,0x04,0x80,0xd8,0x58,0x82,
1595
+ 0x46,0x00,0x00,0xb1,0x18,0x00,0x00,0xa5,0x00,0x00,0x00,0x33,0x08,0x80,0x1c,0xc4,
1596
+ 0xe1,0x1c,0x66,0x14,0x01,0x3d,0x88,0x43,0x38,0x84,0xc3,0x8c,0x42,0x80,0x07,0x79,
1597
+ 0x78,0x07,0x73,0x98,0x71,0x0c,0xe6,0x00,0x0f,0xed,0x10,0x0e,0xf4,0x80,0x0e,0x33,
1598
+ 0x0c,0x42,0x1e,0xc2,0xc1,0x1d,0xce,0xa1,0x1c,0x66,0x30,0x05,0x3d,0x88,0x43,0x38,
1599
+ 0x84,0x83,0x1b,0xcc,0x03,0x3d,0xc8,0x43,0x3d,0x8c,0x03,0x3d,0xcc,0x78,0x8c,0x74,
1600
+ 0x70,0x07,0x7b,0x08,0x07,0x79,0x48,0x87,0x70,0x70,0x07,0x7a,0x70,0x03,0x76,0x78,
1601
+ 0x87,0x70,0x20,0x87,0x19,0xcc,0x11,0x0e,0xec,0x90,0x0e,0xe1,0x30,0x0f,0x6e,0x30,
1602
+ 0x0f,0xe3,0xf0,0x0e,0xf0,0x50,0x0e,0x33,0x10,0xc4,0x1d,0xde,0x21,0x1c,0xd8,0x21,
1603
+ 0x1d,0xc2,0x61,0x1e,0x66,0x30,0x89,0x3b,0xbc,0x83,0x3b,0xd0,0x43,0x39,0xb4,0x03,
1604
+ 0x3c,0xbc,0x83,0x3c,0x84,0x03,0x3b,0xcc,0xf0,0x14,0x76,0x60,0x07,0x7b,0x68,0x07,
1605
+ 0x37,0x68,0x87,0x72,0x68,0x07,0x37,0x80,0x87,0x70,0x90,0x87,0x70,0x60,0x07,0x76,
1606
+ 0x28,0x07,0x76,0xf8,0x05,0x76,0x78,0x87,0x77,0x80,0x87,0x5f,0x08,0x87,0x71,0x18,
1607
+ 0x87,0x72,0x98,0x87,0x79,0x98,0x81,0x2c,0xee,0xf0,0x0e,0xee,0xe0,0x0e,0xf5,0xc0,
1608
+ 0x0e,0xec,0x30,0x03,0x62,0xc8,0xa1,0x1c,0xe4,0xa1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,
1609
+ 0x1c,0xdc,0x61,0x1c,0xca,0x21,0x1c,0xc4,0x81,0x1d,0xca,0x61,0x06,0xd6,0x90,0x43,
1610
+ 0x39,0xc8,0x43,0x39,0x98,0x43,0x39,0xc8,0x43,0x39,0xb8,0xc3,0x38,0x94,0x43,0x38,
1611
+ 0x88,0x03,0x3b,0x94,0xc3,0x2f,0xbc,0x83,0x3c,0xfc,0x82,0x3b,0xd4,0x03,0x3b,0xb0,
1612
+ 0xc3,0x0c,0xc7,0x69,0x87,0x70,0x58,0x87,0x72,0x70,0x83,0x74,0x68,0x07,0x78,0x60,
1613
+ 0x87,0x74,0x18,0x87,0x74,0xa0,0x87,0x19,0xce,0x53,0x0f,0xee,0x00,0x0f,0xf2,0x50,
1614
+ 0x0e,0xe4,0x90,0x0e,0xe3,0x40,0x0f,0xe1,0x20,0x0e,0xec,0x50,0x0e,0x33,0x20,0x28,
1615
+ 0x1d,0xdc,0xc1,0x1e,0xc2,0x41,0x1e,0xd2,0x21,0x1c,0xdc,0x81,0x1e,0xdc,0xe0,0x1c,
1616
+ 0xe4,0xe1,0x1d,0xea,0x01,0x1e,0x66,0x18,0x51,0x38,0xb0,0x43,0x3a,0x9c,0x83,0x3b,
1617
+ 0xcc,0x50,0x24,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x60,0x87,0x77,0x78,0x07,0x78,
1618
+ 0x98,0x51,0x4c,0xf4,0x90,0x0f,0xf0,0x50,0x0e,0x33,0x1e,0x6a,0x1e,0xca,0x61,0x1c,
1619
+ 0xe8,0x21,0x1d,0xde,0xc1,0x1d,0x7e,0x01,0x1e,0xe4,0xa1,0x1c,0xcc,0x21,0x1d,0xf0,
1620
+ 0x61,0x06,0x54,0x85,0x83,0x38,0xcc,0xc3,0x3b,0xb0,0x43,0x3d,0xd0,0x43,0x39,0xfc,
1621
+ 0xc2,0x3c,0xe4,0x43,0x3b,0x88,0xc3,0x3b,0xb0,0xc3,0x8c,0xc5,0x0a,0x87,0x79,0x98,
1622
+ 0x87,0x77,0x18,0x87,0x74,0x08,0x07,0x7a,0x28,0x07,0x72,0x98,0x81,0x5c,0xe3,0x10,
1623
+ 0x0e,0xec,0xc0,0x0e,0xe5,0x50,0x0e,0xf3,0x30,0x23,0xc1,0xd2,0x41,0x1e,0xe4,0xe1,
1624
+ 0x17,0xd8,0xe1,0x1d,0xde,0x01,0x1e,0x66,0x48,0x19,0x3b,0xb0,0x83,0x3d,0xb4,0x83,
1625
+ 0x1b,0x84,0xc3,0x38,0x8c,0x43,0x39,0xcc,0xc3,0x3c,0xb8,0xc1,0x39,0xc8,0xc3,0x3b,
1626
+ 0xd4,0x03,0x3c,0xcc,0x48,0xb4,0x71,0x08,0x07,0x76,0x60,0x07,0x71,0x08,0x87,0x71,
1627
+ 0x58,0x87,0x19,0xdb,0xc6,0x0e,0xec,0x60,0x0f,0xed,0xe0,0x06,0xf0,0x20,0x0f,0xe5,
1628
+ 0x30,0x0f,0xe5,0x20,0x0f,0xf6,0x50,0x0e,0x6e,0x10,0x0e,0xe3,0x30,0x0e,0xe5,0x30,
1629
+ 0x0f,0xf3,0xe0,0x06,0xe9,0xe0,0x0e,0xe4,0x50,0x0e,0xf8,0x30,0x23,0xe2,0xec,0x61,
1630
+ 0x1c,0xc2,0x81,0x1d,0xd8,0xe1,0x17,0xec,0x21,0x1d,0xe6,0x21,0x1d,0xc4,0x21,0x1d,
1631
+ 0xd8,0x21,0x1d,0xe8,0x21,0x1f,0x66,0x20,0x9d,0x3b,0xbc,0x43,0x3d,0xb8,0x03,0x39,
1632
+ 0x94,0x83,0x39,0xcc,0x58,0xbc,0x70,0x70,0x07,0x77,0x78,0x07,0x7a,0x08,0x07,0x7a,
1633
+ 0x48,0x87,0x77,0x70,0x87,0x19,0xce,0x87,0x0e,0xe5,0x10,0x0e,0xf0,0x10,0x0e,0xec,
1634
+ 0xc0,0x0e,0xef,0x30,0x0e,0xf3,0x90,0x0e,0xf4,0x50,0x0e,0x33,0x28,0x30,0x08,0x87,
1635
+ 0x74,0x90,0x07,0x37,0x30,0x87,0x7a,0x70,0x87,0x71,0xa0,0x87,0x74,0x78,0x07,0x77,
1636
+ 0xf8,0x85,0x73,0x90,0x87,0x77,0xa8,0x07,0x78,0x98,0x07,0x00,0x00,0x00,0x00,0x79,
1637
+ 0x18,0x00,0x00,0xdf,0x00,0x00,0x00,0x22,0x47,0xc8,0x90,0x51,0x9e,0x01,0x18,0x94,
1638
+ 0x11,0x00,0x00,0x8b,0x12,0x07,0xc5,0xc6,0x91,0x41,0xb4,0x44,0x06,0x23,0x2c,0x05,
1639
+ 0xb3,0x38,0x05,0x03,0x49,0x1e,0x62,0x24,0x46,0xa1,0x3c,0x08,0x85,0x0c,0x42,0x74,
1640
+ 0x25,0x03,0x00,0x53,0x44,0x4b,0x20,0x56,0x65,0x72,0x73,0x69,0x6f,0x6e,0x77,0x63,
1641
+ 0x68,0x61,0x72,0x5f,0x73,0x69,0x7a,0x65,0x41,0x70,0x70,0x6c,0x65,0x20,0x6d,0x65,
1642
+ 0x74,0x61,0x6c,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x32,0x30,0x32,
1643
+ 0x33,0x2e,0x38,0x38,0x33,0x20,0x28,0x6d,0x65,0x74,0x61,0x6c,0x66,0x65,0x2d,0x33,
1644
+ 0x32,0x30,0x32,0x33,0x2e,0x38,0x38,0x33,0x29,0x4d,0x65,0x74,0x61,0x6c,0x61,0x69,
1645
+ 0x72,0x2e,0x63,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x2e,0x64,0x65,0x6e,0x6f,0x72,0x6d,
1646
+ 0x73,0x5f,0x64,0x69,0x73,0x61,0x62,0x6c,0x65,0x61,0x69,0x72,0x2e,0x63,0x6f,0x6d,
1647
+ 0x70,0x69,0x6c,0x65,0x2e,0x66,0x61,0x73,0x74,0x5f,0x6d,0x61,0x74,0x68,0x5f,0x65,
1648
+ 0x6e,0x61,0x62,0x6c,0x65,0x61,0x69,0x72,0x2e,0x63,0x6f,0x6d,0x70,0x69,0x6c,0x65,
1649
+ 0x2e,0x66,0x72,0x61,0x6d,0x65,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x66,0x65,0x74,
1650
+ 0x63,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x61,0x69,0x72,0x2e,0x76,0x65,0x72,
1651
+ 0x74,0x65,0x78,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x75,0x73,0x65,0x72,0x28,0x6c,
1652
+ 0x6f,0x63,0x6e,0x30,0x29,0x61,0x69,0x72,0x2e,0x61,0x72,0x67,0x5f,0x74,0x79,0x70,
1653
+ 0x65,0x5f,0x6e,0x61,0x6d,0x65,0x66,0x6c,0x6f,0x61,0x74,0x34,0x61,0x69,0x72,0x2e,
1654
+ 0x61,0x72,0x67,0x5f,0x6e,0x61,0x6d,0x65,0x75,0x76,0x75,0x73,0x65,0x72,0x28,0x6c,
1655
+ 0x6f,0x63,0x6e,0x31,0x29,0x63,0x6f,0x6c,0x6f,0x72,0x61,0x69,0x72,0x2e,0x70,0x6f,
1656
+ 0x73,0x69,0x74,0x69,0x6f,0x6e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,
1657
+ 0x6e,0x61,0x69,0x72,0x2e,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65,0x66,
1658
+ 0x6c,0x6f,0x61,0x74,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,
1659
+ 0x61,0x69,0x72,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x69,0x6e,0x70,0x75,0x74,
1660
+ 0x61,0x69,0x72,0x2e,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x6e,0x64,
1661
+ 0x65,0x78,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x64,0x28,0x5f,0x5f,0x61,0x69,
1662
+ 0x72,0x5f,0x70,0x6c,0x61,0x63,0x65,0x68,0x6f,0x6c,0x64,0x65,0x72,0x5f,0x5f,0x29,
1663
+ 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x66,0x6c,0x6f,0x61,0x74,0x32,0x74,0x65,
1664
+ 0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x70,0x73,0x69,
1665
+ 0x7a,0x65,0x61,0x69,0x72,0x2e,0x62,0x75,0x66,0x66,0x65,0x72,0x61,0x69,0x72,0x2e,
1666
+ 0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65,0x61,0x69,0x72,0x2e,0x72,
1667
+ 0x65,0x61,0x64,0x61,0x69,0x72,0x2e,0x73,0x74,0x72,0x75,0x63,0x74,0x5f,0x74,0x79,
1668
+ 0x70,0x65,0x5f,0x69,0x6e,0x66,0x6f,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x6d,
1669
+ 0x76,0x70,0x74,0x6d,0x61,0x69,0x72,0x2e,0x61,0x72,0x67,0x5f,0x74,0x79,0x70,0x65,
1670
+ 0x5f,0x73,0x69,0x7a,0x65,0x61,0x69,0x72,0x2e,0x61,0x72,0x67,0x5f,0x74,0x79,0x70,
1671
+ 0x65,0x5f,0x61,0x6c,0x69,0x67,0x6e,0x5f,0x73,0x69,0x7a,0x65,0x76,0x73,0x5f,0x70,
1672
+ 0x61,0x72,0x61,0x6d,0x73,0x5f,0x31,0x39,0x00,0x00,0x00,0x13,0x84,0x25,0x98,0x20,
1673
+ 0x30,0xca,0x04,0x61,0x11,0x26,0x08,0xcb,0x30,0x41,0x58,0x88,0x09,0x42,0x02,0x4c,
1674
+ 0x10,0x96,0x62,0x82,0xb0,0x18,0x13,0x84,0xe5,0x98,0x20,0x2c,0xc8,0x86,0x01,0x0d,
1675
+ 0x82,0x34,0xd8,0x30,0xa8,0x81,0xb0,0x06,0x1b,0x82,0x61,0xc3,0x80,0x06,0x6c,0xc0,
1676
+ 0x06,0x1b,0x08,0x02,0x0d,0xd8,0x80,0x0d,0x36,0x04,0xc5,0x86,0xc0,0xd8,0x10,0x1c,
1677
+ 0x1b,0x0c,0x24,0x51,0x16,0xa6,0xd9,0x60,0x20,0x8e,0xb2,0x30,0xcf,0x86,0x02,0x52,
1678
+ 0x16,0x26,0xda,0x50,0x48,0xca,0xc4,0x50,0x1b,0x08,0x3d,0xd8,0x03,0x3e,0xe8,0x83,
1679
+ 0x0d,0x0a,0x1b,0x54,0x16,0x1b,0xa8,0xc1,0xa5,0x2c,0x0c,0xb6,0x41,0x51,0x83,0xca,
1680
+ 0x52,0x03,0x35,0xb8,0x94,0x8c,0xd1,0x36,0x28,0x68,0x50,0x59,0x68,0xa0,0x06,0x97,
1681
+ 0xb2,0x30,0xdb,0x06,0xc5,0x0d,0x2a,0xcb,0x0d,0xd4,0xe0,0x52,0x26,0x86,0xdb,0xa0,
1682
+ 0xb0,0x01,0x1c,0xb0,0x41,0x18,0x88,0x01,0x1c,0xc0,0x01,0x1b,0x84,0xc1,0x18,0x6c,
1683
+ 0x90,0xd6,0xa0,0xf3,0xde,0xc0,0x62,0x03,0x35,0xf8,0xc0,0x60,0x14,0xc8,0xe0,0x0d,
1684
+ 0xca,0x20,0x0e,0x14,0x33,0x60,0xce,0x60,0x43,0xf1,0x07,0xa0,0x10,0x0a,0xa2,0x40,
1685
+ 0x0a,0x1b,0x86,0x36,0xf0,0x83,0x52,0xd0,0x48,0x60,0x82,0x1a,0xb1,0xb1,0xd9,0xb5,
1686
+ 0xb9,0xb4,0xbd,0x91,0xd5,0xb1,0x95,0xb9,0x98,0xb1,0x85,0x9d,0xcd,0x4d,0x11,0xe2,
1687
+ 0x40,0x0e,0xaa,0xb0,0xb1,0xd9,0xb5,0xb9,0xa4,0x91,0x95,0xb9,0xd1,0x4d,0x09,0xe6,
1688
+ 0xa0,0x4b,0x58,0x9a,0x9c,0x8b,0x5d,0x99,0xdc,0x5c,0xda,0x9b,0xdb,0x94,0x80,0x0e,
1689
+ 0x4a,0x85,0xa5,0xc9,0xb9,0xb0,0x85,0xb9,0x9d,0xd5,0x85,0x9d,0x95,0x7d,0xd9,0x95,
1690
+ 0xc9,0xcd,0xa5,0xbd,0xb9,0x4d,0x09,0xea,0xa0,0x53,0x58,0x9a,0x9c,0xcb,0xd8,0x5b,
1691
+ 0x1b,0x5c,0x1a,0x5b,0xd9,0xd7,0x1b,0x1c,0x5d,0xda,0x9b,0xdb,0xdc,0x94,0xc1,0x0e,
1692
+ 0xee,0x00,0x0f,0xaa,0x84,0xa5,0xc9,0xb9,0xd8,0x95,0xc9,0xd1,0x95,0xe1,0x4d,0x09,
1693
+ 0x4a,0x01,0x00,0xa9,0x18,0x00,0x00,0x25,0x00,0x00,0x00,0x0b,0x0a,0x72,0x28,0x87,
1694
+ 0x77,0x80,0x07,0x7a,0x58,0x70,0x98,0x43,0x3d,0xb8,0xc3,0x38,0xb0,0x43,0x39,0xd0,
1695
+ 0xc3,0x82,0xe6,0x1c,0xc6,0xa1,0x0d,0xe8,0x41,0x1e,0xc2,0xc1,0x1d,0xe6,0x21,0x1d,
1696
+ 0xe8,0x21,0x1d,0xde,0xc1,0x1d,0x16,0x34,0xe3,0x60,0x0e,0xe7,0x50,0x0f,0xe1,0x20,
1697
+ 0x0f,0xe4,0x40,0x0f,0xe1,0x20,0x0f,0xe7,0x50,0x0e,0xf4,0xb0,0x80,0x81,0x07,0x79,
1698
+ 0x28,0x87,0x70,0x60,0x07,0x76,0x78,0x87,0x71,0x08,0x07,0x7a,0x28,0x07,0x72,0x58,
1699
+ 0x70,0x9c,0xc3,0x38,0xb4,0x01,0x3b,0xa4,0x83,0x3d,0x94,0xc3,0x02,0x6b,0x1c,0xd8,
1700
+ 0x21,0x1c,0xdc,0xe1,0x1c,0xdc,0x20,0x1c,0xe4,0x61,0x1c,0xdc,0x20,0x1c,0xe8,0x81,
1701
+ 0x1e,0xc2,0x61,0x1c,0xd0,0xa1,0x1c,0xc8,0x61,0x1c,0xc2,0x81,0x1d,0xd8,0x61,0xc1,
1702
+ 0x01,0x0f,0xf4,0x20,0x0f,0xe1,0x50,0x0f,0xf4,0x80,0x0e,0x00,0x00,0x00,0x00,0x61,
1703
+ 0x20,0x00,0x00,0x66,0x00,0x00,0x00,0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,0x09,
1704
+ 0x00,0x00,0x00,0xd4,0x4a,0xa0,0x0c,0x8a,0x80,0xde,0x08,0xc0,0x58,0x44,0x10,0x04,
1705
+ 0xc1,0x58,0x84,0x20,0x08,0xc2,0x58,0xc4,0x30,0x0c,0x03,0x85,0x19,0x80,0x19,0x00,
1706
+ 0x12,0x33,0x00,0x34,0x66,0x00,0x00,0xf1,0x30,0x00,0x00,0x20,0x00,0x00,0x00,0x22,
1707
+ 0x47,0xc8,0x90,0x51,0x12,0xc4,0x2b,0x00,0x00,0x00,0x00,0xcf,0x73,0x59,0x00,0x6f,
1708
+ 0x6d,0x6e,0x69,0x70,0x6f,0x74,0x65,0x6e,0x74,0x20,0x63,0x68,0x61,0x72,0x53,0x69,
1709
+ 0x6d,0x70,0x6c,0x65,0x20,0x43,0x2b,0x2b,0x20,0x54,0x42,0x41,0x41,0x61,0x69,0x72,
1710
+ 0x2d,0x61,0x6c,0x69,0x61,0x73,0x2d,0x73,0x63,0x6f,0x70,0x65,0x73,0x28,0x6d,0x61,
1711
+ 0x69,0x6e,0x30,0x29,0x61,0x69,0x72,0x2d,0x61,0x6c,0x69,0x61,0x73,0x2d,0x73,0x63,
1712
+ 0x6f,0x70,0x65,0x2d,0x61,0x72,0x67,0x28,0x34,0x29,0x00,0x13,0x84,0x26,0x59,0x21,
1713
+ 0xb0,0x42,0x2a,0xac,0x18,0x5a,0x81,0x15,0x54,0x61,0x43,0x80,0x0a,0x1b,0x86,0x53,
1714
+ 0x70,0x85,0x55,0xd8,0x30,0xbc,0xc2,0x2b,0xac,0xc2,0x86,0xa0,0x15,0x00,0x00,0xdb,
1715
+ 0x14,0x8c,0x74,0x5d,0x12,0x05,0xa1,0x0c,0x32,0x48,0x85,0x62,0x42,0x20,0x9f,0x6d,
1716
+ 0x0a,0xc8,0xda,0xb6,0x87,0x82,0x50,0x06,0x19,0x2c,0xa5,0x31,0x21,0x90,0x8f,0x05,
1717
+ 0x05,0x7c,0xb6,0x29,0xaa,0x0d,0x0c,0xc0,0x40,0xa2,0x20,0x94,0x41,0x86,0xed,0x89,
1718
+ 0x4c,0x08,0xe4,0x63,0x45,0x00,0x9f,0x6d,0x0a,0x0d,0x0c,0xca,0xa0,0x0c,0x30,0x0a,
1719
+ 0x42,0x19,0x64,0x00,0x03,0xaa,0x32,0x21,0x90,0x8f,0x15,0x01,0x7c,0xb6,0x29,0xbe,
1720
+ 0x32,0x60,0x03,0x35,0x28,0x03,0x0a,0x42,0x19,0x64,0x20,0x03,0xab,0x33,0x21,0x90,
1721
+ 0xcf,0x36,0xc5,0x18,0xa4,0x01,0x1c,0xb8,0x81,0x18,0x50,0x10,0xca,0x20,0x03,0x1a,
1722
+ 0x68,0x60,0x60,0x42,0x20,0x1f,0x0b,0x0a,0xf8,0x6c,0x53,0xa0,0x81,0x1b,0xd4,0xc1,
1723
+ 0x1c,0x98,0x01,0x05,0xa1,0xd8,0x10,0xc0,0x67,0xb6,0x21,0x0c,0x02,0x60,0xb6,0x21,
1724
+ 0x70,0x83,0x60,0xb6,0x21,0x78,0x84,0xd9,0x86,0xe0,0x0d,0x86,0x0c,0x02,0x62,0x00,
1725
+ 0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x5b,0x8a,0x20,0x78,0x85,0x03,0x16,0xb6,0x14,
1726
+ 0x45,0xf0,0x0a,0x07,0x2c,0x6c,0x29,0x94,0xe0,0x15,0x0e,0x58,0xd8,0x52,0x3c,0xc1,
1727
+ 0x2b,0x1c,0xb0,0xb0,0xa5,0xa0,0x82,0x57,0x38,0x60,0x61,0x4b,0x81,0x05,0xaf,0x70,
1728
+ 0xc0,0xc2,0x96,0xa2,0x0b,0x5e,0xe1,0x80,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x71,
1729
+ 0x20,0x00,0x00,0x07,0x00,0x00,0x00,0x52,0x0e,0x10,0x22,0x64,0x82,0xa4,0x1c,0x20,
1730
+ 0x44,0xc8,0xe4,0x48,0x39,0x40,0x88,0x90,0xa1,0x02,0x48,0x17,0x14,0x0c,0x80,0x34,
1731
+ 0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1732
+ 0x00,0x00,0x00,
1733
+ };
1734
+ static const uint8_t _sgl_shd_fs_bytecode_metal_ios[3223] = {
1735
+ 0x4d,0x54,0x4c,0x42,0x01,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1736
+ 0x97,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1737
+ 0x7b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1738
+ 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1739
+ 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1740
+ 0xb0,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x7b,0x00,0x00,0x00,
1741
+ 0x4e,0x41,0x4d,0x45,0x06,0x00,0x6d,0x61,0x69,0x6e,0x30,0x00,0x54,0x59,0x50,0x45,
1742
+ 0x01,0x00,0x01,0x48,0x41,0x53,0x48,0x20,0x00,0x00,0x9a,0x30,0xb9,0xdb,0xa0,0xb2,
1743
+ 0x05,0x9e,0xbc,0xfb,0x10,0xd2,0xb9,0x27,0xd1,0x30,0x54,0xda,0x55,0xfd,0x00,0xad,
1744
+ 0x60,0xe0,0x4f,0xba,0x21,0x48,0x67,0x6f,0x4a,0x4d,0x44,0x53,0x5a,0x08,0x00,0xb0,
1745
+ 0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x4f,0x46,0x46,0x54,0x18,0x00,0x00,0x00,0x00,
1746
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1747
+ 0x00,0x00,0x00,0x00,0x00,0x56,0x45,0x52,0x53,0x08,0x00,0x02,0x00,0x00,0x00,0x02,
1748
+ 0x00,0x00,0x00,0x45,0x4e,0x44,0x54,0x04,0x00,0x00,0x00,0x45,0x4e,0x44,0x54,0x04,
1749
+ 0x00,0x00,0x00,0x45,0x4e,0x44,0x54,0xde,0xc0,0x17,0x0b,0x00,0x00,0x00,0x00,0x14,
1750
+ 0x00,0x00,0x00,0x94,0x0b,0x00,0x00,0xff,0xff,0xff,0xff,0x42,0x43,0xc0,0xde,0x35,
1751
+ 0x14,0x00,0x00,0x03,0x00,0x00,0x00,0x62,0x0c,0x30,0x24,0x80,0x10,0x05,0xc8,0x14,
1752
+ 0x00,0x00,0x00,0x21,0x0c,0x00,0x00,0xdd,0x02,0x00,0x00,0x0b,0x82,0x20,0x00,0x02,
1753
+ 0x00,0x00,0x00,0x13,0x00,0x00,0x00,0x07,0x81,0x23,0x91,0x41,0xc8,0x04,0x49,0x06,
1754
+ 0x10,0x32,0x39,0x92,0x01,0x84,0x0c,0x25,0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,0x80,
1755
+ 0x14,0x45,0x02,0x42,0x92,0x0b,0x42,0xa4,0x10,0x32,0x14,0x38,0x08,0x18,0x4b,0x0a,
1756
+ 0x32,0x52,0x88,0x48,0x90,0x14,0x20,0x43,0x46,0x88,0xa5,0x00,0x19,0x32,0x42,0xe4,
1757
+ 0x48,0x0e,0x90,0x91,0x22,0xc4,0x50,0x41,0x51,0x81,0x8c,0xe1,0x83,0xe5,0x8a,0x04,
1758
+ 0x29,0x46,0x06,0x51,0x18,0x00,0x00,0x76,0x00,0x00,0x00,0x1b,0xc6,0x24,0xf8,0xff,
1759
+ 0xff,0xff,0xff,0x01,0x68,0x03,0x60,0x0d,0x00,0x09,0xa8,0x88,0x70,0x80,0x07,0x78,
1760
+ 0x90,0x87,0x77,0xc0,0x87,0x36,0x30,0x87,0x7a,0x70,0x87,0x71,0x68,0x03,0x73,0x80,
1761
+ 0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1,0x1c,0x00,
1762
+ 0xa2,0x1d,0xd2,0xc1,0x1d,0xda,0x80,0x1d,0xca,0xe1,0x1c,0xc2,0x81,0x1d,0xda,0xc0,
1763
+ 0x1e,0xca,0x61,0x1c,0xe8,0xe1,0x1d,0xe4,0xa1,0x0d,0xee,0x21,0x1d,0xc8,0x81,0x1e,
1764
+ 0xd0,0x01,0x88,0x03,0x39,0xc0,0x03,0x60,0x70,0x87,0x77,0x68,0x03,0x71,0xa8,0x87,
1765
+ 0x74,0x60,0x07,0x7a,0x48,0x07,0x77,0x98,0x07,0x80,0x70,0x87,0x77,0x68,0x03,0x73,
1766
+ 0x90,0x87,0x70,0x68,0x87,0x72,0x68,0x03,0x78,0x78,0x87,0x74,0x70,0x07,0x7a,0x28,
1767
+ 0x07,0x79,0x68,0x83,0x72,0x60,0x87,0x74,0x68,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,
1768
+ 0x01,0x20,0xdc,0xe1,0x1d,0xda,0xc0,0x1c,0xe4,0x21,0x1c,0xda,0xa1,0x1c,0xda,0x00,
1769
+ 0x1e,0xde,0x21,0x1d,0xdc,0x81,0x1e,0xca,0x41,0x1e,0xda,0xa0,0x1c,0xd8,0x21,0x1d,
1770
+ 0xda,0xa1,0x0d,0xdc,0xe1,0x1d,0xdc,0xa1,0x0d,0xd8,0xa1,0x1c,0xc2,0xc1,0x1c,0x00,
1771
+ 0x7a,0x90,0x87,0x7a,0x28,0x07,0x80,0x70,0x87,0x77,0x68,0x83,0x74,0x70,0x07,0x73,
1772
+ 0x98,0x87,0x36,0x30,0x07,0x78,0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,
1773
+ 0xe4,0xa1,0x1e,0xca,0x01,0x20,0xdc,0xe1,0x1d,0xda,0xc0,0x1d,0xc2,0xc1,0x1d,0xe6,
1774
+ 0xa1,0x0d,0xcc,0x01,0x1e,0xda,0xa0,0x1d,0xc2,0x81,0x1e,0xd0,0x01,0xa0,0x07,0x79,
1775
+ 0xa8,0x87,0x72,0x00,0x08,0x77,0x78,0x87,0x36,0x98,0x87,0x74,0x38,0x07,0x77,0x28,
1776
+ 0x07,0x72,0x68,0x03,0x7d,0x28,0x07,0x79,0x78,0x87,0x79,0x68,0x03,0x73,0x80,0x87,
1777
+ 0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1,0x1c,0x00,0xc2,
1778
+ 0x1d,0xde,0xa1,0x0d,0xe8,0x41,0x1e,0xc2,0x01,0x1e,0xe0,0x21,0x1d,0xdc,0xe1,0x1c,
1779
+ 0xda,0xa0,0x1d,0xc2,0x81,0x1e,0xd0,0x01,0xa0,0x07,0x79,0xa8,0x87,0x72,0x00,0x88,
1780
+ 0x79,0xa0,0x87,0x70,0x18,0x87,0x75,0x68,0x03,0x78,0x90,0x87,0x77,0xa0,0x87,0x72,
1781
+ 0x18,0x07,0x7a,0x78,0x07,0x79,0x68,0x03,0x71,0xa8,0x07,0x73,0x30,0x87,0x72,0x90,
1782
+ 0x87,0x36,0x98,0x87,0x74,0xd0,0x87,0x72,0x00,0xf0,0x00,0x20,0xea,0xc1,0x1d,0xe6,
1783
+ 0x21,0x1c,0xcc,0xa1,0x1c,0xda,0xc0,0x1c,0xe0,0xa1,0x0d,0xda,0x21,0x1c,0xe8,0x01,
1784
+ 0x1d,0x00,0x7a,0x90,0x87,0x7a,0x28,0x07,0x60,0x83,0x21,0x0c,0xc0,0x02,0x54,0x1b,
1785
+ 0x8c,0x81,0x00,0x16,0xa0,0xda,0xa0,0x10,0xff,0xff,0xff,0xff,0x3f,0x00,0x6d,0x00,
1786
+ 0xac,0x01,0x20,0x01,0xd5,0x06,0xa3,0x08,0x80,0x05,0xa8,0x36,0x18,0x86,0x00,0x2c,
1787
+ 0x40,0xb5,0x41,0x39,0xfe,0xff,0xff,0xff,0x7f,0x00,0xda,0x00,0x58,0x03,0x40,0x02,
1788
+ 0x2a,0x00,0x00,0x49,0x18,0x00,0x00,0x04,0x00,0x00,0x00,0x13,0x86,0x40,0x18,0x26,
1789
+ 0x0c,0x44,0x61,0x4c,0x18,0x8e,0xc2,0x00,0x00,0x00,0x00,0x89,0x20,0x00,0x00,0x1d,
1790
+ 0x00,0x00,0x00,0x32,0x22,0x48,0x09,0x20,0x64,0x85,0x04,0x93,0x22,0xa4,0x84,0x04,
1791
+ 0x93,0x22,0xe3,0x84,0xa1,0x90,0x14,0x12,0x4c,0x8a,0x8c,0x0b,0x84,0xa4,0x4c,0x10,
1792
+ 0x48,0x33,0x00,0xc3,0x08,0x04,0x60,0x83,0x70,0x94,0x34,0x45,0x94,0x30,0xf9,0xff,
1793
+ 0x44,0x5c,0x13,0x15,0x11,0xbf,0x3d,0xfc,0xd3,0x18,0x01,0x30,0x88,0x30,0x04,0x17,
1794
+ 0x49,0x53,0x44,0x09,0x93,0xff,0x4b,0x00,0xf3,0x2c,0x44,0xf4,0x4f,0x63,0x04,0xc0,
1795
+ 0x20,0x42,0x21,0x94,0x42,0x84,0x40,0x0c,0x9d,0x61,0x04,0x01,0x98,0x23,0x08,0xe6,
1796
+ 0x08,0xc0,0x60,0x18,0x41,0x58,0x4a,0x12,0x88,0x49,0x8a,0x29,0xb0,0xa8,0x0d,0x04,
1797
+ 0xa4,0xc0,0x1a,0x01,0x00,0x00,0x00,0x13,0xaa,0x70,0x48,0x07,0x79,0xb0,0x03,0x3a,
1798
+ 0x68,0x83,0x70,0x80,0x07,0x78,0x60,0x87,0x72,0x68,0x83,0x74,0x78,0x87,0x79,0x88,
1799
+ 0x83,0x38,0x70,0x03,0x38,0x70,0x03,0x38,0xd8,0x70,0x1b,0xe5,0xd0,0x06,0xf0,0xa0,
1800
+ 0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x90,0x0e,
1801
+ 0x71,0xa0,0x07,0x78,0xa0,0x07,0x78,0xd0,0x06,0xe9,0x80,0x07,0x7a,0x80,0x07,0x7a,
1802
+ 0x80,0x07,0x6d,0x90,0x0e,0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,
1803
+ 0x07,0x6d,0x90,0x0e,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,
1804
+ 0x6d,0x90,0x0e,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,
1805
+ 0x60,0x0e,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x60,
1806
+ 0x0e,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,
1807
+ 0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x6d,0x60,0x0f,0x72,
1808
+ 0x40,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x60,0x0f,0x73,0x20,
1809
+ 0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x60,0x0f,0x74,0x80,0x07,
1810
+ 0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,0x76,0x40,0x07,0x7a,
1811
+ 0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,0x79,0x60,0x07,0x7a,0x10,
1812
+ 0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x6d,0x60,0x0f,0x71,0x20,0x07,
1813
+ 0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xd0,0x06,0xf6,
1814
+ 0x10,0x07,0x79,0x20,0x07,0x7a,0x20,0x07,0x75,0x60,0x07,0x7a,0x20,0x07,0x75,0x60,
1815
+ 0x07,0x6d,0x60,0x0f,0x72,0x50,0x07,0x76,0xa0,0x07,0x72,0x50,0x07,0x76,0xa0,0x07,
1816
+ 0x72,0x50,0x07,0x76,0xd0,0x06,0xf6,0x50,0x07,0x71,0x20,0x07,0x7a,0x50,0x07,0x71,
1817
+ 0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07,0x6d,0x60,0x0f,0x71,0x00,0x07,0x72,0x40,
1818
+ 0x07,0x7a,0x10,0x07,0x70,0x20,0x07,0x74,0xa0,0x07,0x71,0x00,0x07,0x72,0x40,0x07,
1819
+ 0x6d,0xe0,0x0e,0x78,0xa0,0x07,0x71,0x60,0x07,0x7a,0x30,0x07,0x72,0x30,0xe4,0x39,
1820
+ 0x00,0x00,0x08,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x60,0xc8,0xd3,0x00,0x01,0x20,
1821
+ 0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x80,0x46,0x08,0x43,0x16,0x0c,0x80,0x34,0xb4,
1822
+ 0xc4,0x06,0x81,0xa2,0xd5,0x02,0x00,0x00,0x59,0x20,0x00,0x08,0x00,0x00,0x00,0x32,
1823
+ 0x1e,0x98,0x10,0x19,0x11,0x4c,0x90,0x8c,0x09,0x26,0x47,0xc6,0x04,0x43,0x5a,0x45,
1824
+ 0x50,0x02,0x85,0x30,0x02,0x50,0x06,0x04,0xc7,0x12,0x34,0x02,0x00,0x00,0x00,0xb1,
1825
+ 0x18,0x00,0x00,0xa5,0x00,0x00,0x00,0x33,0x08,0x80,0x1c,0xc4,0xe1,0x1c,0x66,0x14,
1826
+ 0x01,0x3d,0x88,0x43,0x38,0x84,0xc3,0x8c,0x42,0x80,0x07,0x79,0x78,0x07,0x73,0x98,
1827
+ 0x71,0x0c,0xe6,0x00,0x0f,0xed,0x10,0x0e,0xf4,0x80,0x0e,0x33,0x0c,0x42,0x1e,0xc2,
1828
+ 0xc1,0x1d,0xce,0xa1,0x1c,0x66,0x30,0x05,0x3d,0x88,0x43,0x38,0x84,0x83,0x1b,0xcc,
1829
+ 0x03,0x3d,0xc8,0x43,0x3d,0x8c,0x03,0x3d,0xcc,0x78,0x8c,0x74,0x70,0x07,0x7b,0x08,
1830
+ 0x07,0x79,0x48,0x87,0x70,0x70,0x07,0x7a,0x70,0x03,0x76,0x78,0x87,0x70,0x20,0x87,
1831
+ 0x19,0xcc,0x11,0x0e,0xec,0x90,0x0e,0xe1,0x30,0x0f,0x6e,0x30,0x0f,0xe3,0xf0,0x0e,
1832
+ 0xf0,0x50,0x0e,0x33,0x10,0xc4,0x1d,0xde,0x21,0x1c,0xd8,0x21,0x1d,0xc2,0x61,0x1e,
1833
+ 0x66,0x30,0x89,0x3b,0xbc,0x83,0x3b,0xd0,0x43,0x39,0xb4,0x03,0x3c,0xbc,0x83,0x3c,
1834
+ 0x84,0x03,0x3b,0xcc,0xf0,0x14,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x68,0x87,0x72,
1835
+ 0x68,0x07,0x37,0x80,0x87,0x70,0x90,0x87,0x70,0x60,0x07,0x76,0x28,0x07,0x76,0xf8,
1836
+ 0x05,0x76,0x78,0x87,0x77,0x80,0x87,0x5f,0x08,0x87,0x71,0x18,0x87,0x72,0x98,0x87,
1837
+ 0x79,0x98,0x81,0x2c,0xee,0xf0,0x0e,0xee,0xe0,0x0e,0xf5,0xc0,0x0e,0xec,0x30,0x03,
1838
+ 0x62,0xc8,0xa1,0x1c,0xe4,0xa1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x1c,0xdc,0x61,0x1c,
1839
+ 0xca,0x21,0x1c,0xc4,0x81,0x1d,0xca,0x61,0x06,0xd6,0x90,0x43,0x39,0xc8,0x43,0x39,
1840
+ 0x98,0x43,0x39,0xc8,0x43,0x39,0xb8,0xc3,0x38,0x94,0x43,0x38,0x88,0x03,0x3b,0x94,
1841
+ 0xc3,0x2f,0xbc,0x83,0x3c,0xfc,0x82,0x3b,0xd4,0x03,0x3b,0xb0,0xc3,0x0c,0xc7,0x69,
1842
+ 0x87,0x70,0x58,0x87,0x72,0x70,0x83,0x74,0x68,0x07,0x78,0x60,0x87,0x74,0x18,0x87,
1843
+ 0x74,0xa0,0x87,0x19,0xce,0x53,0x0f,0xee,0x00,0x0f,0xf2,0x50,0x0e,0xe4,0x90,0x0e,
1844
+ 0xe3,0x40,0x0f,0xe1,0x20,0x0e,0xec,0x50,0x0e,0x33,0x20,0x28,0x1d,0xdc,0xc1,0x1e,
1845
+ 0xc2,0x41,0x1e,0xd2,0x21,0x1c,0xdc,0x81,0x1e,0xdc,0xe0,0x1c,0xe4,0xe1,0x1d,0xea,
1846
+ 0x01,0x1e,0x66,0x18,0x51,0x38,0xb0,0x43,0x3a,0x9c,0x83,0x3b,0xcc,0x50,0x24,0x76,
1847
+ 0x60,0x07,0x7b,0x68,0x07,0x37,0x60,0x87,0x77,0x78,0x07,0x78,0x98,0x51,0x4c,0xf4,
1848
+ 0x90,0x0f,0xf0,0x50,0x0e,0x33,0x1e,0x6a,0x1e,0xca,0x61,0x1c,0xe8,0x21,0x1d,0xde,
1849
+ 0xc1,0x1d,0x7e,0x01,0x1e,0xe4,0xa1,0x1c,0xcc,0x21,0x1d,0xf0,0x61,0x06,0x54,0x85,
1850
+ 0x83,0x38,0xcc,0xc3,0x3b,0xb0,0x43,0x3d,0xd0,0x43,0x39,0xfc,0xc2,0x3c,0xe4,0x43,
1851
+ 0x3b,0x88,0xc3,0x3b,0xb0,0xc3,0x8c,0xc5,0x0a,0x87,0x79,0x98,0x87,0x77,0x18,0x87,
1852
+ 0x74,0x08,0x07,0x7a,0x28,0x07,0x72,0x98,0x81,0x5c,0xe3,0x10,0x0e,0xec,0xc0,0x0e,
1853
+ 0xe5,0x50,0x0e,0xf3,0x30,0x23,0xc1,0xd2,0x41,0x1e,0xe4,0xe1,0x17,0xd8,0xe1,0x1d,
1854
+ 0xde,0x01,0x1e,0x66,0x48,0x19,0x3b,0xb0,0x83,0x3d,0xb4,0x83,0x1b,0x84,0xc3,0x38,
1855
+ 0x8c,0x43,0x39,0xcc,0xc3,0x3c,0xb8,0xc1,0x39,0xc8,0xc3,0x3b,0xd4,0x03,0x3c,0xcc,
1856
+ 0x48,0xb4,0x71,0x08,0x07,0x76,0x60,0x07,0x71,0x08,0x87,0x71,0x58,0x87,0x19,0xdb,
1857
+ 0xc6,0x0e,0xec,0x60,0x0f,0xed,0xe0,0x06,0xf0,0x20,0x0f,0xe5,0x30,0x0f,0xe5,0x20,
1858
+ 0x0f,0xf6,0x50,0x0e,0x6e,0x10,0x0e,0xe3,0x30,0x0e,0xe5,0x30,0x0f,0xf3,0xe0,0x06,
1859
+ 0xe9,0xe0,0x0e,0xe4,0x50,0x0e,0xf8,0x30,0x23,0xe2,0xec,0x61,0x1c,0xc2,0x81,0x1d,
1860
+ 0xd8,0xe1,0x17,0xec,0x21,0x1d,0xe6,0x21,0x1d,0xc4,0x21,0x1d,0xd8,0x21,0x1d,0xe8,
1861
+ 0x21,0x1f,0x66,0x20,0x9d,0x3b,0xbc,0x43,0x3d,0xb8,0x03,0x39,0x94,0x83,0x39,0xcc,
1862
+ 0x58,0xbc,0x70,0x70,0x07,0x77,0x78,0x07,0x7a,0x08,0x07,0x7a,0x48,0x87,0x77,0x70,
1863
+ 0x87,0x19,0xce,0x87,0x0e,0xe5,0x10,0x0e,0xf0,0x10,0x0e,0xec,0xc0,0x0e,0xef,0x30,
1864
+ 0x0e,0xf3,0x90,0x0e,0xf4,0x50,0x0e,0x33,0x28,0x30,0x08,0x87,0x74,0x90,0x07,0x37,
1865
+ 0x30,0x87,0x7a,0x70,0x87,0x71,0xa0,0x87,0x74,0x78,0x07,0x77,0xf8,0x85,0x73,0x90,
1866
+ 0x87,0x77,0xa8,0x07,0x78,0x98,0x07,0x00,0x00,0x00,0x00,0x79,0x18,0x00,0x00,0xa7,
1867
+ 0x00,0x00,0x00,0x22,0x47,0xc8,0x90,0x51,0x6e,0xd8,0xce,0x00,0x00,0x00,0x00,0x8b,
1868
+ 0x12,0x07,0xc5,0xc6,0x91,0x41,0x14,0x19,0x8c,0x22,0x2d,0xca,0x23,0x2c,0xc5,0x22,
1869
+ 0x29,0xd8,0xb0,0x1c,0x03,0x00,0x00,0x53,0x44,0x4b,0x20,0x56,0x65,0x72,0x73,0x69,
1870
+ 0x6f,0x6e,0x77,0x63,0x68,0x61,0x72,0x5f,0x73,0x69,0x7a,0x65,0x41,0x70,0x70,0x6c,
1871
+ 0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,
1872
+ 0x33,0x32,0x30,0x32,0x33,0x2e,0x38,0x38,0x33,0x20,0x28,0x6d,0x65,0x74,0x61,0x6c,
1873
+ 0x66,0x65,0x2d,0x33,0x32,0x30,0x32,0x33,0x2e,0x38,0x38,0x33,0x29,0x4d,0x65,0x74,
1874
+ 0x61,0x6c,0x61,0x69,0x72,0x2e,0x63,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x2e,0x64,0x65,
1875
+ 0x6e,0x6f,0x72,0x6d,0x73,0x5f,0x64,0x69,0x73,0x61,0x62,0x6c,0x65,0x61,0x69,0x72,
1876
+ 0x2e,0x63,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x2e,0x66,0x61,0x73,0x74,0x5f,0x6d,0x61,
1877
+ 0x74,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x61,0x69,0x72,0x2e,0x63,0x6f,0x6d,
1878
+ 0x70,0x69,0x6c,0x65,0x2e,0x66,0x72,0x61,0x6d,0x65,0x62,0x75,0x66,0x66,0x65,0x72,
1879
+ 0x5f,0x66,0x65,0x74,0x63,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x61,0x69,0x72,
1880
+ 0x2e,0x72,0x65,0x6e,0x64,0x65,0x72,0x5f,0x74,0x61,0x72,0x67,0x65,0x74,0x61,0x69,
1881
+ 0x72,0x2e,0x61,0x72,0x67,0x5f,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0x66,
1882
+ 0x6c,0x6f,0x61,0x74,0x34,0x61,0x69,0x72,0x2e,0x61,0x72,0x67,0x5f,0x6e,0x61,0x6d,
1883
+ 0x65,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x61,0x69,0x72,0x2e,0x66,
1884
+ 0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x69,0x6e,0x70,0x75,0x74,0x75,0x73,0x65,
1885
+ 0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x61,0x69,0x72,0x2e,0x63,0x65,0x6e,0x74,
1886
+ 0x65,0x72,0x61,0x69,0x72,0x2e,0x70,0x65,0x72,0x73,0x70,0x65,0x63,0x74,0x69,0x76,
1887
+ 0x65,0x75,0x76,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x63,0x6f,
1888
+ 0x6c,0x6f,0x72,0x61,0x69,0x72,0x2e,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x61,0x69,
1889
+ 0x72,0x2e,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x6e,0x64,0x65,0x78,
1890
+ 0x61,0x69,0x72,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x74,0x65,0x78,0x74,0x75,0x72,
1891
+ 0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,
1892
+ 0x65,0x3e,0x74,0x65,0x78,0x61,0x69,0x72,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,
1893
+ 0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x73,0x6d,0x70,0x00,0x13,0x84,0x45,0x98,0x20,
1894
+ 0x40,0xc7,0x04,0x61,0x19,0x26,0x08,0x0b,0x31,0x41,0x58,0x8a,0x09,0x02,0x02,0x4c,
1895
+ 0x10,0x16,0x63,0xc3,0xc0,0x05,0xdd,0x86,0xc1,0x13,0xbe,0x0d,0xc1,0xb0,0x61,0xe0,
1896
+ 0xc0,0x00,0x0c,0x36,0x10,0x04,0x07,0x06,0x60,0xb0,0x21,0x28,0x36,0x04,0xc6,0x86,
1897
+ 0xe0,0xd8,0x70,0x20,0x60,0x00,0x06,0x89,0xb2,0x30,0x1b,0x82,0x35,0xd8,0x90,0x80,
1898
+ 0x41,0xe3,0x3c,0x50,0xa2,0x2c,0xd1,0x86,0xc4,0x6b,0xa4,0x07,0x4a,0x94,0x65,0xda,
1899
+ 0xa0,0x70,0x54,0x05,0x06,0x9e,0x95,0x5c,0x0b,0xb6,0x21,0x11,0x83,0xac,0x02,0x03,
1900
+ 0x2f,0xd1,0x96,0x6d,0x03,0xd1,0x06,0x6e,0xf0,0x06,0x70,0xb0,0x61,0x08,0x03,0x36,
1901
+ 0x88,0x03,0x8d,0x04,0x26,0xa8,0x11,0x1b,0x9b,0x5d,0x9b,0x4b,0xdb,0x1b,0x59,0x1d,
1902
+ 0x5b,0x99,0x8b,0x19,0x5b,0xd8,0xd9,0xdc,0x14,0x41,0x0c,0xc6,0xa0,0x0a,0x1b,0x9b,
1903
+ 0x5d,0x9b,0x4b,0x1a,0x59,0x99,0x1b,0xdd,0x94,0x80,0x0c,0xba,0x84,0xa5,0xc9,0xb9,
1904
+ 0xd8,0x95,0xc9,0xcd,0xa5,0xbd,0xb9,0x4d,0x09,0xca,0xa0,0x54,0x58,0x9a,0x9c,0x0b,
1905
+ 0x5b,0x98,0xdb,0x59,0x5d,0xd8,0x59,0xd9,0x97,0x5d,0x99,0xdc,0x5c,0xda,0x9b,0xdb,
1906
+ 0x94,0xc0,0x0c,0x3a,0x85,0xa5,0xc9,0xb9,0x8c,0xbd,0xb5,0xc1,0xa5,0xb1,0x95,0x7d,
1907
+ 0xbd,0xc1,0xd1,0xa5,0xbd,0xb9,0xcd,0x4d,0x19,0xce,0x00,0x0d,0xd2,0xa0,0x4c,0x58,
1908
+ 0x9a,0x9c,0x8b,0x99,0x5c,0xd8,0x59,0x5b,0x99,0x1b,0xdd,0x94,0x20,0x0e,0x00,0xa9,
1909
+ 0x18,0x00,0x00,0x25,0x00,0x00,0x00,0x0b,0x0a,0x72,0x28,0x87,0x77,0x80,0x07,0x7a,
1910
+ 0x58,0x70,0x98,0x43,0x3d,0xb8,0xc3,0x38,0xb0,0x43,0x39,0xd0,0xc3,0x82,0xe6,0x1c,
1911
+ 0xc6,0xa1,0x0d,0xe8,0x41,0x1e,0xc2,0xc1,0x1d,0xe6,0x21,0x1d,0xe8,0x21,0x1d,0xde,
1912
+ 0xc1,0x1d,0x16,0x34,0xe3,0x60,0x0e,0xe7,0x50,0x0f,0xe1,0x20,0x0f,0xe4,0x40,0x0f,
1913
+ 0xe1,0x20,0x0f,0xe7,0x50,0x0e,0xf4,0xb0,0x80,0x81,0x07,0x79,0x28,0x87,0x70,0x60,
1914
+ 0x07,0x76,0x78,0x87,0x71,0x08,0x07,0x7a,0x28,0x07,0x72,0x58,0x70,0x9c,0xc3,0x38,
1915
+ 0xb4,0x01,0x3b,0xa4,0x83,0x3d,0x94,0xc3,0x02,0x6b,0x1c,0xd8,0x21,0x1c,0xdc,0xe1,
1916
+ 0x1c,0xdc,0x20,0x1c,0xe4,0x61,0x1c,0xdc,0x20,0x1c,0xe8,0x81,0x1e,0xc2,0x61,0x1c,
1917
+ 0xd0,0xa1,0x1c,0xc8,0x61,0x1c,0xc2,0x81,0x1d,0xd8,0x61,0xc1,0x01,0x0f,0xf4,0x20,
1918
+ 0x0f,0xe1,0x50,0x0f,0xf4,0x80,0x0e,0x00,0x00,0x00,0x00,0x61,0x20,0x00,0x00,0x33,
1919
+ 0x00,0x00,0x00,0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0xa4,
1920
+ 0x6a,0x60,0x04,0x80,0xd8,0x58,0x02,0x10,0x8c,0x00,0x10,0x18,0x01,0xa0,0x30,0x03,
1921
+ 0x40,0x62,0x06,0x00,0x00,0x00,0x00,0xf1,0x30,0x00,0x00,0x1c,0x00,0x00,0x00,0x22,
1922
+ 0x47,0xc8,0x90,0x51,0x0e,0xc4,0x2a,0x00,0x00,0x00,0x00,0x17,0x86,0x01,0x00,0x61,
1923
+ 0x69,0x72,0x2d,0x61,0x6c,0x69,0x61,0x73,0x2d,0x73,0x63,0x6f,0x70,0x65,0x73,0x28,
1924
+ 0x6d,0x61,0x69,0x6e,0x30,0x29,0x61,0x69,0x72,0x2d,0x61,0x6c,0x69,0x61,0x73,0x2d,
1925
+ 0x73,0x63,0x6f,0x70,0x65,0x2d,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x73,0x61,0x69,
1926
+ 0x72,0x2d,0x61,0x6c,0x69,0x61,0x73,0x2d,0x73,0x63,0x6f,0x70,0x65,0x2d,0x74,0x65,
1927
+ 0x78,0x74,0x75,0x72,0x65,0x73,0x00,0x2b,0x04,0x3b,0x98,0x83,0x15,0xc3,0x1d,0xd8,
1928
+ 0x01,0x1d,0xac,0x18,0xf0,0xc0,0x0e,0xea,0x60,0x83,0x80,0x07,0x77,0x00,0x00,0x83,
1929
+ 0x0c,0x8b,0x50,0x8c,0x18,0x34,0x43,0x08,0x82,0xc5,0xd7,0x4c,0x4a,0x12,0x20,0xc5,
1930
+ 0x41,0x3c,0x16,0x30,0xf2,0x99,0x6d,0x20,0x02,0x20,0x83,0x80,0x18,0x00,0x00,0x02,
1931
+ 0x00,0x00,0x00,0x5b,0x86,0xe0,0xc0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x71,
1932
+ 0x20,0x00,0x00,0x0d,0x00,0x00,0x00,0x52,0x0e,0x10,0x22,0x64,0x82,0xa4,0x1c,0x20,
1933
+ 0x44,0xc8,0xe4,0x48,0x39,0x40,0x88,0x90,0xa1,0x05,0x6c,0x00,0x12,0xf9,0x12,0xc0,
1934
+ 0x3c,0x0b,0xf1,0x4f,0xc4,0x35,0x51,0x11,0xf1,0xdb,0x83,0x5f,0xe1,0xc5,0x6d,0x2b,
1935
+ 0x00,0x68,0x41,0xc1,0x00,0x48,0x43,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1936
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1937
+ };
1938
+ static const uint8_t _sgl_shd_vs_source_metal_sim[756] = {
1939
+ 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
1940
+ 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
1941
+ 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
1942
+ 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
1943
+ 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76,
1944
+ 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
1945
+ 0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x6d,0x76,0x70,0x3b,0x0a,0x20,0x20,0x20,
1946
+ 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x74,0x6d,0x3b,0x0a,0x7d,0x3b,
1947
+ 0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,
1948
+ 0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
1949
+ 0x75,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,
1950
+ 0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,
1951
+ 0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,
1952
+ 0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
1953
+ 0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,
1954
+ 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
1955
+ 0x6c,0x6f,0x61,0x74,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,
1956
+ 0x65,0x20,0x5b,0x5b,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65,0x5d,0x5d,
1957
+ 0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,
1958
+ 0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
1959
+ 0x74,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,
1960
+ 0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,
1961
+ 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,
1962
+ 0x64,0x30,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,
1963
+ 0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
1964
+ 0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,
1965
+ 0x74,0x65,0x28,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
1966
+ 0x61,0x74,0x20,0x70,0x73,0x69,0x7a,0x65,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,
1967
+ 0x62,0x75,0x74,0x65,0x28,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,
1968
+ 0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,
1969
+ 0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,
1970
+ 0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,
1971
+ 0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,
1972
+ 0x6d,0x73,0x26,0x20,0x5f,0x31,0x39,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,
1973
+ 0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,
1974
+ 0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,
1975
+ 0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,
1976
+ 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x6d,0x76,0x70,0x20,0x2a,
1977
+ 0x20,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,
1978
+ 0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,
1979
+ 0x7a,0x65,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,
1980
+ 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x75,0x76,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,
1981
+ 0x74,0x6d,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x74,
1982
+ 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,
1983
+ 0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x63,0x6f,0x6c,
1984
+ 0x6f,0x72,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,
1985
+ 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,
1986
+ 0x7d,0x0a,0x0a,0x00,
1987
+ };
1988
+ static const uint8_t _sgl_shd_fs_source_metal_sim[439] = {
1989
+ 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
1990
+ 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
1991
+ 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
1992
+ 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
1993
+ 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,
1994
+ 0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
1995
+ 0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
1996
+ 0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,
1997
+ 0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,
1998
+ 0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
1999
+ 0x75,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,
2000
+ 0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,
2001
+ 0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,
2002
+ 0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,
2003
+ 0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,
2004
+ 0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,
2005
+ 0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,
2006
+ 0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x65,
2007
+ 0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,
2008
+ 0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x73,0x6d,0x70,0x20,0x5b,0x5b,
2009
+ 0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,
2010
+ 0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,
2011
+ 0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,
2012
+ 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,
2013
+ 0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,
2014
+ 0x75,0x76,0x2e,0x78,0x79,0x29,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,
2015
+ 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,
2016
+ 0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
2017
+ };
2018
+ #elif defined(SOKOL_D3D11)
2019
+ static const uint8_t _sgl_shd_vs_bytecode_hlsl4[1032] = {
2020
+ 0x44,0x58,0x42,0x43,0x74,0x7f,0x01,0xd9,0xf4,0xd5,0xed,0x1d,0x74,0xc1,0x30,0x27,
2021
+ 0xd8,0xe9,0x9d,0x50,0x01,0x00,0x00,0x00,0x08,0x04,0x00,0x00,0x05,0x00,0x00,0x00,
2022
+ 0x34,0x00,0x00,0x00,0x14,0x01,0x00,0x00,0x90,0x01,0x00,0x00,0x00,0x02,0x00,0x00,
2023
+ 0x8c,0x03,0x00,0x00,0x52,0x44,0x45,0x46,0xd8,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2024
+ 0x48,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x04,0xfe,0xff,
2025
+ 0x10,0x81,0x00,0x00,0xaf,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2026
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2027
+ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
2028
+ 0x73,0x00,0xab,0xab,0x3c,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x60,0x00,0x00,0x00,
2029
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x00,0x00,0x00,
2030
+ 0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x98,0x00,0x00,0x00,
2031
+ 0x00,0x00,0x00,0x00,0xa8,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x40,0x00,0x00,0x00,
2032
+ 0x02,0x00,0x00,0x00,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x31,0x39,0x5f,
2033
+ 0x6d,0x76,0x70,0x00,0x02,0x00,0x03,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
2034
+ 0x00,0x00,0x00,0x00,0x5f,0x31,0x39,0x5f,0x74,0x6d,0x00,0x4d,0x69,0x63,0x72,0x6f,
2035
+ 0x73,0x6f,0x66,0x74,0x20,0x28,0x52,0x29,0x20,0x48,0x4c,0x53,0x4c,0x20,0x53,0x68,
2036
+ 0x61,0x64,0x65,0x72,0x20,0x43,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x72,0x20,0x31,0x30,
2037
+ 0x2e,0x31,0x00,0xab,0x49,0x53,0x47,0x4e,0x74,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
2038
+ 0x08,0x00,0x00,0x00,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2039
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x0f,0x00,0x00,0x68,0x00,0x00,0x00,
2040
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2041
+ 0x03,0x03,0x00,0x00,0x68,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2042
+ 0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x0f,0x0f,0x00,0x00,0x68,0x00,0x00,0x00,
2043
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
2044
+ 0x01,0x00,0x00,0x00,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x00,0xab,0xab,0xab,
2045
+ 0x4f,0x53,0x47,0x4e,0x68,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
2046
+ 0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
2047
+ 0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2048
+ 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,
2049
+ 0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
2050
+ 0x02,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,
2051
+ 0x00,0x53,0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0xab,0xab,0xab,
2052
+ 0x53,0x48,0x44,0x52,0x84,0x01,0x00,0x00,0x40,0x00,0x01,0x00,0x61,0x00,0x00,0x00,
2053
+ 0x59,0x00,0x00,0x04,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,
2054
+ 0x5f,0x00,0x00,0x03,0xf2,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x03,
2055
+ 0x32,0x10,0x10,0x00,0x01,0x00,0x00,0x00,0x5f,0x00,0x00,0x03,0xf2,0x10,0x10,0x00,
2056
+ 0x02,0x00,0x00,0x00,0x65,0x00,0x00,0x03,0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00,
2057
+ 0x65,0x00,0x00,0x03,0xf2,0x20,0x10,0x00,0x01,0x00,0x00,0x00,0x67,0x00,0x00,0x04,
2058
+ 0xf2,0x20,0x10,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x68,0x00,0x00,0x02,
2059
+ 0x01,0x00,0x00,0x00,0x38,0x00,0x00,0x08,0xf2,0x00,0x10,0x00,0x00,0x00,0x00,0x00,
2060
+ 0x56,0x15,0x10,0x00,0x01,0x00,0x00,0x00,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,
2061
+ 0x05,0x00,0x00,0x00,0x32,0x00,0x00,0x0a,0xf2,0x00,0x10,0x00,0x00,0x00,0x00,0x00,
2062
+ 0x06,0x10,0x10,0x00,0x01,0x00,0x00,0x00,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,
2063
+ 0x04,0x00,0x00,0x00,0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,
2064
+ 0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00,
2065
+ 0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x36,0x00,0x00,0x05,
2066
+ 0xf2,0x20,0x10,0x00,0x01,0x00,0x00,0x00,0x46,0x1e,0x10,0x00,0x02,0x00,0x00,0x00,
2067
+ 0x38,0x00,0x00,0x08,0xf2,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x56,0x15,0x10,0x00,
2068
+ 0x00,0x00,0x00,0x00,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2069
+ 0x32,0x00,0x00,0x0a,0xf2,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x06,0x10,0x10,0x00,
2070
+ 0x00,0x00,0x00,0x00,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2071
+ 0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x00,0x0a,0xf2,0x00,0x10,0x00,
2072
+ 0x00,0x00,0x00,0x00,0xa6,0x1a,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x8e,0x20,0x00,
2073
+ 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00,
2074
+ 0x32,0x00,0x00,0x0a,0xf2,0x20,0x10,0x00,0x02,0x00,0x00,0x00,0xf6,0x1f,0x10,0x00,
2075
+ 0x00,0x00,0x00,0x00,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
2076
+ 0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x01,0x53,0x54,0x41,0x54,
2077
+ 0x74,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2078
+ 0x06,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2079
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2080
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2081
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2082
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2083
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2084
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2085
+ };
2086
+ static const uint8_t _sgl_shd_fs_bytecode_hlsl4[608] = {
2087
+ 0x44,0x58,0x42,0x43,0xc8,0x9b,0x66,0x64,0x80,0x2f,0xbe,0x14,0xd9,0x88,0xa0,0x97,
2088
+ 0x64,0x14,0x66,0xff,0x01,0x00,0x00,0x00,0x60,0x02,0x00,0x00,0x05,0x00,0x00,0x00,
2089
+ 0x34,0x00,0x00,0x00,0xc8,0x00,0x00,0x00,0x14,0x01,0x00,0x00,0x48,0x01,0x00,0x00,
2090
+ 0xe4,0x01,0x00,0x00,0x52,0x44,0x45,0x46,0x8c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2091
+ 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x04,0xff,0xff,
2092
+ 0x10,0x81,0x00,0x00,0x64,0x00,0x00,0x00,0x5c,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
2093
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2094
+ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
2095
+ 0x05,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
2096
+ 0x01,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x73,0x6d,0x70,0x00,0x74,0x65,0x78,0x00,
2097
+ 0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,0x74,0x20,0x28,0x52,0x29,0x20,0x48,0x4c,
2098
+ 0x53,0x4c,0x20,0x53,0x68,0x61,0x64,0x65,0x72,0x20,0x43,0x6f,0x6d,0x70,0x69,0x6c,
2099
+ 0x65,0x72,0x20,0x31,0x30,0x2e,0x31,0x00,0x49,0x53,0x47,0x4e,0x44,0x00,0x00,0x00,
2100
+ 0x02,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2101
+ 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x03,0x00,0x00,
2102
+ 0x38,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
2103
+ 0x01,0x00,0x00,0x00,0x0f,0x0f,0x00,0x00,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,
2104
+ 0x00,0xab,0xab,0xab,0x4f,0x53,0x47,0x4e,0x2c,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2105
+ 0x08,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2106
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x53,0x56,0x5f,0x54,
2107
+ 0x61,0x72,0x67,0x65,0x74,0x00,0xab,0xab,0x53,0x48,0x44,0x52,0x94,0x00,0x00,0x00,
2108
+ 0x40,0x00,0x00,0x00,0x25,0x00,0x00,0x00,0x5a,0x00,0x00,0x03,0x00,0x60,0x10,0x00,
2109
+ 0x00,0x00,0x00,0x00,0x58,0x18,0x00,0x04,0x00,0x70,0x10,0x00,0x00,0x00,0x00,0x00,
2110
+ 0x55,0x55,0x00,0x00,0x62,0x10,0x00,0x03,0x32,0x10,0x10,0x00,0x00,0x00,0x00,0x00,
2111
+ 0x62,0x10,0x00,0x03,0xf2,0x10,0x10,0x00,0x01,0x00,0x00,0x00,0x65,0x00,0x00,0x03,
2112
+ 0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x68,0x00,0x00,0x02,0x01,0x00,0x00,0x00,
2113
+ 0x45,0x00,0x00,0x09,0xf2,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x10,0x10,0x00,
2114
+ 0x00,0x00,0x00,0x00,0x46,0x7e,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x10,0x00,
2115
+ 0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x07,0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00,
2116
+ 0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x1e,0x10,0x00,0x01,0x00,0x00,0x00,
2117
+ 0x3e,0x00,0x00,0x01,0x53,0x54,0x41,0x54,0x74,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
2118
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2119
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2120
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2121
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2122
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2123
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2124
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2125
+ };
2126
+ #elif defined(SOKOL_WGPU)
2127
+ static const uint8_t _sgl_shd_vs_source_wgsl[1027] = {
2128
+ 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
2129
+ 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
2130
+ 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
2131
+ 0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a,
2132
+ 0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20,
2133
+ 0x20,0x6d,0x76,0x70,0x20,0x3a,0x20,0x6d,0x61,0x74,0x34,0x78,0x34,0x66,0x2c,0x0a,
2134
+ 0x20,0x20,0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x36,0x34,0x29,
2135
+ 0x20,0x2a,0x2f,0x0a,0x20,0x20,0x74,0x6d,0x20,0x3a,0x20,0x6d,0x61,0x74,0x34,0x78,
2136
+ 0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,
2137
+ 0x30,0x29,0x20,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29,0x20,0x76,0x61,0x72,
2138
+ 0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x31,0x39,0x20,0x3a,
2139
+ 0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x0a,0x76,0x61,0x72,
2140
+ 0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,
2141
+ 0x6f,0x6e,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,
2142
+ 0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,
2143
+ 0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
2144
+ 0x76,0x61,0x74,0x65,0x3e,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,
2145
+ 0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,
2146
+ 0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,
2147
+ 0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,
2148
+ 0x74,0x65,0x3e,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,
2149
+ 0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,
2150
+ 0x3e,0x20,0x70,0x73,0x69,0x7a,0x65,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a,0x0a,
2151
+ 0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x67,0x6c,0x5f,
2152
+ 0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,
2153
+ 0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,
2154
+ 0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,
2155
+ 0x20,0x28,0x78,0x5f,0x31,0x39,0x2e,0x6d,0x76,0x70,0x20,0x2a,0x20,0x70,0x6f,0x73,
2156
+ 0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,
2157
+ 0x20,0x28,0x78,0x5f,0x31,0x39,0x2e,0x74,0x6d,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,
2158
+ 0x66,0x28,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x2e,0x78,0x2c,0x20,0x74,
2159
+ 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x66,
2160
+ 0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,
2161
+ 0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x72,0x65,
2162
+ 0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
2163
+ 0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x62,0x75,
2164
+ 0x69,0x6c,0x74,0x69,0x6e,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x0a,
2165
+ 0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,
2166
+ 0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,
2167
+ 0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x75,0x76,0x5f,0x31,0x20,0x3a,0x20,0x76,
2168
+ 0x65,0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,
2169
+ 0x6e,0x28,0x31,0x29,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,
2170
+ 0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x76,0x65,0x72,0x74,
2171
+ 0x65,0x78,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,
2172
+ 0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
2173
+ 0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,
2174
+ 0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x74,
2175
+ 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,
2176
+ 0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,
2177
+ 0x6e,0x28,0x32,0x29,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x5f,0x70,0x61,0x72,0x61,
2178
+ 0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,
2179
+ 0x74,0x69,0x6f,0x6e,0x28,0x33,0x29,0x20,0x70,0x73,0x69,0x7a,0x65,0x5f,0x70,0x61,
2180
+ 0x72,0x61,0x6d,0x20,0x3a,0x20,0x66,0x33,0x32,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,
2181
+ 0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x70,0x6f,0x73,0x69,0x74,
2182
+ 0x69,0x6f,0x6e,0x5f,0x31,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
2183
+ 0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x74,0x65,0x78,0x63,
2184
+ 0x6f,0x6f,0x72,0x64,0x30,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,
2185
+ 0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,
2186
+ 0x30,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,
2187
+ 0x3b,0x0a,0x20,0x20,0x70,0x73,0x69,0x7a,0x65,0x20,0x3d,0x20,0x70,0x73,0x69,0x7a,
2188
+ 0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,
2189
+ 0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,
2190
+ 0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,
2191
+ 0x6f,0x6e,0x2c,0x20,0x75,0x76,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x29,0x3b,0x0a,
2192
+ 0x7d,0x0a,0x00,
2193
+ };
2194
+ static const uint8_t _sgl_shd_fs_source_wgsl[588] = {
2195
+ 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
2196
+ 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
2197
+ 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
2198
+ 0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
2199
+ 0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x40,0x62,0x69,0x6e,0x64,
2200
+ 0x69,0x6e,0x67,0x28,0x30,0x29,0x20,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x31,0x29,
2201
+ 0x20,0x76,0x61,0x72,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x74,0x65,0x78,0x74,0x75,
2202
+ 0x72,0x65,0x5f,0x32,0x64,0x3c,0x66,0x33,0x32,0x3e,0x3b,0x0a,0x0a,0x40,0x62,0x69,
2203
+ 0x6e,0x64,0x69,0x6e,0x67,0x28,0x33,0x32,0x29,0x20,0x40,0x67,0x72,0x6f,0x75,0x70,
2204
+ 0x28,0x31,0x29,0x20,0x76,0x61,0x72,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x73,0x61,
2205
+ 0x6d,0x70,0x6c,0x65,0x72,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,
2206
+ 0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,
2207
+ 0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x63,
2208
+ 0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,
2209
+ 0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x6c,
2210
+ 0x65,0x74,0x20,0x78,0x5f,0x32,0x33,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,
2211
+ 0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x35,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,
2212
+ 0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x74,0x65,0x78,0x2c,0x20,0x73,0x6d,
2213
+ 0x70,0x2c,0x20,0x78,0x5f,0x32,0x33,0x2e,0x78,0x79,0x29,0x3b,0x0a,0x20,0x20,0x66,
2214
+ 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x28,0x78,0x5f,0x32,
2215
+ 0x35,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,
2216
+ 0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
2217
+ 0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,
2218
+ 0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,
2219
+ 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,
2220
+ 0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x66,
2221
+ 0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,
2222
+ 0x28,0x30,0x29,0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,
2223
+ 0x65,0x63,0x34,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,
2224
+ 0x31,0x29,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,
2225
+ 0x20,0x76,0x65,0x63,0x34,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,
2226
+ 0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x75,0x76,0x5f,
2227
+ 0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,
2228
+ 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,
2229
+ 0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,
2230
+ 0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x66,0x72,0x61,0x67,
2231
+ 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x00,
2232
+ };
2233
+ #elif defined(SOKOL_VULKAN)
2234
+ static const uint8_t _sgl_shd_vs_bytecode_spirv_vk[1668] = {
2235
+ 0x03,0x02,0x23,0x07,0x00,0x04,0x01,0x00,0x0b,0x00,0x08,0x00,0x33,0x00,0x00,0x00,
2236
+ 0x00,0x00,0x00,0x00,0x11,0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x0b,0x00,0x06,0x00,
2237
+ 0x01,0x00,0x00,0x00,0x47,0x4c,0x53,0x4c,0x2e,0x73,0x74,0x64,0x2e,0x34,0x35,0x30,
2238
+ 0x00,0x00,0x00,0x00,0x0e,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2239
+ 0x0f,0x00,0x0d,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,
2240
+ 0x00,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x13,0x00,0x00,0x00,0x18,0x00,0x00,0x00,
2241
+ 0x1f,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
2242
+ 0x31,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x02,0x00,0x00,0x00,0xcc,0x01,0x00,0x00,
2243
+ 0x05,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,0x00,0x00,0x00,0x00,
2244
+ 0x05,0x00,0x06,0x00,0x0b,0x00,0x00,0x00,0x67,0x6c,0x5f,0x50,0x65,0x72,0x56,0x65,
2245
+ 0x72,0x74,0x65,0x78,0x00,0x00,0x00,0x00,0x06,0x00,0x06,0x00,0x0b,0x00,0x00,0x00,
2246
+ 0x00,0x00,0x00,0x00,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,
2247
+ 0x06,0x00,0x07,0x00,0x0b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x67,0x6c,0x5f,0x50,
2248
+ 0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x00,0x00,0x00,0x00,0x06,0x00,0x07,0x00,
2249
+ 0x0b,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x67,0x6c,0x5f,0x43,0x6c,0x69,0x70,0x44,
2250
+ 0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x00,0x06,0x00,0x07,0x00,0x0b,0x00,0x00,0x00,
2251
+ 0x03,0x00,0x00,0x00,0x67,0x6c,0x5f,0x43,0x75,0x6c,0x6c,0x44,0x69,0x73,0x74,0x61,
2252
+ 0x6e,0x63,0x65,0x00,0x05,0x00,0x03,0x00,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2253
+ 0x05,0x00,0x05,0x00,0x11,0x00,0x00,0x00,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
2254
+ 0x73,0x00,0x00,0x00,0x06,0x00,0x04,0x00,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2255
+ 0x6d,0x76,0x70,0x00,0x06,0x00,0x04,0x00,0x11,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2256
+ 0x74,0x6d,0x00,0x00,0x05,0x00,0x03,0x00,0x13,0x00,0x00,0x00,0x5f,0x31,0x39,0x00,
2257
+ 0x05,0x00,0x05,0x00,0x18,0x00,0x00,0x00,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
2258
+ 0x00,0x00,0x00,0x00,0x05,0x00,0x04,0x00,0x1f,0x00,0x00,0x00,0x70,0x73,0x69,0x7a,
2259
+ 0x65,0x00,0x00,0x00,0x05,0x00,0x03,0x00,0x23,0x00,0x00,0x00,0x75,0x76,0x00,0x00,
2260
+ 0x05,0x00,0x05,0x00,0x28,0x00,0x00,0x00,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,
2261
+ 0x30,0x00,0x00,0x00,0x05,0x00,0x04,0x00,0x30,0x00,0x00,0x00,0x63,0x6f,0x6c,0x6f,
2262
+ 0x72,0x00,0x00,0x00,0x05,0x00,0x04,0x00,0x31,0x00,0x00,0x00,0x63,0x6f,0x6c,0x6f,
2263
+ 0x72,0x30,0x00,0x00,0x47,0x00,0x03,0x00,0x0b,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
2264
+ 0x48,0x00,0x05,0x00,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,
2265
+ 0x00,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x0b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2266
+ 0x0b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x0b,0x00,0x00,0x00,
2267
+ 0x02,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x48,0x00,0x05,0x00,
2268
+ 0x0b,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
2269
+ 0x47,0x00,0x03,0x00,0x11,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x48,0x00,0x04,0x00,
2270
+ 0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x48,0x00,0x05,0x00,
2271
+ 0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x10,0x00,0x00,0x00,
2272
+ 0x48,0x00,0x05,0x00,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x00,0x00,0x00,
2273
+ 0x00,0x00,0x00,0x00,0x48,0x00,0x04,0x00,0x11,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2274
+ 0x05,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x11,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2275
+ 0x07,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x11,0x00,0x00,0x00,
2276
+ 0x01,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x47,0x00,0x04,0x00,
2277
+ 0x13,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,
2278
+ 0x13,0x00,0x00,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,
2279
+ 0x18,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,
2280
+ 0x1f,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x47,0x00,0x04,0x00,
2281
+ 0x23,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,
2282
+ 0x28,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x47,0x00,0x04,0x00,
2283
+ 0x30,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x47,0x00,0x04,0x00,
2284
+ 0x31,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x13,0x00,0x02,0x00,
2285
+ 0x02,0x00,0x00,0x00,0x21,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
2286
+ 0x16,0x00,0x03,0x00,0x06,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x17,0x00,0x04,0x00,
2287
+ 0x07,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x15,0x00,0x04,0x00,
2288
+ 0x08,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2b,0x00,0x04,0x00,
2289
+ 0x08,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x1c,0x00,0x04,0x00,
2290
+ 0x0a,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x1e,0x00,0x06,0x00,
2291
+ 0x0b,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,
2292
+ 0x0a,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x0c,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
2293
+ 0x0b,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x0c,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,
2294
+ 0x03,0x00,0x00,0x00,0x15,0x00,0x04,0x00,0x0e,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
2295
+ 0x01,0x00,0x00,0x00,0x2b,0x00,0x04,0x00,0x0e,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,
2296
+ 0x00,0x00,0x00,0x00,0x18,0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x07,0x00,0x00,0x00,
2297
+ 0x04,0x00,0x00,0x00,0x1e,0x00,0x04,0x00,0x11,0x00,0x00,0x00,0x10,0x00,0x00,0x00,
2298
+ 0x10,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x12,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
2299
+ 0x11,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x12,0x00,0x00,0x00,0x13,0x00,0x00,0x00,
2300
+ 0x02,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x14,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
2301
+ 0x10,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x17,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2302
+ 0x07,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x17,0x00,0x00,0x00,0x18,0x00,0x00,0x00,
2303
+ 0x01,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x1b,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
2304
+ 0x07,0x00,0x00,0x00,0x2b,0x00,0x04,0x00,0x0e,0x00,0x00,0x00,0x1d,0x00,0x00,0x00,
2305
+ 0x01,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2306
+ 0x06,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x1e,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,
2307
+ 0x01,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x21,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
2308
+ 0x06,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x1b,0x00,0x00,0x00,0x23,0x00,0x00,0x00,
2309
+ 0x03,0x00,0x00,0x00,0x17,0x00,0x04,0x00,0x26,0x00,0x00,0x00,0x06,0x00,0x00,0x00,
2310
+ 0x02,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x27,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2311
+ 0x26,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x27,0x00,0x00,0x00,0x28,0x00,0x00,0x00,
2312
+ 0x01,0x00,0x00,0x00,0x2b,0x00,0x04,0x00,0x06,0x00,0x00,0x00,0x2a,0x00,0x00,0x00,
2313
+ 0x00,0x00,0x00,0x00,0x2b,0x00,0x04,0x00,0x06,0x00,0x00,0x00,0x2b,0x00,0x00,0x00,
2314
+ 0x00,0x00,0x80,0x3f,0x3b,0x00,0x04,0x00,0x1b,0x00,0x00,0x00,0x30,0x00,0x00,0x00,
2315
+ 0x03,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x17,0x00,0x00,0x00,0x31,0x00,0x00,0x00,
2316
+ 0x01,0x00,0x00,0x00,0x36,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
2317
+ 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xf8,0x00,0x02,0x00,0x05,0x00,0x00,0x00,
2318
+ 0x41,0x00,0x05,0x00,0x14,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x13,0x00,0x00,0x00,
2319
+ 0x0f,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x16,0x00,0x00,0x00,
2320
+ 0x15,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x19,0x00,0x00,0x00,
2321
+ 0x18,0x00,0x00,0x00,0x91,0x00,0x05,0x00,0x07,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,
2322
+ 0x16,0x00,0x00,0x00,0x19,0x00,0x00,0x00,0x41,0x00,0x05,0x00,0x1b,0x00,0x00,0x00,
2323
+ 0x1c,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x3e,0x00,0x03,0x00,
2324
+ 0x1c,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,0x06,0x00,0x00,0x00,
2325
+ 0x20,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x41,0x00,0x05,0x00,0x21,0x00,0x00,0x00,
2326
+ 0x22,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x1d,0x00,0x00,0x00,0x3e,0x00,0x03,0x00,
2327
+ 0x22,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x41,0x00,0x05,0x00,0x14,0x00,0x00,0x00,
2328
+ 0x24,0x00,0x00,0x00,0x13,0x00,0x00,0x00,0x1d,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,
2329
+ 0x10,0x00,0x00,0x00,0x25,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,
2330
+ 0x26,0x00,0x00,0x00,0x29,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x51,0x00,0x05,0x00,
2331
+ 0x06,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2332
+ 0x51,0x00,0x05,0x00,0x06,0x00,0x00,0x00,0x2d,0x00,0x00,0x00,0x29,0x00,0x00,0x00,
2333
+ 0x01,0x00,0x00,0x00,0x50,0x00,0x07,0x00,0x07,0x00,0x00,0x00,0x2e,0x00,0x00,0x00,
2334
+ 0x2c,0x00,0x00,0x00,0x2d,0x00,0x00,0x00,0x2a,0x00,0x00,0x00,0x2b,0x00,0x00,0x00,
2335
+ 0x91,0x00,0x05,0x00,0x07,0x00,0x00,0x00,0x2f,0x00,0x00,0x00,0x25,0x00,0x00,0x00,
2336
+ 0x2e,0x00,0x00,0x00,0x3e,0x00,0x03,0x00,0x23,0x00,0x00,0x00,0x2f,0x00,0x00,0x00,
2337
+ 0x3d,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x31,0x00,0x00,0x00,
2338
+ 0x3e,0x00,0x03,0x00,0x30,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0xfd,0x00,0x01,0x00,
2339
+ 0x38,0x00,0x01,0x00,
2340
+ };
2341
+ static const uint8_t _sgl_shd_fs_bytecode_spirv_vk[792] = {
2342
+ 0x03,0x02,0x23,0x07,0x00,0x04,0x01,0x00,0x0b,0x00,0x08,0x00,0x1d,0x00,0x00,0x00,
2343
+ 0x00,0x00,0x00,0x00,0x11,0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x0b,0x00,0x06,0x00,
2344
+ 0x01,0x00,0x00,0x00,0x47,0x4c,0x53,0x4c,0x2e,0x73,0x74,0x64,0x2e,0x34,0x35,0x30,
2345
+ 0x00,0x00,0x00,0x00,0x0e,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2346
+ 0x0f,0x00,0x0a,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,
2347
+ 0x00,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x10,0x00,0x00,0x00,
2348
+ 0x15,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,0x10,0x00,0x03,0x00,0x04,0x00,0x00,0x00,
2349
+ 0x07,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x02,0x00,0x00,0x00,0xcc,0x01,0x00,0x00,
2350
+ 0x05,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,0x00,0x00,0x00,0x00,
2351
+ 0x05,0x00,0x05,0x00,0x09,0x00,0x00,0x00,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,
2352
+ 0x6f,0x72,0x00,0x00,0x05,0x00,0x03,0x00,0x0c,0x00,0x00,0x00,0x74,0x65,0x78,0x00,
2353
+ 0x05,0x00,0x03,0x00,0x10,0x00,0x00,0x00,0x73,0x6d,0x70,0x00,0x05,0x00,0x03,0x00,
2354
+ 0x15,0x00,0x00,0x00,0x75,0x76,0x00,0x00,0x05,0x00,0x04,0x00,0x1a,0x00,0x00,0x00,
2355
+ 0x63,0x6f,0x6c,0x6f,0x72,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x09,0x00,0x00,0x00,
2356
+ 0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x0c,0x00,0x00,0x00,
2357
+ 0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x0c,0x00,0x00,0x00,
2358
+ 0x22,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x10,0x00,0x00,0x00,
2359
+ 0x21,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x10,0x00,0x00,0x00,
2360
+ 0x22,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x15,0x00,0x00,0x00,
2361
+ 0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x00,0x04,0x00,0x1a,0x00,0x00,0x00,
2362
+ 0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x13,0x00,0x02,0x00,0x02,0x00,0x00,0x00,
2363
+ 0x21,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x16,0x00,0x03,0x00,
2364
+ 0x06,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x17,0x00,0x04,0x00,0x07,0x00,0x00,0x00,
2365
+ 0x06,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x08,0x00,0x00,0x00,
2366
+ 0x03,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x08,0x00,0x00,0x00,
2367
+ 0x09,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x19,0x00,0x09,0x00,0x0a,0x00,0x00,0x00,
2368
+ 0x06,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2369
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x04,0x00,
2370
+ 0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,
2371
+ 0x0b,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1a,0x00,0x02,0x00,
2372
+ 0x0e,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2373
+ 0x0e,0x00,0x00,0x00,0x3b,0x00,0x04,0x00,0x0f,0x00,0x00,0x00,0x10,0x00,0x00,0x00,
2374
+ 0x00,0x00,0x00,0x00,0x1b,0x00,0x03,0x00,0x12,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,
2375
+ 0x20,0x00,0x04,0x00,0x14,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x07,0x00,0x00,0x00,
2376
+ 0x3b,0x00,0x04,0x00,0x14,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2377
+ 0x17,0x00,0x04,0x00,0x16,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
2378
+ 0x3b,0x00,0x04,0x00,0x14,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
2379
+ 0x36,0x00,0x05,0x00,0x02,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2380
+ 0x03,0x00,0x00,0x00,0xf8,0x00,0x02,0x00,0x05,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,
2381
+ 0x0a,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x3d,0x00,0x04,0x00,
2382
+ 0x0e,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x56,0x00,0x05,0x00,
2383
+ 0x12,0x00,0x00,0x00,0x13,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
2384
+ 0x3d,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x17,0x00,0x00,0x00,0x15,0x00,0x00,0x00,
2385
+ 0x4f,0x00,0x07,0x00,0x16,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x17,0x00,0x00,0x00,
2386
+ 0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x57,0x00,0x05,0x00,
2387
+ 0x07,0x00,0x00,0x00,0x19,0x00,0x00,0x00,0x13,0x00,0x00,0x00,0x18,0x00,0x00,0x00,
2388
+ 0x3d,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x1b,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,
2389
+ 0x85,0x00,0x05,0x00,0x07,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x19,0x00,0x00,0x00,
2390
+ 0x1b,0x00,0x00,0x00,0x3e,0x00,0x03,0x00,0x09,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,
2391
+ 0xfd,0x00,0x01,0x00,0x38,0x00,0x01,0x00,
2392
+ };
2393
+ #elif defined(SOKOL_DUMMY_BACKEND)
2394
+ static const char* _sgl_shd_vs_source_dummy = "";
2395
+ static const char* _sgl_shd_fs_source_dummy = "";
2396
+ #else
2397
+ #error "Please define one of SOKOL_GLCORE, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU, SOKOL_VULKAN or SOKOL_DUMMY_BACKEND!"
2398
+ #endif
2399
+ //<#shdgen
2400
+
2401
+ // ████████ ██ ██ ██████ ███████ ███████
2402
+ // ██ ██ ██ ██ ██ ██ ██
2403
+ // ██ ████ ██████ █████ ███████
2404
+ // ██ ██ ██ ██ ██
2405
+ // ██ ██ ██ ███████ ███████
2406
+ //
2407
+ // >>types
2408
+ typedef enum {
2409
+ SGL_PRIMITIVETYPE_POINTS = 0,
2410
+ SGL_PRIMITIVETYPE_LINES,
2411
+ SGL_PRIMITIVETYPE_LINE_STRIP,
2412
+ SGL_PRIMITIVETYPE_TRIANGLES,
2413
+ SGL_PRIMITIVETYPE_TRIANGLE_STRIP,
2414
+ SGL_PRIMITIVETYPE_QUADS,
2415
+ SGL_NUM_PRIMITIVE_TYPES,
2416
+ } _sgl_primitive_type_t;
2417
+
2418
+ typedef struct {
2419
+ uint32_t id;
2420
+ sg_resource_state state;
2421
+ } _sgl_slot_t;
2422
+
2423
+ typedef struct {
2424
+ int size;
2425
+ int queue_top;
2426
+ uint32_t* gen_ctrs;
2427
+ int* free_queue;
2428
+ } _sgl_pool_t;
2429
+
2430
+ typedef struct {
2431
+ _sgl_slot_t slot;
2432
+ sg_pipeline pip[SGL_NUM_PRIMITIVE_TYPES];
2433
+ } _sgl_pipeline_t;
2434
+
2435
+ typedef struct {
2436
+ _sgl_pool_t pool;
2437
+ _sgl_pipeline_t* pips;
2438
+ } _sgl_pipeline_pool_t;
2439
+
2440
+ typedef enum {
2441
+ SGL_MATRIXMODE_MODELVIEW,
2442
+ SGL_MATRIXMODE_PROJECTION,
2443
+ SGL_MATRIXMODE_TEXTURE,
2444
+ SGL_NUM_MATRIXMODES
2445
+ } _sgl_matrix_mode_t;
2446
+
2447
+ typedef struct {
2448
+ float pos[3];
2449
+ float uv[2];
2450
+ uint32_t rgba;
2451
+ float psize;
2452
+ } _sgl_vertex_t;
2453
+
2454
+ typedef struct {
2455
+ float v[4][4];
2456
+ } _sgl_matrix_t;
2457
+
2458
+ typedef struct {
2459
+ _sgl_matrix_t mvp; /* model-view-projection matrix */
2460
+ _sgl_matrix_t tm; /* texture matrix */
2461
+ } _sgl_uniform_t;
2462
+
2463
+ typedef enum {
2464
+ SGL_COMMAND_DRAW,
2465
+ SGL_COMMAND_VIEWPORT,
2466
+ SGL_COMMAND_SCISSOR_RECT,
2467
+ } _sgl_command_type_t;
2468
+
2469
+ typedef struct {
2470
+ sg_pipeline pip;
2471
+ sg_view view;
2472
+ sg_sampler smp;
2473
+ int base_vertex;
2474
+ int num_vertices;
2475
+ int uniform_index;
2476
+ } _sgl_draw_args_t;
2477
+
2478
+ typedef struct {
2479
+ int x, y, w, h;
2480
+ bool origin_top_left;
2481
+ } _sgl_viewport_args_t;
2482
+
2483
+ typedef struct {
2484
+ int x, y, w, h;
2485
+ bool origin_top_left;
2486
+ } _sgl_scissor_rect_args_t;
2487
+
2488
+ typedef union {
2489
+ _sgl_draw_args_t draw;
2490
+ _sgl_viewport_args_t viewport;
2491
+ _sgl_scissor_rect_args_t scissor_rect;
2492
+ } _sgl_args_t;
2493
+
2494
+ typedef struct {
2495
+ _sgl_command_type_t cmd;
2496
+ int layer_id;
2497
+ _sgl_args_t args;
2498
+ } _sgl_command_t;
2499
+
2500
+ #define _SGL_INVALID_SLOT_INDEX (0)
2501
+ #define _SGL_MAX_STACK_DEPTH (64)
2502
+ #define _SGL_DEFAULT_CONTEXT_POOL_SIZE (4)
2503
+ #define _SGL_DEFAULT_PIPELINE_POOL_SIZE (64)
2504
+ #define _SGL_DEFAULT_MAX_VERTICES (1<<16)
2505
+ #define _SGL_DEFAULT_MAX_COMMANDS (1<<14)
2506
+ #define _SGL_SLOT_SHIFT (16)
2507
+ #define _SGL_MAX_POOL_SIZE (1<<_SGL_SLOT_SHIFT)
2508
+ #define _SGL_SLOT_MASK (_SGL_MAX_POOL_SIZE-1)
2509
+
2510
+ typedef struct {
2511
+ _sgl_slot_t slot;
2512
+ sgl_context_desc_t desc;
2513
+ uint32_t frame_id;
2514
+ uint32_t update_frame_id;
2515
+ struct {
2516
+ int cap;
2517
+ int next;
2518
+ _sgl_vertex_t* ptr;
2519
+ } vertices;
2520
+ struct {
2521
+ int cap;
2522
+ int next;
2523
+ _sgl_uniform_t* ptr;
2524
+ } uniforms;
2525
+ struct {
2526
+ int cap;
2527
+ int next;
2528
+ _sgl_command_t* ptr;
2529
+ } commands;
2530
+
2531
+ /* state tracking */
2532
+ int base_vertex;
2533
+ int quad_vtx_count; /* number of times vtx function has been called, used for non-triangle primitives */
2534
+ sgl_error_t error;
2535
+ bool in_begin;
2536
+ int layer_id;
2537
+ float u, v;
2538
+ uint32_t rgba;
2539
+ float point_size;
2540
+ _sgl_primitive_type_t cur_prim_type;
2541
+ sg_view cur_view;
2542
+ sg_sampler cur_smp;
2543
+ bool texturing_enabled;
2544
+ bool matrix_dirty; /* reset in sgl_end(), set in any of the matrix stack functions */
2545
+
2546
+ /* sokol-gfx resources */
2547
+ sg_buffer vbuf;
2548
+ sgl_pipeline def_pip;
2549
+ sg_bindings bind;
2550
+
2551
+ /* pipeline stack */
2552
+ int pip_tos;
2553
+ sgl_pipeline pip_stack[_SGL_MAX_STACK_DEPTH];
2554
+
2555
+ /* matrix stacks */
2556
+ _sgl_matrix_mode_t cur_matrix_mode;
2557
+ int matrix_tos[SGL_NUM_MATRIXMODES];
2558
+ _sgl_matrix_t matrix_stack[SGL_NUM_MATRIXMODES][_SGL_MAX_STACK_DEPTH];
2559
+ } _sgl_context_t;
2560
+
2561
+ typedef struct {
2562
+ _sgl_pool_t pool;
2563
+ _sgl_context_t* contexts;
2564
+ } _sgl_context_pool_t;
2565
+
2566
+ typedef struct {
2567
+ uint32_t init_cookie;
2568
+ sgl_desc_t desc;
2569
+ sg_image def_img; // a default white texture
2570
+ sg_view def_view; // ...and the texture view for the default image
2571
+ sg_sampler def_smp; // a default sampler
2572
+ sg_shader shd; // same shader for all contexts
2573
+ sgl_context def_ctx_id;
2574
+ sgl_context cur_ctx_id;
2575
+ _sgl_context_t* cur_ctx; // may be 0!
2576
+ _sgl_pipeline_pool_t pip_pool;
2577
+ _sgl_context_pool_t context_pool;
2578
+ } _sgl_t;
2579
+ static _sgl_t _sgl;
2580
+
2581
+ // ██ ██████ ██████ ██████ ██ ███ ██ ██████
2582
+ // ██ ██ ██ ██ ██ ██ ████ ██ ██
2583
+ // ██ ██ ██ ██ ███ ██ ███ ██ ██ ██ ██ ██ ███
2584
+ // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
2585
+ // ███████ ██████ ██████ ██████ ██ ██ ████ ██████
2586
+ //
2587
+ // >>logging
2588
+ #if defined(SOKOL_DEBUG)
2589
+ #define _SGL_LOGITEM_XMACRO(item,msg) #item ": " msg,
2590
+ static const char* _sgl_log_messages[] = {
2591
+ _SGL_LOG_ITEMS
2592
+ };
2593
+ #undef _SGL_LOGITEM_XMACRO
2594
+ #endif // SOKOL_DEBUG
2595
+
2596
+ #define _SGL_PANIC(code) _sgl_log(SGL_LOGITEM_ ##code, 0, __LINE__)
2597
+ #define _SGL_ERROR(code) _sgl_log(SGL_LOGITEM_ ##code, 1, __LINE__)
2598
+ #define _SGL_WARN(code) _sgl_log(SGL_LOGITEM_ ##code, 2, __LINE__)
2599
+ #define _SGL_INFO(code) _sgl_log(SGL_LOGITEM_ ##code, 3, __LINE__)
2600
+
2601
+ static void _sgl_log(sgl_log_item_t log_item, uint32_t log_level, uint32_t line_nr) {
2602
+ if (_sgl.desc.logger.func) {
2603
+ #if defined(SOKOL_DEBUG)
2604
+ const char* filename = __FILE__;
2605
+ const char* message = _sgl_log_messages[log_item];
2606
+ #else
2607
+ const char* filename = 0;
2608
+ const char* message = 0;
2609
+ #endif
2610
+ _sgl.desc.logger.func("sgl", log_level, (uint32_t)log_item, message, line_nr, filename, _sgl.desc.logger.user_data);
2611
+ } else {
2612
+ // for log level PANIC it would be 'undefined behaviour' to continue
2613
+ if (log_level == 0) {
2614
+ abort();
2615
+ }
2616
+ }
2617
+ }
2618
+
2619
+ // ███ ███ ███████ ███ ███ ██████ ██████ ██ ██
2620
+ // ████ ████ ██ ████ ████ ██ ██ ██ ██ ██ ██
2621
+ // ██ ████ ██ █████ ██ ████ ██ ██ ██ ██████ ████
2622
+ // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
2623
+ // ██ ██ ███████ ██ ██ ██████ ██ ██ ██
2624
+ //
2625
+ // >>memory
2626
+ static void _sgl_clear(void* ptr, size_t size) {
2627
+ SOKOL_ASSERT(ptr && (size > 0));
2628
+ memset(ptr, 0, size);
2629
+ }
2630
+
2631
+ static void* _sgl_malloc(size_t size) {
2632
+ SOKOL_ASSERT(size > 0);
2633
+ void* ptr;
2634
+ if (_sgl.desc.allocator.alloc_fn) {
2635
+ ptr = _sgl.desc.allocator.alloc_fn(size, _sgl.desc.allocator.user_data);
2636
+ } else {
2637
+ ptr = malloc(size);
2638
+ }
2639
+ if (0 == ptr) {
2640
+ _SGL_PANIC(MALLOC_FAILED);
2641
+ }
2642
+ return ptr;
2643
+ }
2644
+
2645
+ static void* _sgl_malloc_clear(size_t size) {
2646
+ void* ptr = _sgl_malloc(size);
2647
+ _sgl_clear(ptr, size);
2648
+ return ptr;
2649
+ }
2650
+
2651
+ static void _sgl_free(void* ptr) {
2652
+ if (_sgl.desc.allocator.free_fn) {
2653
+ _sgl.desc.allocator.free_fn(ptr, _sgl.desc.allocator.user_data);
2654
+ } else {
2655
+ free(ptr);
2656
+ }
2657
+ }
2658
+
2659
+ // ██████ ██████ ██████ ██
2660
+ // ██ ██ ██ ██ ██ ██ ██
2661
+ // ██████ ██ ██ ██ ██ ██
2662
+ // ██ ██ ██ ██ ██ ██
2663
+ // ██ ██████ ██████ ███████
2664
+ //
2665
+ // >>pool
2666
+ static void _sgl_init_pool(_sgl_pool_t* pool, int num) {
2667
+ SOKOL_ASSERT(pool && (num >= 1));
2668
+ /* slot 0 is reserved for the 'invalid id', so bump the pool size by 1 */
2669
+ pool->size = num + 1;
2670
+ pool->queue_top = 0;
2671
+ /* generation counters indexable by pool slot index, slot 0 is reserved */
2672
+ size_t gen_ctrs_size = sizeof(uint32_t) * (size_t)pool->size;
2673
+ pool->gen_ctrs = (uint32_t*) _sgl_malloc_clear(gen_ctrs_size);
2674
+ /* it's not a bug to only reserve 'num' here */
2675
+ pool->free_queue = (int*) _sgl_malloc_clear(sizeof(int) * (size_t)num);
2676
+ /* never allocate the zero-th pool item since the invalid id is 0 */
2677
+ for (int i = pool->size-1; i >= 1; i--) {
2678
+ pool->free_queue[pool->queue_top++] = i;
2679
+ }
2680
+ }
2681
+
2682
+ static void _sgl_discard_pool(_sgl_pool_t* pool) {
2683
+ SOKOL_ASSERT(pool);
2684
+ SOKOL_ASSERT(pool->free_queue);
2685
+ _sgl_free(pool->free_queue);
2686
+ pool->free_queue = 0;
2687
+ SOKOL_ASSERT(pool->gen_ctrs);
2688
+ _sgl_free(pool->gen_ctrs);
2689
+ pool->gen_ctrs = 0;
2690
+ pool->size = 0;
2691
+ pool->queue_top = 0;
2692
+ }
2693
+
2694
+ static int _sgl_pool_alloc_index(_sgl_pool_t* pool) {
2695
+ SOKOL_ASSERT(pool);
2696
+ SOKOL_ASSERT(pool->free_queue);
2697
+ if (pool->queue_top > 0) {
2698
+ int slot_index = pool->free_queue[--pool->queue_top];
2699
+ SOKOL_ASSERT((slot_index > 0) && (slot_index < pool->size));
2700
+ return slot_index;
2701
+ } else {
2702
+ // pool exhausted
2703
+ return _SGL_INVALID_SLOT_INDEX;
2704
+ }
2705
+ }
2706
+
2707
+ static void _sgl_pool_free_index(_sgl_pool_t* pool, int slot_index) {
2708
+ SOKOL_ASSERT((slot_index > _SGL_INVALID_SLOT_INDEX) && (slot_index < pool->size));
2709
+ SOKOL_ASSERT(pool);
2710
+ SOKOL_ASSERT(pool->free_queue);
2711
+ SOKOL_ASSERT(pool->queue_top < pool->size);
2712
+ #ifdef SOKOL_DEBUG
2713
+ /* debug check against double-free */
2714
+ for (int i = 0; i < pool->queue_top; i++) {
2715
+ SOKOL_ASSERT(pool->free_queue[i] != slot_index);
2716
+ }
2717
+ #endif
2718
+ pool->free_queue[pool->queue_top++] = slot_index;
2719
+ SOKOL_ASSERT(pool->queue_top <= (pool->size-1));
2720
+ }
2721
+
2722
+ /* allocate the slot at slot_index:
2723
+ - bump the slot's generation counter
2724
+ - create a resource id from the generation counter and slot index
2725
+ - set the slot's id to this id
2726
+ - set the slot's state to ALLOC
2727
+ - return the resource id
2728
+ */
2729
+ static uint32_t _sgl_slot_alloc(_sgl_pool_t* pool, _sgl_slot_t* slot, int slot_index) {
2730
+ /* FIXME: add handling for an overflowing generation counter,
2731
+ for now, just overflow (another option is to disable
2732
+ the slot)
2733
+ */
2734
+ SOKOL_ASSERT(pool && pool->gen_ctrs);
2735
+ SOKOL_ASSERT((slot_index > _SGL_INVALID_SLOT_INDEX) && (slot_index < pool->size));
2736
+ SOKOL_ASSERT((slot->state == SG_RESOURCESTATE_INITIAL) && (slot->id == SG_INVALID_ID));
2737
+ uint32_t ctr = ++pool->gen_ctrs[slot_index];
2738
+ slot->id = (ctr<<_SGL_SLOT_SHIFT)|(slot_index & _SGL_SLOT_MASK);
2739
+ slot->state = SG_RESOURCESTATE_ALLOC;
2740
+ return slot->id;
2741
+ }
2742
+
2743
+ /* extract slot index from id */
2744
+ static int _sgl_slot_index(uint32_t id) {
2745
+ int slot_index = (int) (id & _SGL_SLOT_MASK);
2746
+ SOKOL_ASSERT(_SGL_INVALID_SLOT_INDEX != slot_index);
2747
+ return slot_index;
2748
+ }
2749
+
2750
+ // ██████ ██ ██████ ███████ ██ ██ ███ ██ ███████ ███████
2751
+ // ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██
2752
+ // ██████ ██ ██████ █████ ██ ██ ██ ██ ██ █████ ███████
2753
+ // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
2754
+ // ██ ██ ██ ███████ ███████ ██ ██ ████ ███████ ███████
2755
+ //
2756
+ // >>pipelines
2757
+ static void _sgl_reset_pipeline(_sgl_pipeline_t* pip) {
2758
+ SOKOL_ASSERT(pip);
2759
+ _sgl_clear(pip, sizeof(_sgl_pipeline_t));
2760
+ }
2761
+
2762
+ static void _sgl_setup_pipeline_pool(int pool_size) {
2763
+ /* note: the pools here will have an additional item, since slot 0 is reserved */
2764
+ SOKOL_ASSERT((pool_size > 0) && (pool_size < _SGL_MAX_POOL_SIZE));
2765
+ _sgl_init_pool(&_sgl.pip_pool.pool, pool_size);
2766
+ size_t pool_byte_size = sizeof(_sgl_pipeline_t) * (size_t)_sgl.pip_pool.pool.size;
2767
+ _sgl.pip_pool.pips = (_sgl_pipeline_t*) _sgl_malloc_clear(pool_byte_size);
2768
+ }
2769
+
2770
+ static void _sgl_discard_pipeline_pool(void) {
2771
+ SOKOL_ASSERT(0 != _sgl.pip_pool.pips);
2772
+ _sgl_free(_sgl.pip_pool.pips); _sgl.pip_pool.pips = 0;
2773
+ _sgl_discard_pool(&_sgl.pip_pool.pool);
2774
+ }
2775
+
2776
+ /* get pipeline pointer without id-check */
2777
+ static _sgl_pipeline_t* _sgl_pipeline_at(uint32_t pip_id) {
2778
+ SOKOL_ASSERT(SG_INVALID_ID != pip_id);
2779
+ int slot_index = _sgl_slot_index(pip_id);
2780
+ SOKOL_ASSERT((slot_index > _SGL_INVALID_SLOT_INDEX) && (slot_index < _sgl.pip_pool.pool.size));
2781
+ return &_sgl.pip_pool.pips[slot_index];
2782
+ }
2783
+
2784
+ /* get pipeline pointer with id-check, returns 0 if no match */
2785
+ static _sgl_pipeline_t* _sgl_lookup_pipeline(uint32_t pip_id) {
2786
+ if (SG_INVALID_ID != pip_id) {
2787
+ _sgl_pipeline_t* pip = _sgl_pipeline_at(pip_id);
2788
+ if (pip->slot.id == pip_id) {
2789
+ return pip;
2790
+ }
2791
+ }
2792
+ return 0;
2793
+ }
2794
+
2795
+ /* make pipeline id from uint32_t id */
2796
+ static sgl_pipeline _sgl_make_pip_id(uint32_t pip_id) {
2797
+ sgl_pipeline pip = { pip_id };
2798
+ return pip;
2799
+ }
2800
+
2801
+ static sgl_pipeline _sgl_alloc_pipeline(void) {
2802
+ sgl_pipeline res;
2803
+ int slot_index = _sgl_pool_alloc_index(&_sgl.pip_pool.pool);
2804
+ if (_SGL_INVALID_SLOT_INDEX != slot_index) {
2805
+ res = _sgl_make_pip_id(_sgl_slot_alloc(&_sgl.pip_pool.pool, &_sgl.pip_pool.pips[slot_index].slot, slot_index));
2806
+ } else {
2807
+ /* pool is exhausted */
2808
+ res = _sgl_make_pip_id(SG_INVALID_ID);
2809
+ }
2810
+ return res;
2811
+ }
2812
+
2813
+ static void _sgl_init_pipeline(sgl_pipeline pip_id, const sg_pipeline_desc* in_desc, const sgl_context_desc_t* ctx_desc) {
2814
+ SOKOL_ASSERT((pip_id.id != SG_INVALID_ID) && in_desc && ctx_desc);
2815
+
2816
+ /* create a new desc with 'patched' shader and pixel format state */
2817
+ sg_pipeline_desc desc = *in_desc;
2818
+ desc.layout.buffers[0].stride = sizeof(_sgl_vertex_t);
2819
+ {
2820
+ sg_vertex_attr_state* pos = &desc.layout.attrs[0];
2821
+ pos->offset = offsetof(_sgl_vertex_t, pos);
2822
+ pos->format = SG_VERTEXFORMAT_FLOAT3;
2823
+ }
2824
+ {
2825
+ sg_vertex_attr_state* uv = &desc.layout.attrs[1];
2826
+ uv->offset = offsetof(_sgl_vertex_t, uv);
2827
+ uv->format = SG_VERTEXFORMAT_FLOAT2;
2828
+ }
2829
+ {
2830
+ sg_vertex_attr_state* rgba = &desc.layout.attrs[2];
2831
+ rgba->offset = offsetof(_sgl_vertex_t, rgba);
2832
+ rgba->format = SG_VERTEXFORMAT_UBYTE4N;
2833
+ }
2834
+ {
2835
+ sg_vertex_attr_state* psize = &desc.layout.attrs[3];
2836
+ psize->offset = offsetof(_sgl_vertex_t, psize);
2837
+ psize->format = SG_VERTEXFORMAT_FLOAT;
2838
+ }
2839
+ if (in_desc->shader.id == SG_INVALID_ID) {
2840
+ desc.shader = _sgl.shd;
2841
+ }
2842
+ desc.index_type = SG_INDEXTYPE_NONE;
2843
+ desc.sample_count = ctx_desc->sample_count;
2844
+ if (desc.face_winding == _SG_FACEWINDING_DEFAULT) {
2845
+ desc.face_winding = _sgl.desc.face_winding;
2846
+ }
2847
+ desc.depth.pixel_format = ctx_desc->depth_format;
2848
+ if (ctx_desc->depth_format == SG_PIXELFORMAT_NONE) {
2849
+ desc.depth.write_enabled = false;
2850
+ }
2851
+ desc.colors[0].pixel_format = ctx_desc->color_format;
2852
+ if (desc.colors[0].write_mask == _SG_COLORMASK_DEFAULT) {
2853
+ desc.colors[0].write_mask = SG_COLORMASK_RGB;
2854
+ }
2855
+
2856
+ _sgl_pipeline_t* pip = _sgl_lookup_pipeline(pip_id.id);
2857
+ SOKOL_ASSERT(pip && (pip->slot.state == SG_RESOURCESTATE_ALLOC));
2858
+ pip->slot.state = SG_RESOURCESTATE_VALID;
2859
+ for (int i = 0; i < SGL_NUM_PRIMITIVE_TYPES; i++) {
2860
+ switch (i) {
2861
+ case SGL_PRIMITIVETYPE_POINTS:
2862
+ desc.primitive_type = SG_PRIMITIVETYPE_POINTS;
2863
+ break;
2864
+ case SGL_PRIMITIVETYPE_LINES:
2865
+ desc.primitive_type = SG_PRIMITIVETYPE_LINES;
2866
+ break;
2867
+ case SGL_PRIMITIVETYPE_LINE_STRIP:
2868
+ desc.primitive_type = SG_PRIMITIVETYPE_LINE_STRIP;
2869
+ break;
2870
+ case SGL_PRIMITIVETYPE_TRIANGLES:
2871
+ desc.primitive_type = SG_PRIMITIVETYPE_TRIANGLES;
2872
+ break;
2873
+ case SGL_PRIMITIVETYPE_TRIANGLE_STRIP:
2874
+ case SGL_PRIMITIVETYPE_QUADS:
2875
+ desc.primitive_type = SG_PRIMITIVETYPE_TRIANGLE_STRIP;
2876
+ break;
2877
+ }
2878
+ if (SGL_PRIMITIVETYPE_QUADS == i) {
2879
+ /* quads are emulated via triangles, use the same pipeline object */
2880
+ pip->pip[i] = pip->pip[SGL_PRIMITIVETYPE_TRIANGLES];
2881
+ } else {
2882
+ pip->pip[i] = sg_make_pipeline(&desc);
2883
+ if (pip->pip[i].id == SG_INVALID_ID) {
2884
+ _SGL_ERROR(MAKE_PIPELINE_FAILED);
2885
+ pip->slot.state = SG_RESOURCESTATE_FAILED;
2886
+ }
2887
+ }
2888
+ }
2889
+ }
2890
+
2891
+ static sgl_pipeline _sgl_make_pipeline(const sg_pipeline_desc* desc, const sgl_context_desc_t* ctx_desc) {
2892
+ SOKOL_ASSERT(desc && ctx_desc);
2893
+ sgl_pipeline pip_id = _sgl_alloc_pipeline();
2894
+ if (pip_id.id != SG_INVALID_ID) {
2895
+ _sgl_init_pipeline(pip_id, desc, ctx_desc);
2896
+ } else {
2897
+ _SGL_ERROR(PIPELINE_POOL_EXHAUSTED);
2898
+ }
2899
+ return pip_id;
2900
+ }
2901
+
2902
+ static void _sgl_destroy_pipeline(sgl_pipeline pip_id) {
2903
+ _sgl_pipeline_t* pip = _sgl_lookup_pipeline(pip_id.id);
2904
+ if (pip) {
2905
+ sg_push_debug_group("sokol-gl");
2906
+ for (int i = 0; i < SGL_NUM_PRIMITIVE_TYPES; i++) {
2907
+ if (i != SGL_PRIMITIVETYPE_QUADS) {
2908
+ sg_destroy_pipeline(pip->pip[i]);
2909
+ }
2910
+ }
2911
+ sg_pop_debug_group();
2912
+ _sgl_reset_pipeline(pip);
2913
+ _sgl_pool_free_index(&_sgl.pip_pool.pool, _sgl_slot_index(pip_id.id));
2914
+ }
2915
+ }
2916
+
2917
+ static sg_pipeline _sgl_get_pipeline(sgl_pipeline pip_id, _sgl_primitive_type_t prim_type) {
2918
+ _sgl_pipeline_t* pip = _sgl_lookup_pipeline(pip_id.id);
2919
+ if (pip) {
2920
+ return pip->pip[prim_type];
2921
+ } else {
2922
+ sg_pipeline dummy_id = { SG_INVALID_ID };
2923
+ return dummy_id;
2924
+ }
2925
+ }
2926
+
2927
+ // ██████ ██████ ███ ██ ████████ ███████ ██ ██ ████████ ███████
2928
+ // ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██
2929
+ // ██ ██ ██ ██ ██ ██ ██ █████ ███ ██ ███████
2930
+ // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
2931
+ // ██████ ██████ ██ ████ ██ ███████ ██ ██ ██ ███████
2932
+ //
2933
+ // >>contexts
2934
+ static void _sgl_reset_context(_sgl_context_t* ctx) {
2935
+ SOKOL_ASSERT(ctx);
2936
+ SOKOL_ASSERT(0 == ctx->vertices.ptr);
2937
+ SOKOL_ASSERT(0 == ctx->uniforms.ptr);
2938
+ SOKOL_ASSERT(0 == ctx->commands.ptr);
2939
+ _sgl_clear(ctx, sizeof(_sgl_context_t));
2940
+ }
2941
+
2942
+ static void _sgl_setup_context_pool(int pool_size) {
2943
+ /* note: the pools here will have an additional item, since slot 0 is reserved */
2944
+ SOKOL_ASSERT((pool_size > 0) && (pool_size < _SGL_MAX_POOL_SIZE));
2945
+ _sgl_init_pool(&_sgl.context_pool.pool, pool_size);
2946
+ size_t pool_byte_size = sizeof(_sgl_context_t) * (size_t)_sgl.context_pool.pool.size;
2947
+ _sgl.context_pool.contexts = (_sgl_context_t*) _sgl_malloc_clear(pool_byte_size);
2948
+ }
2949
+
2950
+ static void _sgl_discard_context_pool(void) {
2951
+ SOKOL_ASSERT(0 != _sgl.context_pool.contexts);
2952
+ _sgl_free(_sgl.context_pool.contexts); _sgl.context_pool.contexts = 0;
2953
+ _sgl_discard_pool(&_sgl.context_pool.pool);
2954
+ }
2955
+
2956
+ // get context pointer without id-check
2957
+ static _sgl_context_t* _sgl_context_at(uint32_t ctx_id) {
2958
+ SOKOL_ASSERT(SG_INVALID_ID != ctx_id);
2959
+ int slot_index = _sgl_slot_index(ctx_id);
2960
+ SOKOL_ASSERT((slot_index > _SGL_INVALID_SLOT_INDEX) && (slot_index < _sgl.context_pool.pool.size));
2961
+ return &_sgl.context_pool.contexts[slot_index];
2962
+ }
2963
+
2964
+ // get context pointer with id-check, returns 0 if no match
2965
+ static _sgl_context_t* _sgl_lookup_context(uint32_t ctx_id) {
2966
+ if (SG_INVALID_ID != ctx_id) {
2967
+ _sgl_context_t* ctx = _sgl_context_at(ctx_id);
2968
+ if (ctx->slot.id == ctx_id) {
2969
+ return ctx;
2970
+ }
2971
+ }
2972
+ return 0;
2973
+ }
2974
+
2975
+ // make context id from uint32_t id
2976
+ static sgl_context _sgl_make_ctx_id(uint32_t ctx_id) {
2977
+ sgl_context ctx = { ctx_id };
2978
+ return ctx;
2979
+ }
2980
+
2981
+ static sgl_context _sgl_alloc_context(void) {
2982
+ sgl_context res;
2983
+ int slot_index = _sgl_pool_alloc_index(&_sgl.context_pool.pool);
2984
+ if (_SGL_INVALID_SLOT_INDEX != slot_index) {
2985
+ res = _sgl_make_ctx_id(_sgl_slot_alloc(&_sgl.context_pool.pool, &_sgl.context_pool.contexts[slot_index].slot, slot_index));
2986
+ } else {
2987
+ // pool is exhausted
2988
+ res = _sgl_make_ctx_id(SG_INVALID_ID);
2989
+ }
2990
+ return res;
2991
+ }
2992
+
2993
+ // return sgl_context_desc_t with patched defaults
2994
+ static sgl_context_desc_t _sgl_context_desc_defaults(const sgl_context_desc_t* desc) {
2995
+ sgl_context_desc_t res = *desc;
2996
+ res.max_vertices = _sgl_def(desc->max_vertices, _SGL_DEFAULT_MAX_VERTICES);
2997
+ res.max_commands = _sgl_def(desc->max_commands, _SGL_DEFAULT_MAX_COMMANDS);
2998
+ return res;
2999
+ }
3000
+
3001
+ static void _sgl_identity(_sgl_matrix_t*);
3002
+ static sg_commit_listener _sgl_make_commit_listener(_sgl_context_t* ctx);
3003
+ static void _sgl_init_context(sgl_context ctx_id, const sgl_context_desc_t* in_desc) {
3004
+ SOKOL_ASSERT((ctx_id.id != SG_INVALID_ID) && in_desc);
3005
+ _sgl_context_t* ctx = _sgl_lookup_context(ctx_id.id);
3006
+ SOKOL_ASSERT(ctx);
3007
+ ctx->desc = _sgl_context_desc_defaults(in_desc);
3008
+ // NOTE: frame_id must be non-zero, so that updates trigger in first frame
3009
+ ctx->frame_id = 1;
3010
+ ctx->cur_view = _sgl.def_view;
3011
+ ctx->cur_smp = _sgl.def_smp;
3012
+
3013
+ // allocate buffers and pools
3014
+ ctx->vertices.cap = ctx->desc.max_vertices;
3015
+ ctx->commands.cap = ctx->uniforms.cap = ctx->desc.max_commands;
3016
+ ctx->vertices.ptr = (_sgl_vertex_t*) _sgl_malloc((size_t)ctx->vertices.cap * sizeof(_sgl_vertex_t));
3017
+ ctx->uniforms.ptr = (_sgl_uniform_t*) _sgl_malloc((size_t)ctx->uniforms.cap * sizeof(_sgl_uniform_t));
3018
+ ctx->commands.ptr = (_sgl_command_t*) _sgl_malloc((size_t)ctx->commands.cap * sizeof(_sgl_command_t));
3019
+
3020
+ // create sokol-gfx resource objects
3021
+ sg_push_debug_group("sokol-gl");
3022
+
3023
+ sg_buffer_desc vbuf_desc;
3024
+ _sgl_clear(&vbuf_desc, sizeof(vbuf_desc));
3025
+ vbuf_desc.size = (size_t)ctx->vertices.cap * sizeof(_sgl_vertex_t);
3026
+ vbuf_desc.usage.vertex_buffer = true;
3027
+ vbuf_desc.usage.write_transient = true;
3028
+ vbuf_desc.label = "sgl-vertex-buffer";
3029
+ ctx->vbuf = sg_make_buffer(&vbuf_desc);
3030
+ SOKOL_ASSERT(SG_INVALID_ID != ctx->vbuf.id);
3031
+ ctx->bind.vertex_buffers[0] = ctx->vbuf;
3032
+
3033
+ sg_pipeline_desc def_pip_desc;
3034
+ _sgl_clear(&def_pip_desc, sizeof(def_pip_desc));
3035
+ def_pip_desc.depth.write_enabled = true;
3036
+ ctx->def_pip = _sgl_make_pipeline(&def_pip_desc, &ctx->desc);
3037
+ if (!sg_add_commit_listener(_sgl_make_commit_listener(ctx))) {
3038
+ _SGL_ERROR(ADD_COMMIT_LISTENER_FAILED);
3039
+ }
3040
+ sg_pop_debug_group();
3041
+
3042
+ // default state
3043
+ ctx->rgba = 0xFFFFFFFF;
3044
+ ctx->point_size = 1.0f;
3045
+ for (int i = 0; i < SGL_NUM_MATRIXMODES; i++) {
3046
+ _sgl_identity(&ctx->matrix_stack[i][0]);
3047
+ }
3048
+ ctx->pip_stack[0] = ctx->def_pip;
3049
+ ctx->matrix_dirty = true;
3050
+ }
3051
+
3052
+ static sgl_context _sgl_make_context(const sgl_context_desc_t* desc) {
3053
+ SOKOL_ASSERT(desc);
3054
+ sgl_context ctx_id = _sgl_alloc_context();
3055
+ if (ctx_id.id != SG_INVALID_ID) {
3056
+ _sgl_init_context(ctx_id, desc);
3057
+ } else {
3058
+ _SGL_ERROR(CONTEXT_POOL_EXHAUSTED);
3059
+ }
3060
+ return ctx_id;
3061
+ }
3062
+
3063
+ static void _sgl_destroy_context(sgl_context ctx_id) {
3064
+ _sgl_context_t* ctx = _sgl_lookup_context(ctx_id.id);
3065
+ if (ctx) {
3066
+ SOKOL_ASSERT(ctx->vertices.ptr);
3067
+ SOKOL_ASSERT(ctx->uniforms.ptr);
3068
+ SOKOL_ASSERT(ctx->commands.ptr);
3069
+
3070
+ _sgl_free(ctx->vertices.ptr);
3071
+ _sgl_free(ctx->uniforms.ptr);
3072
+ _sgl_free(ctx->commands.ptr);
3073
+ ctx->vertices.ptr = 0;
3074
+ ctx->uniforms.ptr = 0;
3075
+ ctx->commands.ptr = 0;
3076
+
3077
+ sg_push_debug_group("sokol-gl");
3078
+ sg_destroy_buffer(ctx->vbuf);
3079
+ _sgl_destroy_pipeline(ctx->def_pip);
3080
+ sg_remove_commit_listener(_sgl_make_commit_listener(ctx));
3081
+ sg_pop_debug_group();
3082
+
3083
+ _sgl_reset_context(ctx);
3084
+ _sgl_pool_free_index(&_sgl.context_pool.pool, _sgl_slot_index(ctx_id.id));
3085
+ }
3086
+ }
3087
+
3088
+ // ███ ███ ██ ███████ ██████
3089
+ // ████ ████ ██ ██ ██
3090
+ // ██ ████ ██ ██ ███████ ██
3091
+ // ██ ██ ██ ██ ██ ██
3092
+ // ██ ██ ██ ███████ ██████
3093
+ //
3094
+ // >>misc
3095
+
3096
+ static sgl_error_t _sgl_error_defaults(void) {
3097
+ sgl_error_t defaults;
3098
+ _sgl_clear(&defaults, sizeof(defaults));
3099
+ return defaults;
3100
+ }
3101
+
3102
+ static int _sgl_num_vertices(_sgl_context_t* ctx) {
3103
+ return ctx->vertices.next;
3104
+ }
3105
+
3106
+ static int _sgl_num_commands(_sgl_context_t* ctx) {
3107
+ return ctx->commands.next;
3108
+ }
3109
+
3110
+ static void _sgl_begin(_sgl_context_t* ctx, _sgl_primitive_type_t mode) {
3111
+ ctx->in_begin = true;
3112
+ ctx->base_vertex = ctx->vertices.next;
3113
+ ctx->quad_vtx_count = 0;
3114
+ ctx->cur_prim_type = mode;
3115
+ }
3116
+
3117
+ static void _sgl_rewind(_sgl_context_t* ctx) {
3118
+ ctx->frame_id++;
3119
+ ctx->vertices.next = 0;
3120
+ ctx->uniforms.next = 0;
3121
+ ctx->commands.next = 0;
3122
+ ctx->base_vertex = 0;
3123
+ ctx->error = _sgl_error_defaults();
3124
+ ctx->layer_id = 0;
3125
+ ctx->matrix_dirty = true;
3126
+ }
3127
+
3128
+ // called from inside sokol-gfx sg_commit()
3129
+ static void _sgl_commit_listener(void* userdata) {
3130
+ _sgl_context_t* ctx = _sgl_lookup_context((uint32_t)(uintptr_t)userdata);
3131
+ if (ctx) {
3132
+ _sgl_rewind(ctx);
3133
+ }
3134
+ }
3135
+
3136
+ static sg_commit_listener _sgl_make_commit_listener(_sgl_context_t* ctx) {
3137
+ sg_commit_listener listener = { _sgl_commit_listener, (void*)(uintptr_t)(ctx->slot.id) };
3138
+ return listener;
3139
+ }
3140
+
3141
+ static _sgl_vertex_t* _sgl_next_vertex(_sgl_context_t* ctx) {
3142
+ if (ctx->vertices.next < ctx->vertices.cap) {
3143
+ return &ctx->vertices.ptr[ctx->vertices.next++];
3144
+ } else {
3145
+ ctx->error.vertices_full = true;
3146
+ ctx->error.any = true;
3147
+ return 0;
3148
+ }
3149
+ }
3150
+
3151
+ static _sgl_uniform_t* _sgl_next_uniform(_sgl_context_t* ctx) {
3152
+ if (ctx->uniforms.next < ctx->uniforms.cap) {
3153
+ return &ctx->uniforms.ptr[ctx->uniforms.next++];
3154
+ } else {
3155
+ ctx->error.uniforms_full = true;
3156
+ ctx->error.any = true;
3157
+ return 0;
3158
+ }
3159
+ }
3160
+
3161
+ static _sgl_command_t* _sgl_cur_command(_sgl_context_t* ctx) {
3162
+ if (ctx->commands.next > 0) {
3163
+ return &ctx->commands.ptr[ctx->commands.next - 1];
3164
+ } else {
3165
+ return 0;
3166
+ }
3167
+ }
3168
+
3169
+ static _sgl_command_t* _sgl_next_command(_sgl_context_t* ctx) {
3170
+ if (ctx->commands.next < ctx->commands.cap) {
3171
+ return &ctx->commands.ptr[ctx->commands.next++];
3172
+ } else {
3173
+ ctx->error.commands_full = true;
3174
+ ctx->error.any = true;
3175
+ return 0;
3176
+ }
3177
+ }
3178
+
3179
+ static uint32_t _sgl_pack_rgbab(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
3180
+ return (uint32_t)(((uint32_t)a<<24)|((uint32_t)b<<16)|((uint32_t)g<<8)|r);
3181
+ }
3182
+
3183
+ static float _sgl_clamp(float v, float lo, float hi) {
3184
+ if (v < lo) return lo;
3185
+ else if (v > hi) return hi;
3186
+ else return v;
3187
+ }
3188
+
3189
+ static uint32_t _sgl_pack_rgbaf(float r, float g, float b, float a) {
3190
+ uint8_t r_u8 = (uint8_t) (_sgl_clamp(r, 0.0f, 1.0f) * 255.0f);
3191
+ uint8_t g_u8 = (uint8_t) (_sgl_clamp(g, 0.0f, 1.0f) * 255.0f);
3192
+ uint8_t b_u8 = (uint8_t) (_sgl_clamp(b, 0.0f, 1.0f) * 255.0f);
3193
+ uint8_t a_u8 = (uint8_t) (_sgl_clamp(a, 0.0f, 1.0f) * 255.0f);
3194
+ return _sgl_pack_rgbab(r_u8, g_u8, b_u8, a_u8);
3195
+ }
3196
+
3197
+ static void _sgl_vtx(_sgl_context_t* ctx, float x, float y, float z, float u, float v, uint32_t rgba) {
3198
+ SOKOL_ASSERT(ctx->in_begin);
3199
+ _sgl_vertex_t* vtx;
3200
+ /* handle non-native primitive types */
3201
+ if ((ctx->cur_prim_type == SGL_PRIMITIVETYPE_QUADS) && ((ctx->quad_vtx_count & 3) == 3)) {
3202
+ /* for quads, before writing the last quad vertex, reuse
3203
+ the first and third vertex to start the second triangle in the quad
3204
+ */
3205
+ vtx = _sgl_next_vertex(ctx);
3206
+ if (vtx) { *vtx = *(vtx - 3); }
3207
+ vtx = _sgl_next_vertex(ctx);
3208
+ if (vtx) { *vtx = *(vtx - 2); }
3209
+ }
3210
+ vtx = _sgl_next_vertex(ctx);
3211
+ if (vtx) {
3212
+ vtx->pos[0] = x; vtx->pos[1] = y; vtx->pos[2] = z;
3213
+ vtx->uv[0] = u; vtx->uv[1] = v;
3214
+ vtx->rgba = rgba;
3215
+ vtx->psize = ctx->point_size;
3216
+ }
3217
+ ctx->quad_vtx_count++;
3218
+ }
3219
+
3220
+ static void _sgl_identity(_sgl_matrix_t* m) {
3221
+ for (int c = 0; c < 4; c++) {
3222
+ for (int r = 0; r < 4; r++) {
3223
+ m->v[c][r] = (r == c) ? 1.0f : 0.0f;
3224
+ }
3225
+ }
3226
+ }
3227
+
3228
+ static void _sgl_transpose(_sgl_matrix_t* dst, const _sgl_matrix_t* m) {
3229
+ SOKOL_ASSERT(dst != m);
3230
+ for (int c = 0; c < 4; c++) {
3231
+ for (int r = 0; r < 4; r++) {
3232
+ dst->v[r][c] = m->v[c][r];
3233
+ }
3234
+ }
3235
+ }
3236
+
3237
+ /* _sgl_rotate, _sgl_frustum, _sgl_ortho from MESA m_matric.c */
3238
+ static void _sgl_matmul4(_sgl_matrix_t* p, const _sgl_matrix_t* a, const _sgl_matrix_t* b) {
3239
+ for (int r = 0; r < 4; r++) {
3240
+ float ai0=a->v[0][r], ai1=a->v[1][r], ai2=a->v[2][r], ai3=a->v[3][r];
3241
+ p->v[0][r] = ai0*b->v[0][0] + ai1*b->v[0][1] + ai2*b->v[0][2] + ai3*b->v[0][3];
3242
+ p->v[1][r] = ai0*b->v[1][0] + ai1*b->v[1][1] + ai2*b->v[1][2] + ai3*b->v[1][3];
3243
+ p->v[2][r] = ai0*b->v[2][0] + ai1*b->v[2][1] + ai2*b->v[2][2] + ai3*b->v[2][3];
3244
+ p->v[3][r] = ai0*b->v[3][0] + ai1*b->v[3][1] + ai2*b->v[3][2] + ai3*b->v[3][3];
3245
+ }
3246
+ }
3247
+
3248
+ static void _sgl_mul(_sgl_matrix_t* dst, const _sgl_matrix_t* m) {
3249
+ _sgl_matmul4(dst, dst, m);
3250
+ }
3251
+
3252
+ static void _sgl_rotate(_sgl_matrix_t* dst, float a, float x, float y, float z) {
3253
+
3254
+ float s = sinf(a);
3255
+ float c = cosf(a);
3256
+
3257
+ float mag = sqrtf(x*x + y*y + z*z);
3258
+ if (mag < 1.0e-4F) {
3259
+ return;
3260
+ }
3261
+ x /= mag;
3262
+ y /= mag;
3263
+ z /= mag;
3264
+ float xx = x * x;
3265
+ float yy = y * y;
3266
+ float zz = z * z;
3267
+ float xy = x * y;
3268
+ float yz = y * z;
3269
+ float zx = z * x;
3270
+ float xs = x * s;
3271
+ float ys = y * s;
3272
+ float zs = z * s;
3273
+ float one_c = 1.0f - c;
3274
+
3275
+ _sgl_matrix_t m;
3276
+ m.v[0][0] = (one_c * xx) + c;
3277
+ m.v[1][0] = (one_c * xy) - zs;
3278
+ m.v[2][0] = (one_c * zx) + ys;
3279
+ m.v[3][0] = 0.0f;
3280
+ m.v[0][1] = (one_c * xy) + zs;
3281
+ m.v[1][1] = (one_c * yy) + c;
3282
+ m.v[2][1] = (one_c * yz) - xs;
3283
+ m.v[3][1] = 0.0f;
3284
+ m.v[0][2] = (one_c * zx) - ys;
3285
+ m.v[1][2] = (one_c * yz) + xs;
3286
+ m.v[2][2] = (one_c * zz) + c;
3287
+ m.v[3][2] = 0.0f;
3288
+ m.v[0][3] = 0.0f;
3289
+ m.v[1][3] = 0.0f;
3290
+ m.v[2][3] = 0.0f;
3291
+ m.v[3][3] = 1.0f;
3292
+ _sgl_mul(dst, &m);
3293
+ }
3294
+
3295
+ static void _sgl_scale(_sgl_matrix_t* dst, float x, float y, float z) {
3296
+ for (int r = 0; r < 4; r++) {
3297
+ dst->v[0][r] *= x;
3298
+ dst->v[1][r] *= y;
3299
+ dst->v[2][r] *= z;
3300
+ }
3301
+ }
3302
+
3303
+ static void _sgl_translate(_sgl_matrix_t* dst, float x, float y, float z) {
3304
+ for (int r = 0; r < 4; r++) {
3305
+ dst->v[3][r] = dst->v[0][r]*x + dst->v[1][r]*y + dst->v[2][r]*z + dst->v[3][r];
3306
+ }
3307
+ }
3308
+
3309
+ static void _sgl_frustum(_sgl_matrix_t* dst, float left, float right, float bottom, float top, float znear, float zfar) {
3310
+ float x = (2.0f * znear) / (right - left);
3311
+ float y = (2.0f * znear) / (top - bottom);
3312
+ float a = (right + left) / (right - left);
3313
+ float b = (top + bottom) / (top - bottom);
3314
+ float c = -(zfar + znear) / (zfar - znear);
3315
+ float d = -(2.0f * zfar * znear) / (zfar - znear);
3316
+ _sgl_matrix_t m;
3317
+ m.v[0][0] = x; m.v[0][1] = 0.0f; m.v[0][2] = 0.0f; m.v[0][3] = 0.0f;
3318
+ m.v[1][0] = 0.0f; m.v[1][1] = y; m.v[1][2] = 0.0f; m.v[1][3] = 0.0f;
3319
+ m.v[2][0] = a; m.v[2][1] = b; m.v[2][2] = c; m.v[2][3] = -1.0f;
3320
+ m.v[3][0] = 0.0f; m.v[3][1] = 0.0f; m.v[3][2] = d; m.v[3][3] = 0.0f;
3321
+ _sgl_mul(dst, &m);
3322
+ }
3323
+
3324
+ static void _sgl_ortho(_sgl_matrix_t* dst, float left, float right, float bottom, float top, float znear, float zfar) {
3325
+ _sgl_matrix_t m;
3326
+ m.v[0][0] = 2.0f / (right - left);
3327
+ m.v[1][0] = 0.0f;
3328
+ m.v[2][0] = 0.0f;
3329
+ m.v[3][0] = -(right + left) / (right - left);
3330
+ m.v[0][1] = 0.0f;
3331
+ m.v[1][1] = 2.0f / (top - bottom);
3332
+ m.v[2][1] = 0.0f;
3333
+ m.v[3][1] = -(top + bottom) / (top - bottom);
3334
+ m.v[0][2] = 0.0f;
3335
+ m.v[1][2] = 0.0f;
3336
+ m.v[2][2] = -2.0f / (zfar - znear);
3337
+ m.v[3][2] = -(zfar + znear) / (zfar - znear);
3338
+ m.v[0][3] = 0.0f;
3339
+ m.v[1][3] = 0.0f;
3340
+ m.v[2][3] = 0.0f;
3341
+ m.v[3][3] = 1.0f;
3342
+
3343
+ _sgl_mul(dst, &m);
3344
+ }
3345
+
3346
+ /* _sgl_perspective, _sgl_lookat from Regal project.c */
3347
+ static void _sgl_perspective(_sgl_matrix_t* dst, float fovy, float aspect, float znear, float zfar) {
3348
+ float sine = sinf(fovy / 2.0f);
3349
+ float delta_z = zfar - znear;
3350
+ if ((delta_z == 0.0f) || (sine == 0.0f) || (aspect == 0.0f)) {
3351
+ return;
3352
+ }
3353
+ float cotan = cosf(fovy / 2.0f) / sine;
3354
+ _sgl_matrix_t m;
3355
+ _sgl_identity(&m);
3356
+ m.v[0][0] = cotan / aspect;
3357
+ m.v[1][1] = cotan;
3358
+ m.v[2][2] = -(zfar + znear) / delta_z;
3359
+ m.v[2][3] = -1.0f;
3360
+ m.v[3][2] = -2.0f * znear * zfar / delta_z;
3361
+ m.v[3][3] = 0.0f;
3362
+ _sgl_mul(dst, &m);
3363
+ }
3364
+
3365
+ static void _sgl_normalize(float v[3]) {
3366
+ float r = sqrtf(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
3367
+ if (r == 0.0f) {
3368
+ return;
3369
+ }
3370
+ v[0] /= r;
3371
+ v[1] /= r;
3372
+ v[2] /= r;
3373
+ }
3374
+
3375
+ static void _sgl_cross(float v1[3], float v2[3], float res[3]) {
3376
+ res[0] = v1[1]*v2[2] - v1[2]*v2[1];
3377
+ res[1] = v1[2]*v2[0] - v1[0]*v2[2];
3378
+ res[2] = v1[0]*v2[1] - v1[1]*v2[0];
3379
+ }
3380
+
3381
+ static void _sgl_lookat(_sgl_matrix_t* dst,
3382
+ float eye_x, float eye_y, float eye_z,
3383
+ float center_x, float center_y, float center_z,
3384
+ float up_x, float up_y, float up_z)
3385
+ {
3386
+ float fwd[3], side[3], up[3];
3387
+
3388
+ fwd[0] = center_x - eye_x; fwd[1] = center_y - eye_y; fwd[2] = center_z - eye_z;
3389
+ up[0] = up_x; up[1] = up_y; up[2] = up_z;
3390
+ _sgl_normalize(fwd);
3391
+ _sgl_cross(fwd, up, side);
3392
+ _sgl_normalize(side);
3393
+ _sgl_cross(side, fwd, up);
3394
+
3395
+ _sgl_matrix_t m;
3396
+ _sgl_identity(&m);
3397
+ m.v[0][0] = side[0];
3398
+ m.v[1][0] = side[1];
3399
+ m.v[2][0] = side[2];
3400
+ m.v[0][1] = up[0];
3401
+ m.v[1][1] = up[1];
3402
+ m.v[2][1] = up[2];
3403
+ m.v[0][2] = -fwd[0];
3404
+ m.v[1][2] = -fwd[1];
3405
+ m.v[2][2] = -fwd[2];
3406
+ _sgl_mul(dst, &m);
3407
+ _sgl_translate(dst, -eye_x, -eye_y, -eye_z);
3408
+ }
3409
+
3410
+ /* current top-of-stack projection matrix */
3411
+ static _sgl_matrix_t* _sgl_matrix_projection(_sgl_context_t* ctx) {
3412
+ return &ctx->matrix_stack[SGL_MATRIXMODE_PROJECTION][ctx->matrix_tos[SGL_MATRIXMODE_PROJECTION]];
3413
+ }
3414
+
3415
+ /* get top-of-stack modelview matrix */
3416
+ static _sgl_matrix_t* _sgl_matrix_modelview(_sgl_context_t* ctx) {
3417
+ return &ctx->matrix_stack[SGL_MATRIXMODE_MODELVIEW][ctx->matrix_tos[SGL_MATRIXMODE_MODELVIEW]];
3418
+ }
3419
+
3420
+ /* get top-of-stack texture matrix */
3421
+ static _sgl_matrix_t* _sgl_matrix_texture(_sgl_context_t* ctx) {
3422
+ return &ctx->matrix_stack[SGL_MATRIXMODE_TEXTURE][ctx->matrix_tos[SGL_MATRIXMODE_TEXTURE]];
3423
+ }
3424
+
3425
+ /* get pointer to current top-of-stack of current matrix mode */
3426
+ static _sgl_matrix_t* _sgl_matrix(_sgl_context_t* ctx) {
3427
+ return &ctx->matrix_stack[ctx->cur_matrix_mode][ctx->matrix_tos[ctx->cur_matrix_mode]];
3428
+ }
3429
+
3430
+ static sgl_desc_t _sgl_desc_defaults(const sgl_desc_t* desc) {
3431
+ SOKOL_ASSERT((desc->allocator.alloc_fn && desc->allocator.free_fn) || (!desc->allocator.alloc_fn && !desc->allocator.free_fn));
3432
+ sgl_desc_t res = *desc;
3433
+ res.max_vertices = _sgl_def(desc->max_vertices, _SGL_DEFAULT_MAX_VERTICES);
3434
+ res.max_commands = _sgl_def(desc->max_commands, _SGL_DEFAULT_MAX_COMMANDS);
3435
+ res.context_pool_size = _sgl_def(desc->context_pool_size, _SGL_DEFAULT_CONTEXT_POOL_SIZE);
3436
+ res.pipeline_pool_size = _sgl_def(desc->pipeline_pool_size, _SGL_DEFAULT_PIPELINE_POOL_SIZE);
3437
+ res.face_winding = _sgl_def(desc->face_winding, SG_FACEWINDING_CCW);
3438
+ return res;
3439
+ }
3440
+
3441
+ // create resources which are shared between all contexts
3442
+ static void _sgl_setup_common(void) {
3443
+ sg_push_debug_group("sokol-gl");
3444
+
3445
+ uint32_t pixels[64];
3446
+ for (int i = 0; i < 64; i++) {
3447
+ pixels[i] = 0xFFFFFFFF;
3448
+ }
3449
+ sg_image_desc img_desc;
3450
+ _sgl_clear(&img_desc, sizeof(img_desc));
3451
+ img_desc.type = SG_IMAGETYPE_2D;
3452
+ img_desc.width = 8;
3453
+ img_desc.height = 8;
3454
+ img_desc.num_mipmaps = 1;
3455
+ img_desc.pixel_format = SG_PIXELFORMAT_RGBA8;
3456
+ img_desc.data.mip_levels[0] = SG_RANGE(pixels);
3457
+ img_desc.label = "sgl-default-texture";
3458
+ _sgl.def_img = sg_make_image(&img_desc);
3459
+ SOKOL_ASSERT(SG_INVALID_ID != _sgl.def_img.id);
3460
+
3461
+ sg_view_desc view_desc;
3462
+ _sgl_clear(&view_desc, sizeof(view_desc));
3463
+ view_desc.texture.image = _sgl.def_img;
3464
+ view_desc.label = "sgl-default-texture-view";
3465
+ _sgl.def_view = sg_make_view(&view_desc);
3466
+ SOKOL_ASSERT(SG_INVALID_ID != _sgl.def_view.id);
3467
+
3468
+ sg_sampler_desc smp_desc;
3469
+ _sgl_clear(&smp_desc, sizeof(smp_desc));
3470
+ smp_desc.min_filter = SG_FILTER_NEAREST;
3471
+ smp_desc.mag_filter = SG_FILTER_NEAREST;
3472
+ smp_desc.label = "sgl-default-sampler";
3473
+ _sgl.def_smp = sg_make_sampler(&smp_desc);
3474
+ SOKOL_ASSERT(SG_INVALID_ID != _sgl.def_smp.id);
3475
+
3476
+ // one shader for all contexts
3477
+ sg_shader_desc shd_desc;
3478
+ _sgl_clear(&shd_desc, sizeof(shd_desc));
3479
+ shd_desc.attrs[0].glsl_name = "position";
3480
+ shd_desc.attrs[1].glsl_name = "texcoord0";
3481
+ shd_desc.attrs[2].glsl_name = "color0";
3482
+ shd_desc.attrs[3].glsl_name = "psize";
3483
+ shd_desc.attrs[0].hlsl_sem_name = "TEXCOORD";
3484
+ shd_desc.attrs[0].hlsl_sem_index = 0;
3485
+ shd_desc.attrs[1].hlsl_sem_name = "TEXCOORD";
3486
+ shd_desc.attrs[1].hlsl_sem_index = 1;
3487
+ shd_desc.attrs[2].hlsl_sem_name = "TEXCOORD";
3488
+ shd_desc.attrs[2].hlsl_sem_index = 2;
3489
+ shd_desc.attrs[3].hlsl_sem_name = "TEXCOORD";
3490
+ shd_desc.attrs[3].hlsl_sem_index = 3;
3491
+ shd_desc.attrs[0].base_type = SG_SHADERATTRBASETYPE_FLOAT;
3492
+ shd_desc.attrs[1].base_type = SG_SHADERATTRBASETYPE_FLOAT;
3493
+ shd_desc.attrs[2].base_type = SG_SHADERATTRBASETYPE_FLOAT;
3494
+ shd_desc.attrs[3].base_type = SG_SHADERATTRBASETYPE_FLOAT;
3495
+ shd_desc.uniform_blocks[0].stage = SG_SHADERSTAGE_VERTEX;
3496
+ shd_desc.uniform_blocks[0].size = sizeof(_sgl_uniform_t);
3497
+ shd_desc.uniform_blocks[0].hlsl_register_b_n = 0;
3498
+ shd_desc.uniform_blocks[0].msl_buffer_n = 0;
3499
+ shd_desc.uniform_blocks[0].wgsl_group0_binding_n = 0;
3500
+ shd_desc.uniform_blocks[0].spirv_set0_binding_n = 0;
3501
+ shd_desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "vs_params";
3502
+ shd_desc.uniform_blocks[0].glsl_uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
3503
+ shd_desc.uniform_blocks[0].glsl_uniforms[0].array_count = 8;
3504
+ shd_desc.views[0].texture.stage = SG_SHADERSTAGE_FRAGMENT;
3505
+ shd_desc.views[0].texture.image_type = SG_IMAGETYPE_2D;
3506
+ shd_desc.views[0].texture.sample_type = SG_IMAGESAMPLETYPE_FLOAT;
3507
+ shd_desc.views[0].texture.hlsl_register_t_n = 0;
3508
+ shd_desc.views[0].texture.msl_texture_n = 0;
3509
+ shd_desc.views[0].texture.wgsl_group1_binding_n = 0;
3510
+ shd_desc.views[0].texture.spirv_set1_binding_n = 0;
3511
+ shd_desc.samplers[0].stage = SG_SHADERSTAGE_FRAGMENT;
3512
+ shd_desc.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING;
3513
+ shd_desc.samplers[0].hlsl_register_s_n = 0;
3514
+ shd_desc.samplers[0].msl_sampler_n = 0;
3515
+ shd_desc.samplers[0].wgsl_group1_binding_n = 32;
3516
+ shd_desc.samplers[0].spirv_set1_binding_n = 32;
3517
+ shd_desc.texture_sampler_pairs[0].stage = SG_SHADERSTAGE_FRAGMENT;
3518
+ shd_desc.texture_sampler_pairs[0].view_slot = 0;
3519
+ shd_desc.texture_sampler_pairs[0].sampler_slot = 0;
3520
+ shd_desc.texture_sampler_pairs[0].glsl_name = "tex_smp";
3521
+ shd_desc.label = "sgl-shader";
3522
+ #if defined(SOKOL_GLCORE)
3523
+ shd_desc.vertex_func.source = (const char*)_sgl_shd_vs_source_glsl410;
3524
+ shd_desc.fragment_func.source = (const char*)_sgl_shd_fs_source_glsl410;
3525
+ #elif defined(SOKOL_GLES3)
3526
+ shd_desc.vertex_func.source = (const char*)_sgl_shd_vs_source_glsl300es;
3527
+ shd_desc.fragment_func.source = (const char*)_sgl_shd_fs_source_glsl300es;
3528
+ #elif defined(SOKOL_METAL)
3529
+ shd_desc.vertex_func.entry = "main0";
3530
+ shd_desc.fragment_func.entry = "main0";
3531
+ switch (sg_query_backend()) {
3532
+ case SG_BACKEND_METAL_MACOS:
3533
+ shd_desc.vertex_func.bytecode = SG_RANGE(_sgl_shd_vs_bytecode_metal_macos);
3534
+ shd_desc.fragment_func.bytecode = SG_RANGE(_sgl_shd_fs_bytecode_metal_macos);
3535
+ break;
3536
+ case SG_BACKEND_METAL_IOS:
3537
+ shd_desc.vertex_func.bytecode = SG_RANGE(_sgl_shd_vs_bytecode_metal_ios);
3538
+ shd_desc.fragment_func.bytecode = SG_RANGE(_sgl_shd_fs_bytecode_metal_ios);
3539
+ break;
3540
+ default:
3541
+ shd_desc.vertex_func.source = (const char*)_sgl_shd_vs_source_metal_sim;
3542
+ shd_desc.fragment_func.source = (const char*)_sgl_shd_fs_source_metal_sim;
3543
+ break;
3544
+ }
3545
+ #elif defined(SOKOL_D3D11)
3546
+ shd_desc.vertex_func.bytecode = SG_RANGE(_sgl_shd_vs_bytecode_hlsl4);
3547
+ shd_desc.fragment_func.bytecode = SG_RANGE(_sgl_shd_fs_bytecode_hlsl4);
3548
+ #elif defined(SOKOL_WGPU)
3549
+ shd_desc.vertex_func.source = (const char*)_sgl_shd_vs_source_wgsl;
3550
+ shd_desc.fragment_func.source = (const char*)_sgl_shd_fs_source_wgsl;
3551
+ #elif defined(SOKOL_VULKAN)
3552
+ shd_desc.vertex_func.bytecode = SG_RANGE(_sgl_shd_vs_bytecode_spirv_vk);
3553
+ shd_desc.vertex_func.entry = "main";
3554
+ shd_desc.fragment_func.bytecode = SG_RANGE(_sgl_shd_fs_bytecode_spirv_vk);
3555
+ shd_desc.fragment_func.entry = "main";
3556
+ #else
3557
+ shd_desc.vertex_func.source = _sgl_shd_vs_source_dummy;
3558
+ shd_desc.fragment_func.source = _sgl_shd_fs_source_dummy;
3559
+ #endif
3560
+ _sgl.shd = sg_make_shader(&shd_desc);
3561
+ SOKOL_ASSERT(SG_INVALID_ID != _sgl.shd.id);
3562
+ sg_pop_debug_group();
3563
+ }
3564
+
3565
+ // discard resources which are shared between all contexts
3566
+ static void _sgl_discard_common(void) {
3567
+ sg_push_debug_group("sokol-gl");
3568
+ sg_destroy_view(_sgl.def_view);
3569
+ sg_destroy_image(_sgl.def_img);
3570
+ sg_destroy_sampler(_sgl.def_smp);
3571
+ sg_destroy_shader(_sgl.shd);
3572
+ sg_pop_debug_group();
3573
+ }
3574
+
3575
+ static bool _sgl_is_default_context(sgl_context ctx_id) {
3576
+ return ctx_id.id == SGL_DEFAULT_CONTEXT.id;
3577
+ }
3578
+
3579
+ static void _sgl_draw(_sgl_context_t* ctx, int layer_id) {
3580
+ SOKOL_ASSERT(ctx);
3581
+ if ((ctx->vertices.next > 0) && (ctx->commands.next > 0)) {
3582
+ sg_push_debug_group("sokol-gl");
3583
+
3584
+ uint32_t cur_pip_id = SG_INVALID_ID;
3585
+ uint32_t cur_tex_id = SG_INVALID_ID;
3586
+ uint32_t cur_smp_id = SG_INVALID_ID;
3587
+ int cur_uniform_index = -1;
3588
+
3589
+ if (ctx->update_frame_id != ctx->frame_id) {
3590
+ ctx->update_frame_id = ctx->frame_id;
3591
+ sg_write_buffer_desc write_desc;
3592
+ _sgl_clear(&write_desc, sizeof(write_desc));
3593
+ write_desc.src.data.ptr = ctx->vertices.ptr;
3594
+ write_desc.src.data.size = (size_t)ctx->vertices.next * sizeof(_sgl_vertex_t);
3595
+ write_desc.dst.buffer = ctx->vbuf;
3596
+ sg_write_buffer_transient(&write_desc);
3597
+ }
3598
+
3599
+ // render all successfully recorded commands (this may be less than the
3600
+ // issued commands if we're in an error state)
3601
+ for (int i = 0; i < ctx->commands.next; i++) {
3602
+ const _sgl_command_t* cmd = &ctx->commands.ptr[i];
3603
+ if (cmd->layer_id != layer_id) {
3604
+ continue;
3605
+ }
3606
+ switch (cmd->cmd) {
3607
+ case SGL_COMMAND_VIEWPORT:
3608
+ {
3609
+ const _sgl_viewport_args_t* args = &cmd->args.viewport;
3610
+ sg_apply_viewport(args->x, args->y, args->w, args->h, args->origin_top_left);
3611
+ }
3612
+ break;
3613
+ case SGL_COMMAND_SCISSOR_RECT:
3614
+ {
3615
+ const _sgl_scissor_rect_args_t* args = &cmd->args.scissor_rect;
3616
+ sg_apply_scissor_rect(args->x, args->y, args->w, args->h, args->origin_top_left);
3617
+ }
3618
+ break;
3619
+ case SGL_COMMAND_DRAW:
3620
+ {
3621
+ const _sgl_draw_args_t* args = &cmd->args.draw;
3622
+ if (args->pip.id != cur_pip_id) {
3623
+ sg_apply_pipeline(args->pip);
3624
+ cur_pip_id = args->pip.id;
3625
+ // when pipeline changes, also need to re-apply uniforms and bindings
3626
+ cur_tex_id = SG_INVALID_ID;
3627
+ cur_smp_id = SG_INVALID_ID;
3628
+ cur_uniform_index = -1;
3629
+ }
3630
+ if ((cur_tex_id != args->view.id) || (cur_smp_id != args->smp.id)) {
3631
+ ctx->bind.views[0] = args->view;
3632
+ ctx->bind.samplers[0] = args->smp;
3633
+ sg_apply_bindings(&ctx->bind);
3634
+ cur_tex_id = args->view.id;
3635
+ cur_smp_id = args->smp.id;
3636
+ }
3637
+ if (cur_uniform_index != args->uniform_index) {
3638
+ const sg_range ub_range = { &ctx->uniforms.ptr[args->uniform_index], sizeof(_sgl_uniform_t) };
3639
+ sg_apply_uniforms(0, &ub_range);
3640
+ cur_uniform_index = args->uniform_index;
3641
+ }
3642
+ // FIXME: what if number of vertices doesn't match the primitive type?
3643
+ if (args->num_vertices > 0) {
3644
+ sg_draw(args->base_vertex, args->num_vertices, 1);
3645
+ }
3646
+ }
3647
+ break;
3648
+ }
3649
+ }
3650
+ sg_pop_debug_group();
3651
+ }
3652
+ }
3653
+
3654
+ static sgl_context_desc_t _sgl_as_context_desc(const sgl_desc_t* desc) {
3655
+ sgl_context_desc_t ctx_desc;
3656
+ _sgl_clear(&ctx_desc, sizeof(ctx_desc));
3657
+ ctx_desc.max_vertices = desc->max_vertices;
3658
+ ctx_desc.max_commands = desc->max_commands;
3659
+ ctx_desc.color_format = desc->color_format;
3660
+ ctx_desc.depth_format = desc->depth_format;
3661
+ ctx_desc.sample_count = desc->sample_count;
3662
+ return ctx_desc;
3663
+ }
3664
+
3665
+ // ██████ ██ ██ ██████ ██ ██ ██████
3666
+ // ██ ██ ██ ██ ██ ██ ██ ██ ██
3667
+ // ██████ ██ ██ ██████ ██ ██ ██
3668
+ // ██ ██ ██ ██ ██ ██ ██ ██
3669
+ // ██ ██████ ██████ ███████ ██ ██████
3670
+ //
3671
+ // >>public
3672
+ SOKOL_API_IMPL void sgl_setup(const sgl_desc_t* desc) {
3673
+ SOKOL_ASSERT(desc);
3674
+ _sgl_clear(&_sgl, sizeof(_sgl));
3675
+ _sgl.init_cookie = _SGL_INIT_COOKIE;
3676
+ _sgl.desc = _sgl_desc_defaults(desc);
3677
+ _sgl_setup_pipeline_pool(_sgl.desc.pipeline_pool_size);
3678
+ _sgl_setup_context_pool(_sgl.desc.context_pool_size);
3679
+ _sgl_setup_common();
3680
+ const sgl_context_desc_t ctx_desc = _sgl_as_context_desc(&_sgl.desc);
3681
+ _sgl.def_ctx_id = sgl_make_context(&ctx_desc);
3682
+ SOKOL_ASSERT(SGL_DEFAULT_CONTEXT.id == _sgl.def_ctx_id.id);
3683
+ sgl_set_context(_sgl.def_ctx_id);
3684
+ }
3685
+
3686
+ SOKOL_API_IMPL void sgl_shutdown(void) {
3687
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3688
+ // contexts own a pipeline, so destroy contexts before pipelines
3689
+ for (int i = 0; i < _sgl.context_pool.pool.size; i++) {
3690
+ _sgl_context_t* ctx = &_sgl.context_pool.contexts[i];
3691
+ _sgl_destroy_context(_sgl_make_ctx_id(ctx->slot.id));
3692
+ }
3693
+ for (int i = 0; i < _sgl.pip_pool.pool.size; i++) {
3694
+ _sgl_pipeline_t* pip = &_sgl.pip_pool.pips[i];
3695
+ _sgl_destroy_pipeline(_sgl_make_pip_id(pip->slot.id));
3696
+ }
3697
+ _sgl_discard_context_pool();
3698
+ _sgl_discard_pipeline_pool();
3699
+ _sgl_discard_common();
3700
+ _sgl.init_cookie = 0;
3701
+ }
3702
+
3703
+ SOKOL_API_IMPL sgl_error_t sgl_error(void) {
3704
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3705
+ if (ctx) {
3706
+ return ctx->error;
3707
+ } else {
3708
+ sgl_error_t err = _sgl_error_defaults();
3709
+ err.no_context = true;
3710
+ err.any = true;
3711
+ return err;
3712
+ }
3713
+ }
3714
+
3715
+ SOKOL_API_IMPL sgl_error_t sgl_context_error(sgl_context ctx_id) {
3716
+ const _sgl_context_t* ctx = _sgl_lookup_context(ctx_id.id);
3717
+ if (ctx) {
3718
+ return ctx->error;
3719
+ } else {
3720
+ sgl_error_t err = _sgl_error_defaults();
3721
+ err.no_context = true;
3722
+ err.any = true;
3723
+ return err;
3724
+ }
3725
+ }
3726
+
3727
+ SOKOL_API_IMPL float sgl_rad(float deg) {
3728
+ return (deg * (float)M_PI) / 180.0f;
3729
+ }
3730
+
3731
+ SOKOL_API_IMPL float sgl_deg(float rad) {
3732
+ return (rad * 180.0f) / (float)M_PI;
3733
+ }
3734
+
3735
+ SOKOL_API_IMPL sgl_context sgl_make_context(const sgl_context_desc_t* desc) {
3736
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3737
+ return _sgl_make_context(desc);
3738
+ }
3739
+
3740
+ SOKOL_API_IMPL void sgl_destroy_context(sgl_context ctx_id) {
3741
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3742
+ if (_sgl_is_default_context(ctx_id)) {
3743
+ _SGL_WARN(CANNOT_DESTROY_DEFAULT_CONTEXT);
3744
+ return;
3745
+ }
3746
+ _sgl_destroy_context(ctx_id);
3747
+ // re-validate the current context pointer (this will return a nullptr
3748
+ // if we just destroyed the current context)
3749
+ _sgl.cur_ctx = _sgl_lookup_context(_sgl.cur_ctx_id.id);
3750
+ }
3751
+
3752
+ SOKOL_API_IMPL void sgl_set_context(sgl_context ctx_id) {
3753
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3754
+ if (_sgl_is_default_context(ctx_id)) {
3755
+ _sgl.cur_ctx_id = _sgl.def_ctx_id;
3756
+ } else {
3757
+ _sgl.cur_ctx_id = ctx_id;
3758
+ }
3759
+ // this will return null if the handle isn't valid
3760
+ _sgl.cur_ctx = _sgl_lookup_context(_sgl.cur_ctx_id.id);
3761
+ }
3762
+
3763
+ SOKOL_API_IMPL sgl_context sgl_get_context(void) {
3764
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3765
+ return _sgl.cur_ctx_id;
3766
+ }
3767
+
3768
+ SOKOL_API_IMPL sgl_context sgl_default_context(void) {
3769
+ return SGL_DEFAULT_CONTEXT;
3770
+ }
3771
+
3772
+ SOKOL_API_IMPL int sgl_num_vertices(void) {
3773
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3774
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3775
+ if (ctx) {
3776
+ return _sgl_num_vertices(ctx);
3777
+ } else {
3778
+ return 0;
3779
+ }
3780
+ }
3781
+
3782
+ SOKOL_API_IMPL int sgl_num_commands(void) {
3783
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3784
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3785
+ if (ctx) {
3786
+ return _sgl_num_commands(ctx);
3787
+ } else {
3788
+ return 0;
3789
+ }
3790
+ }
3791
+
3792
+ SOKOL_API_IMPL sgl_pipeline sgl_make_pipeline(const sg_pipeline_desc* desc) {
3793
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3794
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3795
+ if (ctx) {
3796
+ return _sgl_make_pipeline(desc, &ctx->desc);
3797
+ } else {
3798
+ return _sgl_make_pip_id(SG_INVALID_ID);
3799
+ }
3800
+ }
3801
+
3802
+ SOKOL_API_IMPL sgl_pipeline sgl_context_make_pipeline(sgl_context ctx_id, const sg_pipeline_desc* desc) {
3803
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3804
+ const _sgl_context_t* ctx = _sgl_lookup_context(ctx_id.id);
3805
+ if (ctx) {
3806
+ return _sgl_make_pipeline(desc, &ctx->desc);
3807
+ } else {
3808
+ return _sgl_make_pip_id(SG_INVALID_ID);
3809
+ }
3810
+ }
3811
+
3812
+ SOKOL_API_IMPL void sgl_destroy_pipeline(sgl_pipeline pip_id) {
3813
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3814
+ _sgl_destroy_pipeline(pip_id);
3815
+ }
3816
+
3817
+ SOKOL_API_IMPL void sgl_load_pipeline(sgl_pipeline pip_id) {
3818
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3819
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3820
+ if (!ctx) {
3821
+ return;
3822
+ }
3823
+ SOKOL_ASSERT((ctx->pip_tos >= 0) && (ctx->pip_tos < _SGL_MAX_STACK_DEPTH));
3824
+ ctx->pip_stack[ctx->pip_tos] = pip_id;
3825
+ }
3826
+
3827
+ SOKOL_API_IMPL void sgl_load_default_pipeline(void) {
3828
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3829
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3830
+ if (!ctx) {
3831
+ return;
3832
+ }
3833
+ SOKOL_ASSERT((ctx->pip_tos >= 0) && (ctx->pip_tos < _SGL_MAX_STACK_DEPTH));
3834
+ ctx->pip_stack[ctx->pip_tos] = ctx->def_pip;
3835
+ }
3836
+
3837
+ SOKOL_API_IMPL void sgl_push_pipeline(void) {
3838
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3839
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3840
+ if (!ctx) {
3841
+ return;
3842
+ }
3843
+ if (ctx->pip_tos < (_SGL_MAX_STACK_DEPTH - 1)) {
3844
+ ctx->pip_tos++;
3845
+ ctx->pip_stack[ctx->pip_tos] = ctx->pip_stack[ctx->pip_tos-1];
3846
+ } else {
3847
+ ctx->error.stack_overflow = true;
3848
+ ctx->error.any = true;
3849
+ }
3850
+ }
3851
+
3852
+ SOKOL_API_IMPL void sgl_pop_pipeline(void) {
3853
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3854
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3855
+ if (!ctx) {
3856
+ return;
3857
+ }
3858
+ if (ctx->pip_tos > 0) {
3859
+ ctx->pip_tos--;
3860
+ } else {
3861
+ ctx->error.stack_underflow = true;
3862
+ ctx->error.any = true;
3863
+ }
3864
+ }
3865
+
3866
+ SOKOL_API_IMPL void sgl_defaults(void) {
3867
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3868
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3869
+ if (!ctx) {
3870
+ return;
3871
+ }
3872
+ SOKOL_ASSERT(!ctx->in_begin);
3873
+ ctx->u = 0.0f; ctx->v = 0.0f;
3874
+ ctx->rgba = 0xFFFFFFFF;
3875
+ ctx->point_size = 1.0f;
3876
+ ctx->texturing_enabled = false;
3877
+ ctx->cur_view = _sgl.def_view;
3878
+ ctx->cur_smp = _sgl.def_smp;
3879
+ sgl_load_default_pipeline();
3880
+ _sgl_identity(_sgl_matrix_texture(ctx));
3881
+ _sgl_identity(_sgl_matrix_modelview(ctx));
3882
+ _sgl_identity(_sgl_matrix_projection(ctx));
3883
+ ctx->cur_matrix_mode = SGL_MATRIXMODE_MODELVIEW;
3884
+ ctx->matrix_dirty = true;
3885
+ }
3886
+
3887
+ SOKOL_API_IMPL void sgl_layer(int layer_id) {
3888
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3889
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3890
+ if (!ctx) {
3891
+ return;
3892
+ }
3893
+ SOKOL_ASSERT(!ctx->in_begin);
3894
+ ctx->layer_id = layer_id;
3895
+ }
3896
+
3897
+ SOKOL_API_IMPL void sgl_viewport(int x, int y, int w, int h, bool origin_top_left) {
3898
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3899
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3900
+ if (!ctx) {
3901
+ return;
3902
+ }
3903
+ SOKOL_ASSERT(!ctx->in_begin);
3904
+ _sgl_command_t* cmd = _sgl_next_command(ctx);
3905
+ if (cmd) {
3906
+ cmd->cmd = SGL_COMMAND_VIEWPORT;
3907
+ cmd->layer_id = ctx->layer_id;
3908
+ cmd->args.viewport.x = x;
3909
+ cmd->args.viewport.y = y;
3910
+ cmd->args.viewport.w = w;
3911
+ cmd->args.viewport.h = h;
3912
+ cmd->args.viewport.origin_top_left = origin_top_left;
3913
+ }
3914
+ }
3915
+
3916
+ SOKOL_API_IMPL void sgl_viewportf(float x, float y, float w, float h, bool origin_top_left) {
3917
+ sgl_viewport((int)x, (int)y, (int)w, (int)h, origin_top_left);
3918
+ }
3919
+
3920
+ SOKOL_API_IMPL void sgl_scissor_rect(int x, int y, int w, int h, bool origin_top_left) {
3921
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3922
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3923
+ if (!ctx) {
3924
+ return;
3925
+ }
3926
+ SOKOL_ASSERT(!ctx->in_begin);
3927
+ _sgl_command_t* cmd = _sgl_next_command(ctx);
3928
+ if (cmd) {
3929
+ cmd->cmd = SGL_COMMAND_SCISSOR_RECT;
3930
+ cmd->layer_id = ctx->layer_id;
3931
+ cmd->args.scissor_rect.x = x;
3932
+ cmd->args.scissor_rect.y = y;
3933
+ cmd->args.scissor_rect.w = w;
3934
+ cmd->args.scissor_rect.h = h;
3935
+ cmd->args.scissor_rect.origin_top_left = origin_top_left;
3936
+ }
3937
+ }
3938
+
3939
+ SOKOL_API_IMPL void sgl_scissor_rectf(float x, float y, float w, float h, bool origin_top_left) {
3940
+ sgl_scissor_rect((int)x, (int)y, (int)w, (int)h, origin_top_left);
3941
+ }
3942
+
3943
+ SOKOL_API_IMPL void sgl_enable_texture(void) {
3944
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3945
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3946
+ if (!ctx) {
3947
+ return;
3948
+ }
3949
+ SOKOL_ASSERT(!ctx->in_begin);
3950
+ ctx->texturing_enabled = true;
3951
+ }
3952
+
3953
+ SOKOL_API_IMPL void sgl_disable_texture(void) {
3954
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3955
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3956
+ if (!ctx) {
3957
+ return;
3958
+ }
3959
+ SOKOL_ASSERT(!ctx->in_begin);
3960
+ ctx->texturing_enabled = false;
3961
+ }
3962
+
3963
+ SOKOL_API_IMPL void sgl_texture(sg_view tex_view, sg_sampler smp) {
3964
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3965
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3966
+ if (!ctx) {
3967
+ return;
3968
+ }
3969
+ SOKOL_ASSERT(!ctx->in_begin);
3970
+ if (SG_INVALID_ID != tex_view.id) {
3971
+ ctx->cur_view = tex_view;
3972
+ } else {
3973
+ ctx->cur_view = _sgl.def_view;
3974
+ }
3975
+ if (SG_INVALID_ID != smp.id) {
3976
+ ctx->cur_smp = smp;
3977
+ } else {
3978
+ ctx->cur_smp = _sgl.def_smp;
3979
+ }
3980
+ }
3981
+
3982
+ SOKOL_API_IMPL void sgl_begin_points(void) {
3983
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3984
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3985
+ if (!ctx) {
3986
+ return;
3987
+ }
3988
+ SOKOL_ASSERT(!ctx->in_begin);
3989
+ _sgl_begin(ctx, SGL_PRIMITIVETYPE_POINTS);
3990
+ }
3991
+
3992
+ SOKOL_API_IMPL void sgl_begin_lines(void) {
3993
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
3994
+ _sgl_context_t* ctx = _sgl.cur_ctx;
3995
+ if (!ctx) {
3996
+ return;
3997
+ }
3998
+ SOKOL_ASSERT(!ctx->in_begin);
3999
+ _sgl_begin(ctx, SGL_PRIMITIVETYPE_LINES);
4000
+ }
4001
+
4002
+ SOKOL_API_IMPL void sgl_begin_line_strip(void) {
4003
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4004
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4005
+ if (!ctx) {
4006
+ return;
4007
+ }
4008
+ SOKOL_ASSERT(!ctx->in_begin);
4009
+ _sgl_begin(ctx, SGL_PRIMITIVETYPE_LINE_STRIP);
4010
+ }
4011
+
4012
+ SOKOL_API_IMPL void sgl_begin_triangles(void) {
4013
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4014
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4015
+ if (!ctx) {
4016
+ return;
4017
+ }
4018
+ SOKOL_ASSERT(!ctx->in_begin);
4019
+ _sgl_begin(ctx, SGL_PRIMITIVETYPE_TRIANGLES);
4020
+ }
4021
+
4022
+ SOKOL_API_IMPL void sgl_begin_triangle_strip(void) {
4023
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4024
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4025
+ if (!ctx) {
4026
+ return;
4027
+ }
4028
+ SOKOL_ASSERT(!ctx->in_begin);
4029
+ _sgl_begin(ctx, SGL_PRIMITIVETYPE_TRIANGLE_STRIP);
4030
+ }
4031
+
4032
+ SOKOL_API_IMPL void sgl_begin_quads(void) {
4033
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4034
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4035
+ if (!ctx) {
4036
+ return;
4037
+ }
4038
+ SOKOL_ASSERT(!ctx->in_begin);
4039
+ _sgl_begin(ctx, SGL_PRIMITIVETYPE_QUADS);
4040
+ }
4041
+
4042
+ SOKOL_API_IMPL void sgl_end(void) {
4043
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4044
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4045
+ if (!ctx) {
4046
+ return;
4047
+ }
4048
+ SOKOL_ASSERT(ctx->in_begin);
4049
+ SOKOL_ASSERT(ctx->vertices.next >= ctx->base_vertex);
4050
+ ctx->in_begin = false;
4051
+
4052
+ bool matrix_dirty = ctx->matrix_dirty;
4053
+ if (matrix_dirty) {
4054
+ ctx->matrix_dirty = false;
4055
+ _sgl_uniform_t* uni = _sgl_next_uniform(ctx);
4056
+ if (uni) {
4057
+ _sgl_matmul4(&uni->mvp, _sgl_matrix_projection(ctx), _sgl_matrix_modelview(ctx));
4058
+ uni->tm = *_sgl_matrix_texture(ctx);
4059
+ }
4060
+ }
4061
+
4062
+ // don't record any new commands when we're in an error state
4063
+ if (ctx->error.any) {
4064
+ return;
4065
+ }
4066
+
4067
+ // check if command can be merged with current command
4068
+ sg_pipeline pip = _sgl_get_pipeline(ctx->pip_stack[ctx->pip_tos], ctx->cur_prim_type);
4069
+ sg_view view = ctx->texturing_enabled ? ctx->cur_view : _sgl.def_view;
4070
+ sg_sampler smp = ctx->texturing_enabled ? ctx->cur_smp : _sgl.def_smp;
4071
+ _sgl_command_t* cur_cmd = _sgl_cur_command(ctx);
4072
+ bool merge_cmd = false;
4073
+ if (cur_cmd) {
4074
+ if ((cur_cmd->cmd == SGL_COMMAND_DRAW) &&
4075
+ (cur_cmd->layer_id == ctx->layer_id) &&
4076
+ (ctx->cur_prim_type != SGL_PRIMITIVETYPE_LINE_STRIP) &&
4077
+ (ctx->cur_prim_type != SGL_PRIMITIVETYPE_TRIANGLE_STRIP) &&
4078
+ !matrix_dirty &&
4079
+ (cur_cmd->args.draw.view.id == view.id) &&
4080
+ (cur_cmd->args.draw.smp.id == smp.id) &&
4081
+ (cur_cmd->args.draw.pip.id == pip.id))
4082
+ {
4083
+ merge_cmd = true;
4084
+ }
4085
+ }
4086
+ if (merge_cmd) {
4087
+ // draw command can be merged with the previous command
4088
+ cur_cmd->args.draw.num_vertices += ctx->vertices.next - ctx->base_vertex;
4089
+ } else {
4090
+ // append a new draw command
4091
+ _sgl_command_t* cmd = _sgl_next_command(ctx);
4092
+ if (cmd) {
4093
+ SOKOL_ASSERT(ctx->uniforms.next > 0);
4094
+ cmd->cmd = SGL_COMMAND_DRAW;
4095
+ cmd->layer_id = ctx->layer_id;
4096
+ cmd->args.draw.view = view;
4097
+ cmd->args.draw.smp = smp;
4098
+ cmd->args.draw.pip = _sgl_get_pipeline(ctx->pip_stack[ctx->pip_tos], ctx->cur_prim_type);
4099
+ cmd->args.draw.base_vertex = ctx->base_vertex;
4100
+ cmd->args.draw.num_vertices = ctx->vertices.next - ctx->base_vertex;
4101
+ cmd->args.draw.uniform_index = ctx->uniforms.next - 1;
4102
+ }
4103
+ }
4104
+ }
4105
+
4106
+ SOKOL_API_IMPL void sgl_point_size(float s) {
4107
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4108
+ if (ctx) {
4109
+ ctx->point_size = s;
4110
+ }
4111
+ }
4112
+
4113
+ SOKOL_API_IMPL void sgl_t2f(float u, float v) {
4114
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4115
+ if (ctx) {
4116
+ ctx->u = u;
4117
+ ctx->v = v;
4118
+ }
4119
+ }
4120
+
4121
+ SOKOL_API_IMPL void sgl_c3f(float r, float g, float b) {
4122
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4123
+ if (ctx) {
4124
+ ctx->rgba = _sgl_pack_rgbaf(r, g, b, 1.0f);
4125
+ }
4126
+ }
4127
+
4128
+ SOKOL_API_IMPL void sgl_c4f(float r, float g, float b, float a) {
4129
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4130
+ if (ctx) {
4131
+ ctx->rgba = _sgl_pack_rgbaf(r, g, b, a);
4132
+ }
4133
+ }
4134
+
4135
+ SOKOL_API_IMPL void sgl_c3b(uint8_t r, uint8_t g, uint8_t b) {
4136
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4137
+ if (ctx) {
4138
+ ctx->rgba = _sgl_pack_rgbab(r, g, b, 255);
4139
+ }
4140
+ }
4141
+
4142
+ SOKOL_API_IMPL void sgl_c4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
4143
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4144
+ if (ctx) {
4145
+ ctx->rgba = _sgl_pack_rgbab(r, g, b, a);
4146
+ }
4147
+ }
4148
+
4149
+ SOKOL_API_IMPL void sgl_c1i(uint32_t rgba) {
4150
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4151
+ if (ctx) {
4152
+ ctx->rgba = rgba;
4153
+ }
4154
+ }
4155
+
4156
+ SOKOL_API_IMPL void sgl_v2f(float x, float y) {
4157
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4158
+ if (ctx) {
4159
+ _sgl_vtx(ctx, x, y, 0.0f, ctx->u, ctx->v, ctx->rgba);
4160
+ }
4161
+ }
4162
+
4163
+ SOKOL_API_IMPL void sgl_v3f(float x, float y, float z) {
4164
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4165
+ if (ctx) {
4166
+ _sgl_vtx(ctx, x, y, z, ctx->u, ctx->v, ctx->rgba);
4167
+ }
4168
+ }
4169
+
4170
+ SOKOL_API_IMPL void sgl_v2f_t2f(float x, float y, float u, float v) {
4171
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4172
+ if (ctx) {
4173
+ _sgl_vtx(ctx, x, y, 0.0f, u, v, ctx->rgba);
4174
+ }
4175
+ }
4176
+
4177
+ SOKOL_API_IMPL void sgl_v3f_t2f(float x, float y, float z, float u, float v) {
4178
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4179
+ if (ctx) {
4180
+ _sgl_vtx(ctx, x, y, z, u, v, ctx->rgba);
4181
+ }
4182
+ }
4183
+
4184
+ SOKOL_API_IMPL void sgl_v2f_c3f(float x, float y, float r, float g, float b) {
4185
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4186
+ if (ctx) {
4187
+ _sgl_vtx(ctx, x, y, 0.0f, ctx->u, ctx->v, _sgl_pack_rgbaf(r, g, b, 1.0f));
4188
+ }
4189
+ }
4190
+
4191
+ SOKOL_API_IMPL void sgl_v2f_c3b(float x, float y, uint8_t r, uint8_t g, uint8_t b) {
4192
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4193
+ if (ctx) {
4194
+ _sgl_vtx(ctx, x, y, 0.0f, ctx->u, ctx->v, _sgl_pack_rgbab(r, g, b, 255));
4195
+ }
4196
+ }
4197
+
4198
+ SOKOL_API_IMPL void sgl_v2f_c4f(float x, float y, float r, float g, float b, float a) {
4199
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4200
+ if (ctx) {
4201
+ _sgl_vtx(ctx, x, y, 0.0f, ctx->u, ctx->v, _sgl_pack_rgbaf(r, g, b, a));
4202
+ }
4203
+ }
4204
+
4205
+ SOKOL_API_IMPL void sgl_v2f_c4b(float x, float y, uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
4206
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4207
+ if (ctx) {
4208
+ _sgl_vtx(ctx, x, y, 0.0f, ctx->u, ctx->v, _sgl_pack_rgbab(r, g, b, a));
4209
+ }
4210
+ }
4211
+
4212
+ SOKOL_API_IMPL void sgl_v2f_c1i(float x, float y, uint32_t rgba) {
4213
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4214
+ if (ctx) {
4215
+ _sgl_vtx(ctx, x, y, 0.0f, ctx->u, ctx->v, rgba);
4216
+ }
4217
+ }
4218
+
4219
+ SOKOL_API_IMPL void sgl_v3f_c3f(float x, float y, float z, float r, float g, float b) {
4220
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4221
+ if (ctx) {
4222
+ _sgl_vtx(ctx, x, y, z, ctx->u, ctx->v, _sgl_pack_rgbaf(r, g, b, 1.0f));
4223
+ }
4224
+ }
4225
+
4226
+ SOKOL_API_IMPL void sgl_v3f_c3b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b) {
4227
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4228
+ if (ctx) {
4229
+ _sgl_vtx(ctx, x, y, z, ctx->u, ctx->v, _sgl_pack_rgbab(r, g, b, 255));
4230
+ }
4231
+ }
4232
+
4233
+ SOKOL_API_IMPL void sgl_v3f_c4f(float x, float y, float z, float r, float g, float b, float a) {
4234
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4235
+ if (ctx) {
4236
+ _sgl_vtx(ctx, x, y, z, ctx->u, ctx->v, _sgl_pack_rgbaf(r, g, b, a));
4237
+ }
4238
+ }
4239
+
4240
+ SOKOL_API_IMPL void sgl_v3f_c4b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
4241
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4242
+ if (ctx) {
4243
+ _sgl_vtx(ctx, x, y, z, ctx->u, ctx->v, _sgl_pack_rgbab(r, g, b, a));
4244
+ }
4245
+ }
4246
+
4247
+ SOKOL_API_IMPL void sgl_v3f_c1i(float x, float y, float z, uint32_t rgba) {
4248
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4249
+ if (ctx) {
4250
+ _sgl_vtx(ctx, x, y, z, ctx->u, ctx->v, rgba);
4251
+ }
4252
+ }
4253
+
4254
+ SOKOL_API_IMPL void sgl_v2f_t2f_c3f(float x, float y, float u, float v, float r, float g, float b) {
4255
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4256
+ if (ctx) {
4257
+ _sgl_vtx(ctx, x, y, 0.0f, u, v, _sgl_pack_rgbaf(r, g, b, 1.0f));
4258
+ }
4259
+ }
4260
+
4261
+ SOKOL_API_IMPL void sgl_v2f_t2f_c3b(float x, float y, float u, float v, uint8_t r, uint8_t g, uint8_t b) {
4262
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4263
+ if (ctx) {
4264
+ _sgl_vtx(ctx, x, y, 0.0f, u, v, _sgl_pack_rgbab(r, g, b, 255));
4265
+ }
4266
+ }
4267
+
4268
+ SOKOL_API_IMPL void sgl_v2f_t2f_c4f(float x, float y, float u, float v, float r, float g, float b, float a) {
4269
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4270
+ if (ctx) {
4271
+ _sgl_vtx(ctx, x, y, 0.0f, u, v, _sgl_pack_rgbaf(r, g, b, a));
4272
+ }
4273
+ }
4274
+
4275
+ SOKOL_API_IMPL void sgl_v2f_t2f_c4b(float x, float y, float u, float v, uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
4276
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4277
+ if (ctx) {
4278
+ _sgl_vtx(ctx, x, y, 0.0f, u, v, _sgl_pack_rgbab(r, g, b, a));
4279
+ }
4280
+ }
4281
+
4282
+ SOKOL_API_IMPL void sgl_v2f_t2f_c1i(float x, float y, float u, float v, uint32_t rgba) {
4283
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4284
+ if (ctx) {
4285
+ _sgl_vtx(ctx, x, y, 0.0f, u, v, rgba);
4286
+ }
4287
+ }
4288
+
4289
+ SOKOL_API_IMPL void sgl_v3f_t2f_c3f(float x, float y, float z, float u, float v, float r, float g, float b) {
4290
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4291
+ if (ctx) {
4292
+ _sgl_vtx(ctx, x, y, z, u, v, _sgl_pack_rgbaf(r, g, b, 1.0f));
4293
+ }
4294
+ }
4295
+
4296
+ SOKOL_API_IMPL void sgl_v3f_t2f_c3b(float x, float y, float z, float u, float v, uint8_t r, uint8_t g, uint8_t b) {
4297
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4298
+ if (ctx) {
4299
+ _sgl_vtx(ctx, x, y, z, u, v, _sgl_pack_rgbab(r, g, b, 255));
4300
+ }
4301
+ }
4302
+
4303
+ SOKOL_API_IMPL void sgl_v3f_t2f_c4f(float x, float y, float z, float u, float v, float r, float g, float b, float a) {
4304
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4305
+ if (ctx) {
4306
+ _sgl_vtx(ctx, x, y, z, u, v, _sgl_pack_rgbaf(r, g, b, a));
4307
+ }
4308
+ }
4309
+
4310
+ SOKOL_API_IMPL void sgl_v3f_t2f_c4b(float x, float y, float z, float u, float v, uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
4311
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4312
+ if (ctx) {
4313
+ _sgl_vtx(ctx, x, y, z, u, v, _sgl_pack_rgbab(r, g, b, a));
4314
+ }
4315
+ }
4316
+
4317
+ SOKOL_API_IMPL void sgl_v3f_t2f_c1i(float x, float y, float z, float u, float v, uint32_t rgba) {
4318
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4319
+ if (ctx) {
4320
+ _sgl_vtx(ctx,x, y, z, u, v, rgba);
4321
+ }
4322
+ }
4323
+
4324
+ SOKOL_API_IMPL void sgl_matrix_mode_modelview(void) {
4325
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4326
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4327
+ if (ctx) {
4328
+ ctx->cur_matrix_mode = SGL_MATRIXMODE_MODELVIEW;
4329
+ }
4330
+ }
4331
+
4332
+ SOKOL_API_IMPL void sgl_matrix_mode_projection(void) {
4333
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4334
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4335
+ if (ctx) {
4336
+ ctx->cur_matrix_mode = SGL_MATRIXMODE_PROJECTION;
4337
+ }
4338
+ }
4339
+
4340
+ SOKOL_API_IMPL void sgl_matrix_mode_texture(void) {
4341
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4342
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4343
+ if (ctx) {
4344
+ ctx->cur_matrix_mode = SGL_MATRIXMODE_TEXTURE;
4345
+ }
4346
+ }
4347
+
4348
+ SOKOL_API_IMPL void sgl_load_identity(void) {
4349
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4350
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4351
+ if (!ctx) {
4352
+ return;
4353
+ }
4354
+ ctx->matrix_dirty = true;
4355
+ _sgl_identity(_sgl_matrix(ctx));
4356
+ }
4357
+
4358
+ SOKOL_API_IMPL void sgl_load_matrix(const float m[16]) {
4359
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4360
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4361
+ if (!ctx) {
4362
+ return;
4363
+ }
4364
+ ctx->matrix_dirty = true;
4365
+ memcpy(&_sgl_matrix(ctx)->v[0][0], &m[0], 64);
4366
+ }
4367
+
4368
+ SOKOL_API_IMPL void sgl_load_transpose_matrix(const float m[16]) {
4369
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4370
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4371
+ if (!ctx) {
4372
+ return;
4373
+ }
4374
+ ctx->matrix_dirty = true;
4375
+ _sgl_transpose(_sgl_matrix(ctx), (const _sgl_matrix_t*) &m[0]);
4376
+ }
4377
+
4378
+ SOKOL_API_IMPL void sgl_mult_matrix(const float m[16]) {
4379
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4380
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4381
+ if (!ctx) {
4382
+ return;
4383
+ }
4384
+ ctx->matrix_dirty = true;
4385
+ const _sgl_matrix_t* m0 = (const _sgl_matrix_t*) &m[0];
4386
+ _sgl_mul(_sgl_matrix(ctx), m0);
4387
+ }
4388
+
4389
+ SOKOL_API_IMPL void sgl_mult_transpose_matrix(const float m[16]) {
4390
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4391
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4392
+ if (!ctx) {
4393
+ return;
4394
+ }
4395
+ ctx->matrix_dirty = true;
4396
+ _sgl_matrix_t m0;
4397
+ _sgl_transpose(&m0, (const _sgl_matrix_t*) &m[0]);
4398
+ _sgl_mul(_sgl_matrix(ctx), &m0);
4399
+ }
4400
+
4401
+ SOKOL_API_IMPL void sgl_rotate(float angle_rad, float x, float y, float z) {
4402
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4403
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4404
+ if (!ctx) {
4405
+ return;
4406
+ }
4407
+ ctx->matrix_dirty = true;
4408
+ _sgl_rotate(_sgl_matrix(ctx), angle_rad, x, y, z);
4409
+ }
4410
+
4411
+ SOKOL_API_IMPL void sgl_scale(float x, float y, float z) {
4412
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4413
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4414
+ if (!ctx) {
4415
+ return;
4416
+ }
4417
+ ctx->matrix_dirty = true;
4418
+ _sgl_scale(_sgl_matrix(ctx), x, y, z);
4419
+ }
4420
+
4421
+ SOKOL_API_IMPL void sgl_translate(float x, float y, float z) {
4422
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4423
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4424
+ if (!ctx) {
4425
+ return;
4426
+ }
4427
+ ctx->matrix_dirty = true;
4428
+ _sgl_translate(_sgl_matrix(ctx), x, y, z);
4429
+ }
4430
+
4431
+ SOKOL_API_IMPL void sgl_frustum(float l, float r, float b, float t, float n, float f) {
4432
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4433
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4434
+ if (!ctx) {
4435
+ return;
4436
+ }
4437
+ ctx->matrix_dirty = true;
4438
+ _sgl_frustum(_sgl_matrix(ctx), l, r, b, t, n, f);
4439
+ }
4440
+
4441
+ SOKOL_API_IMPL void sgl_ortho(float l, float r, float b, float t, float n, float f) {
4442
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4443
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4444
+ if (!ctx) {
4445
+ return;
4446
+ }
4447
+ ctx->matrix_dirty = true;
4448
+ _sgl_ortho(_sgl_matrix(ctx), l, r, b, t, n, f);
4449
+ }
4450
+
4451
+ SOKOL_API_IMPL void sgl_perspective(float fov_y, float aspect, float z_near, float z_far) {
4452
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4453
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4454
+ if (!ctx) {
4455
+ return;
4456
+ }
4457
+ ctx->matrix_dirty = true;
4458
+ _sgl_perspective(_sgl_matrix(ctx), fov_y, aspect, z_near, z_far);
4459
+ }
4460
+
4461
+ SOKOL_API_IMPL void sgl_lookat(float eye_x, float eye_y, float eye_z, float center_x, float center_y, float center_z, float up_x, float up_y, float up_z) {
4462
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4463
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4464
+ if (!ctx) {
4465
+ return;
4466
+ }
4467
+ ctx->matrix_dirty = true;
4468
+ _sgl_lookat(_sgl_matrix(ctx), eye_x, eye_y, eye_z, center_x, center_y, center_z, up_x, up_y, up_z);
4469
+ }
4470
+
4471
+ SOKOL_API_IMPL void sgl_push_matrix(void) {
4472
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4473
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4474
+ if (!ctx) {
4475
+ return;
4476
+ }
4477
+ SOKOL_ASSERT((ctx->cur_matrix_mode >= 0) && (ctx->cur_matrix_mode < SGL_NUM_MATRIXMODES));
4478
+ ctx->matrix_dirty = true;
4479
+ if (ctx->matrix_tos[ctx->cur_matrix_mode] < (_SGL_MAX_STACK_DEPTH - 1)) {
4480
+ const _sgl_matrix_t* src = _sgl_matrix(ctx);
4481
+ ctx->matrix_tos[ctx->cur_matrix_mode]++;
4482
+ _sgl_matrix_t* dst = _sgl_matrix(ctx);
4483
+ *dst = *src;
4484
+ } else {
4485
+ ctx->error.stack_overflow = true;
4486
+ ctx->error.any = true;
4487
+ }
4488
+ }
4489
+
4490
+ SOKOL_API_IMPL void sgl_pop_matrix(void) {
4491
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4492
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4493
+ if (!ctx) {
4494
+ return;
4495
+ }
4496
+ SOKOL_ASSERT((ctx->cur_matrix_mode >= 0) && (ctx->cur_matrix_mode < SGL_NUM_MATRIXMODES));
4497
+ ctx->matrix_dirty = true;
4498
+ if (ctx->matrix_tos[ctx->cur_matrix_mode] > 0) {
4499
+ ctx->matrix_tos[ctx->cur_matrix_mode]--;
4500
+ } else {
4501
+ ctx->error.stack_underflow = true;
4502
+ ctx->error.any = true;
4503
+ }
4504
+ }
4505
+
4506
+ SOKOL_API_IMPL void sgl_draw(void) {
4507
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4508
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4509
+ if (ctx) {
4510
+ _sgl_draw(ctx, 0);
4511
+ }
4512
+ }
4513
+
4514
+ SOKOL_API_IMPL void sgl_draw_layer(int layer_id) {
4515
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4516
+ _sgl_context_t* ctx = _sgl.cur_ctx;
4517
+ if (ctx) {
4518
+ _sgl_draw(ctx, layer_id);
4519
+ }
4520
+ }
4521
+
4522
+ SOKOL_API_IMPL void sgl_context_draw(sgl_context ctx_id) {
4523
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4524
+ _sgl_context_t* ctx = _sgl_lookup_context(ctx_id.id);
4525
+ if (ctx) {
4526
+ _sgl_draw(ctx, 0);
4527
+ }
4528
+ }
4529
+
4530
+ SOKOL_API_IMPL void sgl_context_draw_layer(sgl_context ctx_id, int layer_id) {
4531
+ SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie);
4532
+ _sgl_context_t* ctx = _sgl_lookup_context(ctx_id.id);
4533
+ if (ctx) {
4534
+ _sgl_draw(ctx, layer_id);
4535
+ }
4536
+ }
4537
+
4538
+ #endif /* SOKOL_GL_IMPL */