| 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 | |
| 26 | ...optionally provide the following macros to override defaults: |
| 27 | |
| 28 | SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) |
| 29 | SOKOL_GL_API_DECL - public function declaration prefix (default: extern) |
| 30 | SOKOL_API_DECL - same as SOKOL_GL_API_DECL |
| 31 | SOKOL_API_IMPL - public function implementation prefix (default: -) |
| 32 | SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false)) |
| 33 | |
| 34 | If sokol_gl.h is compiled as a DLL, define the following before |
| 35 | including the declaration or implementation: |
| 36 | |
| 37 | SOKOL_DLL |
| 38 | |
| 39 | On Windows, SOKOL_DLL will define SOKOL_GL_API_DECL as __declspec(dllexport) |
| 40 | or __declspec(dllimport) as needed. |
| 41 | |
| 42 | Include the following headers before including sokol_gl.h: |
| 43 | |
| 44 | sokol_gfx.h |
| 45 | |
| 46 | Matrix functions have been taken from MESA and Regal. |
| 47 | |
| 48 | FEATURE OVERVIEW: |
| 49 | ================= |
| 50 | sokol_gl.h implements a subset of the OpenGLES 1.x feature set useful for |
| 51 | when you just want to quickly render a bunch of triangles or |
| 52 | lines without having to mess with buffers and shaders. |
| 53 | |
| 54 | The current feature set is mostly useful for debug visualizations |
| 55 | and simple UI-style 2D rendering: |
| 56 | |
| 57 | What's implemented: |
| 58 | - vertex components: |
| 59 | - position (x, y, z) |
| 60 | - 2D texture coords (u, v) |
| 61 | - color (r, g, b, a) |
| 62 | - primitive types: |
| 63 | - triangle list and strip |
| 64 | - line list and strip |
| 65 | - quad list (TODO: quad strips) |
| 66 | - point list |
| 67 | - one texture layer (no multi-texturing) |
| 68 | - viewport and scissor-rect with selectable origin (top-left or bottom-left) |
| 69 | - all GL 1.x matrix stack functions, and additionally equivalent |
| 70 | functions for gluPerspective and gluLookat |
| 71 | |
| 72 | Notable GLES 1.x features that are *NOT* implemented: |
| 73 | - vertex lighting (this is the most likely GL feature that might be added later) |
| 74 | - vertex arrays (although providing whole chunks of vertex data at once |
| 75 | might be a useful feature for a later version) |
| 76 | - texture coordinate generation |
| 77 | - line width |
| 78 | - all pixel store functions |
| 79 | - no ALPHA_TEST |
| 80 | - no clear functions (clearing is handled by the sokol-gfx render pass) |
| 81 | - fog |
| 82 | |
| 83 | Notable differences to GL: |
| 84 | - No "enum soup" for render states etc, instead there's a |
| 85 | 'pipeline stack', this is similar to GL's matrix stack, |
| 86 | but for pipeline-state-objects. The pipeline object at |
| 87 | the top of the pipeline stack defines the active set of render states |
| 88 | - All angles are in radians, not degrees (note the sgl_rad() and |
| 89 | sgl_deg() conversion functions) |
| 90 | - No enable/disable state for scissor test, this is always enabled |
| 91 | |
| 92 | STEP BY STEP: |
| 93 | ============= |
| 94 | --- To initialize sokol-gl, call: |
| 95 | |
| 96 | sgl_setup(const sgl_desc_t* desc) |
| 97 | |
| 98 | NOTE that sgl_setup() must be called *after* initializing sokol-gfx |
| 99 | (via sg_setup). This is because sgl_setup() needs to create |
| 100 | sokol-gfx resource objects. |
| 101 | |
| 102 | If you're intending to render to the default pass, and also don't |
| 103 | want to tweak memory usage, and don't want any logging output you can |
| 104 | just keep sgl_desc_t zero-initialized: |
| 105 | |
| 106 | sgl_setup(&(sgl_desc_t*){ 0 }); |
| 107 | |
| 108 | In this case, sokol-gl will create internal sg_pipeline objects that |
| 109 | are compatible with the sokol-app default framebuffer. |
| 110 | |
| 111 | I would recommend to at least install a logging callback so that |
| 112 | you'll see any warnings and errors. The easiest way is through |
| 113 | sokol_log.h: |
| 114 | |
| 115 | #include "sokol_log.h" |
| 116 | |
| 117 | sgl_setup(&(sgl_desc_t){ |
| 118 | .logger.func = slog_func. |
| 119 | }); |
| 120 | |
| 121 | If you want to render into a framebuffer with different pixel-format |
| 122 | and MSAA attributes you need to provide the matching attributes in the |
| 123 | sgl_setup() call: |
| 124 | |
| 125 | sgl_setup(&(sgl_desc_t*){ |
| 126 | .color_format = SG_PIXELFORMAT_..., |
| 127 | .depth_format = SG_PIXELFORMAT_..., |
| 128 | .sample_count = ..., |
| 129 | }); |
| 130 | |
| 131 | To reduce memory usage, or if you need to create more then the default number of |
| 132 | contexts, pipelines, vertices or draw commands, set the following sgl_desc_t |
| 133 | members: |
| 134 | |
| 135 | .context_pool_size (default: 4) |
| 136 | .pipeline_pool_size (default: 64) |
| 137 | .max_vertices (default: 64k) |
| 138 | .max_commands (default: 16k) |
| 139 | |
| 140 | Finally you can change the face winding for front-facing triangles |
| 141 | and quads: |
| 142 | |
| 143 | .face_winding - default is SG_FACEWINDING_CCW |
| 144 | |
| 145 | The default winding for front faces is counter-clock-wise. This is |
| 146 | the same as OpenGL's default, but different from sokol-gfx. |
| 147 | |
| 148 | --- Optionally create additional context objects if you want to render into |
| 149 | multiple sokol-gfx render passes (or generally if you want to |
| 150 | use multiple independent sokol-gl "state buckets") |
| 151 | |
| 152 | sgl_context ctx = sgl_make_context(const sgl_context_desc_t* desc) |
| 153 | |
| 154 | For details on rendering with sokol-gl contexts, search below for |
| 155 | WORKING WITH CONTEXTS. |
| 156 | |
| 157 | --- Optionally create pipeline-state-objects if you need render state |
| 158 | that differs from sokol-gl's default state: |
| 159 | |
| 160 | sgl_pipeline pip = sgl_make_pipeline(const sg_pipeline_desc* desc) |
| 161 | |
| 162 | ...this creates a pipeline object that's compatible with the currently |
| 163 | active context, alternatively call: |
| 164 | |
| 165 | sgl_pipeline_pip = sgl_context_make_pipeline(sgl_context ctx, const sg_pipeline_desc* desc) |
| 166 | |
| 167 | ...to create a pipeline object that's compatible with an explicitly |
| 168 | provided context. |
| 169 | |
| 170 | The similarity with sokol_gfx.h's sg_pipeline type and sg_make_pipeline() |
| 171 | function is intended. sgl_make_pipeline() also takes a standard |
| 172 | sokol-gfx sg_pipeline_desc object to describe the render state, but |
| 173 | without: |
| 174 | - shader |
| 175 | - vertex layout |
| 176 | - color- and depth-pixel-formats |
| 177 | - primitive type (lines, triangles, ...) |
| 178 | - MSAA sample count |
| 179 | Those will be filled in by sgl_make_pipeline(). Note that each |
| 180 | call to sgl_make_pipeline() needs to create several sokol-gfx |
| 181 | pipeline objects (one for each primitive type). |
| 182 | |
| 183 | 'depth.write_enabled' will be forced to 'false' if the context this |
| 184 | pipeline object is intended for has its depth pixel format set to |
| 185 | SG_PIXELFORMAT_NONE (which means the framebuffer this context is used |
| 186 | with doesn't have a depth-stencil surface). |
| 187 | |
| 188 | --- if you need to destroy sgl_pipeline objects before sgl_shutdown(): |
| 189 | |
| 190 | sgl_destroy_pipeline(sgl_pipeline pip) |
| 191 | |
| 192 | --- After sgl_setup() you can call any of the sokol-gl functions anywhere |
| 193 | in a frame, *except* sgl_draw(). The 'vanilla' functions |
| 194 | will only change internal sokol-gl state, and not call any sokol-gfx |
| 195 | functions. |
| 196 | |
| 197 | --- Unlike OpenGL, sokol-gl has a function to reset internal state to |
| 198 | a known default. This is useful at the start of a sequence of |
| 199 | rendering operations: |
| 200 | |
| 201 | void sgl_defaults(void) |
| 202 | |
| 203 | This will set the following default state: |
| 204 | |
| 205 | - current texture coordinate to u=0.0f, v=0.0f |
| 206 | - current color to white (rgba all 1.0f) |
| 207 | - current point size to 1.0f |
| 208 | - unbind the current texture and texturing will be disabled |
| 209 | - *all* matrices will be set to identity (also the projection matrix) |
| 210 | - the default render state will be set by loading the 'default pipeline' |
| 211 | into the top of the pipeline stack |
| 212 | |
| 213 | The current matrix- and pipeline-stack-depths will not be changed by |
| 214 | sgl_defaults(). |
| 215 | |
| 216 | --- change the currently active renderstate through the |
| 217 | pipeline-stack functions, this works similar to the |
| 218 | traditional GL matrix stack: |
| 219 | |
| 220 | ...load the default pipeline state on the top of the pipeline stack: |
| 221 | |
| 222 | sgl_load_default_pipeline() |
| 223 | |
| 224 | ...load a specific pipeline on the top of the pipeline stack: |
| 225 | |
| 226 | sgl_load_pipeline(sgl_pipeline pip) |
| 227 | |
| 228 | ...push and pop the pipeline stack: |
| 229 | sgl_push_pipeline() |
| 230 | sgl_pop_pipeline() |
| 231 | |
| 232 | --- control texturing with: |
| 233 | |
| 234 | sgl_enable_texture() |
| 235 | sgl_disable_texture() |
| 236 | sgl_texture(sg_image img, sg_sampler smp) |
| 237 | |
| 238 | NOTE: the img and smp handles can be invalid (SG_INVALID_ID), in this |
| 239 | case, sokol-gl will fall back to the internal default (white) texture |
| 240 | and sampler. |
| 241 | |
| 242 | --- set the current viewport and scissor rect with: |
| 243 | |
| 244 | sgl_viewport(int x, int y, int w, int h, bool origin_top_left) |
| 245 | sgl_scissor_rect(int x, int y, int w, int h, bool origin_top_left) |
| 246 | |
| 247 | ...or call these alternatives which take float arguments (this might allow |
| 248 | to avoid casting between float and integer in more strongly typed languages |
| 249 | when floating point pixel coordinates are used): |
| 250 | |
| 251 | sgl_viewportf(float x, float y, float w, float h, bool origin_top_left) |
| 252 | sgl_scissor_rectf(float x, float y, float w, float h, bool origin_top_left) |
| 253 | |
| 254 | ...these calls add a new command to the internal command queue, so |
| 255 | that the viewport or scissor rect are set at the right time relative |
| 256 | to other sokol-gl calls. |
| 257 | |
| 258 | --- adjust the transform matrices, matrix manipulation works just like |
| 259 | the OpenGL matrix stack: |
| 260 | |
| 261 | ...set the current matrix mode: |
| 262 | |
| 263 | sgl_matrix_mode_modelview() |
| 264 | sgl_matrix_mode_projection() |
| 265 | sgl_matrix_mode_texture() |
| 266 | |
| 267 | ...load the identity matrix into the current matrix: |
| 268 | |
| 269 | sgl_load_identity() |
| 270 | |
| 271 | ...translate, rotate and scale the current matrix: |
| 272 | |
| 273 | sgl_translate(float x, float y, float z) |
| 274 | sgl_rotate(float angle_rad, float x, float y, float z) |
| 275 | sgl_scale(float x, float y, float z) |
| 276 | |
| 277 | NOTE that all angles in sokol-gl are in radians, not in degree. |
| 278 | Convert between radians and degree with the helper functions: |
| 279 | |
| 280 | float sgl_rad(float deg) - degrees to radians |
| 281 | float sgl_deg(float rad) - radians to degrees |
| 282 | |
| 283 | ...directly load the current matrix from a float[16] array: |
| 284 | |
| 285 | sgl_load_matrix(const float m[16]) |
| 286 | sgl_load_transpose_matrix(const float m[16]) |
| 287 | |
| 288 | ...directly multiply the current matrix from a float[16] array: |
| 289 | |
| 290 | sgl_mult_matrix(const float m[16]) |
| 291 | sgl_mult_transpose_matrix(const float m[16]) |
| 292 | |
| 293 | The memory layout of those float[16] arrays is the same as in OpenGL. |
| 294 | |
| 295 | ...more matrix functions: |
| 296 | |
| 297 | sgl_frustum(float left, float right, float bottom, float top, float near, float far) |
| 298 | sgl_ortho(float left, float right, float bottom, float top, float near, float far) |
| 299 | sgl_perspective(float fov_y, float aspect, float near, float far) |
| 300 | 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) |
| 301 | |
| 302 | These functions work the same as glFrustum(), glOrtho(), gluPerspective() |
| 303 | and gluLookAt(). |
| 304 | |
| 305 | ...and finally to push / pop the current matrix stack: |
| 306 | |
| 307 | sgl_push_matrix(void) |
| 308 | sgl_pop_matrix(void) |
| 309 | |
| 310 | Again, these work the same as glPushMatrix() and glPopMatrix(). |
| 311 | |
| 312 | --- perform primitive rendering: |
| 313 | |
| 314 | ...set the current texture coordinate and color 'registers' with or |
| 315 | point size with: |
| 316 | |
| 317 | sgl_t2f(float u, float v) - set current texture coordinate |
| 318 | sgl_c*(...) - set current color |
| 319 | sgl_point_size(float size) - set current point size |
| 320 | |
| 321 | There are several functions for setting the color (as float values, |
| 322 | unsigned byte values, packed as unsigned 32-bit integer, with |
| 323 | and without alpha). |
| 324 | |
| 325 | NOTE that these are the only functions that can be called both inside |
| 326 | sgl_begin_*() / sgl_end() and outside. |
| 327 | |
| 328 | Also NOTE that point size is currently hardwired to 1.0f if the D3D11 |
| 329 | backend is used. |
| 330 | |
| 331 | ...start a primitive vertex sequence with: |
| 332 | |
| 333 | sgl_begin_points() |
| 334 | sgl_begin_lines() |
| 335 | sgl_begin_line_strip() |
| 336 | sgl_begin_triangles() |
| 337 | sgl_begin_triangle_strip() |
| 338 | sgl_begin_quads() |
| 339 | |
| 340 | ...after sgl_begin_*() specify vertices: |
| 341 | |
| 342 | sgl_v*(...) |
| 343 | sgl_v*_t*(...) |
| 344 | sgl_v*_c*(...) |
| 345 | sgl_v*_t*_c*(...) |
| 346 | |
| 347 | These functions write a new vertex to sokol-gl's internal vertex buffer, |
| 348 | optionally with texture-coords and color. If the texture coordinate |
| 349 | and/or color is missing, it will be taken from the current texture-coord |
| 350 | and color 'register'. |
| 351 | |
| 352 | ...finally, after specifying vertices, call: |
| 353 | |
| 354 | sgl_end() |
| 355 | |
| 356 | This will record a new draw command in sokol-gl's internal command |
| 357 | list, or it will extend the previous draw command if no relevant |
| 358 | state has changed since the last sgl_begin/end pair. |
| 359 | |
| 360 | --- inside a sokol-gfx rendering pass, call the sgl_draw() function |
| 361 | to render the currently active context: |
| 362 | |
| 363 | sgl_draw() |
| 364 | |
| 365 | ...or alternatively call: |
| 366 | |
| 367 | sgl_context_draw(ctx) |
| 368 | |
| 369 | ...to render an explicitly provided context. |
| 370 | |
| 371 | This will render everything that has been recorded in the context since |
| 372 | the last call to sgl_draw() through sokol-gfx, and will 'rewind' the internal |
| 373 | vertex-, uniform- and command-buffers. |
| 374 | |
| 375 | --- each sokol-gl context tracks an internal error code, to query the |
| 376 | current error code for the currently active context call: |
| 377 | |
| 378 | sgl_error_t sgl_error() |
| 379 | |
| 380 | ...alternatively with an explicit context argument: |
| 381 | |
| 382 | sgl_error_t sgl_context_error(ctx); |
| 383 | |
| 384 | ...which can return the following error codes: |
| 385 | |
| 386 | SGL_NO_ERROR - all OK, no error occurred since last sgl_draw() |
| 387 | SGL_ERROR_VERTICES_FULL - internal vertex buffer is full (checked in sgl_end()) |
| 388 | SGL_ERROR_UNIFORMS_FULL - the internal uniforms buffer is full (checked in sgl_end()) |
| 389 | SGL_ERROR_COMMANDS_FULL - the internal command buffer is full (checked in sgl_end()) |
| 390 | SGL_ERROR_STACK_OVERFLOW - matrix- or pipeline-stack overflow |
| 391 | SGL_ERROR_STACK_UNDERFLOW - matrix- or pipeline-stack underflow |
| 392 | SGL_ERROR_NO_CONTEXT - the active context no longer exists |
| 393 | |
| 394 | ...if sokol-gl is in an error-state, sgl_draw() will skip any rendering, |
| 395 | and reset the error code to SGL_NO_ERROR. |
| 396 | |
| 397 | RENDER LAYERS |
| 398 | ============= |
| 399 | Render layers allow to split sokol-gl rendering into separate draw-command |
| 400 | groups which can then be rendered separately in a sokol-gfx draw pass. This |
| 401 | allows to mix/interleave sokol-gl rendering with other render operations. |
| 402 | |
| 403 | Layered rendering is controlled through two functions: |
| 404 | |
| 405 | sgl_layer(int layer_id) |
| 406 | sgl_draw_layer(int layer_id) |
| 407 | |
| 408 | (and the context-variant sgl_draw_layer(): sgl_context_draw_layer() |
| 409 | |
| 410 | The sgl_layer() function sets the 'current layer', any sokol-gl calls |
| 411 | which internally record draw commands will also store the current layer |
| 412 | in the draw command, and later in a sokol-gfx render pass, a call |
| 413 | to sgl_draw_layer() will only render the draw commands that have |
| 414 | a matching layer. |
| 415 | |
| 416 | The default layer is '0', this is active after sokol-gl setup, and |
| 417 | is also restored at the start of a new frame (but *not* by calling |
| 418 | sgl_defaults()). |
| 419 | |
| 420 | NOTE that calling sgl_draw() is equivalent with sgl_draw_layer(0) |
| 421 | (in general you should either use either use sgl_draw() or |
| 422 | sgl_draw_layer() in an application, but not both). |
| 423 | |
| 424 | WORKING WITH CONTEXTS: |
| 425 | ====================== |
| 426 | If you want to render to more than one sokol-gfx render pass you need to |
| 427 | work with additional sokol-gl context objects (one context object for |
| 428 | each offscreen rendering pass, in addition to the implicitly created |
| 429 | 'default context'. |
| 430 | |
| 431 | All sokol-gl state is tracked per context, and there is always a "current |
| 432 | context" (with the notable exception that the currently set context is |
| 433 | destroyed, more on that later). |
| 434 | |
| 435 | Using multiple contexts can also be useful if you only render in |
| 436 | a single pass, but want to maintain multiple independent "state buckets". |
| 437 | |
| 438 | To create new context object, call: |
| 439 | |
| 440 | sgl_context ctx = sgl_make_context(&(sgl_context_desc){ |
| 441 | .max_vertices = ..., // default: 64k |
| 442 | .max_commands = ..., // default: 16k |
| 443 | .color_format = ..., |
| 444 | .depth_format = ..., |
| 445 | .sample_count = ..., |
| 446 | }); |
| 447 | |
| 448 | The color_format, depth_format and sample_count items must be compatible |
| 449 | with the render pass the sgl_draw() or sgL_context_draw() function |
| 450 | will be called in. |
| 451 | |
| 452 | Creating a context does *not* make the context current. To do this, call: |
| 453 | |
| 454 | sgl_set_context(ctx); |
| 455 | |
| 456 | The currently active context will implicitly be used by most sokol-gl functions |
| 457 | which don't take an explicit context handle as argument. |
| 458 | |
| 459 | To switch back to the default context, pass the global constant SGL_DEFAULT_CONTEXT: |
| 460 | |
| 461 | sgl_set_context(SGL_DEFAULT_CONTEXT); |
| 462 | |
| 463 | ...or alternatively use the function sgl_default_context() instead of the |
| 464 | global constant: |
| 465 | |
| 466 | sgl_set_context(sgl_default_context()); |
| 467 | |
| 468 | To get the currently active context, call: |
| 469 | |
| 470 | sgl_context cur_ctx = sgl_get_context(); |
| 471 | |
| 472 | The following functions exist in two variants, one which use the currently |
| 473 | active context (set with sgl_set_context()), and another version which |
| 474 | takes an explicit context handle instead: |
| 475 | |
| 476 | sgl_make_pipeline() vs sgl_context_make_pipeline() |
| 477 | sgl_error() vs sgl_context_error(); |
| 478 | sgl_draw() vs sgl_context_draw(); |
| 479 | |
| 480 | Except for using the currently active context versus a provided context |
| 481 | handle, the two variants are exactlyidentical, e.g. the following |
| 482 | code sequences do the same thing: |
| 483 | |
| 484 | sgl_set_context(ctx); |
| 485 | sgl_pipeline pip = sgl_make_pipeline(...); |
| 486 | sgl_error_t err = sgl_error(); |
| 487 | sgl_draw(); |
| 488 | |
| 489 | vs |
| 490 | |
| 491 | sgl_pipeline pip = sgl_context_make_pipeline(ctx, ...); |
| 492 | sgl_error_t err = sgl_context_error(ctx); |
| 493 | sgl_context_draw(ctx); |
| 494 | |
| 495 | Destroying the currently active context is a 'soft error'. All following |
| 496 | calls which require a currently active context will silently fail, |
| 497 | and sgl_error() will return SGL_ERROR_NO_CONTEXT. |
| 498 | |
| 499 | UNDER THE HOOD: |
| 500 | =============== |
| 501 | sokol_gl.h works by recording vertex data and rendering commands into |
| 502 | memory buffers, and then drawing the recorded commands via sokol_gfx.h |
| 503 | |
| 504 | The only functions which call into sokol_gfx.h are: |
| 505 | - sgl_setup() |
| 506 | - sgl_shutdown() |
| 507 | - sgl_draw() (and variants) |
| 508 | |
| 509 | sgl_setup() must be called after initializing sokol-gfx. |
| 510 | sgl_shutdown() must be called before shutting down sokol-gfx. |
| 511 | sgl_draw() must be called once per frame inside a sokol-gfx render pass. |
| 512 | |
| 513 | All other sokol-gl function can be called anywhere in a frame, since |
| 514 | they just record data into memory buffers owned by sokol-gl. |
| 515 | |
| 516 | What happens in: |
| 517 | |
| 518 | sgl_setup(): |
| 519 | Unique resources shared by all contexts are created: |
| 520 | - a shader object (using embedded shader source or byte code) |
| 521 | - an 8x8 white default texture |
| 522 | The default context is created, which involves: |
| 523 | - 3 memory buffers are created, one for vertex data, |
| 524 | one for uniform data, and one for commands |
| 525 | - a dynamic vertex buffer is created |
| 526 | - the default sgl_pipeline object is created, which involves |
| 527 | creating 5 sg_pipeline objects |
| 528 | |
| 529 | One vertex is 24 bytes: |
| 530 | - float3 position |
| 531 | - float2 texture coords |
| 532 | - uint32_t color |
| 533 | |
| 534 | One uniform block is 128 bytes: |
| 535 | - mat4 model-view-projection matrix |
| 536 | - mat4 texture matrix |
| 537 | |
| 538 | One draw command is ca. 24 bytes for the actual |
| 539 | command code plus command arguments. |
| 540 | |
| 541 | Each sgl_end() consumes one command, and one uniform block |
| 542 | (only when the matrices have changed). |
| 543 | The required size for one sgl_begin/end pair is (at most): |
| 544 | |
| 545 | (152 + 24 * num_verts) bytes |
| 546 | |
| 547 | sgl_shutdown(): |
| 548 | - all sokol-gfx resources (buffer, shader, default-texture and |
| 549 | all pipeline objects) are destroyed |
| 550 | - the 3 memory buffers are freed |
| 551 | |
| 552 | sgl_draw() (and variants) |
| 553 | - copy all recorded vertex data into the dynamic sokol-gfx buffer |
| 554 | via a call to sg_update_buffer() |
| 555 | - for each recorded command: |
| 556 | - if the layer number stored in the command doesn't match |
| 557 | the layer that's to be rendered, skip to the next |
| 558 | command |
| 559 | - if it's a viewport command, call sg_apply_viewport() |
| 560 | - if it's a scissor-rect command, call sg_apply_scissor_rect() |
| 561 | - if it's a draw command: |
| 562 | - depending on what has changed since the last draw command, |
| 563 | call sg_apply_pipeline(), sg_apply_bindings() and |
| 564 | sg_apply_uniforms() |
| 565 | - finally call sg_draw() |
| 566 | |
| 567 | All other functions only modify the internally tracked state, add |
| 568 | data to the vertex, uniform and command buffers, or manipulate |
| 569 | the matrix stack. |
| 570 | |
| 571 | ON DRAW COMMAND MERGING |
| 572 | ======================= |
| 573 | Not every call to sgl_end() will automatically record a new draw command. |
| 574 | If possible, the previous draw command will simply be extended, |
| 575 | resulting in fewer actual draw calls later in sgl_draw(). |
| 576 | |
| 577 | A draw command will be merged with the previous command if "no relevant |
| 578 | state has changed" since the last sgl_end(), meaning: |
| 579 | |
| 580 | - no calls to sgl_viewport() and sgl_scissor_rect() |
| 581 | - the primitive type hasn't changed |
| 582 | - the primitive type isn't a 'strip type' (no line or triangle strip) |
| 583 | - the pipeline state object hasn't changed |
| 584 | - the current layer hasn't changed |
| 585 | - none of the matrices has changed |
| 586 | - none of the texture state has changed |
| 587 | |
| 588 | Merging a draw command simply means that the number of vertices |
| 589 | to render in the previous draw command will be incremented by the |
| 590 | number of vertices in the new draw command. |
| 591 | |
| 592 | MEMORY ALLOCATION OVERRIDE |
| 593 | ========================== |
| 594 | You can override the memory allocation functions at initialization time |
| 595 | like this: |
| 596 | |
| 597 | void* my_alloc(size_t size, void* user_data) { |
| 598 | return malloc(size); |
| 599 | } |
| 600 | |
| 601 | void my_free(void* ptr, void* user_data) { |
| 602 | free(ptr); |
| 603 | } |
| 604 | |
| 605 | ... |
| 606 | sgl_setup(&(sgl_desc_t){ |
| 607 | // ... |
| 608 | .allocator = { |
| 609 | .alloc_fn = my_alloc, |
| 610 | .free_fn = my_free, |
| 611 | .user_data = ...; |
| 612 | } |
| 613 | }); |
| 614 | ... |
| 615 | |
| 616 | If no overrides are provided, malloc and free will be used. |
| 617 | |
| 618 | |
| 619 | ERROR REPORTING AND LOGGING |
| 620 | =========================== |
| 621 | To get any logging information at all you need to provide a logging callback in the setup call, |
| 622 | the easiest way is to use sokol_log.h: |
| 623 | |
| 624 | #include "sokol_log.h" |
| 625 | |
| 626 | sgl_setup(&(sgl_desc_t){ |
| 627 | // ... |
| 628 | .logger.func = slog_func |
| 629 | }); |
| 630 | |
| 631 | To override logging with your own callback, first write a logging function like this: |
| 632 | |
| 633 | void my_log(const char* tag, // e.g. 'sgl' |
| 634 | uint32_t log_level, // 0=panic, 1=error, 2=warn, 3=info |
| 635 | uint32_t log_item_id, // SGL_LOGITEM_* |
| 636 | const char* message_or_null, // a message string, may be nullptr in release mode |
| 637 | uint32_t line_nr, // line number in sokol_gl.h |
| 638 | const char* filename_or_null, // source filename, may be nullptr in release mode |
| 639 | void* user_data) |
| 640 | { |
| 641 | ... |
| 642 | } |
| 643 | |
| 644 | ...and then setup sokol-gl like this: |
| 645 | |
| 646 | sgl_setup(&(sgl_desc_t){ |
| 647 | .logger = { |
| 648 | .func = my_log, |
| 649 | .user_data = my_user_data, |
| 650 | } |
| 651 | }); |
| 652 | |
| 653 | The provided logging function must be reentrant (e.g. be callable from |
| 654 | different threads). |
| 655 | |
| 656 | If you don't want to provide your own custom logger it is highly recommended to use |
| 657 | the standard logger in sokol_log.h instead, otherwise you won't see any warnings or |
| 658 | errors. |
| 659 | |
| 660 | |
| 661 | LICENSE |
| 662 | ======= |
| 663 | zlib/libpng license |
| 664 | |
| 665 | Copyright (c) 2018 Andre Weissflog |
| 666 | |
| 667 | This software is provided 'as-is', without any express or implied warranty. |
| 668 | In no event will the authors be held liable for any damages arising from the |
| 669 | use of this software. |
| 670 | |
| 671 | Permission is granted to anyone to use this software for any purpose, |
| 672 | including commercial applications, and to alter it and redistribute it |
| 673 | freely, subject to the following restrictions: |
| 674 | |
| 675 | 1. The origin of this software must not be misrepresented; you must not |
| 676 | claim that you wrote the original software. If you use this software in a |
| 677 | product, an acknowledgment in the product documentation would be |
| 678 | appreciated but is not required. |
| 679 | |
| 680 | 2. Altered source versions must be plainly marked as such, and must not |
| 681 | be misrepresented as being the original software. |
| 682 | |
| 683 | 3. This notice may not be removed or altered from any source |
| 684 | distribution. |
| 685 | */ |
| 686 | #define SOKOL_GL_INCLUDED (1) |
| 687 | #include <stdint.h> |
| 688 | #include <stdbool.h> |
| 689 | #include <stddef.h> // size_t, offsetof |
| 690 | |
| 691 | #if !defined(SOKOL_GFX_INCLUDED) |
| 692 | #error "Please include sokol_gfx.h before sokol_gl.h" |
| 693 | #endif |
| 694 | |
| 695 | #if defined(SOKOL_API_DECL) && !defined(SOKOL_GL_API_DECL) |
| 696 | #define SOKOL_GL_API_DECL SOKOL_API_DECL |
| 697 | #endif |
| 698 | #ifndef SOKOL_GL_API_DECL |
| 699 | #if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_GL_IMPL) |
| 700 | #define SOKOL_GL_API_DECL __declspec(dllexport) |
| 701 | #elif defined(_WIN32) && defined(SOKOL_DLL) |
| 702 | #define SOKOL_GL_API_DECL __declspec(dllimport) |
| 703 | #else |
| 704 | #define SOKOL_GL_API_DECL extern |
| 705 | #endif |
| 706 | #endif |
| 707 | |
| 708 | #ifdef __cplusplus |
| 709 | extern "C" { |
| 710 | #endif |
| 711 | |
| 712 | /* |
| 713 | sgl_log_item_t |
| 714 | |
| 715 | Log items are defined via X-Macros, and expanded to an |
| 716 | enum 'sgl_log_item' - and in debug mode only - corresponding strings. |
| 717 | |
| 718 | Used as parameter in the logging callback. |
| 719 | */ |
| 720 | #define _SGL_LOG_ITEMS \ |
| 721 | _SGL_LOGITEM_XMACRO(OK, "Ok") \ |
| 722 | _SGL_LOGITEM_XMACRO(MALLOC_FAILED, "memory allocation failed") \ |
| 723 | _SGL_LOGITEM_XMACRO(MAKE_PIPELINE_FAILED, "sg_make_pipeline() failed") \ |
| 724 | _SGL_LOGITEM_XMACRO(PIPELINE_POOL_EXHAUSTED, "pipeline pool exhausted (use sgl_desc_t.pipeline_pool_size to adjust)") \ |
| 725 | _SGL_LOGITEM_XMACRO(ADD_COMMIT_LISTENER_FAILED, "sg_add_commit_listener() failed") \ |
| 726 | _SGL_LOGITEM_XMACRO(CONTEXT_POOL_EXHAUSTED, "context pool exhausted (use sgl_desc_t.context_pool_size to adjust)") \ |
| 727 | _SGL_LOGITEM_XMACRO(CANNOT_DESTROY_DEFAULT_CONTEXT, "cannot destroy default context") \ |
| 728 | |
| 729 | #define _SGL_LOGITEM_XMACRO(item,msg) SGL_LOGITEM_##item, |
| 730 | typedef enum sgl_log_item_t { |
| 731 | _SGL_LOG_ITEMS |
| 732 | } sgl_log_item_t; |
| 733 | #undef _SGL_LOGITEM_XMACRO |
| 734 | |
| 735 | /* |
| 736 | sgl_logger_t |
| 737 | |
| 738 | Used in sgl_desc_t to provide a custom logging and error reporting |
| 739 | callback to sokol-gl. |
| 740 | */ |
| 741 | typedef struct sgl_logger_t { |
| 742 | void (*func)( |
| 743 | const char* tag, // always "sgl" |
| 744 | uint32_t log_level, // 0=panic, 1=error, 2=warning, 3=info |
| 745 | uint32_t log_item_id, // SGL_LOGITEM_* |
| 746 | const char* message_or_null, // a message string, may be nullptr in release mode |
| 747 | uint32_t line_nr, // line number in sokol_gl.h |
| 748 | const char* filename_or_null, // source filename, may be nullptr in release mode |
| 749 | void* user_data); |
| 750 | void* user_data; |
| 751 | } sgl_logger_t; |
| 752 | |
| 753 | /* sokol_gl pipeline handle (created with sgl_make_pipeline()) */ |
| 754 | typedef struct sgl_pipeline { uint32_t id; } sgl_pipeline; |
| 755 | |
| 756 | /* a context handle (created with sgl_make_context()) */ |
| 757 | typedef struct sgl_context { uint32_t id; } sgl_context; |
| 758 | |
| 759 | /* |
| 760 | sgl_error_t |
| 761 | |
| 762 | Errors are reset each frame after calling sgl_draw(), |
| 763 | get the last error code with sgl_error() |
| 764 | */ |
| 765 | typedef enum sgl_error_t { |
| 766 | SGL_NO_ERROR = 0, |
| 767 | SGL_ERROR_VERTICES_FULL, |
| 768 | SGL_ERROR_UNIFORMS_FULL, |
| 769 | SGL_ERROR_COMMANDS_FULL, |
| 770 | SGL_ERROR_STACK_OVERFLOW, |
| 771 | SGL_ERROR_STACK_UNDERFLOW, |
| 772 | SGL_ERROR_NO_CONTEXT, |
| 773 | } sgl_error_t; |
| 774 | |
| 775 | /* |
| 776 | sgl_context_desc_t |
| 777 | |
| 778 | Describes the initialization parameters of a rendering context. |
| 779 | Creating additional contexts is useful if you want to render |
| 780 | in separate sokol-gfx passes. |
| 781 | */ |
| 782 | typedef struct sgl_context_desc_t { |
| 783 | int max_vertices; // default: 64k |
| 784 | int max_commands; // default: 16k |
| 785 | sg_pixel_format color_format; |
| 786 | sg_pixel_format depth_format; |
| 787 | int sample_count; |
| 788 | } sgl_context_desc_t; |
| 789 | |
| 790 | /* |
| 791 | sgl_allocator_t |
| 792 | |
| 793 | Used in sgl_desc_t to provide custom memory-alloc and -free functions |
| 794 | to sokol_gl.h. If memory management should be overridden, both the |
| 795 | alloc and free function must be provided (e.g. it's not valid to |
| 796 | override one function but not the other). |
| 797 | */ |
| 798 | typedef struct sgl_allocator_t { |
| 799 | void* (*alloc_fn)(size_t size, void* user_data); |
| 800 | void (*free_fn)(void* ptr, void* user_data); |
| 801 | void* user_data; |
| 802 | } sgl_allocator_t; |
| 803 | |
| 804 | typedef struct sgl_desc_t { |
| 805 | int max_vertices; // default: 64k |
| 806 | int max_commands; // default: 16k |
| 807 | int context_pool_size; // max number of contexts (including default context), default: 4 |
| 808 | int pipeline_pool_size; // size of internal pipeline pool, default: 64 |
| 809 | sg_pixel_format color_format; |
| 810 | sg_pixel_format depth_format; |
| 811 | int sample_count; |
| 812 | sg_face_winding face_winding; // default: SG_FACEWINDING_CCW |
| 813 | sgl_allocator_t allocator; // optional memory allocation overrides (default: malloc/free) |
| 814 | sgl_logger_t logger; // optional log function override (default: NO LOGGING) |
| 815 | } sgl_desc_t; |
| 816 | |
| 817 | /* the default context handle */ |
| 818 | static const sgl_context SGL_DEFAULT_CONTEXT = { 0x00010001 }; |
| 819 | |
| 820 | /* setup/shutdown/misc */ |
| 821 | SOKOL_GL_API_DECL void sgl_setup(const sgl_desc_t* desc); |
| 822 | SOKOL_GL_API_DECL void sgl_shutdown(void); |
| 823 | SOKOL_GL_API_DECL float sgl_rad(float deg); |
| 824 | SOKOL_GL_API_DECL float sgl_deg(float rad); |
| 825 | SOKOL_GL_API_DECL sgl_error_t sgl_error(void); |
| 826 | SOKOL_GL_API_DECL sgl_error_t sgl_context_error(sgl_context ctx); |
| 827 | |
| 828 | /* context functions */ |
| 829 | SOKOL_GL_API_DECL sgl_context sgl_make_context(const sgl_context_desc_t* desc); |
| 830 | SOKOL_GL_API_DECL void sgl_destroy_context(sgl_context ctx); |
| 831 | SOKOL_GL_API_DECL void sgl_set_context(sgl_context ctx); |
| 832 | SOKOL_GL_API_DECL sgl_context sgl_get_context(void); |
| 833 | SOKOL_GL_API_DECL sgl_context sgl_default_context(void); |
| 834 | |
| 835 | /* draw recorded commands (call inside a sokol-gfx render pass) */ |
| 836 | SOKOL_GL_API_DECL void sgl_draw(void); |
| 837 | SOKOL_GL_API_DECL void sgl_context_draw(sgl_context ctx); |
| 838 | SOKOL_GL_API_DECL void sgl_draw_layer(int layer_id); |
| 839 | SOKOL_GL_API_DECL void sgl_context_draw_layer(sgl_context ctx, int layer_id); |
| 840 | |
| 841 | /* create and destroy pipeline objects */ |
| 842 | SOKOL_GL_API_DECL sgl_pipeline sgl_make_pipeline(const sg_pipeline_desc* desc); |
| 843 | SOKOL_GL_API_DECL sgl_pipeline sgl_context_make_pipeline(sgl_context ctx, const sg_pipeline_desc* desc); |
| 844 | SOKOL_GL_API_DECL void sgl_destroy_pipeline(sgl_pipeline pip); |
| 845 | |
| 846 | /* render state functions */ |
| 847 | SOKOL_GL_API_DECL void sgl_defaults(void); |
| 848 | SOKOL_GL_API_DECL void sgl_viewport(int x, int y, int w, int h, bool origin_top_left); |
| 849 | SOKOL_GL_API_DECL void sgl_viewportf(float x, float y, float w, float h, bool origin_top_left); |
| 850 | SOKOL_GL_API_DECL void sgl_scissor_rect(int x, int y, int w, int h, bool origin_top_left); |
| 851 | SOKOL_GL_API_DECL void sgl_scissor_rectf(float x, float y, float w, float h, bool origin_top_left); |
| 852 | SOKOL_GL_API_DECL void sgl_enable_texture(void); |
| 853 | SOKOL_GL_API_DECL void sgl_disable_texture(void); |
| 854 | SOKOL_GL_API_DECL void sgl_texture(sg_image img, sg_sampler smp); |
| 855 | SOKOL_GL_API_DECL void sgl_layer(int layer_id); |
| 856 | |
| 857 | /* pipeline stack functions */ |
| 858 | SOKOL_GL_API_DECL void sgl_load_default_pipeline(void); |
| 859 | SOKOL_GL_API_DECL void sgl_load_pipeline(sgl_pipeline pip); |
| 860 | SOKOL_GL_API_DECL void sgl_push_pipeline(void); |
| 861 | SOKOL_GL_API_DECL void sgl_pop_pipeline(void); |
| 862 | |
| 863 | /* matrix stack functions */ |
| 864 | SOKOL_GL_API_DECL void sgl_matrix_mode_modelview(void); |
| 865 | SOKOL_GL_API_DECL void sgl_matrix_mode_projection(void); |
| 866 | SOKOL_GL_API_DECL void sgl_matrix_mode_texture(void); |
| 867 | SOKOL_GL_API_DECL void sgl_load_identity(void); |
| 868 | SOKOL_GL_API_DECL void sgl_load_matrix(const float m[16]); |
| 869 | SOKOL_GL_API_DECL void sgl_load_transpose_matrix(const float m[16]); |
| 870 | SOKOL_GL_API_DECL void sgl_mult_matrix(const float m[16]); |
| 871 | SOKOL_GL_API_DECL void sgl_mult_transpose_matrix(const float m[16]); |
| 872 | SOKOL_GL_API_DECL void sgl_rotate(float angle_rad, float x, float y, float z); |
| 873 | SOKOL_GL_API_DECL void sgl_scale(float x, float y, float z); |
| 874 | SOKOL_GL_API_DECL void sgl_translate(float x, float y, float z); |
| 875 | SOKOL_GL_API_DECL void sgl_frustum(float l, float r, float b, float t, float n, float f); |
| 876 | SOKOL_GL_API_DECL void sgl_ortho(float l, float r, float b, float t, float n, float f); |
| 877 | SOKOL_GL_API_DECL void sgl_perspective(float fov_y, float aspect, float z_near, float z_far); |
| 878 | 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); |
| 879 | SOKOL_GL_API_DECL void sgl_push_matrix(void); |
| 880 | SOKOL_GL_API_DECL void sgl_pop_matrix(void); |
| 881 | |
| 882 | /* these functions only set the internal 'current texcoord / color / point size' (valid inside or outside begin/end) */ |
| 883 | SOKOL_GL_API_DECL void sgl_t2f(float u, float v); |
| 884 | SOKOL_GL_API_DECL void sgl_c3f(float r, float g, float b); |
| 885 | SOKOL_GL_API_DECL void sgl_c4f(float r, float g, float b, float a); |
| 886 | SOKOL_GL_API_DECL void sgl_c3b(uint8_t r, uint8_t g, uint8_t b); |
| 887 | SOKOL_GL_API_DECL void sgl_c4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a); |
| 888 | SOKOL_GL_API_DECL void sgl_c1i(uint32_t rgba); |
| 889 | SOKOL_GL_API_DECL void sgl_point_size(float s); |
| 890 | |
| 891 | /* define primitives, each begin/end is one draw command */ |
| 892 | SOKOL_GL_API_DECL void sgl_begin_points(void); |
| 893 | SOKOL_GL_API_DECL void sgl_begin_lines(void); |
| 894 | SOKOL_GL_API_DECL void sgl_begin_line_strip(void); |
| 895 | SOKOL_GL_API_DECL void sgl_begin_triangles(void); |
| 896 | SOKOL_GL_API_DECL void sgl_begin_triangle_strip(void); |
| 897 | SOKOL_GL_API_DECL void sgl_begin_quads(void); |
| 898 | SOKOL_GL_API_DECL void sgl_v2f(float x, float y); |
| 899 | SOKOL_GL_API_DECL void sgl_v3f(float x, float y, float z); |
| 900 | SOKOL_GL_API_DECL void sgl_v2f_t2f(float x, float y, float u, float v); |
| 901 | SOKOL_GL_API_DECL void sgl_v3f_t2f(float x, float y, float z, float u, float v); |
| 902 | SOKOL_GL_API_DECL void sgl_v2f_c3f(float x, float y, float r, float g, float b); |
| 903 | SOKOL_GL_API_DECL void sgl_v2f_c3b(float x, float y, uint8_t r, uint8_t g, uint8_t b); |
| 904 | SOKOL_GL_API_DECL void sgl_v2f_c4f(float x, float y, float r, float g, float b, float a); |
| 905 | SOKOL_GL_API_DECL void sgl_v2f_c4b(float x, float y, uint8_t r, uint8_t g, uint8_t b, uint8_t a); |
| 906 | SOKOL_GL_API_DECL void sgl_v2f_c1i(float x, float y, uint32_t rgba); |
| 907 | SOKOL_GL_API_DECL void sgl_v3f_c3f(float x, float y, float z, float r, float g, float b); |
| 908 | SOKOL_GL_API_DECL void sgl_v3f_c3b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b); |
| 909 | SOKOL_GL_API_DECL void sgl_v3f_c4f(float x, float y, float z, float r, float g, float b, float a); |
| 910 | 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); |
| 911 | SOKOL_GL_API_DECL void sgl_v3f_c1i(float x, float y, float z, uint32_t rgba); |
| 912 | SOKOL_GL_API_DECL void sgl_v2f_t2f_c3f(float x, float y, float u, float v, float r, float g, float b); |
| 913 | 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); |
| 914 | 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); |
| 915 | 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); |
| 916 | SOKOL_GL_API_DECL void sgl_v2f_t2f_c1i(float x, float y, float u, float v, uint32_t rgba); |
| 917 | 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); |
| 918 | 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); |
| 919 | 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); |
| 920 | 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); |
| 921 | SOKOL_GL_API_DECL void sgl_v3f_t2f_c1i(float x, float y, float z, float u, float v, uint32_t rgba); |
| 922 | SOKOL_GL_API_DECL void sgl_end(void); |
| 923 | |
| 924 | #ifdef __cplusplus |
| 925 | } /* extern "C" */ |
| 926 | |
| 927 | /* reference-based equivalents for C++ */ |
| 928 | inline void sgl_setup(const sgl_desc_t& desc) { return sgl_setup(&desc); } |
| 929 | inline sgl_context sgl_make_context(const sgl_context_desc_t& desc) { return sgl_make_context(&desc); } |
| 930 | inline sgl_pipeline sgl_make_pipeline(const sg_pipeline_desc& desc) { return sgl_make_pipeline(&desc); } |
| 931 | inline sgl_pipeline sgl_context_make_pipeline(sgl_context ctx, const sg_pipeline_desc& desc) { return sgl_context_make_pipeline(ctx, &desc); } |
| 932 | #endif |
| 933 | #endif /* SOKOL_GL_INCLUDED */ |
| 934 | |
| 935 | // ██ ███ ███ ██████ ██ ███████ ███ ███ ███████ ███ ██ ████████ █████ ████████ ██ ██████ ███ ██ |
| 936 | // ██ ████ ████ ██ ██ ██ ██ ████ ████ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ |
| 937 | // ██ ██ ████ ██ ██████ ██ █████ ██ ████ ██ █████ ██ ██ ██ ██ ███████ ██ ██ ██ ██ ██ ██ ██ |
| 938 | // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ |
| 939 | // ██ ██ ██ ██ ███████ ███████ ██ ██ ███████ ██ ████ ██ ██ ██ ██ ██ ██████ ██ ████ |
| 940 | // |
| 941 | // >>implementation |
| 942 | #ifdef SOKOL_GL_IMPL |
| 943 | #define SOKOL_GL_IMPL_INCLUDED (1) |
| 944 | |
| 945 | #if defined(SOKOL_MALLOC) || defined(SOKOL_CALLOC) || defined(SOKOL_FREE) |
| 946 | #error "SOKOL_MALLOC/CALLOC/FREE macros are no longer supported, please use sgl_desc_t.allocator to override memory allocation functions" |
| 947 | #endif |
| 948 | |
| 949 | #include <stdlib.h> // malloc/free |
| 950 | #include <string.h> // memset |
| 951 | #include <math.h> // M_PI, sqrtf, sinf, cosf |
| 952 | |
| 953 | #ifndef M_PI |
| 954 | #define M_PI 3.14159265358979323846264338327 |
| 955 | #endif |
| 956 | |
| 957 | #ifndef SOKOL_API_IMPL |
| 958 | #define SOKOL_API_IMPL |
| 959 | #endif |
| 960 | #ifndef SOKOL_DEBUG |
| 961 | #ifndef NDEBUG |
| 962 | #define SOKOL_DEBUG |
| 963 | #endif |
| 964 | #endif |
| 965 | #ifndef SOKOL_ASSERT |
| 966 | #include <assert.h> |
| 967 | #define SOKOL_ASSERT(c) assert(c) |
| 968 | #endif |
| 969 | |
| 970 | #define _sgl_def(val, def) (((val) == 0) ? (def) : (val)) |
| 971 | #define _SGL_INIT_COOKIE (0xABCDABCD) |
| 972 | |
| 973 | /* |
| 974 | Embedded source code compiled with: |
| 975 | |
| 976 | sokol-shdc -i sgl.glsl -o sgl.h -l glsl410:glsl300es:hlsl4:metal_macos:metal_ios:metal_sim:wgpu -b |
| 977 | |
| 978 | (not that for Metal and D3D11 byte code, sokol-shdc must be run |
| 979 | on macOS and Windows) |
| 980 | |
| 981 | @vs vs |
| 982 | uniform vs_params { |
| 983 | mat4 mvp; |
| 984 | mat4 tm; |
| 985 | }; |
| 986 | in vec4 position; |
| 987 | in vec2 texcoord0; |
| 988 | in vec4 color0; |
| 989 | in float psize; |
| 990 | out vec4 uv; |
| 991 | out vec4 color; |
| 992 | void main() { |
| 993 | gl_Position = mvp * position; |
| 994 | #ifndef SOKOL_WGSL |
| 995 | gl_PointSize = psize; |
| 996 | #endif |
| 997 | uv = tm * vec4(texcoord0, 0.0, 1.0); |
| 998 | color = color0; |
| 999 | } |
| 1000 | @end |
| 1001 | |
| 1002 | @fs fs |
| 1003 | uniform texture2D tex; |
| 1004 | uniform sampler smp; |
| 1005 | in vec4 uv; |
| 1006 | in vec4 color; |
| 1007 | out vec4 frag_color; |
| 1008 | void main() { |
| 1009 | frag_color = texture(sampler2D(tex, smp), uv.xy) * color; |
| 1010 | } |
| 1011 | @end |
| 1012 | |
| 1013 | @program sgl vs fs |
| 1014 | */ |
| 1015 | |
| 1016 | #if defined(SOKOL_GLCORE) |
| 1017 | static const uint8_t _sgl_vs_source_glsl410[520] = { |
| 1018 | 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, |
| 1019 | 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61, |
| 1020 | 0x72,0x61,0x6d,0x73,0x5b,0x38,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28, |
| 1021 | 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e, |
| 1022 | 0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a, |
| 1023 | 0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20, |
| 1024 | 0x3d,0x20,0x33,0x29,0x20,0x69,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x73, |
| 1025 | 0x69,0x7a,0x65,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61, |
| 1026 | 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65, |
| 1027 | 0x63,0x34,0x20,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f, |
| 1028 | 0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76, |
| 1029 | 0x65,0x63,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x6c, |
| 1030 | 0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d, |
| 1031 | 0x20,0x31,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c, |
| 1032 | 0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74, |
| 1033 | 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34, |
| 1034 | 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d, |
| 1035 | 0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50, |
| 1036 | 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76, |
| 1037 | 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f, |
| 1038 | 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61, |
| 1039 | 0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61, |
| 1040 | 0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, |
| 1041 | 0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53, |
| 1042 | 0x69,0x7a,0x65,0x20,0x3d,0x20,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20, |
| 1043 | 0x20,0x75,0x76,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61, |
| 1044 | 0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61, |
| 1045 | 0x6d,0x73,0x5b,0x35,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, |
| 1046 | 0x5b,0x36,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x37, |
| 1047 | 0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x74,0x65,0x78,0x63,0x6f,0x6f, |
| 1048 | 0x72,0x64,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a, |
| 1049 | 0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f, |
| 1050 | 0x72,0x30,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, |
| 1051 | }; |
| 1052 | static const uint8_t _sgl_fs_source_glsl410[222] = { |
| 1053 | 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, |
| 1054 | 0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20, |
| 1055 | 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74, |
| 1056 | 0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f, |
| 1057 | 0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, |
| 1058 | 0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74, |
| 1059 | 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34, |
| 1060 | 0x20,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61, |
| 1061 | 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63, |
| 1062 | 0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d, |
| 1063 | 0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67, |
| 1064 | 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65, |
| 1065 | 0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x2e,0x78,0x79,0x29, |
| 1066 | 0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, |
| 1067 | }; |
| 1068 | #elif defined(SOKOL_GLES3) |
| 1069 | static const uint8_t _sgl_vs_source_glsl300es[481] = { |
| 1070 | 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, |
| 1071 | 0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73, |
| 1072 | 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x38,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f, |
| 1073 | 0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29, |
| 1074 | 0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, |
| 1075 | 0x6e,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69, |
| 1076 | 0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,0x69,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74, |
| 1077 | 0x20,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34, |
| 1078 | 0x20,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61, |
| 1079 | 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63, |
| 1080 | 0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x6f,0x75,0x74, |
| 1081 | 0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79, |
| 1082 | 0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32, |
| 1083 | 0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30, |
| 1084 | 0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b, |
| 1085 | 0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, |
| 1086 | 0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, |
| 1087 | 0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, |
| 1088 | 0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d, |
| 1089 | 0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20, |
| 1090 | 0x2a,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20, |
| 1091 | 0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x20,0x3d,0x20,0x70, |
| 1092 | 0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x6d, |
| 1093 | 0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d, |
| 1094 | 0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x35,0x5d,0x2c,0x20, |
| 1095 | 0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x36,0x5d,0x2c,0x20,0x76,0x73, |
| 1096 | 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x37,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65, |
| 1097 | 0x63,0x34,0x28,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x2c,0x20,0x30,0x2e, |
| 1098 | 0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c, |
| 1099 | 0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x7d,0x0a,0x0a, |
| 1100 | 0x00, |
| 1101 | }; |
| 1102 | static const uint8_t _sgl_fs_source_glsl300es[253] = { |
| 1103 | 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, |
| 1104 | 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, |
| 1105 | 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, |
| 1106 | 0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75, |
| 1107 | 0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d, |
| 1108 | 0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a, |
| 1109 | 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, |
| 1110 | 0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x68,0x69,0x67,0x68,0x70,0x20, |
| 1111 | 0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b, |
| 1112 | 0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x75, |
| 1113 | 0x76,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34, |
| 1114 | 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61, |
| 1115 | 0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f, |
| 1116 | 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, |
| 1117 | 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x2e,0x78,0x79,0x29,0x20, |
| 1118 | 0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, |
| 1119 | }; |
| 1120 | #elif defined(SOKOL_METAL) |
| 1121 | static const uint8_t _sgl_vs_bytecode_metal_macos[3317] = { |
| 1122 | 0x4d,0x54,0x4c,0x42,0x01,0x80,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1123 | 0xf5,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1124 | 0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc9,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1125 | 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x01,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1126 | 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x01,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1127 | 0xe0,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x6d,0x00,0x00,0x00, |
| 1128 | 0x4e,0x41,0x4d,0x45,0x06,0x00,0x6d,0x61,0x69,0x6e,0x30,0x00,0x54,0x59,0x50,0x45, |
| 1129 | 0x01,0x00,0x00,0x48,0x41,0x53,0x48,0x20,0x00,0x76,0x25,0x5f,0x37,0x22,0xd0,0x3f, |
| 1130 | 0x64,0xef,0xff,0xc3,0x45,0x1a,0x3d,0xb7,0x5e,0x83,0x13,0x96,0xd3,0x09,0xec,0x53, |
| 1131 | 0x25,0xd5,0x7e,0x0c,0xed,0xb9,0x58,0x34,0x02,0x4f,0x46,0x46,0x54,0x18,0x00,0x00, |
| 1132 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1133 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0x45,0x52,0x53,0x08,0x00,0x01,0x00,0x08, |
| 1134 | 0x00,0x01,0x00,0x01,0x00,0x45,0x4e,0x44,0x54,0x40,0x00,0x00,0x00,0x56,0x41,0x54, |
| 1135 | 0x54,0x2a,0x00,0x04,0x00,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x00,0x80, |
| 1136 | 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x00,0x01,0x80,0x63,0x6f,0x6c,0x6f, |
| 1137 | 0x72,0x30,0x00,0x02,0x80,0x70,0x73,0x69,0x7a,0x65,0x00,0x03,0x80,0x56,0x41,0x54, |
| 1138 | 0x59,0x06,0x00,0x04,0x00,0x06,0x04,0x06,0x03,0x45,0x4e,0x44,0x54,0x04,0x00,0x00, |
| 1139 | 0x00,0x45,0x4e,0x44,0x54,0xde,0xc0,0x17,0x0b,0x00,0x00,0x00,0x00,0x14,0x00,0x00, |
| 1140 | 0x00,0xc4,0x0b,0x00,0x00,0xff,0xff,0xff,0xff,0x42,0x43,0xc0,0xde,0x21,0x0c,0x00, |
| 1141 | 0x00,0xee,0x02,0x00,0x00,0x0b,0x82,0x20,0x00,0x02,0x00,0x00,0x00,0x12,0x00,0x00, |
| 1142 | 0x00,0x07,0x81,0x23,0x91,0x41,0xc8,0x04,0x49,0x06,0x10,0x32,0x39,0x92,0x01,0x84, |
| 1143 | 0x0c,0x25,0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,0x80,0x14,0x45,0x02,0x42,0x92,0x0b, |
| 1144 | 0x42,0xa4,0x10,0x32,0x14,0x38,0x08,0x18,0x49,0x0a,0x32,0x44,0x24,0x48,0x0a,0x90, |
| 1145 | 0x21,0x23,0xc4,0x52,0x80,0x0c,0x19,0x21,0x72,0x24,0x07,0xc8,0x48,0x11,0x62,0xa8, |
| 1146 | 0xa0,0xa8,0x40,0xc6,0xf0,0x01,0x00,0x00,0x00,0x51,0x18,0x00,0x00,0x81,0x00,0x00, |
| 1147 | 0x00,0x1b,0xc8,0x25,0xf8,0xff,0xff,0xff,0xff,0x01,0x90,0x80,0x8a,0x18,0x87,0x77, |
| 1148 | 0x90,0x07,0x79,0x28,0x87,0x71,0xa0,0x07,0x76,0xc8,0x87,0x36,0x90,0x87,0x77,0xa8, |
| 1149 | 0x07,0x77,0x20,0x87,0x72,0x20,0x87,0x36,0x20,0x87,0x74,0xb0,0x87,0x74,0x20,0x87, |
| 1150 | 0x72,0x68,0x83,0x79,0x88,0x07,0x79,0xa0,0x87,0x36,0x30,0x07,0x78,0x68,0x83,0x76, |
| 1151 | 0x08,0x07,0x7a,0x40,0x07,0xc0,0x1c,0xc2,0x81,0x1d,0xe6,0xa1,0x1c,0x00,0x82,0x1c, |
| 1152 | 0xd2,0x61,0x1e,0xc2,0x41,0x1c,0xd8,0xa1,0x1c,0xda,0x80,0x1e,0xc2,0x21,0x1d,0xd8, |
| 1153 | 0xa1,0x0d,0xc6,0x21,0x1c,0xd8,0x81,0x1d,0xe6,0x01,0x30,0x87,0x70,0x60,0x87,0x79, |
| 1154 | 0x28,0x07,0x80,0x60,0x87,0x72,0x98,0x87,0x79,0x68,0x03,0x78,0x90,0x87,0x72,0x18, |
| 1155 | 0x87,0x74,0x98,0x87,0x72,0x68,0x03,0x73,0x80,0x87,0x76,0x08,0x07,0x72,0x00,0xcc, |
| 1156 | 0x21,0x1c,0xd8,0x61,0x1e,0xca,0x01,0x20,0xdc,0xe1,0x1d,0xda,0xc0,0x1c,0xe4,0x21, |
| 1157 | 0x1c,0xda,0xa1,0x1c,0xda,0x00,0x1e,0xde,0x21,0x1d,0xdc,0x81,0x1e,0xca,0x41,0x1e, |
| 1158 | 0xda,0xa0,0x1c,0xd8,0x21,0x1d,0xda,0x01,0xa0,0x07,0x79,0xa8,0x87,0x72,0x00,0x06, |
| 1159 | 0x77,0x78,0x87,0x36,0x30,0x07,0x79,0x08,0x87,0x76,0x28,0x87,0x36,0x80,0x87,0x77, |
| 1160 | 0x48,0x07,0x77,0xa0,0x87,0x72,0x90,0x87,0x36,0x28,0x07,0x76,0x48,0x87,0x76,0x68, |
| 1161 | 0x03,0x77,0x78,0x07,0x77,0x68,0x03,0x76,0x28,0x87,0x70,0x30,0x07,0x80,0x70,0x87, |
| 1162 | 0x77,0x68,0x83,0x74,0x70,0x07,0x73,0x98,0x87,0x36,0x30,0x07,0x78,0x68,0x83,0x76, |
| 1163 | 0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,0xdc,0xe1,0x1d, |
| 1164 | 0xda,0x40,0x1d,0xea,0xa1,0x1d,0xe0,0xa1,0x0d,0xe8,0x21,0x1c,0xc4,0x81,0x1d,0xca, |
| 1165 | 0x61,0x1e,0x00,0x73,0x08,0x07,0x76,0x98,0x87,0x72,0x00,0x08,0x77,0x78,0x87,0x36, |
| 1166 | 0x70,0x87,0x70,0x70,0x87,0x79,0x68,0x03,0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0, |
| 1167 | 0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1,0x1c,0x00,0xc2,0x1d,0xde,0xa1,0x0d,0xe6, |
| 1168 | 0x21,0x1d,0xce,0xc1,0x1d,0xca,0x81,0x1c,0xda,0x40,0x1f,0xca,0x41,0x1e,0xde,0x61, |
| 1169 | 0x1e,0xda,0xc0,0x1c,0xe0,0xa1,0x0d,0xda,0x21,0x1c,0xe8,0x01,0x1d,0x00,0x7a,0x90, |
| 1170 | 0x87,0x7a,0x28,0x07,0x80,0x70,0x87,0x77,0x68,0x03,0x7a,0x90,0x87,0x70,0x80,0x07, |
| 1171 | 0x78,0x48,0x07,0x77,0x38,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41, |
| 1172 | 0x1e,0xea,0xa1,0x1c,0x00,0x62,0x1e,0xe8,0x21,0x1c,0xc6,0x61,0x1d,0xda,0x00,0x1e, |
| 1173 | 0xe4,0xe1,0x1d,0xe8,0xa1,0x1c,0xc6,0x81,0x1e,0xde,0x41,0x1e,0xda,0x40,0x1c,0xea, |
| 1174 | 0xc1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x0d,0xe6,0x21,0x1d,0xf4,0xa1,0x1c,0x00,0x3c, |
| 1175 | 0x00,0x88,0x7a,0x70,0x87,0x79,0x08,0x07,0x73,0x28,0x87,0x36,0x30,0x07,0x78,0x68, |
| 1176 | 0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,0xea, |
| 1177 | 0x61,0x1e,0xca,0xa1,0x0d,0xe6,0xe1,0x1d,0xcc,0x81,0x1e,0xda,0xc0,0x1c,0xd8,0xe1, |
| 1178 | 0x1d,0xc2,0x81,0x1e,0x00,0x73,0x08,0x07,0x76,0x98,0x87,0x72,0x00,0x36,0x18,0x42, |
| 1179 | 0x01,0x2c,0x40,0x05,0x00,0x49,0x18,0x00,0x00,0x01,0x00,0x00,0x00,0x13,0x84,0x40, |
| 1180 | 0x00,0x89,0x20,0x00,0x00,0x20,0x00,0x00,0x00,0x32,0x22,0x48,0x09,0x20,0x64,0x85, |
| 1181 | 0x04,0x93,0x22,0xa4,0x84,0x04,0x93,0x22,0xe3,0x84,0xa1,0x90,0x14,0x12,0x4c,0x8a, |
| 1182 | 0x8c,0x0b,0x84,0xa4,0x4c,0x10,0x44,0x33,0x00,0xc3,0x08,0x04,0x60,0x89,0x10,0x02, |
| 1183 | 0x18,0x46,0x10,0x80,0x24,0x08,0x33,0x51,0xf3,0x40,0x0f,0xf2,0x50,0x0f,0xe3,0x40, |
| 1184 | 0x0f,0x6e,0xd0,0x0e,0xe5,0x40,0x0f,0xe1,0xc0,0x0e,0x7a,0xa0,0x07,0xed,0x10,0x0e, |
| 1185 | 0xf4,0x20,0x0f,0xe9,0x80,0x0f,0x28,0x20,0x07,0x49,0x53,0x44,0x09,0x93,0x5f,0x49, |
| 1186 | 0xff,0x03,0x44,0x00,0x23,0x21,0xa1,0x94,0x41,0x04,0x43,0x28,0x86,0x08,0x23,0x80, |
| 1187 | 0x43,0x68,0x20,0x60,0x8e,0x00,0x0c,0x52,0x60,0xcd,0x11,0x80,0xc2,0x20,0x42,0x20, |
| 1188 | 0x0c,0x23,0x10,0xcb,0x08,0x00,0x00,0x00,0x00,0x13,0xb2,0x70,0x48,0x07,0x79,0xb0, |
| 1189 | 0x03,0x3a,0x68,0x83,0x70,0x80,0x07,0x78,0x60,0x87,0x72,0x68,0x83,0x76,0x08,0x87, |
| 1190 | 0x71,0x78,0x87,0x79,0xc0,0x87,0x38,0x80,0x03,0x37,0x88,0x83,0x38,0x70,0x03,0x38, |
| 1191 | 0xd8,0x70,0x1b,0xe5,0xd0,0x06,0xf0,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74, |
| 1192 | 0xa0,0x07,0x76,0x40,0x07,0x6d,0x90,0x0e,0x71,0xa0,0x07,0x78,0xa0,0x07,0x78,0xd0, |
| 1193 | 0x06,0xe9,0x80,0x07,0x7a,0x80,0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,0x71,0x60,0x07, |
| 1194 | 0x7a,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x6d,0x90,0x0e,0x73,0x20,0x07,0x7a, |
| 1195 | 0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x90,0x0e,0x76,0x40,0x07,0x7a,0x60, |
| 1196 | 0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0e,0x73,0x20,0x07,0x7a,0x30,0x07, |
| 1197 | 0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x60,0x0e,0x76,0x40,0x07,0x7a,0x60,0x07,0x74, |
| 1198 | 0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xa0, |
| 1199 | 0x07,0x71,0x60,0x07,0x6d,0x60,0x0f,0x72,0x40,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07, |
| 1200 | 0x73,0x20,0x07,0x6d,0x60,0x0f,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73, |
| 1201 | 0x20,0x07,0x6d,0x60,0x0f,0x74,0x80,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40, |
| 1202 | 0x07,0x6d,0x60,0x0f,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07, |
| 1203 | 0x6d,0x60,0x0f,0x79,0x60,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72, |
| 1204 | 0x80,0x07,0x6d,0x60,0x0f,0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xa0, |
| 1205 | 0x07,0x71,0x20,0x07,0x78,0xd0,0x06,0xf6,0x10,0x07,0x79,0x20,0x07,0x7a,0x20,0x07, |
| 1206 | 0x75,0x60,0x07,0x7a,0x20,0x07,0x75,0x60,0x07,0x6d,0x60,0x0f,0x72,0x50,0x07,0x76, |
| 1207 | 0xa0,0x07,0x72,0x50,0x07,0x76,0xa0,0x07,0x72,0x50,0x07,0x76,0xd0,0x06,0xf6,0x50, |
| 1208 | 0x07,0x71,0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07, |
| 1209 | 0x6d,0x60,0x0f,0x71,0x00,0x07,0x72,0x40,0x07,0x7a,0x10,0x07,0x70,0x20,0x07,0x74, |
| 1210 | 0xa0,0x07,0x71,0x00,0x07,0x72,0x40,0x07,0x6d,0xe0,0x0e,0x78,0xa0,0x07,0x71,0x60, |
| 1211 | 0x07,0x7a,0x30,0x07,0x72,0x30,0x84,0x49,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00, |
| 1212 | 0xc8,0x02,0x01,0x00,0x00,0x0b,0x00,0x00,0x00,0x32,0x1e,0x98,0x10,0x19,0x11,0x4c, |
| 1213 | 0x90,0x8c,0x09,0x26,0x47,0xc6,0x04,0x43,0x5a,0x25,0x30,0x02,0x50,0x04,0x05,0x18, |
| 1214 | 0x50,0x08,0x65,0x50,0x80,0x02,0x05,0x51,0x20,0xd4,0x46,0x00,0x88,0x8d,0x25,0x34, |
| 1215 | 0x01,0x00,0x00,0x00,0x00,0x79,0x18,0x00,0x00,0x02,0x01,0x00,0x00,0x1a,0x03,0x4c, |
| 1216 | 0x10,0x97,0x29,0xa2,0x25,0x10,0xab,0x32,0xb9,0xb9,0xb4,0x37,0xb7,0x21,0xc6,0x32, |
| 1217 | 0x28,0x00,0xb3,0x50,0xb9,0x1b,0x43,0x0b,0x93,0xfb,0x9a,0x4b,0xd3,0x2b,0x1b,0x62, |
| 1218 | 0x2c,0x81,0x22,0x2c,0x05,0xe7,0x20,0x08,0x0e,0x8e,0xad,0x0c,0xa4,0xad,0x8c,0x2e, |
| 1219 | 0x8c,0x0d,0xc4,0xae,0x4c,0x6e,0x2e,0xed,0xcd,0x0d,0x64,0x26,0x06,0x06,0x26,0xc6, |
| 1220 | 0xc5,0xc6,0xe6,0x06,0x04,0xa5,0xad,0x8c,0x2e,0x8c,0xcd,0xac,0xac,0x65,0x26,0x06, |
| 1221 | 0x06,0x26,0xc6,0xc5,0xc6,0xe6,0xc6,0x45,0x26,0x65,0x88,0xa0,0x10,0x43,0x8c,0x25, |
| 1222 | 0x58,0x90,0x45,0x60,0xd1,0x54,0x46,0x17,0xc6,0x36,0x04,0x51,0x8e,0x25,0x58,0x82, |
| 1223 | 0x45,0xe0,0x16,0x96,0x26,0xe7,0x32,0xf6,0xd6,0x06,0x97,0xc6,0x56,0xe6,0x42,0x56, |
| 1224 | 0xe6,0xf6,0x26,0xd7,0x36,0xf7,0x45,0x96,0x36,0x17,0x26,0xc6,0x56,0x36,0x44,0x50, |
| 1225 | 0x12,0x72,0x61,0x69,0x72,0x2e,0x63,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x2e,0x66,0x61, |
| 1226 | 0x73,0x74,0x5f,0x6d,0x61,0x74,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x43,0x04, |
| 1227 | 0x65,0x61,0x19,0x84,0xa5,0xc9,0xb9,0x8c,0xbd,0xb5,0xc1,0xa5,0xb1,0x95,0xb9,0x98, |
| 1228 | 0xc9,0x85,0xb5,0x95,0x89,0xd5,0x99,0x99,0x95,0xc9,0x7d,0x99,0x95,0xd1,0x8d,0xa1, |
| 1229 | 0x7d,0x91,0xa5,0xcd,0x85,0x89,0xb1,0x95,0x0d,0x11,0x94,0x86,0x51,0x58,0x9a,0x9c, |
| 1230 | 0x8b,0x5d,0x99,0x1c,0x5d,0x19,0xde,0xd7,0x5b,0x1d,0x1d,0x5c,0x1d,0x1d,0x97,0xba, |
| 1231 | 0xb9,0x32,0x39,0x14,0xb6,0xb7,0x31,0x37,0x98,0x14,0x46,0x61,0x69,0x72,0x2e,0x61, |
| 1232 | 0x72,0x67,0x5f,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0x34,0xcc,0xd8,0xde, |
| 1233 | 0xc2,0xe8,0x68,0xc8,0x84,0xa5,0xc9,0xb9,0x84,0xc9,0x9d,0x7d,0xb9,0x85,0xb5,0x95, |
| 1234 | 0x51,0xa8,0xb3,0x1b,0xc2,0x28,0x8f,0x02,0x29,0x91,0x22,0x29,0x93,0x42,0x71,0xa9, |
| 1235 | 0x9b,0x2b,0x93,0x43,0x61,0x7b,0x1b,0x73,0x8b,0x49,0x61,0x31,0xf6,0xc6,0xf6,0x26, |
| 1236 | 0x37,0x84,0x51,0x1e,0xc5,0x52,0x22,0x45,0x52,0x26,0xe5,0x22,0x13,0x96,0x26,0xe7, |
| 1237 | 0x02,0xf7,0x36,0x97,0x46,0x97,0xf6,0xe6,0xc6,0xe5,0x8c,0xed,0x0b,0xea,0x6d,0x2e, |
| 1238 | 0x8d,0x2e,0xed,0xcd,0x6d,0x88,0xa2,0x64,0x4a,0xa4,0x48,0xca,0xa4,0x68,0x74,0xc2, |
| 1239 | 0xd2,0xe4,0x5c,0xe0,0xde,0xd2,0xdc,0xe8,0xbe,0xe6,0xd2,0xf4,0xca,0x58,0x98,0xb1, |
| 1240 | 0xbd,0x85,0xd1,0x91,0x39,0x63,0xfb,0x82,0x7a,0x4b,0x73,0xa3,0x9b,0x4a,0xd3,0x2b, |
| 1241 | 0x1b,0xa2,0x28,0x9c,0x12,0x29,0x9d,0x32,0x29,0xde,0x10,0x44,0xa9,0x14,0x4c,0xd9, |
| 1242 | 0x94,0x8f,0x50,0x58,0x9a,0x9c,0x8b,0x5d,0x99,0x1c,0x5d,0x19,0xde,0x57,0x9a,0x1b, |
| 1243 | 0x5c,0x1d,0x1d,0xa5,0xb0,0x34,0x39,0x17,0xb6,0xb7,0xb1,0x30,0xba,0xb4,0x37,0xb7, |
| 1244 | 0xaf,0x34,0x37,0xb2,0x32,0x3c,0x7a,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x64, |
| 1245 | 0x28,0x5f,0x5f,0x61,0x69,0x72,0x5f,0x70,0x6c,0x61,0x63,0x65,0x68,0x6f,0x6c,0x64, |
| 1246 | 0x65,0x72,0x5f,0x5f,0x29,0x44,0xe0,0xde,0xe6,0xd2,0xe8,0xd2,0xde,0xdc,0x86,0x50, |
| 1247 | 0x8b,0xa0,0x84,0x81,0x22,0x06,0x8b,0xb0,0x04,0xca,0x18,0x28,0x91,0x22,0x29,0x93, |
| 1248 | 0x42,0x06,0x34,0xcc,0xd8,0xde,0xc2,0xe8,0x64,0x98,0xd0,0x95,0xe1,0x8d,0xbd,0xbd, |
| 1249 | 0xc9,0x91,0xc1,0x0c,0xa1,0x96,0x40,0x09,0x03,0x45,0x0c,0x96,0x60,0x09,0x94,0x31, |
| 1250 | 0x50,0x22,0xc5,0x0c,0x94,0x49,0x39,0x03,0x1a,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x43, |
| 1251 | 0xa8,0x65,0x50,0xc2,0x40,0x11,0x83,0x65,0x58,0x02,0x65,0x0c,0x94,0x48,0x91,0x94, |
| 1252 | 0x49,0x49,0x03,0x16,0x70,0x73,0x69,0x7a,0x65,0x43,0xa8,0xc5,0x50,0xc2,0x40,0x11, |
| 1253 | 0x83,0xc5,0x58,0x02,0x65,0x0c,0x94,0x48,0xe9,0x94,0x49,0x59,0x03,0x2a,0x61,0x69, |
| 1254 | 0x72,0x2e,0x62,0x75,0x66,0x66,0x65,0x72,0x7c,0xc2,0xd2,0xe4,0x5c,0xc4,0xea,0xcc, |
| 1255 | 0xcc,0xca,0xe4,0xbe,0xe6,0xd2,0xf4,0xca,0x88,0x84,0xa5,0xc9,0xb9,0xc8,0x95,0x85, |
| 1256 | 0x91,0x91,0x0a,0x4b,0x93,0x73,0x99,0xa3,0x93,0xab,0x1b,0xa3,0xfb,0xa2,0xcb,0x83, |
| 1257 | 0x2b,0xfb,0x4a,0x73,0x33,0x7b,0x23,0x62,0xc6,0xf6,0x16,0x46,0x47,0x83,0x47,0xc3, |
| 1258 | 0xa1,0xcd,0x0e,0x8e,0x02,0x5d,0xdb,0x10,0x6a,0x11,0x16,0x62,0x11,0x94,0x38,0x50, |
| 1259 | 0xe4,0x60,0x21,0x16,0x62,0x11,0x94,0x38,0x50,0xe6,0x80,0x51,0x58,0x9a,0x9c,0x4b, |
| 1260 | 0x98,0xdc,0xd9,0x17,0x5d,0x1e,0x5c,0xd9,0xd7,0x5c,0x9a,0x5e,0x19,0xaf,0xb0,0x34, |
| 1261 | 0x39,0x97,0x30,0xb9,0xb3,0x2f,0xba,0x3c,0xb8,0xb2,0xaf,0x30,0xb6,0xb4,0x33,0xb7, |
| 1262 | 0xaf,0xb9,0x34,0xbd,0x32,0x26,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x1c, |
| 1263 | 0xbe,0x62,0x72,0x86,0x90,0xc1,0x52,0x28,0x6d,0xa0,0xb8,0xc1,0x72,0x28,0x62,0xb0, |
| 1264 | 0x08,0x4b,0xa0,0xbc,0x81,0x02,0x07,0x0a,0x1d,0x28,0x75,0xb0,0x1c,0x8a,0x1d,0x2c, |
| 1265 | 0x89,0x12,0x29,0x77,0xa0,0x4c,0x0a,0x1e,0x0c,0x51,0x94,0x32,0x50,0xd0,0x40,0x51, |
| 1266 | 0x03,0x85,0x0d,0x94,0x3c,0x18,0x62,0x24,0x80,0x02,0x06,0x8a,0x1e,0xf0,0x79,0x6b, |
| 1267 | 0x73,0x4b,0x83,0x7b,0xa3,0x2b,0x73,0xa3,0x03,0x19,0x43,0x0b,0x93,0xe3,0x33,0x95, |
| 1268 | 0xd6,0x06,0xc7,0x56,0x06,0x32,0xb4,0xb2,0x02,0x42,0x25,0x14,0x14,0x34,0x44,0x50, |
| 1269 | 0xfa,0x60,0x88,0xa1,0xf0,0x81,0xe2,0x07,0x8d,0x32,0xc4,0x50,0xfe,0x40,0xf9,0x83, |
| 1270 | 0x46,0x19,0x11,0xb1,0x03,0x3b,0xd8,0x43,0x3b,0xb8,0x41,0x3b,0xbc,0x03,0x39,0xd4, |
| 1271 | 0x03,0x3b,0x94,0x83,0x1b,0x98,0x03,0x3b,0x84,0xc3,0x39,0xcc,0xc3,0x14,0x21,0x18, |
| 1272 | 0x46,0x28,0xec,0xc0,0x0e,0xf6,0xd0,0x0e,0x6e,0x90,0x0e,0xe4,0x50,0x0e,0xee,0x40, |
| 1273 | 0x0f,0x53,0x82,0x62,0xc4,0x12,0x0e,0xe9,0x20,0x0f,0x6e,0x60,0x0f,0xe5,0x20,0x0f, |
| 1274 | 0xf3,0x90,0x0e,0xef,0xe0,0x0e,0x53,0x02,0x63,0x04,0x15,0x0e,0xe9,0x20,0x0f,0x6e, |
| 1275 | 0xc0,0x0e,0xe1,0xe0,0x0e,0xe7,0x50,0x0f,0xe1,0x70,0x0e,0xe5,0xf0,0x0b,0xf6,0x50, |
| 1276 | 0x0e,0xf2,0x30,0x0f,0xe9,0xf0,0x0e,0xee,0x30,0x25,0x40,0x46,0x4c,0xe1,0x90,0x0e, |
| 1277 | 0xf2,0xe0,0x06,0xe3,0xf0,0x0e,0xed,0x00,0x0f,0xe9,0xc0,0x0e,0xe5,0xf0,0x0b,0xef, |
| 1278 | 0x00,0x0f,0xf4,0x90,0x0e,0xef,0xe0,0x0e,0xf3,0x30,0x65,0x50,0x18,0x67,0x84,0x12, |
| 1279 | 0x0e,0xe9,0x20,0x0f,0x6e,0x60,0x0f,0xe5,0x20,0x0f,0xf4,0x50,0x0e,0xf8,0x30,0x25, |
| 1280 | 0xd8,0x03,0x00,0x00,0x00,0x79,0x18,0x00,0x00,0x7b,0x00,0x00,0x00,0x33,0x08,0x80, |
| 1281 | 0x1c,0xc4,0xe1,0x1c,0x66,0x14,0x01,0x3d,0x88,0x43,0x38,0x84,0xc3,0x8c,0x42,0x80, |
| 1282 | 0x07,0x79,0x78,0x07,0x73,0x98,0x71,0x0c,0xe6,0x00,0x0f,0xed,0x10,0x0e,0xf4,0x80, |
| 1283 | 0x0e,0x33,0x0c,0x42,0x1e,0xc2,0xc1,0x1d,0xce,0xa1,0x1c,0x66,0x30,0x05,0x3d,0x88, |
| 1284 | 0x43,0x38,0x84,0x83,0x1b,0xcc,0x03,0x3d,0xc8,0x43,0x3d,0x8c,0x03,0x3d,0xcc,0x78, |
| 1285 | 0x8c,0x74,0x70,0x07,0x7b,0x08,0x07,0x79,0x48,0x87,0x70,0x70,0x07,0x7a,0x70,0x03, |
| 1286 | 0x76,0x78,0x87,0x70,0x20,0x87,0x19,0xcc,0x11,0x0e,0xec,0x90,0x0e,0xe1,0x30,0x0f, |
| 1287 | 0x6e,0x30,0x0f,0xe3,0xf0,0x0e,0xf0,0x50,0x0e,0x33,0x10,0xc4,0x1d,0xde,0x21,0x1c, |
| 1288 | 0xd8,0x21,0x1d,0xc2,0x61,0x1e,0x66,0x30,0x89,0x3b,0xbc,0x83,0x3b,0xd0,0x43,0x39, |
| 1289 | 0xb4,0x03,0x3c,0xbc,0x83,0x3c,0x84,0x03,0x3b,0xcc,0xf0,0x14,0x76,0x60,0x07,0x7b, |
| 1290 | 0x68,0x07,0x37,0x68,0x87,0x72,0x68,0x07,0x37,0x80,0x87,0x70,0x90,0x87,0x70,0x60, |
| 1291 | 0x07,0x76,0x28,0x07,0x76,0xf8,0x05,0x76,0x78,0x87,0x77,0x80,0x87,0x5f,0x08,0x87, |
| 1292 | 0x71,0x18,0x87,0x72,0x98,0x87,0x79,0x98,0x81,0x2c,0xee,0xf0,0x0e,0xee,0xe0,0x0e, |
| 1293 | 0xf5,0xc0,0x0e,0xec,0x30,0x03,0x62,0xc8,0xa1,0x1c,0xe4,0xa1,0x1c,0xcc,0xa1,0x1c, |
| 1294 | 0xe4,0xa1,0x1c,0xdc,0x61,0x1c,0xca,0x21,0x1c,0xc4,0x81,0x1d,0xca,0x61,0x06,0xd6, |
| 1295 | 0x90,0x43,0x39,0xc8,0x43,0x39,0x98,0x43,0x39,0xc8,0x43,0x39,0xb8,0xc3,0x38,0x94, |
| 1296 | 0x43,0x38,0x88,0x03,0x3b,0x94,0xc3,0x2f,0xbc,0x83,0x3c,0xfc,0x82,0x3b,0xd4,0x03, |
| 1297 | 0x3b,0xb0,0xc3,0x0c,0xc7,0x69,0x87,0x70,0x58,0x87,0x72,0x70,0x83,0x74,0x68,0x07, |
| 1298 | 0x78,0x60,0x87,0x74,0x18,0x87,0x74,0xa0,0x87,0x19,0xce,0x53,0x0f,0xee,0x00,0x0f, |
| 1299 | 0xf2,0x50,0x0e,0xe4,0x90,0x0e,0xe3,0x40,0x0f,0xe1,0x20,0x0e,0xec,0x50,0x0e,0x33, |
| 1300 | 0x20,0x28,0x1d,0xdc,0xc1,0x1e,0xc2,0x41,0x1e,0xd2,0x21,0x1c,0xdc,0x81,0x1e,0xdc, |
| 1301 | 0xe0,0x1c,0xe4,0xe1,0x1d,0xea,0x01,0x1e,0x66,0x18,0x51,0x38,0xb0,0x43,0x3a,0x9c, |
| 1302 | 0x83,0x3b,0xcc,0x50,0x24,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x60,0x87,0x77,0x78, |
| 1303 | 0x07,0x78,0x98,0x51,0x4c,0xf4,0x90,0x0f,0xf0,0x50,0x0e,0x33,0x1e,0x6a,0x1e,0xca, |
| 1304 | 0x61,0x1c,0xe8,0x21,0x1d,0xde,0xc1,0x1d,0x7e,0x01,0x1e,0xe4,0xa1,0x1c,0xcc,0x21, |
| 1305 | 0x1d,0xf0,0x61,0x06,0x54,0x85,0x83,0x38,0xcc,0xc3,0x3b,0xb0,0x43,0x3d,0xd0,0x43, |
| 1306 | 0x39,0xfc,0xc2,0x3c,0xe4,0x43,0x3b,0x88,0xc3,0x3b,0xb0,0xc3,0x8c,0xc5,0x0a,0x87, |
| 1307 | 0x79,0x98,0x87,0x77,0x18,0x87,0x74,0x08,0x07,0x7a,0x28,0x07,0x72,0x98,0x81,0x5c, |
| 1308 | 0xe3,0x10,0x0e,0xec,0xc0,0x0e,0xe5,0x50,0x0e,0xf3,0x30,0x23,0xc1,0xd2,0x41,0x1e, |
| 1309 | 0xe4,0xe1,0x17,0xd8,0xe1,0x1d,0xde,0x01,0x1e,0x66,0x50,0x59,0x38,0xa4,0x83,0x3c, |
| 1310 | 0xb8,0x81,0x39,0xd4,0x83,0x3b,0x8c,0x03,0x3d,0xa4,0xc3,0x3b,0xb8,0xc3,0x2f,0x9c, |
| 1311 | 0x83,0x3c,0xbc,0x43,0x3d,0xc0,0xc3,0x3c,0x00,0x71,0x20,0x00,0x00,0x02,0x00,0x00, |
| 1312 | 0x00,0x06,0x50,0x30,0x00,0xd2,0xd0,0x00,0x00,0x61,0x20,0x00,0x00,0x3e,0x00,0x00, |
| 1313 | 0x00,0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0xf4,0xc6,0x22, |
| 1314 | 0x86,0x61,0x18,0xc6,0x22,0x04,0x41,0x10,0xc6,0x22,0x82,0x20,0x08,0xa8,0x95,0x40, |
| 1315 | 0x19,0x14,0x01,0xbd,0x11,0x00,0x1a,0x33,0x00,0x24,0x66,0x00,0x28,0xcc,0x00,0x00, |
| 1316 | 0x00,0xe3,0x15,0x4b,0x94,0x65,0x11,0x05,0x65,0x90,0x21,0x1a,0x0c,0x13,0x02,0xf9, |
| 1317 | 0x8c,0x57,0x3c,0x55,0xd7,0x2d,0x14,0x94,0x41,0x86,0xea,0x70,0x4c,0x08,0xe4,0x63, |
| 1318 | 0x41,0x01,0x9f,0xf1,0x0a,0x4a,0x13,0x03,0x31,0x70,0x28,0x28,0x83,0x0c,0x1a,0x43, |
| 1319 | 0x99,0x10,0xc8,0xc7,0x8a,0x00,0x3e,0xe3,0x15,0xd9,0x77,0x06,0x67,0x40,0x51,0x50, |
| 1320 | 0x06,0x19,0xbe,0x48,0x33,0x21,0x90,0x8f,0x15,0x01,0x7c,0xc6,0x2b,0x3c,0x32,0x68, |
| 1321 | 0x03,0x36,0x20,0x03,0x0a,0xca,0x20,0xc3,0x18,0x60,0x99,0x09,0x81,0x7c,0xc6,0x2b, |
| 1322 | 0xc4,0x00,0x0d,0xe2,0x00,0x0e,0x3c,0x0a,0xca,0x20,0xc3,0x19,0x70,0x61,0x60,0x42, |
| 1323 | 0x20,0x1f,0x0b,0x0a,0xf8,0x8c,0x57,0x9c,0x41,0x1b,0xd8,0x41,0x1d,0x88,0x01,0x05, |
| 1324 | 0xc5,0x86,0x00,0x3e,0xb3,0x0d,0x61,0x10,0x00,0xb3,0x0d,0x41,0x1b,0x04,0xb3,0x0d, |
| 1325 | 0xc1,0x23,0xcc,0x36,0x04,0x6e,0x30,0x64,0x10,0x10,0x03,0x00,0x00,0x09,0x00,0x00, |
| 1326 | 0x00,0x5b,0x86,0x20,0x00,0x85,0x2d,0x43,0x11,0x80,0xc2,0x96,0x41,0x09,0x40,0x61, |
| 1327 | 0xcb,0xf0,0x04,0xa0,0xb0,0x65,0xa0,0x02,0x50,0xd8,0x32,0x60,0x01,0x28,0x6c,0x19, |
| 1328 | 0xba,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1329 | 0x00,0x00,0x00,0x00,0x00, |
| 1330 | }; |
| 1331 | static const uint8_t _sgl_fs_bytecode_metal_macos[2825] = { |
| 1332 | 0x4d,0x54,0x4c,0x42,0x01,0x80,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1333 | 0x09,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1334 | 0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc9,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1335 | 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd1,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1336 | 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd9,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1337 | 0x30,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x6d,0x00,0x00,0x00, |
| 1338 | 0x4e,0x41,0x4d,0x45,0x06,0x00,0x6d,0x61,0x69,0x6e,0x30,0x00,0x54,0x59,0x50,0x45, |
| 1339 | 0x01,0x00,0x01,0x48,0x41,0x53,0x48,0x20,0x00,0xb9,0x65,0x80,0x88,0xa2,0xc8,0x18, |
| 1340 | 0x8d,0x2a,0x38,0xc1,0x87,0xa4,0x7f,0x35,0x83,0x69,0xdc,0x8c,0xcb,0x7b,0x11,0x67, |
| 1341 | 0x89,0xc7,0xf0,0x8a,0x99,0x36,0x06,0xc5,0x90,0x4f,0x46,0x46,0x54,0x18,0x00,0x00, |
| 1342 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1343 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0x45,0x52,0x53,0x08,0x00,0x01,0x00,0x08, |
| 1344 | 0x00,0x01,0x00,0x01,0x00,0x45,0x4e,0x44,0x54,0x04,0x00,0x00,0x00,0x45,0x4e,0x44, |
| 1345 | 0x54,0x04,0x00,0x00,0x00,0x45,0x4e,0x44,0x54,0xde,0xc0,0x17,0x0b,0x00,0x00,0x00, |
| 1346 | 0x00,0x14,0x00,0x00,0x00,0x10,0x0a,0x00,0x00,0xff,0xff,0xff,0xff,0x42,0x43,0xc0, |
| 1347 | 0xde,0x21,0x0c,0x00,0x00,0x81,0x02,0x00,0x00,0x0b,0x82,0x20,0x00,0x02,0x00,0x00, |
| 1348 | 0x00,0x12,0x00,0x00,0x00,0x07,0x81,0x23,0x91,0x41,0xc8,0x04,0x49,0x06,0x10,0x32, |
| 1349 | 0x39,0x92,0x01,0x84,0x0c,0x25,0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,0x80,0x14,0x45, |
| 1350 | 0x02,0x42,0x92,0x0b,0x42,0xa4,0x10,0x32,0x14,0x38,0x08,0x18,0x49,0x0a,0x32,0x44, |
| 1351 | 0x24,0x48,0x0a,0x90,0x21,0x23,0xc4,0x52,0x80,0x0c,0x19,0x21,0x72,0x24,0x07,0xc8, |
| 1352 | 0x48,0x11,0x62,0xa8,0xa0,0xa8,0x40,0xc6,0xf0,0x01,0x00,0x00,0x00,0x51,0x18,0x00, |
| 1353 | 0x00,0x89,0x00,0x00,0x00,0x1b,0xcc,0x25,0xf8,0xff,0xff,0xff,0xff,0x01,0x60,0x00, |
| 1354 | 0x09,0xa8,0x88,0x71,0x78,0x07,0x79,0x90,0x87,0x72,0x18,0x07,0x7a,0x60,0x87,0x7c, |
| 1355 | 0x68,0x03,0x79,0x78,0x87,0x7a,0x70,0x07,0x72,0x28,0x07,0x72,0x68,0x03,0x72,0x48, |
| 1356 | 0x07,0x7b,0x48,0x07,0x72,0x28,0x87,0x36,0x98,0x87,0x78,0x90,0x07,0x7a,0x68,0x03, |
| 1357 | 0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xcc,0x21,0x1c,0xd8,0x61, |
| 1358 | 0x1e,0xca,0x01,0x20,0xc8,0x21,0x1d,0xe6,0x21,0x1c,0xc4,0x81,0x1d,0xca,0xa1,0x0d, |
| 1359 | 0xe8,0x21,0x1c,0xd2,0x81,0x1d,0xda,0x60,0x1c,0xc2,0x81,0x1d,0xd8,0x61,0x1e,0x00, |
| 1360 | 0x73,0x08,0x07,0x76,0x98,0x87,0x72,0x00,0x08,0x76,0x28,0x87,0x79,0x98,0x87,0x36, |
| 1361 | 0x80,0x07,0x79,0x28,0x87,0x71,0x48,0x87,0x79,0x28,0x87,0x36,0x30,0x07,0x78,0x68, |
| 1362 | 0x87,0x70,0x20,0x07,0xc0,0x1c,0xc2,0x81,0x1d,0xe6,0xa1,0x1c,0x00,0xc2,0x1d,0xde, |
| 1363 | 0xa1,0x0d,0xcc,0x41,0x1e,0xc2,0xa1,0x1d,0xca,0xa1,0x0d,0xe0,0xe1,0x1d,0xd2,0xc1, |
| 1364 | 0x1d,0xe8,0xa1,0x1c,0xe4,0xa1,0x0d,0xca,0x81,0x1d,0xd2,0xa1,0x1d,0x00,0x7a,0x90, |
| 1365 | 0x87,0x7a,0x28,0x07,0x60,0x70,0x87,0x77,0x68,0x03,0x73,0x90,0x87,0x70,0x68,0x87, |
| 1366 | 0x72,0x68,0x03,0x78,0x78,0x87,0x74,0x70,0x07,0x7a,0x28,0x07,0x79,0x68,0x83,0x72, |
| 1367 | 0x60,0x87,0x74,0x68,0x87,0x36,0x70,0x87,0x77,0x70,0x87,0x36,0x60,0x87,0x72,0x08, |
| 1368 | 0x07,0x73,0x00,0x08,0x77,0x78,0x87,0x36,0x48,0x07,0x77,0x30,0x87,0x79,0x68,0x03, |
| 1369 | 0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1, |
| 1370 | 0x1c,0x00,0xc2,0x1d,0xde,0xa1,0x0d,0xd4,0xa1,0x1e,0xda,0x01,0x1e,0xda,0x80,0x1e, |
| 1371 | 0xc2,0x41,0x1c,0xd8,0xa1,0x1c,0xe6,0x01,0x30,0x87,0x70,0x60,0x87,0x79,0x28,0x07, |
| 1372 | 0x80,0x70,0x87,0x77,0x68,0x03,0x77,0x08,0x07,0x77,0x98,0x87,0x36,0x30,0x07,0x78, |
| 1373 | 0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20, |
| 1374 | 0xdc,0xe1,0x1d,0xda,0x60,0x1e,0xd2,0xe1,0x1c,0xdc,0xa1,0x1c,0xc8,0xa1,0x0d,0xf4, |
| 1375 | 0xa1,0x1c,0xe4,0xe1,0x1d,0xe6,0xa1,0x0d,0xcc,0x01,0x1e,0xda,0xa0,0x1d,0xc2,0x81, |
| 1376 | 0x1e,0xd0,0x01,0xa0,0x07,0x79,0xa8,0x87,0x72,0x00,0x08,0x77,0x78,0x87,0x36,0xa0, |
| 1377 | 0x07,0x79,0x08,0x07,0x78,0x80,0x87,0x74,0x70,0x87,0x73,0x68,0x83,0x76,0x08,0x07, |
| 1378 | 0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,0xe6,0x81,0x1e,0xc2,0x61, |
| 1379 | 0x1c,0xd6,0xa1,0x0d,0xe0,0x41,0x1e,0xde,0x81,0x1e,0xca,0x61,0x1c,0xe8,0xe1,0x1d, |
| 1380 | 0xe4,0xa1,0x0d,0xc4,0xa1,0x1e,0xcc,0xc1,0x1c,0xca,0x41,0x1e,0xda,0x60,0x1e,0xd2, |
| 1381 | 0x41,0x1f,0xca,0x01,0xc0,0x03,0x80,0xa8,0x07,0x77,0x98,0x87,0x70,0x30,0x87,0x72, |
| 1382 | 0x68,0x03,0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e, |
| 1383 | 0xea,0xa1,0x1c,0x00,0xa2,0x1e,0xe6,0xa1,0x1c,0xda,0x60,0x1e,0xde,0xc1,0x1c,0xe8, |
| 1384 | 0xa1,0x0d,0xcc,0x81,0x1d,0xde,0x21,0x1c,0xe8,0x01,0x30,0x87,0x70,0x60,0x87,0x79, |
| 1385 | 0x28,0x07,0x60,0x83,0x21,0x0c,0xc0,0x02,0x54,0x1b,0x8c,0x81,0x00,0x16,0xa0,0xda, |
| 1386 | 0x80,0x10,0xff,0xff,0xff,0xff,0x3f,0x00,0x0c,0x20,0x01,0xd5,0x06,0xa3,0x08,0x80, |
| 1387 | 0x05,0xa8,0x36,0x18,0x86,0x00,0x2c,0x40,0x05,0x49,0x18,0x00,0x00,0x03,0x00,0x00, |
| 1388 | 0x00,0x13,0x86,0x40,0x18,0x26,0x0c,0x44,0x61,0x00,0x00,0x00,0x00,0x89,0x20,0x00, |
| 1389 | 0x00,0x1d,0x00,0x00,0x00,0x32,0x22,0x48,0x09,0x20,0x64,0x85,0x04,0x93,0x22,0xa4, |
| 1390 | 0x84,0x04,0x93,0x22,0xe3,0x84,0xa1,0x90,0x14,0x12,0x4c,0x8a,0x8c,0x0b,0x84,0xa4, |
| 1391 | 0x4c,0x10,0x48,0x33,0x00,0xc3,0x08,0x04,0x60,0x83,0x70,0x94,0x34,0x45,0x94,0x30, |
| 1392 | 0xf9,0xff,0x44,0x5c,0x13,0x15,0x11,0xbf,0x3d,0xfc,0xd3,0x18,0x01,0x30,0x88,0x30, |
| 1393 | 0x04,0x17,0x49,0x53,0x44,0x09,0x93,0xff,0x4b,0x00,0xf3,0x2c,0x44,0xf4,0x4f,0x63, |
| 1394 | 0x04,0xc0,0x20,0x42,0x21,0x94,0x42,0x84,0x40,0x0c,0x9d,0x61,0x04,0x01,0x98,0x23, |
| 1395 | 0x08,0xe6,0x08,0xc0,0x60,0x18,0x41,0x58,0x0a,0x12,0x88,0x49,0x8a,0x29,0x40,0x6d, |
| 1396 | 0x20,0x20,0x05,0xd6,0x08,0x00,0x00,0x00,0x00,0x13,0xb2,0x70,0x48,0x07,0x79,0xb0, |
| 1397 | 0x03,0x3a,0x68,0x83,0x70,0x80,0x07,0x78,0x60,0x87,0x72,0x68,0x83,0x76,0x08,0x87, |
| 1398 | 0x71,0x78,0x87,0x79,0xc0,0x87,0x38,0x80,0x03,0x37,0x88,0x83,0x38,0x70,0x03,0x38, |
| 1399 | 0xd8,0x70,0x1b,0xe5,0xd0,0x06,0xf0,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74, |
| 1400 | 0xa0,0x07,0x76,0x40,0x07,0x6d,0x90,0x0e,0x71,0xa0,0x07,0x78,0xa0,0x07,0x78,0xd0, |
| 1401 | 0x06,0xe9,0x80,0x07,0x7a,0x80,0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,0x71,0x60,0x07, |
| 1402 | 0x7a,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x6d,0x90,0x0e,0x73,0x20,0x07,0x7a, |
| 1403 | 0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x90,0x0e,0x76,0x40,0x07,0x7a,0x60, |
| 1404 | 0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0e,0x73,0x20,0x07,0x7a,0x30,0x07, |
| 1405 | 0x72,0xa0,0x07,0x73,0x20,0x07,0x6d,0x60,0x0e,0x76,0x40,0x07,0x7a,0x60,0x07,0x74, |
| 1406 | 0xa0,0x07,0x76,0x40,0x07,0x6d,0x60,0x0f,0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xa0, |
| 1407 | 0x07,0x71,0x60,0x07,0x6d,0x60,0x0f,0x72,0x40,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07, |
| 1408 | 0x73,0x20,0x07,0x6d,0x60,0x0f,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xa0,0x07,0x73, |
| 1409 | 0x20,0x07,0x6d,0x60,0x0f,0x74,0x80,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40, |
| 1410 | 0x07,0x6d,0x60,0x0f,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07, |
| 1411 | 0x6d,0x60,0x0f,0x79,0x60,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72, |
| 1412 | 0x80,0x07,0x6d,0x60,0x0f,0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xa0, |
| 1413 | 0x07,0x71,0x20,0x07,0x78,0xd0,0x06,0xf6,0x10,0x07,0x79,0x20,0x07,0x7a,0x20,0x07, |
| 1414 | 0x75,0x60,0x07,0x7a,0x20,0x07,0x75,0x60,0x07,0x6d,0x60,0x0f,0x72,0x50,0x07,0x76, |
| 1415 | 0xa0,0x07,0x72,0x50,0x07,0x76,0xa0,0x07,0x72,0x50,0x07,0x76,0xd0,0x06,0xf6,0x50, |
| 1416 | 0x07,0x71,0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07,0x7a,0x50,0x07,0x71,0x20,0x07, |
| 1417 | 0x6d,0x60,0x0f,0x71,0x00,0x07,0x72,0x40,0x07,0x7a,0x10,0x07,0x70,0x20,0x07,0x74, |
| 1418 | 0xa0,0x07,0x71,0x00,0x07,0x72,0x40,0x07,0x6d,0xe0,0x0e,0x78,0xa0,0x07,0x71,0x60, |
| 1419 | 0x07,0x7a,0x30,0x07,0x72,0x30,0x84,0x41,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00, |
| 1420 | 0x18,0xc2,0x38,0x40,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x64,0x81,0x00,0x00,0x00, |
| 1421 | 0x00,0x08,0x00,0x00,0x00,0x32,0x1e,0x98,0x10,0x19,0x11,0x4c,0x90,0x8c,0x09,0x26, |
| 1422 | 0x47,0xc6,0x04,0x43,0x5a,0x25,0x30,0x02,0x50,0x04,0x85,0x50,0x10,0x65,0x40,0x70, |
| 1423 | 0x2c,0xa1,0x09,0x00,0x00,0x79,0x18,0x00,0x00,0xb7,0x00,0x00,0x00,0x1a,0x03,0x4c, |
| 1424 | 0x10,0x97,0x29,0xa2,0x25,0x10,0xab,0x32,0xb9,0xb9,0xb4,0x37,0xb7,0x21,0xc6,0x42, |
| 1425 | 0x3c,0x00,0x84,0x50,0xb9,0x1b,0x43,0x0b,0x93,0xfb,0x9a,0x4b,0xd3,0x2b,0x1b,0x62, |
| 1426 | 0x2c,0xc2,0x23,0x2c,0x05,0xe7,0x20,0x08,0x0e,0x8e,0xad,0x0c,0xa4,0xad,0x8c,0x2e, |
| 1427 | 0x8c,0x0d,0xc4,0xae,0x4c,0x6e,0x2e,0xed,0xcd,0x0d,0x64,0x26,0x06,0x06,0x26,0xc6, |
| 1428 | 0xc5,0xc6,0xe6,0x06,0x04,0xa5,0xad,0x8c,0x2e,0x8c,0xcd,0xac,0xac,0x65,0x26,0x06, |
| 1429 | 0x06,0x26,0xc6,0xc5,0xc6,0xe6,0xc6,0x45,0x26,0x65,0x88,0xf0,0x10,0x43,0x8c,0x45, |
| 1430 | 0x58,0x8c,0x65,0x60,0xd1,0x54,0x46,0x17,0xc6,0x36,0x04,0x79,0x8e,0x45,0x58,0x84, |
| 1431 | 0x65,0xe0,0x16,0x96,0x26,0xe7,0x32,0xf6,0xd6,0x06,0x97,0xc6,0x56,0xe6,0x42,0x56, |
| 1432 | 0xe6,0xf6,0x26,0xd7,0x36,0xf7,0x45,0x96,0x36,0x17,0x26,0xc6,0x56,0x36,0x44,0x78, |
| 1433 | 0x12,0x72,0x61,0x69,0x72,0x2e,0x63,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x2e,0x66,0x61, |
| 1434 | 0x73,0x74,0x5f,0x6d,0x61,0x74,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x43,0x84, |
| 1435 | 0x67,0x61,0x19,0x84,0xa5,0xc9,0xb9,0x8c,0xbd,0xb5,0xc1,0xa5,0xb1,0x95,0xb9,0x98, |
| 1436 | 0xc9,0x85,0xb5,0x95,0x89,0xd5,0x99,0x99,0x95,0xc9,0x7d,0x99,0x95,0xd1,0x8d,0xa1, |
| 1437 | 0x7d,0x91,0xa5,0xcd,0x85,0x89,0xb1,0x95,0x0d,0x11,0x9e,0x86,0x51,0x58,0x9a,0x9c, |
| 1438 | 0x8b,0x5c,0x99,0x1b,0x59,0x99,0xdc,0x17,0x5d,0x98,0xdc,0x59,0x19,0x1d,0xa3,0xb0, |
| 1439 | 0x34,0x39,0x97,0x30,0xb9,0xb3,0x2f,0xba,0x3c,0xb8,0xb2,0x2f,0xb7,0xb0,0xb6,0x32, |
| 1440 | 0x1a,0x66,0x6c,0x6f,0x61,0x74,0x34,0x64,0xc2,0xd2,0xe4,0x5c,0xc2,0xe4,0xce,0xbe, |
| 1441 | 0xdc,0xc2,0xda,0xca,0xa8,0x98,0xc9,0x85,0x9d,0x7d,0x8d,0xbd,0xb1,0xbd,0xc9,0x0d, |
| 1442 | 0x61,0x9e,0x67,0x19,0x1e,0xe8,0x89,0x1e,0xe9,0x99,0x86,0x08,0x0f,0x45,0x29,0x2c, |
| 1443 | 0x4d,0xce,0xc5,0x4c,0x2e,0xec,0xac,0xad,0xcc,0x8d,0xee,0x2b,0xcd,0x0d,0xae,0x8e, |
| 1444 | 0x8e,0x4b,0xdd,0x5c,0x99,0x1c,0x0a,0xdb,0xdb,0x98,0x1b,0x4c,0x0a,0x95,0xb0,0x34, |
| 1445 | 0x39,0x97,0xb1,0x32,0x37,0xba,0x32,0x39,0x3e,0x61,0x69,0x72,0x2e,0x70,0x65,0x72, |
| 1446 | 0x73,0x70,0x65,0x63,0x74,0x69,0x76,0x65,0x14,0xea,0xec,0x86,0x48,0xcb,0xf0,0x58, |
| 1447 | 0xcf,0xf5,0x60,0x4f,0xf6,0x40,0x4f,0xf4,0x48,0x8f,0xc6,0xa5,0x6e,0xae,0x4c,0x0e, |
| 1448 | 0x85,0xed,0x6d,0xcc,0x2d,0x26,0x85,0xc5,0xd8,0x1b,0xdb,0x9b,0xdc,0x10,0x69,0x11, |
| 1449 | 0x1e,0xeb,0xe1,0x1e,0xec,0xc9,0x1e,0xe8,0x89,0x1e,0xe9,0xe9,0xb8,0x84,0xa5,0xc9, |
| 1450 | 0xb9,0xd0,0x95,0xe1,0xd1,0xd5,0xc9,0x95,0x51,0x0a,0x4b,0x93,0x73,0x61,0x7b,0x1b, |
| 1451 | 0x0b,0xa3,0x4b,0x7b,0x73,0xfb,0x4a,0x73,0x23,0x2b,0xc3,0xa3,0x12,0x96,0x26,0xe7, |
| 1452 | 0x32,0x17,0xd6,0x06,0xc7,0x56,0x46,0x8c,0xae,0x0c,0x8f,0xae,0x4e,0xae,0x4c,0x86, |
| 1453 | 0x8c,0xc7,0x8c,0xed,0x2d,0x8c,0x8e,0x05,0x64,0x2e,0xac,0x0d,0x8e,0xad,0xcc,0x87, |
| 1454 | 0x03,0x5d,0x19,0xde,0x10,0x6a,0x21,0x9e,0xef,0x01,0x83,0x65,0x58,0x84,0x27,0x0c, |
| 1455 | 0x1e,0xe8,0x11,0x83,0x47,0x7a,0xc6,0x80,0x4b,0x58,0x9a,0x9c,0xcb,0x5c,0x58,0x1b, |
| 1456 | 0x1c,0x5b,0x99,0x1c,0x8f,0xb9,0xb0,0x36,0x38,0xb6,0x32,0x39,0x0e,0x73,0x6d,0x70, |
| 1457 | 0x43,0xa4,0xe5,0x78,0xca,0xe0,0x01,0x83,0x65,0x58,0x84,0x07,0x7a,0xcc,0xe0,0x91, |
| 1458 | 0x9e,0x33,0x18,0x82,0x3c,0xdb,0xe3,0x3d,0x64,0xf0,0xa0,0xc1,0x10,0x03,0x01,0x9e, |
| 1459 | 0xea,0x49,0x83,0x11,0x11,0x3b,0xb0,0x83,0x3d,0xb4,0x83,0x1b,0xb4,0xc3,0x3b,0x90, |
| 1460 | 0x43,0x3d,0xb0,0x43,0x39,0xb8,0x81,0x39,0xb0,0x43,0x38,0x9c,0xc3,0x3c,0x4c,0x11, |
| 1461 | 0x82,0x61,0x84,0xc2,0x0e,0xec,0x60,0x0f,0xed,0xe0,0x06,0xe9,0x40,0x0e,0xe5,0xe0, |
| 1462 | 0x0e,0xf4,0x30,0x25,0x28,0x46,0x2c,0xe1,0x90,0x0e,0xf2,0xe0,0x06,0xf6,0x50,0x0e, |
| 1463 | 0xf2,0x30,0x0f,0xe9,0xf0,0x0e,0xee,0x30,0x25,0x30,0x46,0x50,0xe1,0x90,0x0e,0xf2, |
| 1464 | 0xe0,0x06,0xec,0x10,0x0e,0xee,0x70,0x0e,0xf5,0x10,0x0e,0xe7,0x50,0x0e,0xbf,0x60, |
| 1465 | 0x0f,0xe5,0x20,0x0f,0xf3,0x90,0x0e,0xef,0xe0,0x0e,0x53,0x02,0x64,0xc4,0x14,0x0e, |
| 1466 | 0xe9,0x20,0x0f,0x6e,0x30,0x0e,0xef,0xd0,0x0e,0xf0,0x90,0x0e,0xec,0x50,0x0e,0xbf, |
| 1467 | 0xf0,0x0e,0xf0,0x40,0x0f,0xe9,0xf0,0x0e,0xee,0x30,0x0f,0x53,0x06,0x85,0x71,0x46, |
| 1468 | 0x30,0xe1,0x90,0x0e,0xf2,0xe0,0x06,0xe6,0x20,0x0f,0xe1,0x70,0x0e,0xed,0x50,0x0e, |
| 1469 | 0xee,0x40,0x0f,0x53,0x02,0x35,0x00,0x00,0x00,0x79,0x18,0x00,0x00,0x7b,0x00,0x00, |
| 1470 | 0x00,0x33,0x08,0x80,0x1c,0xc4,0xe1,0x1c,0x66,0x14,0x01,0x3d,0x88,0x43,0x38,0x84, |
| 1471 | 0xc3,0x8c,0x42,0x80,0x07,0x79,0x78,0x07,0x73,0x98,0x71,0x0c,0xe6,0x00,0x0f,0xed, |
| 1472 | 0x10,0x0e,0xf4,0x80,0x0e,0x33,0x0c,0x42,0x1e,0xc2,0xc1,0x1d,0xce,0xa1,0x1c,0x66, |
| 1473 | 0x30,0x05,0x3d,0x88,0x43,0x38,0x84,0x83,0x1b,0xcc,0x03,0x3d,0xc8,0x43,0x3d,0x8c, |
| 1474 | 0x03,0x3d,0xcc,0x78,0x8c,0x74,0x70,0x07,0x7b,0x08,0x07,0x79,0x48,0x87,0x70,0x70, |
| 1475 | 0x07,0x7a,0x70,0x03,0x76,0x78,0x87,0x70,0x20,0x87,0x19,0xcc,0x11,0x0e,0xec,0x90, |
| 1476 | 0x0e,0xe1,0x30,0x0f,0x6e,0x30,0x0f,0xe3,0xf0,0x0e,0xf0,0x50,0x0e,0x33,0x10,0xc4, |
| 1477 | 0x1d,0xde,0x21,0x1c,0xd8,0x21,0x1d,0xc2,0x61,0x1e,0x66,0x30,0x89,0x3b,0xbc,0x83, |
| 1478 | 0x3b,0xd0,0x43,0x39,0xb4,0x03,0x3c,0xbc,0x83,0x3c,0x84,0x03,0x3b,0xcc,0xf0,0x14, |
| 1479 | 0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x68,0x87,0x72,0x68,0x07,0x37,0x80,0x87,0x70, |
| 1480 | 0x90,0x87,0x70,0x60,0x07,0x76,0x28,0x07,0x76,0xf8,0x05,0x76,0x78,0x87,0x77,0x80, |
| 1481 | 0x87,0x5f,0x08,0x87,0x71,0x18,0x87,0x72,0x98,0x87,0x79,0x98,0x81,0x2c,0xee,0xf0, |
| 1482 | 0x0e,0xee,0xe0,0x0e,0xf5,0xc0,0x0e,0xec,0x30,0x03,0x62,0xc8,0xa1,0x1c,0xe4,0xa1, |
| 1483 | 0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x1c,0xdc,0x61,0x1c,0xca,0x21,0x1c,0xc4,0x81,0x1d, |
| 1484 | 0xca,0x61,0x06,0xd6,0x90,0x43,0x39,0xc8,0x43,0x39,0x98,0x43,0x39,0xc8,0x43,0x39, |
| 1485 | 0xb8,0xc3,0x38,0x94,0x43,0x38,0x88,0x03,0x3b,0x94,0xc3,0x2f,0xbc,0x83,0x3c,0xfc, |
| 1486 | 0x82,0x3b,0xd4,0x03,0x3b,0xb0,0xc3,0x0c,0xc7,0x69,0x87,0x70,0x58,0x87,0x72,0x70, |
| 1487 | 0x83,0x74,0x68,0x07,0x78,0x60,0x87,0x74,0x18,0x87,0x74,0xa0,0x87,0x19,0xce,0x53, |
| 1488 | 0x0f,0xee,0x00,0x0f,0xf2,0x50,0x0e,0xe4,0x90,0x0e,0xe3,0x40,0x0f,0xe1,0x20,0x0e, |
| 1489 | 0xec,0x50,0x0e,0x33,0x20,0x28,0x1d,0xdc,0xc1,0x1e,0xc2,0x41,0x1e,0xd2,0x21,0x1c, |
| 1490 | 0xdc,0x81,0x1e,0xdc,0xe0,0x1c,0xe4,0xe1,0x1d,0xea,0x01,0x1e,0x66,0x18,0x51,0x38, |
| 1491 | 0xb0,0x43,0x3a,0x9c,0x83,0x3b,0xcc,0x50,0x24,0x76,0x60,0x07,0x7b,0x68,0x07,0x37, |
| 1492 | 0x60,0x87,0x77,0x78,0x07,0x78,0x98,0x51,0x4c,0xf4,0x90,0x0f,0xf0,0x50,0x0e,0x33, |
| 1493 | 0x1e,0x6a,0x1e,0xca,0x61,0x1c,0xe8,0x21,0x1d,0xde,0xc1,0x1d,0x7e,0x01,0x1e,0xe4, |
| 1494 | 0xa1,0x1c,0xcc,0x21,0x1d,0xf0,0x61,0x06,0x54,0x85,0x83,0x38,0xcc,0xc3,0x3b,0xb0, |
| 1495 | 0x43,0x3d,0xd0,0x43,0x39,0xfc,0xc2,0x3c,0xe4,0x43,0x3b,0x88,0xc3,0x3b,0xb0,0xc3, |
| 1496 | 0x8c,0xc5,0x0a,0x87,0x79,0x98,0x87,0x77,0x18,0x87,0x74,0x08,0x07,0x7a,0x28,0x07, |
| 1497 | 0x72,0x98,0x81,0x5c,0xe3,0x10,0x0e,0xec,0xc0,0x0e,0xe5,0x50,0x0e,0xf3,0x30,0x23, |
| 1498 | 0xc1,0xd2,0x41,0x1e,0xe4,0xe1,0x17,0xd8,0xe1,0x1d,0xde,0x01,0x1e,0x66,0x50,0x59, |
| 1499 | 0x38,0xa4,0x83,0x3c,0xb8,0x81,0x39,0xd4,0x83,0x3b,0x8c,0x03,0x3d,0xa4,0xc3,0x3b, |
| 1500 | 0xb8,0xc3,0x2f,0x9c,0x83,0x3c,0xbc,0x43,0x3d,0xc0,0xc3,0x3c,0x00,0x71,0x20,0x00, |
| 1501 | 0x00,0x08,0x00,0x00,0x00,0x16,0xb0,0x01,0x48,0xe4,0x4b,0x00,0xf3,0x2c,0xc4,0x3f, |
| 1502 | 0x11,0xd7,0x44,0x45,0xc4,0x6f,0x0f,0x7e,0x85,0x17,0xb7,0x6d,0x00,0x05,0x03,0x20, |
| 1503 | 0x0d,0x0d,0x00,0x00,0x00,0x61,0x20,0x00,0x00,0x0f,0x00,0x00,0x00,0x13,0x04,0x41, |
| 1504 | 0x2c,0x10,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0xc4,0x46,0x00,0xc6,0x12,0x80,0x80, |
| 1505 | 0xd4,0x08,0x40,0x0d,0x90,0x98,0x01,0xa0,0x30,0x03,0x40,0x60,0x04,0x00,0x00,0x00, |
| 1506 | 0x00,0x83,0x0c,0x8b,0x60,0x8c,0x18,0x28,0x42,0x40,0x29,0x49,0x50,0x20,0x86,0x60, |
| 1507 | 0x01,0x23,0x9f,0xd9,0x06,0x23,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1508 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1509 | }; |
| 1510 | static const uint8_t _sgl_vs_bytecode_metal_ios[3317] = { |
| 1511 | 0x4d,0x54,0x4c,0x42,0x01,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1512 | 0xf5,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1513 | 0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc9,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1514 | 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x01,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1515 | 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x01,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1516 | 0xe0,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x6d,0x00,0x00,0x00, |
| 1517 | 0x4e,0x41,0x4d,0x45,0x06,0x00,0x6d,0x61,0x69,0x6e,0x30,0x00,0x54,0x59,0x50,0x45, |
| 1518 | 0x01,0x00,0x00,0x48,0x41,0x53,0x48,0x20,0x00,0x17,0x11,0x57,0x16,0x94,0x42,0x52, |
| 1519 | 0xfb,0x1e,0xd0,0x32,0xfd,0x87,0x16,0xb0,0xa4,0xd0,0xc2,0x43,0xbe,0x93,0x8c,0xe0, |
| 1520 | 0x2d,0x7a,0x5c,0x3e,0x06,0x4c,0x57,0xeb,0x4b,0x4f,0x46,0x46,0x54,0x18,0x00,0x00, |
| 1521 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1522 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0x45,0x52,0x53,0x08,0x00,0x01,0x00,0x08, |
| 1523 | 0x00,0x01,0x00,0x01,0x00,0x45,0x4e,0x44,0x54,0x40,0x00,0x00,0x00,0x56,0x41,0x54, |
| 1524 | 0x54,0x2a,0x00,0x04,0x00,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x00,0x80, |
| 1525 | 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x00,0x01,0x80,0x63,0x6f,0x6c,0x6f, |
| 1526 | 0x72,0x30,0x00,0x02,0x80,0x70,0x73,0x69,0x7a,0x65,0x00,0x03,0x80,0x56,0x41,0x54, |
| 1527 | 0x59,0x06,0x00,0x04,0x00,0x06,0x04,0x06,0x03,0x45,0x4e,0x44,0x54,0x04,0x00,0x00, |
| 1528 | 0x00,0x45,0x4e,0x44,0x54,0xde,0xc0,0x17,0x0b,0x00,0x00,0x00,0x00,0x14,0x00,0x00, |
| 1529 | 0x00,0xc0,0x0b,0x00,0x00,0xff,0xff,0xff,0xff,0x42,0x43,0xc0,0xde,0x21,0x0c,0x00, |
| 1530 | 0x00,0xed,0x02,0x00,0x00,0x0b,0x82,0x20,0x00,0x02,0x00,0x00,0x00,0x12,0x00,0x00, |
| 1531 | 0x00,0x07,0x81,0x23,0x91,0x41,0xc8,0x04,0x49,0x06,0x10,0x32,0x39,0x92,0x01,0x84, |
| 1532 | 0x0c,0x25,0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,0x80,0x14,0x45,0x02,0x42,0x92,0x0b, |
| 1533 | 0x42,0xa4,0x10,0x32,0x14,0x38,0x08,0x18,0x49,0x0a,0x32,0x44,0x24,0x48,0x0a,0x90, |
| 1534 | 0x21,0x23,0xc4,0x52,0x80,0x0c,0x19,0x21,0x72,0x24,0x07,0xc8,0x48,0x11,0x62,0xa8, |
| 1535 | 0xa0,0xa8,0x40,0xc6,0xf0,0x01,0x00,0x00,0x00,0x51,0x18,0x00,0x00,0x82,0x00,0x00, |
| 1536 | 0x00,0x1b,0xc8,0x25,0xf8,0xff,0xff,0xff,0xff,0x01,0x90,0x80,0x8a,0x18,0x87,0x77, |
| 1537 | 0x90,0x07,0x79,0x28,0x87,0x71,0xa0,0x07,0x76,0xc8,0x87,0x36,0x90,0x87,0x77,0xa8, |
| 1538 | 0x07,0x77,0x20,0x87,0x72,0x20,0x87,0x36,0x20,0x87,0x74,0xb0,0x87,0x74,0x20,0x87, |
| 1539 | 0x72,0x68,0x83,0x79,0x88,0x07,0x79,0xa0,0x87,0x36,0x30,0x07,0x78,0x68,0x83,0x76, |
| 1540 | 0x08,0x07,0x7a,0x40,0x07,0xc0,0x1c,0xc2,0x81,0x1d,0xe6,0xa1,0x1c,0x00,0x82,0x1c, |
| 1541 | 0xd2,0x61,0x1e,0xc2,0x41,0x1c,0xd8,0xa1,0x1c,0xda,0x80,0x1e,0xc2,0x21,0x1d,0xd8, |
| 1542 | 0xa1,0x0d,0xc6,0x21,0x1c,0xd8,0x81,0x1d,0xe6,0x01,0x30,0x87,0x70,0x60,0x87,0x79, |
| 1543 | 0x28,0x07,0x80,0x60,0x87,0x72,0x98,0x87,0x79,0x68,0x03,0x78,0x90,0x87,0x72,0x18, |
| 1544 | 0x87,0x74,0x98,0x87,0x72,0x68,0x03,0x73,0x80,0x87,0x76,0x08,0x07,0x72,0x00,0xcc, |
| 1545 | 0x21,0x1c,0xd8,0x61,0x1e,0xca,0x01,0x20,0xdc,0xe1,0x1d,0xda,0xc0,0x1c,0xe4,0x21, |
| 1546 | 0x1c,0xda,0xa1,0x1c,0xda,0x00,0x1e,0xde,0x21,0x1d,0xdc,0x81,0x1e,0xca,0x41,0x1e, |
| 1547 | 0xda,0xa0,0x1c,0xd8,0x21,0x1d,0xda,0x01,0xa0,0x07,0x79,0xa8,0x87,0x72,0x00,0x06, |
| 1548 | 0x77,0x78,0x87,0x36,0x30,0x07,0x79,0x08,0x87,0x76,0x28,0x87,0x36,0x80,0x87,0x77, |
| 1549 | 0x48,0x07,0x77,0xa0,0x87,0x72,0x90,0x87,0x36,0x28,0x07,0x76,0x48,0x87,0x76,0x68, |
| 1550 | 0x03,0x77,0x78,0x07,0x77,0x68,0x03,0x76,0x28,0x87,0x70,0x30,0x07,0x80,0x70,0x87, |
| 1551 | 0x77,0x68,0x83,0x74,0x70,0x07,0x73,0x98,0x87,0x36,0x30,0x07,0x78,0x68,0x83,0x76, |
| 1552 | 0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,0xdc,0xe1,0x1d, |
| 1553 | 0xda,0x40,0x1d,0xea,0xa1,0x1d,0xe0,0xa1,0x0d,0xe8,0x21,0x1c,0xc4,0x81,0x1d,0xca, |
| 1554 | 0x61,0x1e,0x00,0x73,0x08,0x07,0x76,0x98,0x87,0x72,0x00,0x08,0x77,0x78,0x87,0x36, |
| 1555 | 0x70,0x87,0x70,0x70,0x87,0x79,0x68,0x03,0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0, |
| 1556 | 0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1,0x1c,0x00,0xc2,0x1d,0xde,0xa1,0x0d,0xe6, |
| 1557 | 0x21,0x1d,0xce,0xc1,0x1d,0xca,0x81,0x1c,0xda,0x40,0x1f,0xca,0x41,0x1e,0xde,0x61, |
| 1558 | 0x1e,0xda,0xc0,0x1c,0xe0,0xa1,0x0d,0xda,0x21,0x1c,0xe8,0x01,0x1d,0x00,0x7a,0x90, |
| 1559 | 0x87,0x7a,0x28,0x07,0x80,0x70,0x87,0x77,0x68,0x03,0x7a,0x90,0x87,0x70,0x80,0x07, |
| 1560 | 0x78,0x48,0x07,0x77,0x38,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41, |
| 1561 | 0x1e,0xea,0xa1,0x1c,0x00,0x62,0x1e,0xe8,0x21,0x1c,0xc6,0x61,0x1d,0xda,0x00,0x1e, |
| 1562 | 0xe4,0xe1,0x1d,0xe8,0xa1,0x1c,0xc6,0x81,0x1e,0xde,0x41,0x1e,0xda,0x40,0x1c,0xea, |
| 1563 | 0xc1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x0d,0xe6,0x21,0x1d,0xf4,0xa1,0x1c,0x00,0x3c, |
| 1564 | 0x00,0x88,0x7a,0x70,0x87,0x79,0x08,0x07,0x73,0x28,0x87,0x36,0x30,0x07,0x78,0x68, |
| 1565 | 0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,0xea, |
| 1566 | 0x61,0x1e,0xca,0xa1,0x0d,0xe6,0xe1,0x1d,0xcc,0x81,0x1e,0xda,0xc0,0x1c,0xd8,0xe1, |
| 1567 | 0x1d,0xc2,0x81,0x1e,0x00,0x73,0x08,0x07,0x76,0x98,0x87,0x72,0x00,0x36,0x20,0x42, |
| 1568 | 0x01,0x24,0xc0,0x02,0x54,0x00,0x00,0x00,0x00,0x49,0x18,0x00,0x00,0x01,0x00,0x00, |
| 1569 | 0x00,0x13,0x84,0x40,0x00,0x89,0x20,0x00,0x00,0x20,0x00,0x00,0x00,0x32,0x22,0x48, |
| 1570 | 0x09,0x20,0x64,0x85,0x04,0x93,0x22,0xa4,0x84,0x04,0x93,0x22,0xe3,0x84,0xa1,0x90, |
| 1571 | 0x14,0x12,0x4c,0x8a,0x8c,0x0b,0x84,0xa4,0x4c,0x10,0x44,0x33,0x00,0xc3,0x08,0x04, |
| 1572 | 0x60,0x89,0x10,0x02,0x18,0x46,0x10,0x80,0x24,0x08,0x33,0x51,0xf3,0x40,0x0f,0xf2, |
| 1573 | 0x50,0x0f,0xe3,0x40,0x0f,0x6e,0xd0,0x0e,0xe5,0x40,0x0f,0xe1,0xc0,0x0e,0x7a,0xa0, |
| 1574 | 0x07,0xed,0x10,0x0e,0xf4,0x20,0x0f,0xe9,0x80,0x0f,0x28,0x20,0x07,0x49,0x53,0x44, |
| 1575 | 0x09,0x93,0x5f,0x49,0xff,0x03,0x44,0x00,0x23,0x21,0xa1,0x94,0x41,0x04,0x43,0x28, |
| 1576 | 0x86,0x08,0x23,0x80,0x43,0x68,0x20,0x60,0x8e,0x00,0x0c,0x52,0x60,0xcd,0x11,0x80, |
| 1577 | 0xc2,0x20,0x42,0x20,0x0c,0x23,0x10,0xcb,0x08,0x00,0x00,0x00,0x00,0x13,0xa8,0x70, |
| 1578 | 0x48,0x07,0x79,0xb0,0x03,0x3a,0x68,0x83,0x70,0x80,0x07,0x78,0x60,0x87,0x72,0x68, |
| 1579 | 0x83,0x74,0x78,0x87,0x79,0xc8,0x03,0x37,0x80,0x03,0x37,0x80,0x83,0x0d,0xb7,0x51, |
| 1580 | 0x0e,0x6d,0x00,0x0f,0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07, |
| 1581 | 0x74,0xd0,0x06,0xe9,0x10,0x07,0x7a,0x80,0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,0x78, |
| 1582 | 0xa0,0x07,0x78,0xa0,0x07,0x78,0xd0,0x06,0xe9,0x10,0x07,0x76,0xa0,0x07,0x71,0x60, |
| 1583 | 0x07,0x7a,0x10,0x07,0x76,0xd0,0x06,0xe9,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07, |
| 1584 | 0x7a,0x30,0x07,0x72,0xd0,0x06,0xe9,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a, |
| 1585 | 0x60,0x07,0x74,0xd0,0x06,0xe6,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30, |
| 1586 | 0x07,0x72,0xd0,0x06,0xe6,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07, |
| 1587 | 0x74,0xd0,0x06,0xf6,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x7a,0x10,0x07,0x76, |
| 1588 | 0xd0,0x06,0xf6,0x20,0x07,0x74,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xd0, |
| 1589 | 0x06,0xf6,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xd0,0x06, |
| 1590 | 0xf6,0x40,0x07,0x78,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xf6, |
| 1591 | 0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xf6,0x90, |
| 1592 | 0x07,0x76,0xa0,0x07,0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xd0,0x06, |
| 1593 | 0xf6,0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72, |
| 1594 | 0x80,0x07,0x6d,0x60,0x0f,0x71,0x90,0x07,0x72,0xa0,0x07,0x72,0x50,0x07,0x76,0xa0, |
| 1595 | 0x07,0x72,0x50,0x07,0x76,0xd0,0x06,0xf6,0x20,0x07,0x75,0x60,0x07,0x7a,0x20,0x07, |
| 1596 | 0x75,0x60,0x07,0x7a,0x20,0x07,0x75,0x60,0x07,0x6d,0x60,0x0f,0x75,0x10,0x07,0x72, |
| 1597 | 0xa0,0x07,0x75,0x10,0x07,0x72,0xa0,0x07,0x75,0x10,0x07,0x72,0xd0,0x06,0xf6,0x10, |
| 1598 | 0x07,0x70,0x20,0x07,0x74,0xa0,0x07,0x71,0x00,0x07,0x72,0x40,0x07,0x7a,0x10,0x07, |
| 1599 | 0x70,0x20,0x07,0x74,0xd0,0x06,0xee,0x80,0x07,0x7a,0x10,0x07,0x76,0xa0,0x07,0x73, |
| 1600 | 0x20,0x07,0x43,0x98,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x80,0x2c,0x10,0x00, |
| 1601 | 0x00,0x0b,0x00,0x00,0x00,0x32,0x1e,0x98,0x10,0x19,0x11,0x4c,0x90,0x8c,0x09,0x26, |
| 1602 | 0x47,0xc6,0x04,0x43,0x5a,0x25,0x30,0x02,0x50,0x04,0x05,0x18,0x50,0x08,0x65,0x50, |
| 1603 | 0x80,0x02,0x05,0x51,0x20,0xd4,0x46,0x00,0x88,0x8d,0x25,0x40,0x02,0x00,0x00,0x00, |
| 1604 | 0x00,0x79,0x18,0x00,0x00,0x02,0x01,0x00,0x00,0x1a,0x03,0x4c,0x10,0x97,0x29,0xa2, |
| 1605 | 0x25,0x10,0xab,0x32,0xb9,0xb9,0xb4,0x37,0xb7,0x21,0xc6,0x32,0x28,0x00,0xb3,0x50, |
| 1606 | 0xb9,0x1b,0x43,0x0b,0x93,0xfb,0x9a,0x4b,0xd3,0x2b,0x1b,0x62,0x2c,0x81,0x22,0x2c, |
| 1607 | 0x05,0xe7,0x20,0x08,0x0e,0x8e,0xad,0x0c,0xa4,0xad,0x8c,0x2e,0x8c,0x0d,0xc4,0xae, |
| 1608 | 0x4c,0x6e,0x2e,0xed,0xcd,0x0d,0x64,0x26,0x06,0x06,0x26,0xc6,0xc5,0xc6,0xe6,0x06, |
| 1609 | 0x04,0xa5,0xad,0x8c,0x2e,0x8c,0xcd,0xac,0xac,0x65,0x26,0x06,0x06,0x26,0xc6,0xc5, |
| 1610 | 0xc6,0xe6,0xc6,0x45,0x26,0x65,0x88,0xa0,0x10,0x43,0x8c,0x25,0x58,0x90,0x45,0x60, |
| 1611 | 0xd1,0x54,0x46,0x17,0xc6,0x36,0x04,0x51,0x8e,0x25,0x58,0x82,0x45,0xe0,0x16,0x96, |
| 1612 | 0x26,0xe7,0x32,0xf6,0xd6,0x06,0x97,0xc6,0x56,0xe6,0x42,0x56,0xe6,0xf6,0x26,0xd7, |
| 1613 | 0x36,0xf7,0x45,0x96,0x36,0x17,0x26,0xc6,0x56,0x36,0x44,0x50,0x12,0x72,0x61,0x69, |
| 1614 | 0x72,0x2e,0x63,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x2e,0x66,0x61,0x73,0x74,0x5f,0x6d, |
| 1615 | 0x61,0x74,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x43,0x04,0x65,0x21,0x19,0x84, |
| 1616 | 0xa5,0xc9,0xb9,0x8c,0xbd,0xb5,0xc1,0xa5,0xb1,0x95,0xb9,0x98,0xc9,0x85,0xb5,0x95, |
| 1617 | 0x89,0xd5,0x99,0x99,0x95,0xc9,0x7d,0x99,0x95,0xd1,0x8d,0xa1,0x7d,0x95,0xb9,0x85, |
| 1618 | 0x89,0xb1,0x95,0x0d,0x11,0x94,0x86,0x51,0x58,0x9a,0x9c,0x8b,0x5d,0x99,0x1c,0x5d, |
| 1619 | 0x19,0xde,0xd7,0x5b,0x1d,0x1d,0x5c,0x1d,0x1d,0x97,0xba,0xb9,0x32,0x39,0x14,0xb6, |
| 1620 | 0xb7,0x31,0x37,0x98,0x14,0x46,0x61,0x69,0x72,0x2e,0x61,0x72,0x67,0x5f,0x74,0x79, |
| 1621 | 0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0x34,0xcc,0xd8,0xde,0xc2,0xe8,0x68,0xc8,0x84, |
| 1622 | 0xa5,0xc9,0xb9,0x84,0xc9,0x9d,0x7d,0xb9,0x85,0xb5,0x95,0x51,0xa8,0xb3,0x1b,0xc2, |
| 1623 | 0x28,0x8f,0x02,0x29,0x91,0x22,0x29,0x93,0x42,0x71,0xa9,0x9b,0x2b,0x93,0x43,0x61, |
| 1624 | 0x7b,0x1b,0x73,0x8b,0x49,0x61,0x31,0xf6,0xc6,0xf6,0x26,0x37,0x84,0x51,0x1e,0xc5, |
| 1625 | 0x52,0x22,0x45,0x52,0x26,0xe5,0x22,0x13,0x96,0x26,0xe7,0x02,0xf7,0x36,0x97,0x46, |
| 1626 | 0x97,0xf6,0xe6,0xc6,0xe5,0x8c,0xed,0x0b,0xea,0x6d,0x2e,0x8d,0x2e,0xed,0xcd,0x6d, |
| 1627 | 0x88,0xa2,0x64,0x4a,0xa4,0x48,0xca,0xa4,0x68,0x74,0xc2,0xd2,0xe4,0x5c,0xe0,0xde, |
| 1628 | 0xd2,0xdc,0xe8,0xbe,0xe6,0xd2,0xf4,0xca,0x58,0x98,0xb1,0xbd,0x85,0xd1,0x91,0x39, |
| 1629 | 0x63,0xfb,0x82,0x7a,0x4b,0x73,0xa3,0x9b,0x4a,0xd3,0x2b,0x1b,0xa2,0x28,0x9c,0x12, |
| 1630 | 0x29,0x9d,0x32,0x29,0xde,0x10,0x44,0xa9,0x14,0x4c,0xd9,0x94,0x8f,0x50,0x58,0x9a, |
| 1631 | 0x9c,0x8b,0x5d,0x99,0x1c,0x5d,0x19,0xde,0x57,0x9a,0x1b,0x5c,0x1d,0x1d,0xa5,0xb0, |
| 1632 | 0x34,0x39,0x17,0xb6,0xb7,0xb1,0x30,0xba,0xb4,0x37,0xb7,0xaf,0x34,0x37,0xb2,0x32, |
| 1633 | 0x3c,0x7a,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x64,0x28,0x5f,0x5f,0x61,0x69, |
| 1634 | 0x72,0x5f,0x70,0x6c,0x61,0x63,0x65,0x68,0x6f,0x6c,0x64,0x65,0x72,0x5f,0x5f,0x29, |
| 1635 | 0x44,0xe0,0xde,0xe6,0xd2,0xe8,0xd2,0xde,0xdc,0x86,0x50,0x8b,0xa0,0x84,0x81,0x22, |
| 1636 | 0x06,0x8b,0xb0,0x04,0xca,0x18,0x28,0x91,0x22,0x29,0x93,0x42,0x06,0x34,0xcc,0xd8, |
| 1637 | 0xde,0xc2,0xe8,0x64,0x98,0xd0,0x95,0xe1,0x8d,0xbd,0xbd,0xc9,0x91,0xc1,0x0c,0xa1, |
| 1638 | 0x96,0x40,0x09,0x03,0x45,0x0c,0x96,0x60,0x09,0x94,0x31,0x50,0x22,0xc5,0x0c,0x94, |
| 1639 | 0x49,0x39,0x03,0x1a,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x43,0xa8,0x65,0x50,0xc2,0x40, |
| 1640 | 0x11,0x83,0x65,0x58,0x02,0x65,0x0c,0x94,0x48,0x91,0x94,0x49,0x49,0x03,0x16,0x70, |
| 1641 | 0x73,0x69,0x7a,0x65,0x43,0xa8,0xc5,0x50,0xc2,0x40,0x11,0x83,0xc5,0x58,0x02,0x65, |
| 1642 | 0x0c,0x94,0x48,0xe9,0x94,0x49,0x59,0x03,0x2a,0x61,0x69,0x72,0x2e,0x62,0x75,0x66, |
| 1643 | 0x66,0x65,0x72,0x7c,0xc2,0xd2,0xe4,0x5c,0xc4,0xea,0xcc,0xcc,0xca,0xe4,0xbe,0xe6, |
| 1644 | 0xd2,0xf4,0xca,0x88,0x84,0xa5,0xc9,0xb9,0xc8,0x95,0x85,0x91,0x91,0x0a,0x4b,0x93, |
| 1645 | 0x73,0x99,0xa3,0x93,0xab,0x1b,0xa3,0xfb,0xa2,0xcb,0x83,0x2b,0xfb,0x4a,0x73,0x33, |
| 1646 | 0x7b,0x23,0x62,0xc6,0xf6,0x16,0x46,0x47,0x83,0x47,0xc3,0xa1,0xcd,0x0e,0x8e,0x02, |
| 1647 | 0x5d,0xdb,0x10,0x6a,0x11,0x16,0x62,0x11,0x94,0x38,0x50,0xe4,0x60,0x21,0x16,0x62, |
| 1648 | 0x11,0x94,0x38,0x50,0xe6,0x80,0x51,0x58,0x9a,0x9c,0x4b,0x98,0xdc,0xd9,0x17,0x5d, |
| 1649 | 0x1e,0x5c,0xd9,0xd7,0x5c,0x9a,0x5e,0x19,0xaf,0xb0,0x34,0x39,0x97,0x30,0xb9,0xb3, |
| 1650 | 0x2f,0xba,0x3c,0xb8,0xb2,0xaf,0x30,0xb6,0xb4,0x33,0xb7,0xaf,0xb9,0x34,0xbd,0x32, |
| 1651 | 0x26,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x1c,0xbe,0x62,0x72,0x86,0x90, |
| 1652 | 0xc1,0x52,0x28,0x6d,0xa0,0xb8,0xc1,0x72,0x28,0x62,0xb0,0x08,0x4b,0xa0,0xbc,0x81, |
| 1653 | 0x02,0x07,0x0a,0x1d,0x28,0x75,0xb0,0x1c,0x8a,0x1d,0x2c,0x89,0x12,0x29,0x77,0xa0, |
| 1654 | 0x4c,0x0a,0x1e,0x0c,0x51,0x94,0x32,0x50,0xd0,0x40,0x51,0x03,0x85,0x0d,0x94,0x3c, |
| 1655 | 0x18,0x62,0x24,0x80,0x02,0x06,0x8a,0x1e,0xf0,0x79,0x6b,0x73,0x4b,0x83,0x7b,0xa3, |
| 1656 | 0x2b,0x73,0xa3,0x03,0x19,0x43,0x0b,0x93,0xe3,0x33,0x95,0xd6,0x06,0xc7,0x56,0x06, |
| 1657 | 0x32,0xb4,0xb2,0x02,0x42,0x25,0x14,0x14,0x34,0x44,0x50,0xfa,0x60,0x88,0xa1,0xf0, |
| 1658 | 0x81,0xe2,0x07,0x8d,0x32,0xc4,0x50,0xfe,0x40,0xf9,0x83,0x46,0x19,0x11,0xb1,0x03, |
| 1659 | 0x3b,0xd8,0x43,0x3b,0xb8,0x41,0x3b,0xbc,0x03,0x39,0xd4,0x03,0x3b,0x94,0x83,0x1b, |
| 1660 | 0x98,0x03,0x3b,0x84,0xc3,0x39,0xcc,0xc3,0x14,0x21,0x18,0x46,0x28,0xec,0xc0,0x0e, |
| 1661 | 0xf6,0xd0,0x0e,0x6e,0x90,0x0e,0xe4,0x50,0x0e,0xee,0x40,0x0f,0x53,0x82,0x62,0xc4, |
| 1662 | 0x12,0x0e,0xe9,0x20,0x0f,0x6e,0x60,0x0f,0xe5,0x20,0x0f,0xf3,0x90,0x0e,0xef,0xe0, |
| 1663 | 0x0e,0x53,0x02,0x63,0x04,0x15,0x0e,0xe9,0x20,0x0f,0x6e,0xc0,0x0e,0xe1,0xe0,0x0e, |
| 1664 | 0xe7,0x50,0x0f,0xe1,0x70,0x0e,0xe5,0xf0,0x0b,0xf6,0x50,0x0e,0xf2,0x30,0x0f,0xe9, |
| 1665 | 0xf0,0x0e,0xee,0x30,0x25,0x40,0x46,0x4c,0xe1,0x90,0x0e,0xf2,0xe0,0x06,0xe3,0xf0, |
| 1666 | 0x0e,0xed,0x00,0x0f,0xe9,0xc0,0x0e,0xe5,0xf0,0x0b,0xef,0x00,0x0f,0xf4,0x90,0x0e, |
| 1667 | 0xef,0xe0,0x0e,0xf3,0x30,0x65,0x50,0x18,0x67,0x84,0x12,0x0e,0xe9,0x20,0x0f,0x6e, |
| 1668 | 0x60,0x0f,0xe5,0x20,0x0f,0xf4,0x50,0x0e,0xf8,0x30,0x25,0xd8,0x03,0x00,0x00,0x00, |
| 1669 | 0x00,0x79,0x18,0x00,0x00,0x7b,0x00,0x00,0x00,0x33,0x08,0x80,0x1c,0xc4,0xe1,0x1c, |
| 1670 | 0x66,0x14,0x01,0x3d,0x88,0x43,0x38,0x84,0xc3,0x8c,0x42,0x80,0x07,0x79,0x78,0x07, |
| 1671 | 0x73,0x98,0x71,0x0c,0xe6,0x00,0x0f,0xed,0x10,0x0e,0xf4,0x80,0x0e,0x33,0x0c,0x42, |
| 1672 | 0x1e,0xc2,0xc1,0x1d,0xce,0xa1,0x1c,0x66,0x30,0x05,0x3d,0x88,0x43,0x38,0x84,0x83, |
| 1673 | 0x1b,0xcc,0x03,0x3d,0xc8,0x43,0x3d,0x8c,0x03,0x3d,0xcc,0x78,0x8c,0x74,0x70,0x07, |
| 1674 | 0x7b,0x08,0x07,0x79,0x48,0x87,0x70,0x70,0x07,0x7a,0x70,0x03,0x76,0x78,0x87,0x70, |
| 1675 | 0x20,0x87,0x19,0xcc,0x11,0x0e,0xec,0x90,0x0e,0xe1,0x30,0x0f,0x6e,0x30,0x0f,0xe3, |
| 1676 | 0xf0,0x0e,0xf0,0x50,0x0e,0x33,0x10,0xc4,0x1d,0xde,0x21,0x1c,0xd8,0x21,0x1d,0xc2, |
| 1677 | 0x61,0x1e,0x66,0x30,0x89,0x3b,0xbc,0x83,0x3b,0xd0,0x43,0x39,0xb4,0x03,0x3c,0xbc, |
| 1678 | 0x83,0x3c,0x84,0x03,0x3b,0xcc,0xf0,0x14,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x68, |
| 1679 | 0x87,0x72,0x68,0x07,0x37,0x80,0x87,0x70,0x90,0x87,0x70,0x60,0x07,0x76,0x28,0x07, |
| 1680 | 0x76,0xf8,0x05,0x76,0x78,0x87,0x77,0x80,0x87,0x5f,0x08,0x87,0x71,0x18,0x87,0x72, |
| 1681 | 0x98,0x87,0x79,0x98,0x81,0x2c,0xee,0xf0,0x0e,0xee,0xe0,0x0e,0xf5,0xc0,0x0e,0xec, |
| 1682 | 0x30,0x03,0x62,0xc8,0xa1,0x1c,0xe4,0xa1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x1c,0xdc, |
| 1683 | 0x61,0x1c,0xca,0x21,0x1c,0xc4,0x81,0x1d,0xca,0x61,0x06,0xd6,0x90,0x43,0x39,0xc8, |
| 1684 | 0x43,0x39,0x98,0x43,0x39,0xc8,0x43,0x39,0xb8,0xc3,0x38,0x94,0x43,0x38,0x88,0x03, |
| 1685 | 0x3b,0x94,0xc3,0x2f,0xbc,0x83,0x3c,0xfc,0x82,0x3b,0xd4,0x03,0x3b,0xb0,0xc3,0x0c, |
| 1686 | 0xc7,0x69,0x87,0x70,0x58,0x87,0x72,0x70,0x83,0x74,0x68,0x07,0x78,0x60,0x87,0x74, |
| 1687 | 0x18,0x87,0x74,0xa0,0x87,0x19,0xce,0x53,0x0f,0xee,0x00,0x0f,0xf2,0x50,0x0e,0xe4, |
| 1688 | 0x90,0x0e,0xe3,0x40,0x0f,0xe1,0x20,0x0e,0xec,0x50,0x0e,0x33,0x20,0x28,0x1d,0xdc, |
| 1689 | 0xc1,0x1e,0xc2,0x41,0x1e,0xd2,0x21,0x1c,0xdc,0x81,0x1e,0xdc,0xe0,0x1c,0xe4,0xe1, |
| 1690 | 0x1d,0xea,0x01,0x1e,0x66,0x18,0x51,0x38,0xb0,0x43,0x3a,0x9c,0x83,0x3b,0xcc,0x50, |
| 1691 | 0x24,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x60,0x87,0x77,0x78,0x07,0x78,0x98,0x51, |
| 1692 | 0x4c,0xf4,0x90,0x0f,0xf0,0x50,0x0e,0x33,0x1e,0x6a,0x1e,0xca,0x61,0x1c,0xe8,0x21, |
| 1693 | 0x1d,0xde,0xc1,0x1d,0x7e,0x01,0x1e,0xe4,0xa1,0x1c,0xcc,0x21,0x1d,0xf0,0x61,0x06, |
| 1694 | 0x54,0x85,0x83,0x38,0xcc,0xc3,0x3b,0xb0,0x43,0x3d,0xd0,0x43,0x39,0xfc,0xc2,0x3c, |
| 1695 | 0xe4,0x43,0x3b,0x88,0xc3,0x3b,0xb0,0xc3,0x8c,0xc5,0x0a,0x87,0x79,0x98,0x87,0x77, |
| 1696 | 0x18,0x87,0x74,0x08,0x07,0x7a,0x28,0x07,0x72,0x98,0x81,0x5c,0xe3,0x10,0x0e,0xec, |
| 1697 | 0xc0,0x0e,0xe5,0x50,0x0e,0xf3,0x30,0x23,0xc1,0xd2,0x41,0x1e,0xe4,0xe1,0x17,0xd8, |
| 1698 | 0xe1,0x1d,0xde,0x01,0x1e,0x66,0x50,0x59,0x38,0xa4,0x83,0x3c,0xb8,0x81,0x39,0xd4, |
| 1699 | 0x83,0x3b,0x8c,0x03,0x3d,0xa4,0xc3,0x3b,0xb8,0xc3,0x2f,0x9c,0x83,0x3c,0xbc,0x43, |
| 1700 | 0x3d,0xc0,0xc3,0x3c,0x00,0x71,0x20,0x00,0x00,0x02,0x00,0x00,0x00,0x06,0x50,0x30, |
| 1701 | 0x00,0xd2,0xd0,0x00,0x00,0x61,0x20,0x00,0x00,0x3e,0x00,0x00,0x00,0x13,0x04,0x41, |
| 1702 | 0x2c,0x10,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0xf4,0xc6,0x22,0x86,0x61,0x18,0xc6, |
| 1703 | 0x22,0x04,0x41,0x10,0xc6,0x22,0x82,0x20,0x08,0xa8,0x95,0x40,0x19,0x14,0x01,0xbd, |
| 1704 | 0x11,0x00,0x1a,0x33,0x00,0x24,0x66,0x00,0x28,0xcc,0x00,0x00,0x00,0xe3,0x15,0x4b, |
| 1705 | 0x94,0x65,0x11,0x05,0x65,0x90,0x21,0x1a,0x0c,0x13,0x02,0xf9,0x8c,0x57,0x3c,0x55, |
| 1706 | 0xd7,0x2d,0x14,0x94,0x41,0x86,0xea,0x70,0x4c,0x08,0xe4,0x63,0x41,0x01,0x9f,0xf1, |
| 1707 | 0x0a,0x4a,0x13,0x03,0x31,0x70,0x28,0x28,0x83,0x0c,0x1a,0x43,0x99,0x10,0xc8,0xc7, |
| 1708 | 0x8a,0x00,0x3e,0xe3,0x15,0xd9,0x77,0x06,0x67,0x40,0x51,0x50,0x06,0x19,0xbe,0x48, |
| 1709 | 0x33,0x21,0x90,0x8f,0x15,0x01,0x7c,0xc6,0x2b,0x3c,0x32,0x68,0x03,0x36,0x20,0x03, |
| 1710 | 0x0a,0xca,0x20,0xc3,0x18,0x60,0x99,0x09,0x81,0x7c,0xc6,0x2b,0xc4,0x00,0x0d,0xe2, |
| 1711 | 0x00,0x0e,0x3c,0x0a,0xca,0x20,0xc3,0x19,0x70,0x61,0x60,0x42,0x20,0x1f,0x0b,0x0a, |
| 1712 | 0xf8,0x8c,0x57,0x9c,0x41,0x1b,0xd8,0x41,0x1d,0x88,0x01,0x05,0xc5,0x86,0x00,0x3e, |
| 1713 | 0xb3,0x0d,0x61,0x10,0x00,0xb3,0x0d,0x41,0x1b,0x04,0xb3,0x0d,0xc1,0x23,0xcc,0x36, |
| 1714 | 0x04,0x6e,0x30,0x64,0x10,0x10,0x03,0x00,0x00,0x09,0x00,0x00,0x00,0x5b,0x86,0x20, |
| 1715 | 0x00,0x85,0x2d,0x43,0x11,0x80,0xc2,0x96,0x41,0x09,0x40,0x61,0xcb,0xf0,0x04,0xa0, |
| 1716 | 0xb0,0x65,0xa0,0x02,0x50,0xd8,0x32,0x60,0x01,0x28,0x6c,0x19,0xba,0x00,0x14,0x00, |
| 1717 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1718 | 0x00,0x00,0x00,0x00,0x00, |
| 1719 | }; |
| 1720 | static const uint8_t _sgl_fs_bytecode_metal_ios[2809] = { |
| 1721 | 0x4d,0x54,0x4c,0x42,0x01,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1722 | 0xf9,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1723 | 0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc9,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1724 | 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd1,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1725 | 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd9,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1726 | 0x20,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x6d,0x00,0x00,0x00, |
| 1727 | 0x4e,0x41,0x4d,0x45,0x06,0x00,0x6d,0x61,0x69,0x6e,0x30,0x00,0x54,0x59,0x50,0x45, |
| 1728 | 0x01,0x00,0x01,0x48,0x41,0x53,0x48,0x20,0x00,0xc1,0x98,0x28,0x2b,0x2b,0x1f,0x36, |
| 1729 | 0x7c,0x5c,0xb0,0x69,0x3f,0xc3,0xd1,0x80,0x4b,0xcf,0xa1,0x10,0xfc,0x19,0x31,0x58, |
| 1730 | 0xad,0x45,0xd3,0x5a,0x81,0x72,0x0d,0x8f,0x85,0x4f,0x46,0x46,0x54,0x18,0x00,0x00, |
| 1731 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1732 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0x45,0x52,0x53,0x08,0x00,0x01,0x00,0x08, |
| 1733 | 0x00,0x01,0x00,0x01,0x00,0x45,0x4e,0x44,0x54,0x04,0x00,0x00,0x00,0x45,0x4e,0x44, |
| 1734 | 0x54,0x04,0x00,0x00,0x00,0x45,0x4e,0x44,0x54,0xde,0xc0,0x17,0x0b,0x00,0x00,0x00, |
| 1735 | 0x00,0x14,0x00,0x00,0x00,0x08,0x0a,0x00,0x00,0xff,0xff,0xff,0xff,0x42,0x43,0xc0, |
| 1736 | 0xde,0x21,0x0c,0x00,0x00,0x7f,0x02,0x00,0x00,0x0b,0x82,0x20,0x00,0x02,0x00,0x00, |
| 1737 | 0x00,0x12,0x00,0x00,0x00,0x07,0x81,0x23,0x91,0x41,0xc8,0x04,0x49,0x06,0x10,0x32, |
| 1738 | 0x39,0x92,0x01,0x84,0x0c,0x25,0x05,0x08,0x19,0x1e,0x04,0x8b,0x62,0x80,0x14,0x45, |
| 1739 | 0x02,0x42,0x92,0x0b,0x42,0xa4,0x10,0x32,0x14,0x38,0x08,0x18,0x49,0x0a,0x32,0x44, |
| 1740 | 0x24,0x48,0x0a,0x90,0x21,0x23,0xc4,0x52,0x80,0x0c,0x19,0x21,0x72,0x24,0x07,0xc8, |
| 1741 | 0x48,0x11,0x62,0xa8,0xa0,0xa8,0x40,0xc6,0xf0,0x01,0x00,0x00,0x00,0x51,0x18,0x00, |
| 1742 | 0x00,0x89,0x00,0x00,0x00,0x1b,0xcc,0x25,0xf8,0xff,0xff,0xff,0xff,0x01,0x60,0x00, |
| 1743 | 0x09,0xa8,0x88,0x71,0x78,0x07,0x79,0x90,0x87,0x72,0x18,0x07,0x7a,0x60,0x87,0x7c, |
| 1744 | 0x68,0x03,0x79,0x78,0x87,0x7a,0x70,0x07,0x72,0x28,0x07,0x72,0x68,0x03,0x72,0x48, |
| 1745 | 0x07,0x7b,0x48,0x07,0x72,0x28,0x87,0x36,0x98,0x87,0x78,0x90,0x07,0x7a,0x68,0x03, |
| 1746 | 0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xcc,0x21,0x1c,0xd8,0x61, |
| 1747 | 0x1e,0xca,0x01,0x20,0xc8,0x21,0x1d,0xe6,0x21,0x1c,0xc4,0x81,0x1d,0xca,0xa1,0x0d, |
| 1748 | 0xe8,0x21,0x1c,0xd2,0x81,0x1d,0xda,0x60,0x1c,0xc2,0x81,0x1d,0xd8,0x61,0x1e,0x00, |
| 1749 | 0x73,0x08,0x07,0x76,0x98,0x87,0x72,0x00,0x08,0x76,0x28,0x87,0x79,0x98,0x87,0x36, |
| 1750 | 0x80,0x07,0x79,0x28,0x87,0x71,0x48,0x87,0x79,0x28,0x87,0x36,0x30,0x07,0x78,0x68, |
| 1751 | 0x87,0x70,0x20,0x07,0xc0,0x1c,0xc2,0x81,0x1d,0xe6,0xa1,0x1c,0x00,0xc2,0x1d,0xde, |
| 1752 | 0xa1,0x0d,0xcc,0x41,0x1e,0xc2,0xa1,0x1d,0xca,0xa1,0x0d,0xe0,0xe1,0x1d,0xd2,0xc1, |
| 1753 | 0x1d,0xe8,0xa1,0x1c,0xe4,0xa1,0x0d,0xca,0x81,0x1d,0xd2,0xa1,0x1d,0x00,0x7a,0x90, |
| 1754 | 0x87,0x7a,0x28,0x07,0x60,0x70,0x87,0x77,0x68,0x03,0x73,0x90,0x87,0x70,0x68,0x87, |
| 1755 | 0x72,0x68,0x03,0x78,0x78,0x87,0x74,0x70,0x07,0x7a,0x28,0x07,0x79,0x68,0x83,0x72, |
| 1756 | 0x60,0x87,0x74,0x68,0x87,0x36,0x70,0x87,0x77,0x70,0x87,0x36,0x60,0x87,0x72,0x08, |
| 1757 | 0x07,0x73,0x00,0x08,0x77,0x78,0x87,0x36,0x48,0x07,0x77,0x30,0x87,0x79,0x68,0x03, |
| 1758 | 0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e,0xea,0xa1, |
| 1759 | 0x1c,0x00,0xc2,0x1d,0xde,0xa1,0x0d,0xd4,0xa1,0x1e,0xda,0x01,0x1e,0xda,0x80,0x1e, |
| 1760 | 0xc2,0x41,0x1c,0xd8,0xa1,0x1c,0xe6,0x01,0x30,0x87,0x70,0x60,0x87,0x79,0x28,0x07, |
| 1761 | 0x80,0x70,0x87,0x77,0x68,0x03,0x77,0x08,0x07,0x77,0x98,0x87,0x36,0x30,0x07,0x78, |
| 1762 | 0x68,0x83,0x76,0x08,0x07,0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20, |
| 1763 | 0xdc,0xe1,0x1d,0xda,0x60,0x1e,0xd2,0xe1,0x1c,0xdc,0xa1,0x1c,0xc8,0xa1,0x0d,0xf4, |
| 1764 | 0xa1,0x1c,0xe4,0xe1,0x1d,0xe6,0xa1,0x0d,0xcc,0x01,0x1e,0xda,0xa0,0x1d,0xc2,0x81, |
| 1765 | 0x1e,0xd0,0x01,0xa0,0x07,0x79,0xa8,0x87,0x72,0x00,0x08,0x77,0x78,0x87,0x36,0xa0, |
| 1766 | 0x07,0x79,0x08,0x07,0x78,0x80,0x87,0x74,0x70,0x87,0x73,0x68,0x83,0x76,0x08,0x07, |
| 1767 | 0x7a,0x40,0x07,0x80,0x1e,0xe4,0xa1,0x1e,0xca,0x01,0x20,0xe6,0x81,0x1e,0xc2,0x61, |
| 1768 | 0x1c,0xd6,0xa1,0x0d,0xe0,0x41,0x1e,0xde,0x81,0x1e,0xca,0x61,0x1c,0xe8,0xe1,0x1d, |
| 1769 | 0xe4,0xa1,0x0d,0xc4,0xa1,0x1e,0xcc,0xc1,0x1c,0xca,0x41,0x1e,0xda,0x60,0x1e,0xd2, |
| 1770 | 0x41,0x1f,0xca,0x01,0xc0,0x03,0x80,0xa8,0x07,0x77,0x98,0x87,0x70,0x30,0x87,0x72, |
| 1771 | 0x68,0x03,0x73,0x80,0x87,0x36,0x68,0x87,0x70,0xa0,0x07,0x74,0x00,0xe8,0x41,0x1e, |
| 1772 | 0xea,0xa1,0x1c,0x00,0xa2,0x1e,0xe6,0xa1,0x1c,0xda,0x60,0x1e,0xde,0xc1,0x1c,0xe8, |
| 1773 | 0xa1,0x0d,0xcc,0x81,0x1d,0xde,0x21,0x1c,0xe8,0x01,0x30,0x87,0x70,0x60,0x87,0x79, |
| 1774 | 0x28,0x07,0x60,0x83,0x21,0x0c,0xc0,0x02,0x54,0x1b,0x8c,0x81,0x00,0x16,0xa0,0xda, |
| 1775 | 0x80,0x10,0xff,0xff,0xff,0xff,0x3f,0x00,0x0c,0x20,0x01,0xd5,0x06,0xa3,0x08,0x80, |
| 1776 | 0x05,0xa8,0x36,0x18,0x86,0x00,0x2c,0x40,0x05,0x49,0x18,0x00,0x00,0x03,0x00,0x00, |
| 1777 | 0x00,0x13,0x86,0x40,0x18,0x26,0x0c,0x44,0x61,0x00,0x00,0x00,0x00,0x89,0x20,0x00, |
| 1778 | 0x00,0x1d,0x00,0x00,0x00,0x32,0x22,0x48,0x09,0x20,0x64,0x85,0x04,0x93,0x22,0xa4, |
| 1779 | 0x84,0x04,0x93,0x22,0xe3,0x84,0xa1,0x90,0x14,0x12,0x4c,0x8a,0x8c,0x0b,0x84,0xa4, |
| 1780 | 0x4c,0x10,0x48,0x33,0x00,0xc3,0x08,0x04,0x60,0x83,0x70,0x94,0x34,0x45,0x94,0x30, |
| 1781 | 0xf9,0xff,0x44,0x5c,0x13,0x15,0x11,0xbf,0x3d,0xfc,0xd3,0x18,0x01,0x30,0x88,0x30, |
| 1782 | 0x04,0x17,0x49,0x53,0x44,0x09,0x93,0xff,0x4b,0x00,0xf3,0x2c,0x44,0xf4,0x4f,0x63, |
| 1783 | 0x04,0xc0,0x20,0x42,0x21,0x94,0x42,0x84,0x40,0x0c,0x9d,0x61,0x04,0x01,0x98,0x23, |
| 1784 | 0x08,0xe6,0x08,0xc0,0x60,0x18,0x41,0x58,0x0a,0x12,0x88,0x49,0x8a,0x29,0x40,0x6d, |
| 1785 | 0x20,0x20,0x05,0xd6,0x08,0x00,0x00,0x00,0x00,0x13,0xa8,0x70,0x48,0x07,0x79,0xb0, |
| 1786 | 0x03,0x3a,0x68,0x83,0x70,0x80,0x07,0x78,0x60,0x87,0x72,0x68,0x83,0x74,0x78,0x87, |
| 1787 | 0x79,0xc8,0x03,0x37,0x80,0x03,0x37,0x80,0x83,0x0d,0xb7,0x51,0x0e,0x6d,0x00,0x0f, |
| 1788 | 0x7a,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xe9, |
| 1789 | 0x10,0x07,0x7a,0x80,0x07,0x7a,0x80,0x07,0x6d,0x90,0x0e,0x78,0xa0,0x07,0x78,0xa0, |
| 1790 | 0x07,0x78,0xd0,0x06,0xe9,0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x7a,0x10,0x07, |
| 1791 | 0x76,0xd0,0x06,0xe9,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72, |
| 1792 | 0xd0,0x06,0xe9,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0, |
| 1793 | 0x06,0xe6,0x30,0x07,0x72,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xd0,0x06, |
| 1794 | 0xe6,0x60,0x07,0x74,0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xf6, |
| 1795 | 0x10,0x07,0x76,0xa0,0x07,0x71,0x60,0x07,0x7a,0x10,0x07,0x76,0xd0,0x06,0xf6,0x20, |
| 1796 | 0x07,0x74,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xd0,0x06,0xf6,0x30,0x07, |
| 1797 | 0x72,0xa0,0x07,0x73,0x20,0x07,0x7a,0x30,0x07,0x72,0xd0,0x06,0xf6,0x40,0x07,0x78, |
| 1798 | 0xa0,0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xf6,0x60,0x07,0x74,0xa0, |
| 1799 | 0x07,0x76,0x40,0x07,0x7a,0x60,0x07,0x74,0xd0,0x06,0xf6,0x90,0x07,0x76,0xa0,0x07, |
| 1800 | 0x71,0x20,0x07,0x78,0xa0,0x07,0x71,0x20,0x07,0x78,0xd0,0x06,0xf6,0x10,0x07,0x72, |
| 1801 | 0x80,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x7a,0x10,0x07,0x72,0x80,0x07,0x6d,0x60, |
| 1802 | 0x0f,0x71,0x90,0x07,0x72,0xa0,0x07,0x72,0x50,0x07,0x76,0xa0,0x07,0x72,0x50,0x07, |
| 1803 | 0x76,0xd0,0x06,0xf6,0x20,0x07,0x75,0x60,0x07,0x7a,0x20,0x07,0x75,0x60,0x07,0x7a, |
| 1804 | 0x20,0x07,0x75,0x60,0x07,0x6d,0x60,0x0f,0x75,0x10,0x07,0x72,0xa0,0x07,0x75,0x10, |
| 1805 | 0x07,0x72,0xa0,0x07,0x75,0x10,0x07,0x72,0xd0,0x06,0xf6,0x10,0x07,0x70,0x20,0x07, |
| 1806 | 0x74,0xa0,0x07,0x71,0x00,0x07,0x72,0x40,0x07,0x7a,0x10,0x07,0x70,0x20,0x07,0x74, |
| 1807 | 0xd0,0x06,0xee,0x80,0x07,0x7a,0x10,0x07,0x76,0xa0,0x07,0x73,0x20,0x07,0x43,0x18, |
| 1808 | 0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x80,0x21,0x8c,0x03,0x04,0x80,0x00,0x00, |
| 1809 | 0x00,0x00,0x00,0x40,0x16,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x32,0x1e,0x98, |
| 1810 | 0x10,0x19,0x11,0x4c,0x90,0x8c,0x09,0x26,0x47,0xc6,0x04,0x43,0x5a,0x25,0x30,0x02, |
| 1811 | 0x50,0x04,0x85,0x50,0x10,0x65,0x40,0x70,0x2c,0x01,0x12,0x00,0x00,0x79,0x18,0x00, |
| 1812 | 0x00,0xb7,0x00,0x00,0x00,0x1a,0x03,0x4c,0x10,0x97,0x29,0xa2,0x25,0x10,0xab,0x32, |
| 1813 | 0xb9,0xb9,0xb4,0x37,0xb7,0x21,0xc6,0x42,0x3c,0x00,0x84,0x50,0xb9,0x1b,0x43,0x0b, |
| 1814 | 0x93,0xfb,0x9a,0x4b,0xd3,0x2b,0x1b,0x62,0x2c,0xc2,0x23,0x2c,0x05,0xe7,0x20,0x08, |
| 1815 | 0x0e,0x8e,0xad,0x0c,0xa4,0xad,0x8c,0x2e,0x8c,0x0d,0xc4,0xae,0x4c,0x6e,0x2e,0xed, |
| 1816 | 0xcd,0x0d,0x64,0x26,0x06,0x06,0x26,0xc6,0xc5,0xc6,0xe6,0x06,0x04,0xa5,0xad,0x8c, |
| 1817 | 0x2e,0x8c,0xcd,0xac,0xac,0x65,0x26,0x06,0x06,0x26,0xc6,0xc5,0xc6,0xe6,0xc6,0x45, |
| 1818 | 0x26,0x65,0x88,0xf0,0x10,0x43,0x8c,0x45,0x58,0x8c,0x65,0x60,0xd1,0x54,0x46,0x17, |
| 1819 | 0xc6,0x36,0x04,0x79,0x8e,0x45,0x58,0x84,0x65,0xe0,0x16,0x96,0x26,0xe7,0x32,0xf6, |
| 1820 | 0xd6,0x06,0x97,0xc6,0x56,0xe6,0x42,0x56,0xe6,0xf6,0x26,0xd7,0x36,0xf7,0x45,0x96, |
| 1821 | 0x36,0x17,0x26,0xc6,0x56,0x36,0x44,0x78,0x12,0x72,0x61,0x69,0x72,0x2e,0x63,0x6f, |
| 1822 | 0x6d,0x70,0x69,0x6c,0x65,0x2e,0x66,0x61,0x73,0x74,0x5f,0x6d,0x61,0x74,0x68,0x5f, |
| 1823 | 0x65,0x6e,0x61,0x62,0x6c,0x65,0x43,0x84,0x67,0x21,0x19,0x84,0xa5,0xc9,0xb9,0x8c, |
| 1824 | 0xbd,0xb5,0xc1,0xa5,0xb1,0x95,0xb9,0x98,0xc9,0x85,0xb5,0x95,0x89,0xd5,0x99,0x99, |
| 1825 | 0x95,0xc9,0x7d,0x99,0x95,0xd1,0x8d,0xa1,0x7d,0x95,0xb9,0x85,0x89,0xb1,0x95,0x0d, |
| 1826 | 0x11,0x9e,0x86,0x51,0x58,0x9a,0x9c,0x8b,0x5c,0x99,0x1b,0x59,0x99,0xdc,0x17,0x5d, |
| 1827 | 0x98,0xdc,0x59,0x19,0x1d,0xa3,0xb0,0x34,0x39,0x97,0x30,0xb9,0xb3,0x2f,0xba,0x3c, |
| 1828 | 0xb8,0xb2,0x2f,0xb7,0xb0,0xb6,0x32,0x1a,0x66,0x6c,0x6f,0x61,0x74,0x34,0x64,0xc2, |
| 1829 | 0xd2,0xe4,0x5c,0xc2,0xe4,0xce,0xbe,0xdc,0xc2,0xda,0xca,0xa8,0x98,0xc9,0x85,0x9d, |
| 1830 | 0x7d,0x8d,0xbd,0xb1,0xbd,0xc9,0x0d,0x61,0x9e,0x67,0x19,0x1e,0xe8,0x89,0x1e,0xe9, |
| 1831 | 0x99,0x86,0x08,0x0f,0x45,0x29,0x2c,0x4d,0xce,0xc5,0x4c,0x2e,0xec,0xac,0xad,0xcc, |
| 1832 | 0x8d,0xee,0x2b,0xcd,0x0d,0xae,0x8e,0x8e,0x4b,0xdd,0x5c,0x99,0x1c,0x0a,0xdb,0xdb, |
| 1833 | 0x98,0x1b,0x4c,0x0a,0x95,0xb0,0x34,0x39,0x97,0xb1,0x32,0x37,0xba,0x32,0x39,0x3e, |
| 1834 | 0x61,0x69,0x72,0x2e,0x70,0x65,0x72,0x73,0x70,0x65,0x63,0x74,0x69,0x76,0x65,0x14, |
| 1835 | 0xea,0xec,0x86,0x48,0xcb,0xf0,0x58,0xcf,0xf5,0x60,0x4f,0xf6,0x40,0x4f,0xf4,0x48, |
| 1836 | 0x8f,0xc6,0xa5,0x6e,0xae,0x4c,0x0e,0x85,0xed,0x6d,0xcc,0x2d,0x26,0x85,0xc5,0xd8, |
| 1837 | 0x1b,0xdb,0x9b,0xdc,0x10,0x69,0x11,0x1e,0xeb,0xe1,0x1e,0xec,0xc9,0x1e,0xe8,0x89, |
| 1838 | 0x1e,0xe9,0xe9,0xb8,0x84,0xa5,0xc9,0xb9,0xd0,0x95,0xe1,0xd1,0xd5,0xc9,0x95,0x51, |
| 1839 | 0x0a,0x4b,0x93,0x73,0x61,0x7b,0x1b,0x0b,0xa3,0x4b,0x7b,0x73,0xfb,0x4a,0x73,0x23, |
| 1840 | 0x2b,0xc3,0xa3,0x12,0x96,0x26,0xe7,0x32,0x17,0xd6,0x06,0xc7,0x56,0x46,0x8c,0xae, |
| 1841 | 0x0c,0x8f,0xae,0x4e,0xae,0x4c,0x86,0x8c,0xc7,0x8c,0xed,0x2d,0x8c,0x8e,0x05,0x64, |
| 1842 | 0x2e,0xac,0x0d,0x8e,0xad,0xcc,0x87,0x03,0x5d,0x19,0xde,0x10,0x6a,0x21,0x9e,0xef, |
| 1843 | 0x01,0x83,0x65,0x58,0x84,0x27,0x0c,0x1e,0xe8,0x11,0x83,0x47,0x7a,0xc6,0x80,0x4b, |
| 1844 | 0x58,0x9a,0x9c,0xcb,0x5c,0x58,0x1b,0x1c,0x5b,0x99,0x1c,0x8f,0xb9,0xb0,0x36,0x38, |
| 1845 | 0xb6,0x32,0x39,0x0e,0x73,0x6d,0x70,0x43,0xa4,0xe5,0x78,0xca,0xe0,0x01,0x83,0x65, |
| 1846 | 0x58,0x84,0x07,0x7a,0xcc,0xe0,0x91,0x9e,0x33,0x18,0x82,0x3c,0xdb,0xe3,0x3d,0x64, |
| 1847 | 0xf0,0xa0,0xc1,0x10,0x03,0x01,0x9e,0xea,0x49,0x83,0x11,0x11,0x3b,0xb0,0x83,0x3d, |
| 1848 | 0xb4,0x83,0x1b,0xb4,0xc3,0x3b,0x90,0x43,0x3d,0xb0,0x43,0x39,0xb8,0x81,0x39,0xb0, |
| 1849 | 0x43,0x38,0x9c,0xc3,0x3c,0x4c,0x11,0x82,0x61,0x84,0xc2,0x0e,0xec,0x60,0x0f,0xed, |
| 1850 | 0xe0,0x06,0xe9,0x40,0x0e,0xe5,0xe0,0x0e,0xf4,0x30,0x25,0x28,0x46,0x2c,0xe1,0x90, |
| 1851 | 0x0e,0xf2,0xe0,0x06,0xf6,0x50,0x0e,0xf2,0x30,0x0f,0xe9,0xf0,0x0e,0xee,0x30,0x25, |
| 1852 | 0x30,0x46,0x50,0xe1,0x90,0x0e,0xf2,0xe0,0x06,0xec,0x10,0x0e,0xee,0x70,0x0e,0xf5, |
| 1853 | 0x10,0x0e,0xe7,0x50,0x0e,0xbf,0x60,0x0f,0xe5,0x20,0x0f,0xf3,0x90,0x0e,0xef,0xe0, |
| 1854 | 0x0e,0x53,0x02,0x64,0xc4,0x14,0x0e,0xe9,0x20,0x0f,0x6e,0x30,0x0e,0xef,0xd0,0x0e, |
| 1855 | 0xf0,0x90,0x0e,0xec,0x50,0x0e,0xbf,0xf0,0x0e,0xf0,0x40,0x0f,0xe9,0xf0,0x0e,0xee, |
| 1856 | 0x30,0x0f,0x53,0x06,0x85,0x71,0x46,0x30,0xe1,0x90,0x0e,0xf2,0xe0,0x06,0xe6,0x20, |
| 1857 | 0x0f,0xe1,0x70,0x0e,0xed,0x50,0x0e,0xee,0x40,0x0f,0x53,0x02,0x35,0x00,0x00,0x00, |
| 1858 | 0x00,0x79,0x18,0x00,0x00,0x7b,0x00,0x00,0x00,0x33,0x08,0x80,0x1c,0xc4,0xe1,0x1c, |
| 1859 | 0x66,0x14,0x01,0x3d,0x88,0x43,0x38,0x84,0xc3,0x8c,0x42,0x80,0x07,0x79,0x78,0x07, |
| 1860 | 0x73,0x98,0x71,0x0c,0xe6,0x00,0x0f,0xed,0x10,0x0e,0xf4,0x80,0x0e,0x33,0x0c,0x42, |
| 1861 | 0x1e,0xc2,0xc1,0x1d,0xce,0xa1,0x1c,0x66,0x30,0x05,0x3d,0x88,0x43,0x38,0x84,0x83, |
| 1862 | 0x1b,0xcc,0x03,0x3d,0xc8,0x43,0x3d,0x8c,0x03,0x3d,0xcc,0x78,0x8c,0x74,0x70,0x07, |
| 1863 | 0x7b,0x08,0x07,0x79,0x48,0x87,0x70,0x70,0x07,0x7a,0x70,0x03,0x76,0x78,0x87,0x70, |
| 1864 | 0x20,0x87,0x19,0xcc,0x11,0x0e,0xec,0x90,0x0e,0xe1,0x30,0x0f,0x6e,0x30,0x0f,0xe3, |
| 1865 | 0xf0,0x0e,0xf0,0x50,0x0e,0x33,0x10,0xc4,0x1d,0xde,0x21,0x1c,0xd8,0x21,0x1d,0xc2, |
| 1866 | 0x61,0x1e,0x66,0x30,0x89,0x3b,0xbc,0x83,0x3b,0xd0,0x43,0x39,0xb4,0x03,0x3c,0xbc, |
| 1867 | 0x83,0x3c,0x84,0x03,0x3b,0xcc,0xf0,0x14,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x68, |
| 1868 | 0x87,0x72,0x68,0x07,0x37,0x80,0x87,0x70,0x90,0x87,0x70,0x60,0x07,0x76,0x28,0x07, |
| 1869 | 0x76,0xf8,0x05,0x76,0x78,0x87,0x77,0x80,0x87,0x5f,0x08,0x87,0x71,0x18,0x87,0x72, |
| 1870 | 0x98,0x87,0x79,0x98,0x81,0x2c,0xee,0xf0,0x0e,0xee,0xe0,0x0e,0xf5,0xc0,0x0e,0xec, |
| 1871 | 0x30,0x03,0x62,0xc8,0xa1,0x1c,0xe4,0xa1,0x1c,0xcc,0xa1,0x1c,0xe4,0xa1,0x1c,0xdc, |
| 1872 | 0x61,0x1c,0xca,0x21,0x1c,0xc4,0x81,0x1d,0xca,0x61,0x06,0xd6,0x90,0x43,0x39,0xc8, |
| 1873 | 0x43,0x39,0x98,0x43,0x39,0xc8,0x43,0x39,0xb8,0xc3,0x38,0x94,0x43,0x38,0x88,0x03, |
| 1874 | 0x3b,0x94,0xc3,0x2f,0xbc,0x83,0x3c,0xfc,0x82,0x3b,0xd4,0x03,0x3b,0xb0,0xc3,0x0c, |
| 1875 | 0xc7,0x69,0x87,0x70,0x58,0x87,0x72,0x70,0x83,0x74,0x68,0x07,0x78,0x60,0x87,0x74, |
| 1876 | 0x18,0x87,0x74,0xa0,0x87,0x19,0xce,0x53,0x0f,0xee,0x00,0x0f,0xf2,0x50,0x0e,0xe4, |
| 1877 | 0x90,0x0e,0xe3,0x40,0x0f,0xe1,0x20,0x0e,0xec,0x50,0x0e,0x33,0x20,0x28,0x1d,0xdc, |
| 1878 | 0xc1,0x1e,0xc2,0x41,0x1e,0xd2,0x21,0x1c,0xdc,0x81,0x1e,0xdc,0xe0,0x1c,0xe4,0xe1, |
| 1879 | 0x1d,0xea,0x01,0x1e,0x66,0x18,0x51,0x38,0xb0,0x43,0x3a,0x9c,0x83,0x3b,0xcc,0x50, |
| 1880 | 0x24,0x76,0x60,0x07,0x7b,0x68,0x07,0x37,0x60,0x87,0x77,0x78,0x07,0x78,0x98,0x51, |
| 1881 | 0x4c,0xf4,0x90,0x0f,0xf0,0x50,0x0e,0x33,0x1e,0x6a,0x1e,0xca,0x61,0x1c,0xe8,0x21, |
| 1882 | 0x1d,0xde,0xc1,0x1d,0x7e,0x01,0x1e,0xe4,0xa1,0x1c,0xcc,0x21,0x1d,0xf0,0x61,0x06, |
| 1883 | 0x54,0x85,0x83,0x38,0xcc,0xc3,0x3b,0xb0,0x43,0x3d,0xd0,0x43,0x39,0xfc,0xc2,0x3c, |
| 1884 | 0xe4,0x43,0x3b,0x88,0xc3,0x3b,0xb0,0xc3,0x8c,0xc5,0x0a,0x87,0x79,0x98,0x87,0x77, |
| 1885 | 0x18,0x87,0x74,0x08,0x07,0x7a,0x28,0x07,0x72,0x98,0x81,0x5c,0xe3,0x10,0x0e,0xec, |
| 1886 | 0xc0,0x0e,0xe5,0x50,0x0e,0xf3,0x30,0x23,0xc1,0xd2,0x41,0x1e,0xe4,0xe1,0x17,0xd8, |
| 1887 | 0xe1,0x1d,0xde,0x01,0x1e,0x66,0x50,0x59,0x38,0xa4,0x83,0x3c,0xb8,0x81,0x39,0xd4, |
| 1888 | 0x83,0x3b,0x8c,0x03,0x3d,0xa4,0xc3,0x3b,0xb8,0xc3,0x2f,0x9c,0x83,0x3c,0xbc,0x43, |
| 1889 | 0x3d,0xc0,0xc3,0x3c,0x00,0x71,0x20,0x00,0x00,0x08,0x00,0x00,0x00,0x16,0xb0,0x01, |
| 1890 | 0x48,0xe4,0x4b,0x00,0xf3,0x2c,0xc4,0x3f,0x11,0xd7,0x44,0x45,0xc4,0x6f,0x0f,0x7e, |
| 1891 | 0x85,0x17,0xb7,0x6d,0x00,0x05,0x03,0x20,0x0d,0x0d,0x00,0x00,0x00,0x61,0x20,0x00, |
| 1892 | 0x00,0x0f,0x00,0x00,0x00,0x13,0x04,0x41,0x2c,0x10,0x00,0x00,0x00,0x06,0x00,0x00, |
| 1893 | 0x00,0xc4,0x46,0x00,0xc6,0x12,0x80,0x80,0xd4,0x08,0x40,0x0d,0x90,0x98,0x01,0xa0, |
| 1894 | 0x30,0x03,0x40,0x60,0x04,0x00,0x00,0x00,0x00,0x83,0x0c,0x8b,0x60,0x8c,0x18,0x28, |
| 1895 | 0x42,0x40,0x29,0x49,0x50,0x20,0x86,0x60,0x01,0x23,0x9f,0xd9,0x06,0x23,0x00,0x32, |
| 1896 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1897 | }; |
| 1898 | static const uint8_t _sgl_vs_source_metal_sim[756] = { |
| 1899 | 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, |
| 1900 | 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, |
| 1901 | 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, |
| 1902 | 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, |
| 1903 | 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76, |
| 1904 | 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, |
| 1905 | 0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x6d,0x76,0x70,0x3b,0x0a,0x20,0x20,0x20, |
| 1906 | 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x74,0x6d,0x3b,0x0a,0x7d,0x3b, |
| 1907 | 0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f, |
| 1908 | 0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, |
| 1909 | 0x75,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29, |
| 1910 | 0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63, |
| 1911 | 0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e, |
| 1912 | 0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, |
| 1913 | 0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70, |
| 1914 | 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, |
| 1915 | 0x6c,0x6f,0x61,0x74,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a, |
| 1916 | 0x65,0x20,0x5b,0x5b,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65,0x5d,0x5d, |
| 1917 | 0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69, |
| 1918 | 0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, |
| 1919 | 0x74,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74, |
| 1920 | 0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20, |
| 1921 | 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72, |
| 1922 | 0x64,0x30,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31, |
| 1923 | 0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, |
| 1924 | 0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75, |
| 1925 | 0x74,0x65,0x28,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, |
| 1926 | 0x61,0x74,0x20,0x70,0x73,0x69,0x7a,0x65,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69, |
| 1927 | 0x62,0x75,0x74,0x65,0x28,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76, |
| 1928 | 0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20, |
| 1929 | 0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69, |
| 1930 | 0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20, |
| 1931 | 0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61, |
| 1932 | 0x6d,0x73,0x26,0x20,0x5f,0x31,0x39,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72, |
| 1933 | 0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69, |
| 1934 | 0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b, |
| 1935 | 0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69, |
| 1936 | 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x6d,0x76,0x70,0x20,0x2a, |
| 1937 | 0x20,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20, |
| 1938 | 0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69, |
| 1939 | 0x7a,0x65,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20, |
| 1940 | 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x75,0x76,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e, |
| 1941 | 0x74,0x6d,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x74, |
| 1942 | 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31, |
| 1943 | 0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x63,0x6f,0x6c, |
| 1944 | 0x6f,0x72,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a, |
| 1945 | 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, |
| 1946 | 0x7d,0x0a,0x0a,0x00, |
| 1947 | }; |
| 1948 | static const uint8_t _sgl_fs_source_metal_sim[439] = { |
| 1949 | 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, |
| 1950 | 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, |
| 1951 | 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, |
| 1952 | 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, |
| 1953 | 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d, |
| 1954 | 0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, |
| 1955 | 0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, |
| 1956 | 0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d, |
| 1957 | 0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f, |
| 1958 | 0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, |
| 1959 | 0x75,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29, |
| 1960 | 0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63, |
| 1961 | 0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e, |
| 1962 | 0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65, |
| 1963 | 0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69, |
| 1964 | 0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b, |
| 1965 | 0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78, |
| 1966 | 0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x65, |
| 1967 | 0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d, |
| 1968 | 0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x73,0x6d,0x70,0x20,0x5b,0x5b, |
| 1969 | 0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a, |
| 1970 | 0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75, |
| 1971 | 0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e, |
| 1972 | 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78, |
| 1973 | 0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e, |
| 1974 | 0x75,0x76,0x2e,0x78,0x79,0x29,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f, |
| 1975 | 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75, |
| 1976 | 0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, |
| 1977 | }; |
| 1978 | #elif defined(SOKOL_D3D11) |
| 1979 | static const uint8_t _sgl_vs_bytecode_hlsl4[1032] = { |
| 1980 | 0x44,0x58,0x42,0x43,0x74,0x7f,0x01,0xd9,0xf4,0xd5,0xed,0x1d,0x74,0xc1,0x30,0x27, |
| 1981 | 0xd8,0xe9,0x9d,0x50,0x01,0x00,0x00,0x00,0x08,0x04,0x00,0x00,0x05,0x00,0x00,0x00, |
| 1982 | 0x34,0x00,0x00,0x00,0x14,0x01,0x00,0x00,0x90,0x01,0x00,0x00,0x00,0x02,0x00,0x00, |
| 1983 | 0x8c,0x03,0x00,0x00,0x52,0x44,0x45,0x46,0xd8,0x00,0x00,0x00,0x01,0x00,0x00,0x00, |
| 1984 | 0x48,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x04,0xfe,0xff, |
| 1985 | 0x10,0x81,0x00,0x00,0xaf,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1986 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1987 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, |
| 1988 | 0x73,0x00,0xab,0xab,0x3c,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x60,0x00,0x00,0x00, |
| 1989 | 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x00,0x00,0x00, |
| 1990 | 0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x98,0x00,0x00,0x00, |
| 1991 | 0x00,0x00,0x00,0x00,0xa8,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x40,0x00,0x00,0x00, |
| 1992 | 0x02,0x00,0x00,0x00,0x98,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x31,0x39,0x5f, |
| 1993 | 0x6d,0x76,0x70,0x00,0x02,0x00,0x03,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00,0x00, |
| 1994 | 0x00,0x00,0x00,0x00,0x5f,0x31,0x39,0x5f,0x74,0x6d,0x00,0x4d,0x69,0x63,0x72,0x6f, |
| 1995 | 0x73,0x6f,0x66,0x74,0x20,0x28,0x52,0x29,0x20,0x48,0x4c,0x53,0x4c,0x20,0x53,0x68, |
| 1996 | 0x61,0x64,0x65,0x72,0x20,0x43,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x72,0x20,0x31,0x30, |
| 1997 | 0x2e,0x31,0x00,0xab,0x49,0x53,0x47,0x4e,0x74,0x00,0x00,0x00,0x04,0x00,0x00,0x00, |
| 1998 | 0x08,0x00,0x00,0x00,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 1999 | 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x0f,0x00,0x00,0x68,0x00,0x00,0x00, |
| 2000 | 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00, |
| 2001 | 0x03,0x03,0x00,0x00,0x68,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2002 | 0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x0f,0x0f,0x00,0x00,0x68,0x00,0x00,0x00, |
| 2003 | 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00, |
| 2004 | 0x01,0x00,0x00,0x00,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x00,0xab,0xab,0xab, |
| 2005 | 0x4f,0x53,0x47,0x4e,0x68,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x08,0x00,0x00,0x00, |
| 2006 | 0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00, |
| 2007 | 0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x01,0x00,0x00,0x00, |
| 2008 | 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, |
| 2009 | 0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00, |
| 2010 | 0x02,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44, |
| 2011 | 0x00,0x53,0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0xab,0xab,0xab, |
| 2012 | 0x53,0x48,0x44,0x52,0x84,0x01,0x00,0x00,0x40,0x00,0x01,0x00,0x61,0x00,0x00,0x00, |
| 2013 | 0x59,0x00,0x00,0x04,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00, |
| 2014 | 0x5f,0x00,0x00,0x03,0xf2,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x03, |
| 2015 | 0x32,0x10,0x10,0x00,0x01,0x00,0x00,0x00,0x5f,0x00,0x00,0x03,0xf2,0x10,0x10,0x00, |
| 2016 | 0x02,0x00,0x00,0x00,0x65,0x00,0x00,0x03,0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00, |
| 2017 | 0x65,0x00,0x00,0x03,0xf2,0x20,0x10,0x00,0x01,0x00,0x00,0x00,0x67,0x00,0x00,0x04, |
| 2018 | 0xf2,0x20,0x10,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x68,0x00,0x00,0x02, |
| 2019 | 0x01,0x00,0x00,0x00,0x38,0x00,0x00,0x08,0xf2,0x00,0x10,0x00,0x00,0x00,0x00,0x00, |
| 2020 | 0x56,0x15,0x10,0x00,0x01,0x00,0x00,0x00,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00, |
| 2021 | 0x05,0x00,0x00,0x00,0x32,0x00,0x00,0x0a,0xf2,0x00,0x10,0x00,0x00,0x00,0x00,0x00, |
| 2022 | 0x06,0x10,0x10,0x00,0x01,0x00,0x00,0x00,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00, |
| 2023 | 0x04,0x00,0x00,0x00,0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, |
| 2024 | 0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00, |
| 2025 | 0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x36,0x00,0x00,0x05, |
| 2026 | 0xf2,0x20,0x10,0x00,0x01,0x00,0x00,0x00,0x46,0x1e,0x10,0x00,0x02,0x00,0x00,0x00, |
| 2027 | 0x38,0x00,0x00,0x08,0xf2,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x56,0x15,0x10,0x00, |
| 2028 | 0x00,0x00,0x00,0x00,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, |
| 2029 | 0x32,0x00,0x00,0x0a,0xf2,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x06,0x10,0x10,0x00, |
| 2030 | 0x00,0x00,0x00,0x00,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2031 | 0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x00,0x0a,0xf2,0x00,0x10,0x00, |
| 2032 | 0x00,0x00,0x00,0x00,0xa6,0x1a,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x8e,0x20,0x00, |
| 2033 | 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00, |
| 2034 | 0x32,0x00,0x00,0x0a,0xf2,0x20,0x10,0x00,0x02,0x00,0x00,0x00,0xf6,0x1f,0x10,0x00, |
| 2035 | 0x00,0x00,0x00,0x00,0x46,0x8e,0x20,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00, |
| 2036 | 0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x01,0x53,0x54,0x41,0x54, |
| 2037 | 0x74,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2038 | 0x06,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2039 | 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2040 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2041 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2042 | 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2043 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2044 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2045 | }; |
| 2046 | static const uint8_t _sgl_fs_bytecode_hlsl4[608] = { |
| 2047 | 0x44,0x58,0x42,0x43,0xc8,0x9b,0x66,0x64,0x80,0x2f,0xbe,0x14,0xd9,0x88,0xa0,0x97, |
| 2048 | 0x64,0x14,0x66,0xff,0x01,0x00,0x00,0x00,0x60,0x02,0x00,0x00,0x05,0x00,0x00,0x00, |
| 2049 | 0x34,0x00,0x00,0x00,0xc8,0x00,0x00,0x00,0x14,0x01,0x00,0x00,0x48,0x01,0x00,0x00, |
| 2050 | 0xe4,0x01,0x00,0x00,0x52,0x44,0x45,0x46,0x8c,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2051 | 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x04,0xff,0xff, |
| 2052 | 0x10,0x81,0x00,0x00,0x64,0x00,0x00,0x00,0x5c,0x00,0x00,0x00,0x03,0x00,0x00,0x00, |
| 2053 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2054 | 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x02,0x00,0x00,0x00, |
| 2055 | 0x05,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, |
| 2056 | 0x01,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x73,0x6d,0x70,0x00,0x74,0x65,0x78,0x00, |
| 2057 | 0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,0x74,0x20,0x28,0x52,0x29,0x20,0x48,0x4c, |
| 2058 | 0x53,0x4c,0x20,0x53,0x68,0x61,0x64,0x65,0x72,0x20,0x43,0x6f,0x6d,0x70,0x69,0x6c, |
| 2059 | 0x65,0x72,0x20,0x31,0x30,0x2e,0x31,0x00,0x49,0x53,0x47,0x4e,0x44,0x00,0x00,0x00, |
| 2060 | 0x02,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2061 | 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x03,0x00,0x00, |
| 2062 | 0x38,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00, |
| 2063 | 0x01,0x00,0x00,0x00,0x0f,0x0f,0x00,0x00,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44, |
| 2064 | 0x00,0xab,0xab,0xab,0x4f,0x53,0x47,0x4e,0x2c,0x00,0x00,0x00,0x01,0x00,0x00,0x00, |
| 2065 | 0x08,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2066 | 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x53,0x56,0x5f,0x54, |
| 2067 | 0x61,0x72,0x67,0x65,0x74,0x00,0xab,0xab,0x53,0x48,0x44,0x52,0x94,0x00,0x00,0x00, |
| 2068 | 0x40,0x00,0x00,0x00,0x25,0x00,0x00,0x00,0x5a,0x00,0x00,0x03,0x00,0x60,0x10,0x00, |
| 2069 | 0x00,0x00,0x00,0x00,0x58,0x18,0x00,0x04,0x00,0x70,0x10,0x00,0x00,0x00,0x00,0x00, |
| 2070 | 0x55,0x55,0x00,0x00,0x62,0x10,0x00,0x03,0x32,0x10,0x10,0x00,0x00,0x00,0x00,0x00, |
| 2071 | 0x62,0x10,0x00,0x03,0xf2,0x10,0x10,0x00,0x01,0x00,0x00,0x00,0x65,0x00,0x00,0x03, |
| 2072 | 0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x68,0x00,0x00,0x02,0x01,0x00,0x00,0x00, |
| 2073 | 0x45,0x00,0x00,0x09,0xf2,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x10,0x10,0x00, |
| 2074 | 0x00,0x00,0x00,0x00,0x46,0x7e,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x10,0x00, |
| 2075 | 0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x07,0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00, |
| 2076 | 0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x1e,0x10,0x00,0x01,0x00,0x00,0x00, |
| 2077 | 0x3e,0x00,0x00,0x01,0x53,0x54,0x41,0x54,0x74,0x00,0x00,0x00,0x03,0x00,0x00,0x00, |
| 2078 | 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00, |
| 2079 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,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,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2082 | 0x00,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 2085 | |
| 2086 | }; |
| 2087 | #elif defined(SOKOL_WGPU) |
| 2088 | static const uint8_t _sgl_vs_source_wgsl[1162] = { |
| 2089 | 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, |
| 2090 | 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, |
| 2091 | 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, |
| 2092 | 0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a, |
| 2093 | 0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20, |
| 2094 | 0x20,0x6d,0x76,0x70,0x20,0x3a,0x20,0x6d,0x61,0x74,0x34,0x78,0x34,0x66,0x2c,0x0a, |
| 2095 | 0x20,0x20,0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x36,0x34,0x29, |
| 2096 | 0x20,0x2a,0x2f,0x0a,0x20,0x20,0x74,0x6d,0x20,0x3a,0x20,0x6d,0x61,0x74,0x34,0x78, |
| 2097 | 0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29, |
| 2098 | 0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x30,0x29,0x20,0x76,0x61,0x72, |
| 2099 | 0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x31,0x39,0x20,0x3a, |
| 2100 | 0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x0a,0x76,0x61,0x72, |
| 2101 | 0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x70,0x6f,0x73,0x69,0x74,0x69, |
| 2102 | 0x6f,0x6e,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76, |
| 2103 | 0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a, |
| 2104 | 0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69, |
| 2105 | 0x76,0x61,0x74,0x65,0x3e,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20, |
| 2106 | 0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72, |
| 2107 | 0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76, |
| 2108 | 0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61, |
| 2109 | 0x74,0x65,0x3e,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3a,0x20,0x76,0x65,0x63, |
| 2110 | 0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65, |
| 2111 | 0x3e,0x20,0x70,0x73,0x69,0x7a,0x65,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a,0x0a, |
| 2112 | 0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x67,0x6c,0x5f, |
| 2113 | 0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66, |
| 2114 | 0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b, |
| 2115 | 0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32,0x20,0x3a,0x20,0x6d,0x61, |
| 2116 | 0x74,0x34,0x78,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x39,0x2e,0x6d,0x76,0x70, |
| 2117 | 0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x35,0x20,0x3a,0x20,0x76, |
| 2118 | 0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f, |
| 2119 | 0x31,0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, |
| 2120 | 0x20,0x3d,0x20,0x28,0x78,0x5f,0x32,0x32,0x20,0x2a,0x20,0x78,0x5f,0x32,0x35,0x29, |
| 2121 | 0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x32,0x20,0x3a,0x20,0x6d, |
| 2122 | 0x61,0x74,0x34,0x78,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x39,0x2e,0x74,0x6d, |
| 2123 | 0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x36,0x20,0x3a,0x20,0x76, |
| 2124 | 0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30, |
| 2125 | 0x3b,0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x28,0x78,0x5f,0x33,0x32,0x20,0x2a, |
| 2126 | 0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x33,0x36,0x2e,0x78,0x2c,0x20,0x78, |
| 2127 | 0x5f,0x33,0x36,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30, |
| 2128 | 0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x35,0x20, |
| 2129 | 0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30, |
| 2130 | 0x3b,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x78,0x5f,0x34,0x35, |
| 2131 | 0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73, |
| 2132 | 0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b, |
| 2133 | 0x0a,0x20,0x20,0x40,0x62,0x75,0x69,0x6c,0x74,0x69,0x6e,0x28,0x70,0x6f,0x73,0x69, |
| 2134 | 0x74,0x69,0x6f,0x6e,0x29,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74, |
| 2135 | 0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,0x40, |
| 2136 | 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x75,0x76, |
| 2137 | 0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,0x40,0x6c, |
| 2138 | 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x0a,0x20,0x20,0x63,0x6f,0x6c, |
| 2139 | 0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a, |
| 2140 | 0x0a,0x40,0x76,0x65,0x72,0x74,0x65,0x78,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e, |
| 2141 | 0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x70,0x6f, |
| 2142 | 0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a, |
| 2143 | 0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f, |
| 2144 | 0x6e,0x28,0x31,0x29,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,0x70, |
| 2145 | 0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,0x40,0x6c, |
| 2146 | 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x32,0x29,0x20,0x63,0x6f,0x6c,0x6f,0x72, |
| 2147 | 0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c, |
| 2148 | 0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x33,0x29,0x20,0x70,0x73, |
| 2149 | 0x69,0x7a,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x66,0x33,0x32,0x29, |
| 2150 | 0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20, |
| 2151 | 0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x20,0x3d,0x20,0x70,0x6f, |
| 2152 | 0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a, |
| 2153 | 0x20,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3d,0x20,0x74,0x65, |
| 2154 | 0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20, |
| 2155 | 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30, |
| 2156 | 0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x70,0x73,0x69,0x7a,0x65,0x20, |
| 2157 | 0x3d,0x20,0x70,0x73,0x69,0x7a,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20, |
| 2158 | 0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74, |
| 2159 | 0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x67,0x6c,0x5f, |
| 2160 | 0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x75,0x76,0x2c,0x20,0x63,0x6f, |
| 2161 | 0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, |
| 2162 | }; |
| 2163 | static const uint8_t _sgl_fs_source_wgsl[647] = { |
| 2164 | 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, |
| 2165 | 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, |
| 2166 | 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69, |
| 2167 | 0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, |
| 2168 | 0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75, |
| 2169 | 0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x34,0x38, |
| 2170 | 0x29,0x20,0x76,0x61,0x72,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x74,0x65,0x78,0x74, |
| 2171 | 0x75,0x72,0x65,0x5f,0x32,0x64,0x3c,0x66,0x33,0x32,0x3e,0x3b,0x0a,0x0a,0x40,0x67, |
| 2172 | 0x72,0x6f,0x75,0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67, |
| 2173 | 0x28,0x36,0x34,0x29,0x20,0x76,0x61,0x72,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x73, |
| 2174 | 0x61,0x6d,0x70,0x6c,0x65,0x72,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69, |
| 2175 | 0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66, |
| 2176 | 0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20, |
| 2177 | 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a, |
| 2178 | 0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20, |
| 2179 | 0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66, |
| 2180 | 0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32, |
| 2181 | 0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74, |
| 2182 | 0x75,0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x74,0x65,0x78,0x2c,0x20,0x73, |
| 2183 | 0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x32,0x33,0x2e,0x78, |
| 2184 | 0x2c,0x20,0x78,0x5f,0x32,0x33,0x2e,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65, |
| 2185 | 0x74,0x20,0x78,0x5f,0x32,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d, |
| 2186 | 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, |
| 2187 | 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x28,0x78,0x5f,0x32,0x35,0x20,0x2a,0x20,0x78, |
| 2188 | 0x5f,0x32,0x37,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a, |
| 2189 | 0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f, |
| 2190 | 0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, |
| 2191 | 0x28,0x30,0x29,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, |
| 2192 | 0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40, |
| 2193 | 0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e, |
| 2194 | 0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x75,0x76, |
| 2195 | 0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x20, |
| 2196 | 0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x63,0x6f,0x6c, |
| 2197 | 0x6f,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66, |
| 2198 | 0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a, |
| 2199 | 0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b, |
| 2200 | 0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72, |
| 2201 | 0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31, |
| 2202 | 0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69, |
| 2203 | 0x6e,0x5f,0x6f,0x75,0x74,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, |
| 2204 | 0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, |
| 2205 | }; |
| 2206 | #elif defined(SOKOL_DUMMY_BACKEND) |
| 2207 | static const char* _sgl_vs_source_dummy = ""; |
| 2208 | static const char* _sgl_fs_source_dummy = ""; |
| 2209 | #else |
| 2210 | #error "Please define one of SOKOL_GLCORE, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!" |
| 2211 | #endif |
| 2212 | |
| 2213 | // ████████ ██ ██ ██████ ███████ ███████ |
| 2214 | // ██ ██ ██ ██ ██ ██ ██ |
| 2215 | // ██ ████ ██████ █████ ███████ |
| 2216 | // ██ ██ ██ ██ ██ |
| 2217 | // ██ ██ ██ ███████ ███████ |
| 2218 | // |
| 2219 | // >>types |
| 2220 | typedef enum { |
| 2221 | SGL_PRIMITIVETYPE_POINTS = 0, |
| 2222 | SGL_PRIMITIVETYPE_LINES, |
| 2223 | SGL_PRIMITIVETYPE_LINE_STRIP, |
| 2224 | SGL_PRIMITIVETYPE_TRIANGLES, |
| 2225 | SGL_PRIMITIVETYPE_TRIANGLE_STRIP, |
| 2226 | SGL_PRIMITIVETYPE_QUADS, |
| 2227 | SGL_NUM_PRIMITIVE_TYPES, |
| 2228 | } _sgl_primitive_type_t; |
| 2229 | |
| 2230 | typedef struct { |
| 2231 | uint32_t id; |
| 2232 | sg_resource_state state; |
| 2233 | } _sgl_slot_t; |
| 2234 | |
| 2235 | typedef struct { |
| 2236 | int size; |
| 2237 | int queue_top; |
| 2238 | uint32_t* gen_ctrs; |
| 2239 | int* free_queue; |
| 2240 | } _sgl_pool_t; |
| 2241 | |
| 2242 | typedef struct { |
| 2243 | _sgl_slot_t slot; |
| 2244 | sg_pipeline pip[SGL_NUM_PRIMITIVE_TYPES]; |
| 2245 | } _sgl_pipeline_t; |
| 2246 | |
| 2247 | typedef struct { |
| 2248 | _sgl_pool_t pool; |
| 2249 | _sgl_pipeline_t* pips; |
| 2250 | } _sgl_pipeline_pool_t; |
| 2251 | |
| 2252 | typedef enum { |
| 2253 | SGL_MATRIXMODE_MODELVIEW, |
| 2254 | SGL_MATRIXMODE_PROJECTION, |
| 2255 | SGL_MATRIXMODE_TEXTURE, |
| 2256 | SGL_NUM_MATRIXMODES |
| 2257 | } _sgl_matrix_mode_t; |
| 2258 | |
| 2259 | typedef struct { |
| 2260 | float pos[3]; |
| 2261 | float uv[2]; |
| 2262 | uint32_t rgba; |
| 2263 | float psize; |
| 2264 | } _sgl_vertex_t; |
| 2265 | |
| 2266 | typedef struct { |
| 2267 | float v[4][4]; |
| 2268 | } _sgl_matrix_t; |
| 2269 | |
| 2270 | typedef struct { |
| 2271 | _sgl_matrix_t mvp; /* model-view-projection matrix */ |
| 2272 | _sgl_matrix_t tm; /* texture matrix */ |
| 2273 | } _sgl_uniform_t; |
| 2274 | |
| 2275 | typedef enum { |
| 2276 | SGL_COMMAND_DRAW, |
| 2277 | SGL_COMMAND_VIEWPORT, |
| 2278 | SGL_COMMAND_SCISSOR_RECT, |
| 2279 | } _sgl_command_type_t; |
| 2280 | |
| 2281 | typedef struct { |
| 2282 | sg_pipeline pip; |
| 2283 | sg_image img; |
| 2284 | sg_sampler smp; |
| 2285 | int base_vertex; |
| 2286 | int num_vertices; |
| 2287 | int uniform_index; |
| 2288 | } _sgl_draw_args_t; |
| 2289 | |
| 2290 | typedef struct { |
| 2291 | int x, y, w, h; |
| 2292 | bool origin_top_left; |
| 2293 | } _sgl_viewport_args_t; |
| 2294 | |
| 2295 | typedef struct { |
| 2296 | int x, y, w, h; |
| 2297 | bool origin_top_left; |
| 2298 | } _sgl_scissor_rect_args_t; |
| 2299 | |
| 2300 | typedef union { |
| 2301 | _sgl_draw_args_t draw; |
| 2302 | _sgl_viewport_args_t viewport; |
| 2303 | _sgl_scissor_rect_args_t scissor_rect; |
| 2304 | } _sgl_args_t; |
| 2305 | |
| 2306 | typedef struct { |
| 2307 | _sgl_command_type_t cmd; |
| 2308 | int layer_id; |
| 2309 | _sgl_args_t args; |
| 2310 | } _sgl_command_t; |
| 2311 | |
| 2312 | #define _SGL_INVALID_SLOT_INDEX (0) |
| 2313 | #define _SGL_MAX_STACK_DEPTH (64) |
| 2314 | #define _SGL_DEFAULT_CONTEXT_POOL_SIZE (4) |
| 2315 | #define _SGL_DEFAULT_PIPELINE_POOL_SIZE (64) |
| 2316 | // __v_ start |
| 2317 | #if !defined(_SGL_DEFAULT_MAX_VERTICES) |
| 2318 | #define _SGL_DEFAULT_MAX_VERTICES (1<<17) |
| 2319 | #endif |
| 2320 | #if !defined(_SGL_DEFAULT_MAX_COMMANDS) |
| 2321 | #define _SGL_DEFAULT_MAX_COMMANDS (1<<15) |
| 2322 | #endif |
| 2323 | // __v_ end |
| 2324 | #define _SGL_SLOT_SHIFT (16) |
| 2325 | #define _SGL_MAX_POOL_SIZE (1<<_SGL_SLOT_SHIFT) |
| 2326 | #define _SGL_SLOT_MASK (_SGL_MAX_POOL_SIZE-1) |
| 2327 | |
| 2328 | typedef struct { |
| 2329 | _sgl_slot_t slot; |
| 2330 | sgl_context_desc_t desc; |
| 2331 | uint32_t frame_id; |
| 2332 | uint32_t update_frame_id; |
| 2333 | struct { |
| 2334 | int cap; |
| 2335 | int next; |
| 2336 | _sgl_vertex_t* ptr; |
| 2337 | } vertices; |
| 2338 | struct { |
| 2339 | int cap; |
| 2340 | int next; |
| 2341 | _sgl_uniform_t* ptr; |
| 2342 | } uniforms; |
| 2343 | struct { |
| 2344 | int cap; |
| 2345 | int next; |
| 2346 | _sgl_command_t* ptr; |
| 2347 | } commands; |
| 2348 | |
| 2349 | /* state tracking */ |
| 2350 | int base_vertex; |
| 2351 | int vtx_count; /* number of times vtx function has been called, used for non-triangle primitives */ |
| 2352 | sgl_error_t error; |
| 2353 | bool in_begin; |
| 2354 | int layer_id; |
| 2355 | float u, v; |
| 2356 | uint32_t rgba; |
| 2357 | float point_size; |
| 2358 | _sgl_primitive_type_t cur_prim_type; |
| 2359 | sg_image cur_img; |
| 2360 | sg_sampler cur_smp; |
| 2361 | bool texturing_enabled; |
| 2362 | bool matrix_dirty; /* reset in sgl_end(), set in any of the matrix stack functions */ |
| 2363 | |
| 2364 | /* sokol-gfx resources */ |
| 2365 | sg_buffer vbuf; |
| 2366 | sgl_pipeline def_pip; |
| 2367 | sg_bindings bind; |
| 2368 | |
| 2369 | /* pipeline stack */ |
| 2370 | int pip_tos; |
| 2371 | sgl_pipeline pip_stack[_SGL_MAX_STACK_DEPTH]; |
| 2372 | |
| 2373 | /* matrix stacks */ |
| 2374 | _sgl_matrix_mode_t cur_matrix_mode; |
| 2375 | int matrix_tos[SGL_NUM_MATRIXMODES]; |
| 2376 | _sgl_matrix_t matrix_stack[SGL_NUM_MATRIXMODES][_SGL_MAX_STACK_DEPTH]; |
| 2377 | } _sgl_context_t; |
| 2378 | |
| 2379 | typedef struct { |
| 2380 | _sgl_pool_t pool; |
| 2381 | _sgl_context_t* contexts; |
| 2382 | } _sgl_context_pool_t; |
| 2383 | |
| 2384 | typedef struct { |
| 2385 | uint32_t init_cookie; |
| 2386 | sgl_desc_t desc; |
| 2387 | sg_image def_img; // a default white texture |
| 2388 | sg_sampler def_smp; // a default sampler |
| 2389 | sg_shader shd; // same shader for all contexts |
| 2390 | sgl_context def_ctx_id; |
| 2391 | sgl_context cur_ctx_id; |
| 2392 | _sgl_context_t* cur_ctx; // may be 0! |
| 2393 | _sgl_pipeline_pool_t pip_pool; |
| 2394 | _sgl_context_pool_t context_pool; |
| 2395 | } _sgl_t; |
| 2396 | static _sgl_t _sgl; |
| 2397 | |
| 2398 | // ██ ██████ ██████ ██████ ██ ███ ██ ██████ |
| 2399 | // ██ ██ ██ ██ ██ ██ ████ ██ ██ |
| 2400 | // ██ ██ ██ ██ ███ ██ ███ ██ ██ ██ ██ ██ ███ |
| 2401 | // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ |
| 2402 | // ███████ ██████ ██████ ██████ ██ ██ ████ ██████ |
| 2403 | // |
| 2404 | // >>logging |
| 2405 | #if defined(SOKOL_DEBUG) |
| 2406 | #define _SGL_LOGITEM_XMACRO(item,msg) #item ": " msg, |
| 2407 | static const char* _sgl_log_messages[] = { |
| 2408 | _SGL_LOG_ITEMS |
| 2409 | }; |
| 2410 | #undef _SGL_LOGITEM_XMACRO |
| 2411 | #endif // SOKOL_DEBUG |
| 2412 | |
| 2413 | #define _SGL_PANIC(code) _sgl_log(SGL_LOGITEM_ ##code, 0, __LINE__) |
| 2414 | #define _SGL_ERROR(code) _sgl_log(SGL_LOGITEM_ ##code, 1, __LINE__) |
| 2415 | #define _SGL_WARN(code) _sgl_log(SGL_LOGITEM_ ##code, 2, __LINE__) |
| 2416 | #define _SGL_INFO(code) _sgl_log(SGL_LOGITEM_ ##code, 3, __LINE__) |
| 2417 | |
| 2418 | static void _sgl_log(sgl_log_item_t log_item, uint32_t log_level, uint32_t line_nr) { |
| 2419 | if (_sgl.desc.logger.func) { |
| 2420 | #if defined(SOKOL_DEBUG) |
| 2421 | const char* filename = __FILE__; |
| 2422 | const char* message = _sgl_log_messages[log_item]; |
| 2423 | #else |
| 2424 | const char* filename = 0; |
| 2425 | const char* message = 0; |
| 2426 | #endif |
| 2427 | _sgl.desc.logger.func("sgl", log_level, log_item, message, line_nr, filename, _sgl.desc.logger.user_data); |
| 2428 | } else { |
| 2429 | // for log level PANIC it would be 'undefined behaviour' to continue |
| 2430 | if (log_level == 0) { |
| 2431 | abort(); |
| 2432 | } |
| 2433 | } |
| 2434 | } |
| 2435 | |
| 2436 | // ███ ███ ███████ ███ ███ ██████ ██████ ██ ██ |
| 2437 | // ████ ████ ██ ████ ████ ██ ██ ██ ██ ██ ██ |
| 2438 | // ██ ████ ██ █████ ██ ████ ██ ██ ██ ██████ ████ |
| 2439 | // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ |
| 2440 | // ██ ██ ███████ ██ ██ ██████ ██ ██ ██ |
| 2441 | // |
| 2442 | // >>memory |
| 2443 | static void _sgl_clear(void* ptr, size_t size) { |
| 2444 | SOKOL_ASSERT(ptr && (size > 0)); |
| 2445 | memset(ptr, 0, size); |
| 2446 | } |
| 2447 | |
| 2448 | static void* _sgl_malloc(size_t size) { |
| 2449 | SOKOL_ASSERT(size > 0); |
| 2450 | void* ptr; |
| 2451 | if (_sgl.desc.allocator.alloc_fn) { |
| 2452 | ptr = _sgl.desc.allocator.alloc_fn(size, _sgl.desc.allocator.user_data); |
| 2453 | } else { |
| 2454 | ptr = malloc(size); |
| 2455 | } |
| 2456 | if (0 == ptr) { |
| 2457 | _SGL_PANIC(MALLOC_FAILED); |
| 2458 | } |
| 2459 | return ptr; |
| 2460 | } |
| 2461 | |
| 2462 | static void* _sgl_malloc_clear(size_t size) { |
| 2463 | void* ptr = _sgl_malloc(size); |
| 2464 | _sgl_clear(ptr, size); |
| 2465 | return ptr; |
| 2466 | } |
| 2467 | |
| 2468 | static void _sgl_free(void* ptr) { |
| 2469 | if (_sgl.desc.allocator.free_fn) { |
| 2470 | _sgl.desc.allocator.free_fn(ptr, _sgl.desc.allocator.user_data); |
| 2471 | } else { |
| 2472 | free(ptr); |
| 2473 | } |
| 2474 | } |
| 2475 | |
| 2476 | // ██████ ██████ ██████ ██ |
| 2477 | // ██ ██ ██ ██ ██ ██ ██ |
| 2478 | // ██████ ██ ██ ██ ██ ██ |
| 2479 | // ██ ██ ██ ██ ██ ██ |
| 2480 | // ██ ██████ ██████ ███████ |
| 2481 | // |
| 2482 | // >>pool |
| 2483 | static void _sgl_init_pool(_sgl_pool_t* pool, int num) { |
| 2484 | SOKOL_ASSERT(pool && (num >= 1)); |
| 2485 | /* slot 0 is reserved for the 'invalid id', so bump the pool size by 1 */ |
| 2486 | pool->size = num + 1; |
| 2487 | pool->queue_top = 0; |
| 2488 | /* generation counters indexable by pool slot index, slot 0 is reserved */ |
| 2489 | size_t gen_ctrs_size = sizeof(uint32_t) * (size_t)pool->size; |
| 2490 | pool->gen_ctrs = (uint32_t*) _sgl_malloc_clear(gen_ctrs_size); |
| 2491 | /* it's not a bug to only reserve 'num' here */ |
| 2492 | pool->free_queue = (int*) _sgl_malloc_clear(sizeof(int) * (size_t)num); |
| 2493 | /* never allocate the zero-th pool item since the invalid id is 0 */ |
| 2494 | for (int i = pool->size-1; i >= 1; i--) { |
| 2495 | pool->free_queue[pool->queue_top++] = i; |
| 2496 | } |
| 2497 | } |
| 2498 | |
| 2499 | static void _sgl_discard_pool(_sgl_pool_t* pool) { |
| 2500 | SOKOL_ASSERT(pool); |
| 2501 | SOKOL_ASSERT(pool->free_queue); |
| 2502 | _sgl_free(pool->free_queue); |
| 2503 | pool->free_queue = 0; |
| 2504 | SOKOL_ASSERT(pool->gen_ctrs); |
| 2505 | _sgl_free(pool->gen_ctrs); |
| 2506 | pool->gen_ctrs = 0; |
| 2507 | pool->size = 0; |
| 2508 | pool->queue_top = 0; |
| 2509 | } |
| 2510 | |
| 2511 | static int _sgl_pool_alloc_index(_sgl_pool_t* pool) { |
| 2512 | SOKOL_ASSERT(pool); |
| 2513 | SOKOL_ASSERT(pool->free_queue); |
| 2514 | if (pool->queue_top > 0) { |
| 2515 | int slot_index = pool->free_queue[--pool->queue_top]; |
| 2516 | SOKOL_ASSERT((slot_index > 0) && (slot_index < pool->size)); |
| 2517 | return slot_index; |
| 2518 | } else { |
| 2519 | // pool exhausted |
| 2520 | return _SGL_INVALID_SLOT_INDEX; |
| 2521 | } |
| 2522 | } |
| 2523 | |
| 2524 | static void _sgl_pool_free_index(_sgl_pool_t* pool, int slot_index) { |
| 2525 | SOKOL_ASSERT((slot_index > _SGL_INVALID_SLOT_INDEX) && (slot_index < pool->size)); |
| 2526 | SOKOL_ASSERT(pool); |
| 2527 | SOKOL_ASSERT(pool->free_queue); |
| 2528 | SOKOL_ASSERT(pool->queue_top < pool->size); |
| 2529 | #ifdef SOKOL_DEBUG |
| 2530 | /* debug check against double-free */ |
| 2531 | for (int i = 0; i < pool->queue_top; i++) { |
| 2532 | SOKOL_ASSERT(pool->free_queue[i] != slot_index); |
| 2533 | } |
| 2534 | #endif |
| 2535 | pool->free_queue[pool->queue_top++] = slot_index; |
| 2536 | SOKOL_ASSERT(pool->queue_top <= (pool->size-1)); |
| 2537 | } |
| 2538 | |
| 2539 | /* allocate the slot at slot_index: |
| 2540 | - bump the slot's generation counter |
| 2541 | - create a resource id from the generation counter and slot index |
| 2542 | - set the slot's id to this id |
| 2543 | - set the slot's state to ALLOC |
| 2544 | - return the resource id |
| 2545 | */ |
| 2546 | static uint32_t _sgl_slot_alloc(_sgl_pool_t* pool, _sgl_slot_t* slot, int slot_index) { |
| 2547 | /* FIXME: add handling for an overflowing generation counter, |
| 2548 | for now, just overflow (another option is to disable |
| 2549 | the slot) |
| 2550 | */ |
| 2551 | SOKOL_ASSERT(pool && pool->gen_ctrs); |
| 2552 | SOKOL_ASSERT((slot_index > _SGL_INVALID_SLOT_INDEX) && (slot_index < pool->size)); |
| 2553 | SOKOL_ASSERT((slot->state == SG_RESOURCESTATE_INITIAL) && (slot->id == SG_INVALID_ID)); |
| 2554 | uint32_t ctr = ++pool->gen_ctrs[slot_index]; |
| 2555 | slot->id = (ctr<<_SGL_SLOT_SHIFT)|(slot_index & _SGL_SLOT_MASK); |
| 2556 | slot->state = SG_RESOURCESTATE_ALLOC; |
| 2557 | return slot->id; |
| 2558 | } |
| 2559 | |
| 2560 | /* extract slot index from id */ |
| 2561 | static int _sgl_slot_index(uint32_t id) { |
| 2562 | int slot_index = (int) (id & _SGL_SLOT_MASK); |
| 2563 | SOKOL_ASSERT(_SGL_INVALID_SLOT_INDEX != slot_index); |
| 2564 | return slot_index; |
| 2565 | } |
| 2566 | |
| 2567 | // ██████ ██ ██████ ███████ ██ ██ ███ ██ ███████ ███████ |
| 2568 | // ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ |
| 2569 | // ██████ ██ ██████ █████ ██ ██ ██ ██ ██ █████ ███████ |
| 2570 | // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ |
| 2571 | // ██ ██ ██ ███████ ███████ ██ ██ ████ ███████ ███████ |
| 2572 | // |
| 2573 | // >>pipelines |
| 2574 | static void _sgl_reset_pipeline(_sgl_pipeline_t* pip) { |
| 2575 | SOKOL_ASSERT(pip); |
| 2576 | _sgl_clear(pip, sizeof(_sgl_pipeline_t)); |
| 2577 | } |
| 2578 | |
| 2579 | static void _sgl_setup_pipeline_pool(int pool_size) { |
| 2580 | /* note: the pools here will have an additional item, since slot 0 is reserved */ |
| 2581 | SOKOL_ASSERT((pool_size > 0) && (pool_size < _SGL_MAX_POOL_SIZE)); |
| 2582 | _sgl_init_pool(&_sgl.pip_pool.pool, pool_size); |
| 2583 | size_t pool_byte_size = sizeof(_sgl_pipeline_t) * (size_t)_sgl.pip_pool.pool.size; |
| 2584 | _sgl.pip_pool.pips = (_sgl_pipeline_t*) _sgl_malloc_clear(pool_byte_size); |
| 2585 | } |
| 2586 | |
| 2587 | static void _sgl_discard_pipeline_pool(void) { |
| 2588 | SOKOL_ASSERT(0 != _sgl.pip_pool.pips); |
| 2589 | _sgl_free(_sgl.pip_pool.pips); _sgl.pip_pool.pips = 0; |
| 2590 | _sgl_discard_pool(&_sgl.pip_pool.pool); |
| 2591 | } |
| 2592 | |
| 2593 | /* get pipeline pointer without id-check */ |
| 2594 | static _sgl_pipeline_t* _sgl_pipeline_at(uint32_t pip_id) { |
| 2595 | SOKOL_ASSERT(SG_INVALID_ID != pip_id); |
| 2596 | int slot_index = _sgl_slot_index(pip_id); |
| 2597 | SOKOL_ASSERT((slot_index > _SGL_INVALID_SLOT_INDEX) && (slot_index < _sgl.pip_pool.pool.size)); |
| 2598 | return &_sgl.pip_pool.pips[slot_index]; |
| 2599 | } |
| 2600 | |
| 2601 | /* get pipeline pointer with id-check, returns 0 if no match */ |
| 2602 | static _sgl_pipeline_t* _sgl_lookup_pipeline(uint32_t pip_id) { |
| 2603 | if (SG_INVALID_ID != pip_id) { |
| 2604 | _sgl_pipeline_t* pip = _sgl_pipeline_at(pip_id); |
| 2605 | if (pip->slot.id == pip_id) { |
| 2606 | return pip; |
| 2607 | } |
| 2608 | } |
| 2609 | return 0; |
| 2610 | } |
| 2611 | |
| 2612 | /* make pipeline id from uint32_t id */ |
| 2613 | static sgl_pipeline _sgl_make_pip_id(uint32_t pip_id) { |
| 2614 | sgl_pipeline pip = { pip_id }; |
| 2615 | return pip; |
| 2616 | } |
| 2617 | |
| 2618 | static sgl_pipeline _sgl_alloc_pipeline(void) { |
| 2619 | sgl_pipeline res; |
| 2620 | int slot_index = _sgl_pool_alloc_index(&_sgl.pip_pool.pool); |
| 2621 | if (_SGL_INVALID_SLOT_INDEX != slot_index) { |
| 2622 | res = _sgl_make_pip_id(_sgl_slot_alloc(&_sgl.pip_pool.pool, &_sgl.pip_pool.pips[slot_index].slot, slot_index)); |
| 2623 | } else { |
| 2624 | /* pool is exhausted */ |
| 2625 | res = _sgl_make_pip_id(SG_INVALID_ID); |
| 2626 | } |
| 2627 | return res; |
| 2628 | } |
| 2629 | |
| 2630 | static void _sgl_init_pipeline(sgl_pipeline pip_id, const sg_pipeline_desc* in_desc, const sgl_context_desc_t* ctx_desc) { |
| 2631 | SOKOL_ASSERT((pip_id.id != SG_INVALID_ID) && in_desc && ctx_desc); |
| 2632 | |
| 2633 | /* create a new desc with 'patched' shader and pixel format state */ |
| 2634 | sg_pipeline_desc desc = *in_desc; |
| 2635 | desc.layout.buffers[0].stride = sizeof(_sgl_vertex_t); |
| 2636 | { |
| 2637 | sg_vertex_attr_state* pos = &desc.layout.attrs[0]; |
| 2638 | pos->offset = offsetof(_sgl_vertex_t, pos); |
| 2639 | pos->format = SG_VERTEXFORMAT_FLOAT3; |
| 2640 | } |
| 2641 | { |
| 2642 | sg_vertex_attr_state* uv = &desc.layout.attrs[1]; |
| 2643 | uv->offset = offsetof(_sgl_vertex_t, uv); |
| 2644 | uv->format = SG_VERTEXFORMAT_FLOAT2; |
| 2645 | } |
| 2646 | { |
| 2647 | sg_vertex_attr_state* rgba = &desc.layout.attrs[2]; |
| 2648 | rgba->offset = offsetof(_sgl_vertex_t, rgba); |
| 2649 | rgba->format = SG_VERTEXFORMAT_UBYTE4N; |
| 2650 | } |
| 2651 | { |
| 2652 | sg_vertex_attr_state* psize = &desc.layout.attrs[3]; |
| 2653 | psize->offset = offsetof(_sgl_vertex_t, psize); |
| 2654 | psize->format = SG_VERTEXFORMAT_FLOAT; |
| 2655 | } |
| 2656 | if (in_desc->shader.id == SG_INVALID_ID) { |
| 2657 | desc.shader = _sgl.shd; |
| 2658 | } |
| 2659 | desc.index_type = SG_INDEXTYPE_NONE; |
| 2660 | desc.sample_count = ctx_desc->sample_count; |
| 2661 | if (desc.face_winding == _SG_FACEWINDING_DEFAULT) { |
| 2662 | desc.face_winding = _sgl.desc.face_winding; |
| 2663 | } |
| 2664 | desc.depth.pixel_format = ctx_desc->depth_format; |
| 2665 | if (ctx_desc->depth_format == SG_PIXELFORMAT_NONE) { |
| 2666 | desc.depth.write_enabled = false; |
| 2667 | } |
| 2668 | desc.colors[0].pixel_format = ctx_desc->color_format; |
| 2669 | if (desc.colors[0].write_mask == _SG_COLORMASK_DEFAULT) { |
| 2670 | desc.colors[0].write_mask = SG_COLORMASK_RGB; |
| 2671 | } |
| 2672 | |
| 2673 | _sgl_pipeline_t* pip = _sgl_lookup_pipeline(pip_id.id); |
| 2674 | SOKOL_ASSERT(pip && (pip->slot.state == SG_RESOURCESTATE_ALLOC)); |
| 2675 | pip->slot.state = SG_RESOURCESTATE_VALID; |
| 2676 | for (int i = 0; i < SGL_NUM_PRIMITIVE_TYPES; i++) { |
| 2677 | switch (i) { |
| 2678 | case SGL_PRIMITIVETYPE_POINTS: |
| 2679 | desc.primitive_type = SG_PRIMITIVETYPE_POINTS; |
| 2680 | break; |
| 2681 | case SGL_PRIMITIVETYPE_LINES: |
| 2682 | desc.primitive_type = SG_PRIMITIVETYPE_LINES; |
| 2683 | break; |
| 2684 | case SGL_PRIMITIVETYPE_LINE_STRIP: |
| 2685 | desc.primitive_type = SG_PRIMITIVETYPE_LINE_STRIP; |
| 2686 | break; |
| 2687 | case SGL_PRIMITIVETYPE_TRIANGLES: |
| 2688 | desc.primitive_type = SG_PRIMITIVETYPE_TRIANGLES; |
| 2689 | break; |
| 2690 | case SGL_PRIMITIVETYPE_TRIANGLE_STRIP: |
| 2691 | case SGL_PRIMITIVETYPE_QUADS: |
| 2692 | desc.primitive_type = SG_PRIMITIVETYPE_TRIANGLE_STRIP; |
| 2693 | break; |
| 2694 | } |
| 2695 | if (SGL_PRIMITIVETYPE_QUADS == i) { |
| 2696 | /* quads are emulated via triangles, use the same pipeline object */ |
| 2697 | pip->pip[i] = pip->pip[SGL_PRIMITIVETYPE_TRIANGLES]; |
| 2698 | } else { |
| 2699 | pip->pip[i] = sg_make_pipeline(&desc); |
| 2700 | if (pip->pip[i].id == SG_INVALID_ID) { |
| 2701 | _SGL_ERROR(MAKE_PIPELINE_FAILED); |
| 2702 | pip->slot.state = SG_RESOURCESTATE_FAILED; |
| 2703 | } |
| 2704 | } |
| 2705 | } |
| 2706 | } |
| 2707 | |
| 2708 | static sgl_pipeline _sgl_make_pipeline(const sg_pipeline_desc* desc, const sgl_context_desc_t* ctx_desc) { |
| 2709 | SOKOL_ASSERT(desc && ctx_desc); |
| 2710 | sgl_pipeline pip_id = _sgl_alloc_pipeline(); |
| 2711 | if (pip_id.id != SG_INVALID_ID) { |
| 2712 | _sgl_init_pipeline(pip_id, desc, ctx_desc); |
| 2713 | } else { |
| 2714 | _SGL_ERROR(PIPELINE_POOL_EXHAUSTED); |
| 2715 | } |
| 2716 | return pip_id; |
| 2717 | } |
| 2718 | |
| 2719 | static void _sgl_destroy_pipeline(sgl_pipeline pip_id) { |
| 2720 | _sgl_pipeline_t* pip = _sgl_lookup_pipeline(pip_id.id); |
| 2721 | if (pip) { |
| 2722 | sg_push_debug_group("sokol-gl"); |
| 2723 | for (int i = 0; i < SGL_NUM_PRIMITIVE_TYPES; i++) { |
| 2724 | if (i != SGL_PRIMITIVETYPE_QUADS) { |
| 2725 | sg_destroy_pipeline(pip->pip[i]); |
| 2726 | } |
| 2727 | } |
| 2728 | sg_pop_debug_group(); |
| 2729 | _sgl_reset_pipeline(pip); |
| 2730 | _sgl_pool_free_index(&_sgl.pip_pool.pool, _sgl_slot_index(pip_id.id)); |
| 2731 | } |
| 2732 | } |
| 2733 | |
| 2734 | static sg_pipeline _sgl_get_pipeline(sgl_pipeline pip_id, _sgl_primitive_type_t prim_type) { |
| 2735 | _sgl_pipeline_t* pip = _sgl_lookup_pipeline(pip_id.id); |
| 2736 | if (pip) { |
| 2737 | return pip->pip[prim_type]; |
| 2738 | } else { |
| 2739 | sg_pipeline dummy_id = { SG_INVALID_ID }; |
| 2740 | return dummy_id; |
| 2741 | } |
| 2742 | } |
| 2743 | |
| 2744 | // ██████ ██████ ███ ██ ████████ ███████ ██ ██ ████████ ███████ |
| 2745 | // ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ |
| 2746 | // ██ ██ ██ ██ ██ ██ ██ █████ ███ ██ ███████ |
| 2747 | // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ |
| 2748 | // ██████ ██████ ██ ████ ██ ███████ ██ ██ ██ ███████ |
| 2749 | // |
| 2750 | // >>contexts |
| 2751 | static void _sgl_reset_context(_sgl_context_t* ctx) { |
| 2752 | SOKOL_ASSERT(ctx); |
| 2753 | SOKOL_ASSERT(0 == ctx->vertices.ptr); |
| 2754 | SOKOL_ASSERT(0 == ctx->uniforms.ptr); |
| 2755 | SOKOL_ASSERT(0 == ctx->commands.ptr); |
| 2756 | _sgl_clear(ctx, sizeof(_sgl_context_t)); |
| 2757 | } |
| 2758 | |
| 2759 | static void _sgl_setup_context_pool(int pool_size) { |
| 2760 | /* note: the pools here will have an additional item, since slot 0 is reserved */ |
| 2761 | SOKOL_ASSERT((pool_size > 0) && (pool_size < _SGL_MAX_POOL_SIZE)); |
| 2762 | _sgl_init_pool(&_sgl.context_pool.pool, pool_size); |
| 2763 | size_t pool_byte_size = sizeof(_sgl_context_t) * (size_t)_sgl.context_pool.pool.size; |
| 2764 | _sgl.context_pool.contexts = (_sgl_context_t*) _sgl_malloc_clear(pool_byte_size); |
| 2765 | } |
| 2766 | |
| 2767 | static void _sgl_discard_context_pool(void) { |
| 2768 | SOKOL_ASSERT(0 != _sgl.context_pool.contexts); |
| 2769 | _sgl_free(_sgl.context_pool.contexts); _sgl.context_pool.contexts = 0; |
| 2770 | _sgl_discard_pool(&_sgl.context_pool.pool); |
| 2771 | } |
| 2772 | |
| 2773 | // get context pointer without id-check |
| 2774 | static _sgl_context_t* _sgl_context_at(uint32_t ctx_id) { |
| 2775 | SOKOL_ASSERT(SG_INVALID_ID != ctx_id); |
| 2776 | int slot_index = _sgl_slot_index(ctx_id); |
| 2777 | SOKOL_ASSERT((slot_index > _SGL_INVALID_SLOT_INDEX) && (slot_index < _sgl.context_pool.pool.size)); |
| 2778 | return &_sgl.context_pool.contexts[slot_index]; |
| 2779 | } |
| 2780 | |
| 2781 | // get context pointer with id-check, returns 0 if no match |
| 2782 | static _sgl_context_t* _sgl_lookup_context(uint32_t ctx_id) { |
| 2783 | if (SG_INVALID_ID != ctx_id) { |
| 2784 | _sgl_context_t* ctx = _sgl_context_at(ctx_id); |
| 2785 | if (ctx->slot.id == ctx_id) { |
| 2786 | return ctx; |
| 2787 | } |
| 2788 | } |
| 2789 | return 0; |
| 2790 | } |
| 2791 | |
| 2792 | // make context id from uint32_t id |
| 2793 | static sgl_context _sgl_make_ctx_id(uint32_t ctx_id) { |
| 2794 | sgl_context ctx = { ctx_id }; |
| 2795 | return ctx; |
| 2796 | } |
| 2797 | |
| 2798 | static sgl_context _sgl_alloc_context(void) { |
| 2799 | sgl_context res; |
| 2800 | int slot_index = _sgl_pool_alloc_index(&_sgl.context_pool.pool); |
| 2801 | if (_SGL_INVALID_SLOT_INDEX != slot_index) { |
| 2802 | res = _sgl_make_ctx_id(_sgl_slot_alloc(&_sgl.context_pool.pool, &_sgl.context_pool.contexts[slot_index].slot, slot_index)); |
| 2803 | } else { |
| 2804 | // pool is exhausted |
| 2805 | res = _sgl_make_ctx_id(SG_INVALID_ID); |
| 2806 | } |
| 2807 | return res; |
| 2808 | } |
| 2809 | |
| 2810 | // return sgl_context_desc_t with patched defaults |
| 2811 | static sgl_context_desc_t _sgl_context_desc_defaults(const sgl_context_desc_t* desc) { |
| 2812 | sgl_context_desc_t res = *desc; |
| 2813 | res.max_vertices = _sgl_def(desc->max_vertices, _SGL_DEFAULT_MAX_VERTICES); |
| 2814 | res.max_commands = _sgl_def(desc->max_commands, _SGL_DEFAULT_MAX_COMMANDS); |
| 2815 | return res; |
| 2816 | } |
| 2817 | |
| 2818 | static void _sgl_identity(_sgl_matrix_t*); |
| 2819 | static sg_commit_listener _sgl_make_commit_listener(_sgl_context_t* ctx); |
| 2820 | static void _sgl_init_context(sgl_context ctx_id, const sgl_context_desc_t* in_desc) { |
| 2821 | SOKOL_ASSERT((ctx_id.id != SG_INVALID_ID) && in_desc); |
| 2822 | _sgl_context_t* ctx = _sgl_lookup_context(ctx_id.id); |
| 2823 | SOKOL_ASSERT(ctx); |
| 2824 | ctx->desc = _sgl_context_desc_defaults(in_desc); |
| 2825 | // NOTE: frame_id must be non-zero, so that updates trigger in first frame |
| 2826 | ctx->frame_id = 1; |
| 2827 | ctx->cur_img = _sgl.def_img; |
| 2828 | ctx->cur_smp = _sgl.def_smp; |
| 2829 | |
| 2830 | // allocate buffers and pools |
| 2831 | ctx->vertices.cap = ctx->desc.max_vertices; |
| 2832 | ctx->commands.cap = ctx->uniforms.cap = ctx->desc.max_commands; |
| 2833 | ctx->vertices.ptr = (_sgl_vertex_t*) _sgl_malloc((size_t)ctx->vertices.cap * sizeof(_sgl_vertex_t)); |
| 2834 | ctx->uniforms.ptr = (_sgl_uniform_t*) _sgl_malloc((size_t)ctx->uniforms.cap * sizeof(_sgl_uniform_t)); |
| 2835 | ctx->commands.ptr = (_sgl_command_t*) _sgl_malloc((size_t)ctx->commands.cap * sizeof(_sgl_command_t)); |
| 2836 | |
| 2837 | // create sokol-gfx resource objects |
| 2838 | sg_push_debug_group("sokol-gl"); |
| 2839 | |
| 2840 | sg_buffer_desc vbuf_desc; |
| 2841 | _sgl_clear(&vbuf_desc, sizeof(vbuf_desc)); |
| 2842 | vbuf_desc.size = (size_t)ctx->vertices.cap * sizeof(_sgl_vertex_t); |
| 2843 | vbuf_desc.type = SG_BUFFERTYPE_VERTEXBUFFER; |
| 2844 | vbuf_desc.usage = SG_USAGE_STREAM; |
| 2845 | vbuf_desc.label = "sgl-vertex-buffer"; |
| 2846 | ctx->vbuf = sg_make_buffer(&vbuf_desc); |
| 2847 | SOKOL_ASSERT(SG_INVALID_ID != ctx->vbuf.id); |
| 2848 | ctx->bind.vertex_buffers[0] = ctx->vbuf; |
| 2849 | |
| 2850 | sg_pipeline_desc def_pip_desc; |
| 2851 | _sgl_clear(&def_pip_desc, sizeof(def_pip_desc)); |
| 2852 | def_pip_desc.depth.write_enabled = true; |
| 2853 | ctx->def_pip = _sgl_make_pipeline(&def_pip_desc, &ctx->desc); |
| 2854 | if (!sg_add_commit_listener(_sgl_make_commit_listener(ctx))) { |
| 2855 | _SGL_ERROR(ADD_COMMIT_LISTENER_FAILED); |
| 2856 | } |
| 2857 | sg_pop_debug_group(); |
| 2858 | |
| 2859 | // default state |
| 2860 | ctx->rgba = 0xFFFFFFFF; |
| 2861 | ctx->point_size = 1.0f; |
| 2862 | for (int i = 0; i < SGL_NUM_MATRIXMODES; i++) { |
| 2863 | _sgl_identity(&ctx->matrix_stack[i][0]); |
| 2864 | } |
| 2865 | ctx->pip_stack[0] = ctx->def_pip; |
| 2866 | ctx->matrix_dirty = true; |
| 2867 | } |
| 2868 | |
| 2869 | static sgl_context _sgl_make_context(const sgl_context_desc_t* desc) { |
| 2870 | SOKOL_ASSERT(desc); |
| 2871 | sgl_context ctx_id = _sgl_alloc_context(); |
| 2872 | if (ctx_id.id != SG_INVALID_ID) { |
| 2873 | _sgl_init_context(ctx_id, desc); |
| 2874 | } else { |
| 2875 | _SGL_ERROR(CONTEXT_POOL_EXHAUSTED); |
| 2876 | } |
| 2877 | return ctx_id; |
| 2878 | } |
| 2879 | |
| 2880 | static void _sgl_destroy_context(sgl_context ctx_id) { |
| 2881 | _sgl_context_t* ctx = _sgl_lookup_context(ctx_id.id); |
| 2882 | if (ctx) { |
| 2883 | SOKOL_ASSERT(ctx->vertices.ptr); |
| 2884 | SOKOL_ASSERT(ctx->uniforms.ptr); |
| 2885 | SOKOL_ASSERT(ctx->commands.ptr); |
| 2886 | |
| 2887 | _sgl_free(ctx->vertices.ptr); |
| 2888 | _sgl_free(ctx->uniforms.ptr); |
| 2889 | _sgl_free(ctx->commands.ptr); |
| 2890 | ctx->vertices.ptr = 0; |
| 2891 | ctx->uniforms.ptr = 0; |
| 2892 | ctx->commands.ptr = 0; |
| 2893 | |
| 2894 | sg_push_debug_group("sokol-gl"); |
| 2895 | sg_destroy_buffer(ctx->vbuf); |
| 2896 | _sgl_destroy_pipeline(ctx->def_pip); |
| 2897 | sg_remove_commit_listener(_sgl_make_commit_listener(ctx)); |
| 2898 | sg_pop_debug_group(); |
| 2899 | |
| 2900 | _sgl_reset_context(ctx); |
| 2901 | _sgl_pool_free_index(&_sgl.context_pool.pool, _sgl_slot_index(ctx_id.id)); |
| 2902 | } |
| 2903 | } |
| 2904 | |
| 2905 | // ███ ███ ██ ███████ ██████ |
| 2906 | // ████ ████ ██ ██ ██ |
| 2907 | // ██ ████ ██ ██ ███████ ██ |
| 2908 | // ██ ██ ██ ██ ██ ██ |
| 2909 | // ██ ██ ██ ███████ ██████ |
| 2910 | // |
| 2911 | // >>misc |
| 2912 | static void _sgl_begin(_sgl_context_t* ctx, _sgl_primitive_type_t mode) { |
| 2913 | ctx->in_begin = true; |
| 2914 | ctx->base_vertex = ctx->vertices.next; |
| 2915 | ctx->vtx_count = 0; |
| 2916 | ctx->cur_prim_type = mode; |
| 2917 | } |
| 2918 | |
| 2919 | static void _sgl_rewind(_sgl_context_t* ctx) { |
| 2920 | ctx->frame_id++; |
| 2921 | ctx->vertices.next = 0; |
| 2922 | ctx->uniforms.next = 0; |
| 2923 | ctx->commands.next = 0; |
| 2924 | ctx->base_vertex = 0; |
| 2925 | ctx->error = SGL_NO_ERROR; |
| 2926 | ctx->layer_id = 0; |
| 2927 | ctx->matrix_dirty = true; |
| 2928 | } |
| 2929 | |
| 2930 | // called from inside sokol-gfx sg_commit() |
| 2931 | static void _sgl_commit_listener(void* userdata) { |
| 2932 | _sgl_context_t* ctx = _sgl_lookup_context((uint32_t)(uintptr_t)userdata); |
| 2933 | if (ctx) { |
| 2934 | _sgl_rewind(ctx); |
| 2935 | } |
| 2936 | } |
| 2937 | |
| 2938 | static sg_commit_listener _sgl_make_commit_listener(_sgl_context_t* ctx) { |
| 2939 | sg_commit_listener listener = { _sgl_commit_listener, (void*)(uintptr_t)(ctx->slot.id) }; |
| 2940 | return listener; |
| 2941 | } |
| 2942 | |
| 2943 | static _sgl_vertex_t* _sgl_next_vertex(_sgl_context_t* ctx) { |
| 2944 | if (ctx->vertices.next < ctx->vertices.cap) { |
| 2945 | return &ctx->vertices.ptr[ctx->vertices.next++]; |
| 2946 | } else { |
| 2947 | ctx->error = SGL_ERROR_VERTICES_FULL; |
| 2948 | return 0; |
| 2949 | } |
| 2950 | } |
| 2951 | |
| 2952 | static _sgl_uniform_t* _sgl_next_uniform(_sgl_context_t* ctx) { |
| 2953 | if (ctx->uniforms.next < ctx->uniforms.cap) { |
| 2954 | return &ctx->uniforms.ptr[ctx->uniforms.next++]; |
| 2955 | } else { |
| 2956 | ctx->error = SGL_ERROR_UNIFORMS_FULL; |
| 2957 | return 0; |
| 2958 | } |
| 2959 | } |
| 2960 | |
| 2961 | static _sgl_command_t* _sgl_cur_command(_sgl_context_t* ctx) { |
| 2962 | if (ctx->commands.next > 0) { |
| 2963 | return &ctx->commands.ptr[ctx->commands.next - 1]; |
| 2964 | } else { |
| 2965 | return 0; |
| 2966 | } |
| 2967 | } |
| 2968 | |
| 2969 | static _sgl_command_t* _sgl_next_command(_sgl_context_t* ctx) { |
| 2970 | if (ctx->commands.next < ctx->commands.cap) { |
| 2971 | return &ctx->commands.ptr[ctx->commands.next++]; |
| 2972 | } else { |
| 2973 | ctx->error = SGL_ERROR_COMMANDS_FULL; |
| 2974 | return 0; |
| 2975 | } |
| 2976 | } |
| 2977 | |
| 2978 | static uint32_t _sgl_pack_rgbab(uint8_t r, uint8_t g, uint8_t b, uint8_t a) { |
| 2979 | return (uint32_t)(((uint32_t)a<<24)|((uint32_t)b<<16)|((uint32_t)g<<8)|r); |
| 2980 | } |
| 2981 | |
| 2982 | static float _sgl_clamp(float v, float lo, float hi) { |
| 2983 | if (v < lo) return lo; |
| 2984 | else if (v > hi) return hi; |
| 2985 | else return v; |
| 2986 | } |
| 2987 | |
| 2988 | static uint32_t _sgl_pack_rgbaf(float r, float g, float b, float a) { |
| 2989 | uint8_t r_u8 = (uint8_t) (_sgl_clamp(r, 0.0f, 1.0f) * 255.0f); |
| 2990 | uint8_t g_u8 = (uint8_t) (_sgl_clamp(g, 0.0f, 1.0f) * 255.0f); |
| 2991 | uint8_t b_u8 = (uint8_t) (_sgl_clamp(b, 0.0f, 1.0f) * 255.0f); |
| 2992 | uint8_t a_u8 = (uint8_t) (_sgl_clamp(a, 0.0f, 1.0f) * 255.0f); |
| 2993 | return _sgl_pack_rgbab(r_u8, g_u8, b_u8, a_u8); |
| 2994 | } |
| 2995 | |
| 2996 | static void _sgl_vtx(_sgl_context_t* ctx, float x, float y, float z, float u, float v, uint32_t rgba) { |
| 2997 | SOKOL_ASSERT(ctx->in_begin); |
| 2998 | _sgl_vertex_t* vtx; |
| 2999 | /* handle non-native primitive types */ |
| 3000 | if ((ctx->cur_prim_type == SGL_PRIMITIVETYPE_QUADS) && ((ctx->vtx_count & 3) == 3)) { |
| 3001 | /* for quads, before writing the last quad vertex, reuse |
| 3002 | the first and third vertex to start the second triangle in the quad |
| 3003 | */ |
| 3004 | vtx = _sgl_next_vertex(ctx); |
| 3005 | if (vtx) { *vtx = *(vtx - 3); } |
| 3006 | vtx = _sgl_next_vertex(ctx); |
| 3007 | if (vtx) { *vtx = *(vtx - 2); } |
| 3008 | } |
| 3009 | vtx = _sgl_next_vertex(ctx); |
| 3010 | if (vtx) { |
| 3011 | vtx->pos[0] = x; vtx->pos[1] = y; vtx->pos[2] = z; |
| 3012 | vtx->uv[0] = u; vtx->uv[1] = v; |
| 3013 | vtx->rgba = rgba; |
| 3014 | vtx->psize = ctx->point_size; |
| 3015 | } |
| 3016 | ctx->vtx_count++; |
| 3017 | } |
| 3018 | |
| 3019 | static void _sgl_identity(_sgl_matrix_t* m) { |
| 3020 | for (int c = 0; c < 4; c++) { |
| 3021 | for (int r = 0; r < 4; r++) { |
| 3022 | m->v[c][r] = (r == c) ? 1.0f : 0.0f; |
| 3023 | } |
| 3024 | } |
| 3025 | } |
| 3026 | |
| 3027 | static void _sgl_transpose(_sgl_matrix_t* dst, const _sgl_matrix_t* m) { |
| 3028 | SOKOL_ASSERT(dst != m); |
| 3029 | for (int c = 0; c < 4; c++) { |
| 3030 | for (int r = 0; r < 4; r++) { |
| 3031 | dst->v[r][c] = m->v[c][r]; |
| 3032 | } |
| 3033 | } |
| 3034 | } |
| 3035 | |
| 3036 | /* _sgl_rotate, _sgl_frustum, _sgl_ortho from MESA m_matric.c */ |
| 3037 | static void _sgl_matmul4(_sgl_matrix_t* p, const _sgl_matrix_t* a, const _sgl_matrix_t* b) { |
| 3038 | for (int r = 0; r < 4; r++) { |
| 3039 | float ai0=a->v[0][r], ai1=a->v[1][r], ai2=a->v[2][r], ai3=a->v[3][r]; |
| 3040 | p->v[0][r] = ai0*b->v[0][0] + ai1*b->v[0][1] + ai2*b->v[0][2] + ai3*b->v[0][3]; |
| 3041 | p->v[1][r] = ai0*b->v[1][0] + ai1*b->v[1][1] + ai2*b->v[1][2] + ai3*b->v[1][3]; |
| 3042 | p->v[2][r] = ai0*b->v[2][0] + ai1*b->v[2][1] + ai2*b->v[2][2] + ai3*b->v[2][3]; |
| 3043 | p->v[3][r] = ai0*b->v[3][0] + ai1*b->v[3][1] + ai2*b->v[3][2] + ai3*b->v[3][3]; |
| 3044 | } |
| 3045 | } |
| 3046 | |
| 3047 | static void _sgl_mul(_sgl_matrix_t* dst, const _sgl_matrix_t* m) { |
| 3048 | _sgl_matmul4(dst, dst, m); |
| 3049 | } |
| 3050 | |
| 3051 | static void _sgl_rotate(_sgl_matrix_t* dst, float a, float x, float y, float z) { |
| 3052 | |
| 3053 | float s = sinf(a); |
| 3054 | float c = cosf(a); |
| 3055 | |
| 3056 | float mag = sqrtf(x*x + y*y + z*z); |
| 3057 | if (mag < 1.0e-4F) { |
| 3058 | return; |
| 3059 | } |
| 3060 | x /= mag; |
| 3061 | y /= mag; |
| 3062 | z /= mag; |
| 3063 | float xx = x * x; |
| 3064 | float yy = y * y; |
| 3065 | float zz = z * z; |
| 3066 | float xy = x * y; |
| 3067 | float yz = y * z; |
| 3068 | float zx = z * x; |
| 3069 | float xs = x * s; |
| 3070 | float ys = y * s; |
| 3071 | float zs = z * s; |
| 3072 | float one_c = 1.0f - c; |
| 3073 | |
| 3074 | _sgl_matrix_t m; |
| 3075 | m.v[0][0] = (one_c * xx) + c; |
| 3076 | m.v[1][0] = (one_c * xy) - zs; |
| 3077 | m.v[2][0] = (one_c * zx) + ys; |
| 3078 | m.v[3][0] = 0.0f; |
| 3079 | m.v[0][1] = (one_c * xy) + zs; |
| 3080 | m.v[1][1] = (one_c * yy) + c; |
| 3081 | m.v[2][1] = (one_c * yz) - xs; |
| 3082 | m.v[3][1] = 0.0f; |
| 3083 | m.v[0][2] = (one_c * zx) - ys; |
| 3084 | m.v[1][2] = (one_c * yz) + xs; |
| 3085 | m.v[2][2] = (one_c * zz) + c; |
| 3086 | m.v[3][2] = 0.0f; |
| 3087 | m.v[0][3] = 0.0f; |
| 3088 | m.v[1][3] = 0.0f; |
| 3089 | m.v[2][3] = 0.0f; |
| 3090 | m.v[3][3] = 1.0f; |
| 3091 | _sgl_mul(dst, &m); |
| 3092 | } |
| 3093 | |
| 3094 | static void _sgl_scale(_sgl_matrix_t* dst, float x, float y, float z) { |
| 3095 | for (int r = 0; r < 4; r++) { |
| 3096 | dst->v[0][r] *= x; |
| 3097 | dst->v[1][r] *= y; |
| 3098 | dst->v[2][r] *= z; |
| 3099 | } |
| 3100 | } |
| 3101 | |
| 3102 | static void _sgl_translate(_sgl_matrix_t* dst, float x, float y, float z) { |
| 3103 | for (int r = 0; r < 4; r++) { |
| 3104 | dst->v[3][r] = dst->v[0][r]*x + dst->v[1][r]*y + dst->v[2][r]*z + dst->v[3][r]; |
| 3105 | } |
| 3106 | } |
| 3107 | |
| 3108 | static void _sgl_frustum(_sgl_matrix_t* dst, float left, float right, float bottom, float top, float znear, float zfar) { |
| 3109 | float x = (2.0f * znear) / (right - left); |
| 3110 | float y = (2.0f * znear) / (top - bottom); |
| 3111 | float a = (right + left) / (right - left); |
| 3112 | float b = (top + bottom) / (top - bottom); |
| 3113 | float c = -(zfar + znear) / (zfar - znear); |
| 3114 | float d = -(2.0f * zfar * znear) / (zfar - znear); |
| 3115 | _sgl_matrix_t m; |
| 3116 | m.v[0][0] = x; m.v[0][1] = 0.0f; m.v[0][2] = 0.0f; m.v[0][3] = 0.0f; |
| 3117 | m.v[1][0] = 0.0f; m.v[1][1] = y; m.v[1][2] = 0.0f; m.v[1][3] = 0.0f; |
| 3118 | m.v[2][0] = a; m.v[2][1] = b; m.v[2][2] = c; m.v[2][3] = -1.0f; |
| 3119 | m.v[3][0] = 0.0f; m.v[3][1] = 0.0f; m.v[3][2] = d; m.v[3][3] = 0.0f; |
| 3120 | _sgl_mul(dst, &m); |
| 3121 | } |
| 3122 | |
| 3123 | static void _sgl_ortho(_sgl_matrix_t* dst, float left, float right, float bottom, float top, float znear, float zfar) { |
| 3124 | _sgl_matrix_t m; |
| 3125 | m.v[0][0] = 2.0f / (right - left); |
| 3126 | m.v[1][0] = 0.0f; |
| 3127 | m.v[2][0] = 0.0f; |
| 3128 | m.v[3][0] = -(right + left) / (right - left); |
| 3129 | m.v[0][1] = 0.0f; |
| 3130 | m.v[1][1] = 2.0f / (top - bottom); |
| 3131 | m.v[2][1] = 0.0f; |
| 3132 | m.v[3][1] = -(top + bottom) / (top - bottom); |
| 3133 | m.v[0][2] = 0.0f; |
| 3134 | m.v[1][2] = 0.0f; |
| 3135 | m.v[2][2] = -2.0f / (zfar - znear); |
| 3136 | m.v[3][2] = -(zfar + znear) / (zfar - znear); |
| 3137 | m.v[0][3] = 0.0f; |
| 3138 | m.v[1][3] = 0.0f; |
| 3139 | m.v[2][3] = 0.0f; |
| 3140 | m.v[3][3] = 1.0f; |
| 3141 | |
| 3142 | _sgl_mul(dst, &m); |
| 3143 | } |
| 3144 | |
| 3145 | /* _sgl_perspective, _sgl_lookat from Regal project.c */ |
| 3146 | static void _sgl_perspective(_sgl_matrix_t* dst, float fovy, float aspect, float znear, float zfar) { |
| 3147 | float sine = sinf(fovy / 2.0f); |
| 3148 | float delta_z = zfar - znear; |
| 3149 | if ((delta_z == 0.0f) || (sine == 0.0f) || (aspect == 0.0f)) { |
| 3150 | return; |
| 3151 | } |
| 3152 | float cotan = cosf(fovy / 2.0f) / sine; |
| 3153 | _sgl_matrix_t m; |
| 3154 | _sgl_identity(&m); |
| 3155 | m.v[0][0] = cotan / aspect; |
| 3156 | m.v[1][1] = cotan; |
| 3157 | m.v[2][2] = -(zfar + znear) / delta_z; |
| 3158 | m.v[2][3] = -1.0f; |
| 3159 | m.v[3][2] = -2.0f * znear * zfar / delta_z; |
| 3160 | m.v[3][3] = 0.0f; |
| 3161 | _sgl_mul(dst, &m); |
| 3162 | } |
| 3163 | |
| 3164 | static void _sgl_normalize(float v[3]) { |
| 3165 | float r = sqrtf(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); |
| 3166 | if (r == 0.0f) { |
| 3167 | return; |
| 3168 | } |
| 3169 | v[0] /= r; |
| 3170 | v[1] /= r; |
| 3171 | v[2] /= r; |
| 3172 | } |
| 3173 | |
| 3174 | static void _sgl_cross(float v1[3], float v2[3], float res[3]) { |
| 3175 | res[0] = v1[1]*v2[2] - v1[2]*v2[1]; |
| 3176 | res[1] = v1[2]*v2[0] - v1[0]*v2[2]; |
| 3177 | res[2] = v1[0]*v2[1] - v1[1]*v2[0]; |
| 3178 | } |
| 3179 | |
| 3180 | static void _sgl_lookat(_sgl_matrix_t* dst, |
| 3181 | float eye_x, float eye_y, float eye_z, |
| 3182 | float center_x, float center_y, float center_z, |
| 3183 | float up_x, float up_y, float up_z) |
| 3184 | { |
| 3185 | float fwd[3], side[3], up[3]; |
| 3186 | |
| 3187 | fwd[0] = center_x - eye_x; fwd[1] = center_y - eye_y; fwd[2] = center_z - eye_z; |
| 3188 | up[0] = up_x; up[1] = up_y; up[2] = up_z; |
| 3189 | _sgl_normalize(fwd); |
| 3190 | _sgl_cross(fwd, up, side); |
| 3191 | _sgl_normalize(side); |
| 3192 | _sgl_cross(side, fwd, up); |
| 3193 | |
| 3194 | _sgl_matrix_t m; |
| 3195 | _sgl_identity(&m); |
| 3196 | m.v[0][0] = side[0]; |
| 3197 | m.v[1][0] = side[1]; |
| 3198 | m.v[2][0] = side[2]; |
| 3199 | m.v[0][1] = up[0]; |
| 3200 | m.v[1][1] = up[1]; |
| 3201 | m.v[2][1] = up[2]; |
| 3202 | m.v[0][2] = -fwd[0]; |
| 3203 | m.v[1][2] = -fwd[1]; |
| 3204 | m.v[2][2] = -fwd[2]; |
| 3205 | _sgl_mul(dst, &m); |
| 3206 | _sgl_translate(dst, -eye_x, -eye_y, -eye_z); |
| 3207 | } |
| 3208 | |
| 3209 | /* current top-of-stack projection matrix */ |
| 3210 | static _sgl_matrix_t* _sgl_matrix_projection(_sgl_context_t* ctx) { |
| 3211 | return &ctx->matrix_stack[SGL_MATRIXMODE_PROJECTION][ctx->matrix_tos[SGL_MATRIXMODE_PROJECTION]]; |
| 3212 | } |
| 3213 | |
| 3214 | /* get top-of-stack modelview matrix */ |
| 3215 | static _sgl_matrix_t* _sgl_matrix_modelview(_sgl_context_t* ctx) { |
| 3216 | return &ctx->matrix_stack[SGL_MATRIXMODE_MODELVIEW][ctx->matrix_tos[SGL_MATRIXMODE_MODELVIEW]]; |
| 3217 | } |
| 3218 | |
| 3219 | /* get top-of-stack texture matrix */ |
| 3220 | static _sgl_matrix_t* _sgl_matrix_texture(_sgl_context_t* ctx) { |
| 3221 | return &ctx->matrix_stack[SGL_MATRIXMODE_TEXTURE][ctx->matrix_tos[SGL_MATRIXMODE_TEXTURE]]; |
| 3222 | } |
| 3223 | |
| 3224 | /* get pointer to current top-of-stack of current matrix mode */ |
| 3225 | static _sgl_matrix_t* _sgl_matrix(_sgl_context_t* ctx) { |
| 3226 | return &ctx->matrix_stack[ctx->cur_matrix_mode][ctx->matrix_tos[ctx->cur_matrix_mode]]; |
| 3227 | } |
| 3228 | |
| 3229 | // return sg_context_desc_t with patched defaults |
| 3230 | static sgl_desc_t _sgl_desc_defaults(const sgl_desc_t* desc) { |
| 3231 | SOKOL_ASSERT((desc->allocator.alloc_fn && desc->allocator.free_fn) || (!desc->allocator.alloc_fn && !desc->allocator.free_fn)); |
| 3232 | sgl_desc_t res = *desc; |
| 3233 | res.max_vertices = _sgl_def(desc->max_vertices, _SGL_DEFAULT_MAX_VERTICES); |
| 3234 | res.max_commands = _sgl_def(desc->max_commands, _SGL_DEFAULT_MAX_COMMANDS); |
| 3235 | res.context_pool_size = _sgl_def(desc->context_pool_size, _SGL_DEFAULT_CONTEXT_POOL_SIZE); |
| 3236 | res.pipeline_pool_size = _sgl_def(desc->pipeline_pool_size, _SGL_DEFAULT_PIPELINE_POOL_SIZE); |
| 3237 | res.face_winding = _sgl_def(desc->face_winding, SG_FACEWINDING_CCW); |
| 3238 | return res; |
| 3239 | } |
| 3240 | |
| 3241 | // create resources which are shared between all contexts |
| 3242 | static void _sgl_setup_common(void) { |
| 3243 | sg_push_debug_group("sokol-gl"); |
| 3244 | |
| 3245 | uint32_t pixels[64]; |
| 3246 | for (int i = 0; i < 64; i++) { |
| 3247 | pixels[i] = 0xFFFFFFFF; |
| 3248 | } |
| 3249 | sg_image_desc img_desc; |
| 3250 | _sgl_clear(&img_desc, sizeof(img_desc)); |
| 3251 | img_desc.type = SG_IMAGETYPE_2D; |
| 3252 | img_desc.width = 8; |
| 3253 | img_desc.height = 8; |
| 3254 | img_desc.num_mipmaps = 1; |
| 3255 | img_desc.pixel_format = SG_PIXELFORMAT_RGBA8; |
| 3256 | img_desc.data.subimage[0][0] = SG_RANGE(pixels); |
| 3257 | img_desc.label = "sgl-default-texture"; |
| 3258 | _sgl.def_img = sg_make_image(&img_desc); |
| 3259 | SOKOL_ASSERT(SG_INVALID_ID != _sgl.def_img.id); |
| 3260 | |
| 3261 | sg_sampler_desc smp_desc; |
| 3262 | _sgl_clear(&smp_desc, sizeof(smp_desc)); |
| 3263 | smp_desc.min_filter = SG_FILTER_NEAREST; |
| 3264 | smp_desc.mag_filter = SG_FILTER_NEAREST; |
| 3265 | _sgl.def_smp = sg_make_sampler(&smp_desc); |
| 3266 | SOKOL_ASSERT(SG_INVALID_ID != _sgl.def_smp.id); |
| 3267 | |
| 3268 | // one shader for all contexts |
| 3269 | sg_shader_desc shd_desc; |
| 3270 | _sgl_clear(&shd_desc, sizeof(shd_desc)); |
| 3271 | shd_desc.attrs[0].name = "position"; |
| 3272 | shd_desc.attrs[1].name = "texcoord0"; |
| 3273 | shd_desc.attrs[2].name = "color0"; |
| 3274 | shd_desc.attrs[3].name = "psize"; |
| 3275 | shd_desc.attrs[0].sem_name = "TEXCOORD"; |
| 3276 | shd_desc.attrs[0].sem_index = 0; |
| 3277 | shd_desc.attrs[1].sem_name = "TEXCOORD"; |
| 3278 | shd_desc.attrs[1].sem_index = 1; |
| 3279 | shd_desc.attrs[2].sem_name = "TEXCOORD"; |
| 3280 | shd_desc.attrs[2].sem_index = 2; |
| 3281 | shd_desc.attrs[3].sem_name = "TEXCOORD"; |
| 3282 | shd_desc.attrs[3].sem_index = 3; |
| 3283 | sg_shader_uniform_block_desc* ub = &shd_desc.vs.uniform_blocks[0]; |
| 3284 | ub->size = sizeof(_sgl_uniform_t); |
| 3285 | ub->uniforms[0].name = "vs_params"; |
| 3286 | ub->uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; |
| 3287 | ub->uniforms[0].array_count = 8; |
| 3288 | shd_desc.fs.images[0].used = true; |
| 3289 | shd_desc.fs.images[0].image_type = SG_IMAGETYPE_2D; |
| 3290 | shd_desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; |
| 3291 | shd_desc.fs.samplers[0].used = true; |
| 3292 | shd_desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; |
| 3293 | shd_desc.fs.image_sampler_pairs[0].used = true; |
| 3294 | shd_desc.fs.image_sampler_pairs[0].image_slot = 0; |
| 3295 | shd_desc.fs.image_sampler_pairs[0].sampler_slot = 0; |
| 3296 | shd_desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp"; |
| 3297 | shd_desc.label = "sgl-shader"; |
| 3298 | #if defined(SOKOL_GLCORE) |
| 3299 | shd_desc.vs.source = (const char*)_sgl_vs_source_glsl410; |
| 3300 | shd_desc.fs.source = (const char*)_sgl_fs_source_glsl410; |
| 3301 | #elif defined(SOKOL_GLES3) |
| 3302 | shd_desc.vs.source = (const char*)_sgl_vs_source_glsl300es; |
| 3303 | shd_desc.fs.source = (const char*)_sgl_fs_source_glsl300es; |
| 3304 | #elif defined(SOKOL_METAL) |
| 3305 | shd_desc.vs.entry = "main0"; |
| 3306 | shd_desc.fs.entry = "main0"; |
| 3307 | switch (sg_query_backend()) { |
| 3308 | case SG_BACKEND_METAL_MACOS: |
| 3309 | shd_desc.vs.bytecode = SG_RANGE(_sgl_vs_bytecode_metal_macos); |
| 3310 | shd_desc.fs.bytecode = SG_RANGE(_sgl_fs_bytecode_metal_macos); |
| 3311 | break; |
| 3312 | case SG_BACKEND_METAL_IOS: |
| 3313 | shd_desc.vs.bytecode = SG_RANGE(_sgl_vs_bytecode_metal_ios); |
| 3314 | shd_desc.fs.bytecode = SG_RANGE(_sgl_fs_bytecode_metal_ios); |
| 3315 | break; |
| 3316 | default: |
| 3317 | shd_desc.vs.source = (const char*)_sgl_vs_source_metal_sim; |
| 3318 | shd_desc.fs.source = (const char*)_sgl_fs_source_metal_sim; |
| 3319 | break; |
| 3320 | } |
| 3321 | #elif defined(SOKOL_D3D11) |
| 3322 | shd_desc.vs.bytecode = SG_RANGE(_sgl_vs_bytecode_hlsl4); |
| 3323 | shd_desc.fs.bytecode = SG_RANGE(_sgl_fs_bytecode_hlsl4); |
| 3324 | #elif defined(SOKOL_WGPU) |
| 3325 | shd_desc.vs.source = (const char*)_sgl_vs_source_wgsl; |
| 3326 | shd_desc.fs.source = (const char*)_sgl_fs_source_wgsl; |
| 3327 | #else |
| 3328 | shd_desc.vs.source = _sgl_vs_source_dummy; |
| 3329 | shd_desc.fs.source = _sgl_fs_source_dummy; |
| 3330 | #endif |
| 3331 | _sgl.shd = sg_make_shader(&shd_desc); |
| 3332 | SOKOL_ASSERT(SG_INVALID_ID != _sgl.shd.id); |
| 3333 | sg_pop_debug_group(); |
| 3334 | } |
| 3335 | |
| 3336 | // discard resources which are shared between all contexts |
| 3337 | static void _sgl_discard_common(void) { |
| 3338 | sg_push_debug_group("sokol-gl"); |
| 3339 | sg_destroy_image(_sgl.def_img); |
| 3340 | sg_destroy_sampler(_sgl.def_smp); |
| 3341 | sg_destroy_shader(_sgl.shd); |
| 3342 | sg_pop_debug_group(); |
| 3343 | } |
| 3344 | |
| 3345 | static bool _sgl_is_default_context(sgl_context ctx_id) { |
| 3346 | return ctx_id.id == SGL_DEFAULT_CONTEXT.id; |
| 3347 | } |
| 3348 | |
| 3349 | static void _sgl_draw(_sgl_context_t* ctx, int layer_id) { |
| 3350 | SOKOL_ASSERT(ctx); |
| 3351 | if ((ctx->error == SGL_NO_ERROR) && (ctx->vertices.next > 0) && (ctx->commands.next > 0)) { |
| 3352 | sg_push_debug_group("sokol-gl"); |
| 3353 | |
| 3354 | uint32_t cur_pip_id = SG_INVALID_ID; |
| 3355 | uint32_t cur_img_id = SG_INVALID_ID; |
| 3356 | uint32_t cur_smp_id = SG_INVALID_ID; |
| 3357 | int cur_uniform_index = -1; |
| 3358 | |
| 3359 | if (ctx->update_frame_id != ctx->frame_id) { |
| 3360 | ctx->update_frame_id = ctx->frame_id; |
| 3361 | const sg_range range = { ctx->vertices.ptr, (size_t)ctx->vertices.next * sizeof(_sgl_vertex_t) }; |
| 3362 | sg_update_buffer(ctx->vbuf, &range); |
| 3363 | } |
| 3364 | |
| 3365 | for (int i = 0; i < ctx->commands.next; i++) { |
| 3366 | const _sgl_command_t* cmd = &ctx->commands.ptr[i]; |
| 3367 | if (cmd->layer_id != layer_id) { |
| 3368 | continue; |
| 3369 | } |
| 3370 | switch (cmd->cmd) { |
| 3371 | case SGL_COMMAND_VIEWPORT: |
| 3372 | { |
| 3373 | const _sgl_viewport_args_t* args = &cmd->args.viewport; |
| 3374 | sg_apply_viewport(args->x, args->y, args->w, args->h, args->origin_top_left); |
| 3375 | } |
| 3376 | break; |
| 3377 | case SGL_COMMAND_SCISSOR_RECT: |
| 3378 | { |
| 3379 | const _sgl_scissor_rect_args_t* args = &cmd->args.scissor_rect; |
| 3380 | sg_apply_scissor_rect(args->x, args->y, args->w, args->h, args->origin_top_left); |
| 3381 | } |
| 3382 | break; |
| 3383 | case SGL_COMMAND_DRAW: |
| 3384 | { |
| 3385 | const _sgl_draw_args_t* args = &cmd->args.draw; |
| 3386 | if (args->pip.id != cur_pip_id) { |
| 3387 | sg_apply_pipeline(args->pip); |
| 3388 | cur_pip_id = args->pip.id; |
| 3389 | /* when pipeline changes, also need to re-apply uniforms and bindings */ |
| 3390 | cur_img_id = SG_INVALID_ID; |
| 3391 | cur_smp_id = SG_INVALID_ID; |
| 3392 | cur_uniform_index = -1; |
| 3393 | } |
| 3394 | if ((cur_img_id != args->img.id) || (cur_smp_id != args->smp.id)) { |
| 3395 | ctx->bind.fs.images[0] = args->img; |
| 3396 | ctx->bind.fs.samplers[0] = args->smp; |
| 3397 | sg_apply_bindings(&ctx->bind); |
| 3398 | cur_img_id = args->img.id; |
| 3399 | cur_smp_id = args->smp.id; |
| 3400 | } |
| 3401 | if (cur_uniform_index != args->uniform_index) { |
| 3402 | const sg_range ub_range = { &ctx->uniforms.ptr[args->uniform_index], sizeof(_sgl_uniform_t) }; |
| 3403 | sg_apply_uniforms(SG_SHADERSTAGE_VS, 0, &ub_range); |
| 3404 | cur_uniform_index = args->uniform_index; |
| 3405 | } |
| 3406 | /* FIXME: what if number of vertices doesn't match the primitive type? */ |
| 3407 | if (args->num_vertices > 0) { |
| 3408 | sg_draw(args->base_vertex, args->num_vertices, 1); |
| 3409 | } |
| 3410 | } |
| 3411 | break; |
| 3412 | } |
| 3413 | } |
| 3414 | sg_pop_debug_group(); |
| 3415 | } |
| 3416 | } |
| 3417 | |
| 3418 | static sgl_context_desc_t _sgl_as_context_desc(const sgl_desc_t* desc) { |
| 3419 | sgl_context_desc_t ctx_desc; |
| 3420 | _sgl_clear(&ctx_desc, sizeof(ctx_desc)); |
| 3421 | ctx_desc.max_vertices = desc->max_vertices; |
| 3422 | ctx_desc.max_commands = desc->max_commands; |
| 3423 | ctx_desc.color_format = desc->color_format; |
| 3424 | ctx_desc.depth_format = desc->depth_format; |
| 3425 | ctx_desc.sample_count = desc->sample_count; |
| 3426 | return ctx_desc; |
| 3427 | } |
| 3428 | |
| 3429 | // ██████ ██ ██ ██████ ██ ██ ██████ |
| 3430 | // ██ ██ ██ ██ ██ ██ ██ ██ ██ |
| 3431 | // ██████ ██ ██ ██████ ██ ██ ██ |
| 3432 | // ██ ██ ██ ██ ██ ██ ██ ██ |
| 3433 | // ██ ██████ ██████ ███████ ██ ██████ |
| 3434 | // |
| 3435 | // >>public |
| 3436 | SOKOL_API_IMPL void sgl_setup(const sgl_desc_t* desc) { |
| 3437 | SOKOL_ASSERT(desc); |
| 3438 | _sgl_clear(&_sgl, sizeof(_sgl)); |
| 3439 | _sgl.init_cookie = _SGL_INIT_COOKIE; |
| 3440 | _sgl.desc = _sgl_desc_defaults(desc); |
| 3441 | _sgl_setup_pipeline_pool(_sgl.desc.pipeline_pool_size); |
| 3442 | _sgl_setup_context_pool(_sgl.desc.context_pool_size); |
| 3443 | _sgl_setup_common(); |
| 3444 | const sgl_context_desc_t ctx_desc = _sgl_as_context_desc(&_sgl.desc); |
| 3445 | _sgl.def_ctx_id = sgl_make_context(&ctx_desc); |
| 3446 | SOKOL_ASSERT(SGL_DEFAULT_CONTEXT.id == _sgl.def_ctx_id.id); |
| 3447 | sgl_set_context(_sgl.def_ctx_id); |
| 3448 | } |
| 3449 | |
| 3450 | SOKOL_API_IMPL void sgl_shutdown(void) { |
| 3451 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3452 | // contexts own a pipeline, so destroy contexts before pipelines |
| 3453 | for (int i = 0; i < _sgl.context_pool.pool.size; i++) { |
| 3454 | _sgl_context_t* ctx = &_sgl.context_pool.contexts[i]; |
| 3455 | _sgl_destroy_context(_sgl_make_ctx_id(ctx->slot.id)); |
| 3456 | } |
| 3457 | for (int i = 0; i < _sgl.pip_pool.pool.size; i++) { |
| 3458 | _sgl_pipeline_t* pip = &_sgl.pip_pool.pips[i]; |
| 3459 | _sgl_destroy_pipeline(_sgl_make_pip_id(pip->slot.id)); |
| 3460 | } |
| 3461 | _sgl_discard_context_pool(); |
| 3462 | _sgl_discard_pipeline_pool(); |
| 3463 | _sgl_discard_common(); |
| 3464 | _sgl.init_cookie = 0; |
| 3465 | } |
| 3466 | |
| 3467 | SOKOL_API_IMPL sgl_error_t sgl_error(void) { |
| 3468 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3469 | if (ctx) { |
| 3470 | return ctx->error; |
| 3471 | } else { |
| 3472 | return SGL_ERROR_NO_CONTEXT; |
| 3473 | } |
| 3474 | } |
| 3475 | |
| 3476 | SOKOL_API_IMPL sgl_error_t sgl_context_error(sgl_context ctx_id) { |
| 3477 | const _sgl_context_t* ctx = _sgl_lookup_context(ctx_id.id); |
| 3478 | if (ctx) { |
| 3479 | return ctx->error; |
| 3480 | } else { |
| 3481 | return SGL_ERROR_NO_CONTEXT; |
| 3482 | } |
| 3483 | } |
| 3484 | |
| 3485 | SOKOL_API_IMPL float sgl_rad(float deg) { |
| 3486 | return (deg * (float)M_PI) / 180.0f; |
| 3487 | } |
| 3488 | |
| 3489 | SOKOL_API_IMPL float sgl_deg(float rad) { |
| 3490 | return (rad * 180.0f) / (float)M_PI; |
| 3491 | } |
| 3492 | |
| 3493 | SOKOL_API_IMPL sgl_context sgl_make_context(const sgl_context_desc_t* desc) { |
| 3494 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3495 | return _sgl_make_context(desc); |
| 3496 | } |
| 3497 | |
| 3498 | SOKOL_API_IMPL void sgl_destroy_context(sgl_context ctx_id) { |
| 3499 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3500 | if (_sgl_is_default_context(ctx_id)) { |
| 3501 | _SGL_WARN(CANNOT_DESTROY_DEFAULT_CONTEXT); |
| 3502 | return; |
| 3503 | } |
| 3504 | _sgl_destroy_context(ctx_id); |
| 3505 | // re-validate the current context pointer (this will return a nullptr |
| 3506 | // if we just destroyed the current context) |
| 3507 | _sgl.cur_ctx = _sgl_lookup_context(_sgl.cur_ctx_id.id); |
| 3508 | } |
| 3509 | |
| 3510 | SOKOL_API_IMPL void sgl_set_context(sgl_context ctx_id) { |
| 3511 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3512 | if (_sgl_is_default_context(ctx_id)) { |
| 3513 | _sgl.cur_ctx_id = _sgl.def_ctx_id; |
| 3514 | } else { |
| 3515 | _sgl.cur_ctx_id = ctx_id; |
| 3516 | } |
| 3517 | // this will return null if the handle isn't valid |
| 3518 | _sgl.cur_ctx = _sgl_lookup_context(_sgl.cur_ctx_id.id); |
| 3519 | } |
| 3520 | |
| 3521 | SOKOL_API_IMPL sgl_context sgl_get_context(void) { |
| 3522 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3523 | return _sgl.cur_ctx_id; |
| 3524 | } |
| 3525 | |
| 3526 | SOKOL_API_IMPL sgl_context sgl_default_context(void) { |
| 3527 | return SGL_DEFAULT_CONTEXT; |
| 3528 | } |
| 3529 | |
| 3530 | SOKOL_API_IMPL sgl_pipeline sgl_make_pipeline(const sg_pipeline_desc* desc) { |
| 3531 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3532 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3533 | if (ctx) { |
| 3534 | return _sgl_make_pipeline(desc, &ctx->desc); |
| 3535 | } else { |
| 3536 | return _sgl_make_pip_id(SG_INVALID_ID); |
| 3537 | } |
| 3538 | } |
| 3539 | |
| 3540 | SOKOL_API_IMPL sgl_pipeline sgl_context_make_pipeline(sgl_context ctx_id, const sg_pipeline_desc* desc) { |
| 3541 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3542 | const _sgl_context_t* ctx = _sgl_lookup_context(ctx_id.id); |
| 3543 | if (ctx) { |
| 3544 | return _sgl_make_pipeline(desc, &ctx->desc); |
| 3545 | } else { |
| 3546 | return _sgl_make_pip_id(SG_INVALID_ID); |
| 3547 | } |
| 3548 | } |
| 3549 | |
| 3550 | SOKOL_API_IMPL void sgl_destroy_pipeline(sgl_pipeline pip_id) { |
| 3551 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3552 | _sgl_destroy_pipeline(pip_id); |
| 3553 | } |
| 3554 | |
| 3555 | SOKOL_API_IMPL void sgl_load_pipeline(sgl_pipeline pip_id) { |
| 3556 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3557 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3558 | if (!ctx) { |
| 3559 | return; |
| 3560 | } |
| 3561 | SOKOL_ASSERT((ctx->pip_tos >= 0) && (ctx->pip_tos < _SGL_MAX_STACK_DEPTH)); |
| 3562 | ctx->pip_stack[ctx->pip_tos] = pip_id; |
| 3563 | } |
| 3564 | |
| 3565 | SOKOL_API_IMPL void sgl_load_default_pipeline(void) { |
| 3566 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3567 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3568 | if (!ctx) { |
| 3569 | return; |
| 3570 | } |
| 3571 | SOKOL_ASSERT((ctx->pip_tos >= 0) && (ctx->pip_tos < _SGL_MAX_STACK_DEPTH)); |
| 3572 | ctx->pip_stack[ctx->pip_tos] = ctx->def_pip; |
| 3573 | } |
| 3574 | |
| 3575 | SOKOL_API_IMPL void sgl_push_pipeline(void) { |
| 3576 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3577 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3578 | if (!ctx) { |
| 3579 | return; |
| 3580 | } |
| 3581 | if (ctx->pip_tos < (_SGL_MAX_STACK_DEPTH - 1)) { |
| 3582 | ctx->pip_tos++; |
| 3583 | ctx->pip_stack[ctx->pip_tos] = ctx->pip_stack[ctx->pip_tos-1]; |
| 3584 | } else { |
| 3585 | ctx->error = SGL_ERROR_STACK_OVERFLOW; |
| 3586 | } |
| 3587 | } |
| 3588 | |
| 3589 | SOKOL_API_IMPL void sgl_pop_pipeline(void) { |
| 3590 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3591 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3592 | if (!ctx) { |
| 3593 | return; |
| 3594 | } |
| 3595 | if (ctx->pip_tos > 0) { |
| 3596 | ctx->pip_tos--; |
| 3597 | } else { |
| 3598 | ctx->error = SGL_ERROR_STACK_UNDERFLOW; |
| 3599 | } |
| 3600 | } |
| 3601 | |
| 3602 | SOKOL_API_IMPL void sgl_defaults(void) { |
| 3603 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3604 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3605 | if (!ctx) { |
| 3606 | return; |
| 3607 | } |
| 3608 | SOKOL_ASSERT(!ctx->in_begin); |
| 3609 | ctx->u = 0.0f; ctx->v = 0.0f; |
| 3610 | ctx->rgba = 0xFFFFFFFF; |
| 3611 | ctx->point_size = 1.0f; |
| 3612 | ctx->texturing_enabled = false; |
| 3613 | ctx->cur_img = _sgl.def_img; |
| 3614 | ctx->cur_smp = _sgl.def_smp; |
| 3615 | sgl_load_default_pipeline(); |
| 3616 | _sgl_identity(_sgl_matrix_texture(ctx)); |
| 3617 | _sgl_identity(_sgl_matrix_modelview(ctx)); |
| 3618 | _sgl_identity(_sgl_matrix_projection(ctx)); |
| 3619 | ctx->cur_matrix_mode = SGL_MATRIXMODE_MODELVIEW; |
| 3620 | ctx->matrix_dirty = true; |
| 3621 | } |
| 3622 | |
| 3623 | SOKOL_API_IMPL void sgl_layer(int layer_id) { |
| 3624 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3625 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3626 | if (!ctx) { |
| 3627 | return; |
| 3628 | } |
| 3629 | SOKOL_ASSERT(!ctx->in_begin); |
| 3630 | ctx->layer_id = layer_id; |
| 3631 | } |
| 3632 | |
| 3633 | SOKOL_API_IMPL void sgl_viewport(int x, int y, int w, int h, bool origin_top_left) { |
| 3634 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3635 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3636 | if (!ctx) { |
| 3637 | return; |
| 3638 | } |
| 3639 | SOKOL_ASSERT(!ctx->in_begin); |
| 3640 | _sgl_command_t* cmd = _sgl_next_command(ctx); |
| 3641 | if (cmd) { |
| 3642 | cmd->cmd = SGL_COMMAND_VIEWPORT; |
| 3643 | cmd->layer_id = ctx->layer_id; |
| 3644 | cmd->args.viewport.x = x; |
| 3645 | cmd->args.viewport.y = y; |
| 3646 | cmd->args.viewport.w = w; |
| 3647 | cmd->args.viewport.h = h; |
| 3648 | cmd->args.viewport.origin_top_left = origin_top_left; |
| 3649 | } |
| 3650 | } |
| 3651 | |
| 3652 | SOKOL_API_IMPL void sgl_viewportf(float x, float y, float w, float h, bool origin_top_left) { |
| 3653 | sgl_viewport((int)x, (int)y, (int)w, (int)h, origin_top_left); |
| 3654 | } |
| 3655 | |
| 3656 | SOKOL_API_IMPL void sgl_scissor_rect(int x, int y, int w, int h, bool origin_top_left) { |
| 3657 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3658 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3659 | if (!ctx) { |
| 3660 | return; |
| 3661 | } |
| 3662 | SOKOL_ASSERT(!ctx->in_begin); |
| 3663 | _sgl_command_t* cmd = _sgl_next_command(ctx); |
| 3664 | if (cmd) { |
| 3665 | cmd->cmd = SGL_COMMAND_SCISSOR_RECT; |
| 3666 | cmd->layer_id = ctx->layer_id; |
| 3667 | cmd->args.scissor_rect.x = x; |
| 3668 | cmd->args.scissor_rect.y = y; |
| 3669 | cmd->args.scissor_rect.w = w; |
| 3670 | cmd->args.scissor_rect.h = h; |
| 3671 | cmd->args.scissor_rect.origin_top_left = origin_top_left; |
| 3672 | } |
| 3673 | } |
| 3674 | |
| 3675 | SOKOL_API_IMPL void sgl_scissor_rectf(float x, float y, float w, float h, bool origin_top_left) { |
| 3676 | sgl_scissor_rect((int)x, (int)y, (int)w, (int)h, origin_top_left); |
| 3677 | } |
| 3678 | |
| 3679 | SOKOL_API_IMPL void sgl_enable_texture(void) { |
| 3680 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3681 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3682 | if (!ctx) { |
| 3683 | return; |
| 3684 | } |
| 3685 | SOKOL_ASSERT(!ctx->in_begin); |
| 3686 | ctx->texturing_enabled = true; |
| 3687 | } |
| 3688 | |
| 3689 | SOKOL_API_IMPL void sgl_disable_texture(void) { |
| 3690 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3691 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3692 | if (!ctx) { |
| 3693 | return; |
| 3694 | } |
| 3695 | SOKOL_ASSERT(!ctx->in_begin); |
| 3696 | ctx->texturing_enabled = false; |
| 3697 | } |
| 3698 | |
| 3699 | SOKOL_API_IMPL void sgl_texture(sg_image img, sg_sampler smp) { |
| 3700 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3701 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3702 | if (!ctx) { |
| 3703 | return; |
| 3704 | } |
| 3705 | SOKOL_ASSERT(!ctx->in_begin); |
| 3706 | if (SG_INVALID_ID != img.id) { |
| 3707 | ctx->cur_img = img; |
| 3708 | } else { |
| 3709 | ctx->cur_img = _sgl.def_img; |
| 3710 | } |
| 3711 | if (SG_INVALID_ID != smp.id) { |
| 3712 | ctx->cur_smp = smp; |
| 3713 | } else { |
| 3714 | ctx->cur_smp = _sgl.def_smp; |
| 3715 | } |
| 3716 | } |
| 3717 | |
| 3718 | SOKOL_API_IMPL void sgl_begin_points(void) { |
| 3719 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3720 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3721 | if (!ctx) { |
| 3722 | return; |
| 3723 | } |
| 3724 | SOKOL_ASSERT(!ctx->in_begin); |
| 3725 | _sgl_begin(ctx, SGL_PRIMITIVETYPE_POINTS); |
| 3726 | } |
| 3727 | |
| 3728 | SOKOL_API_IMPL void sgl_begin_lines(void) { |
| 3729 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3730 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3731 | if (!ctx) { |
| 3732 | return; |
| 3733 | } |
| 3734 | SOKOL_ASSERT(!ctx->in_begin); |
| 3735 | _sgl_begin(ctx, SGL_PRIMITIVETYPE_LINES); |
| 3736 | } |
| 3737 | |
| 3738 | SOKOL_API_IMPL void sgl_begin_line_strip(void) { |
| 3739 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3740 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3741 | if (!ctx) { |
| 3742 | return; |
| 3743 | } |
| 3744 | SOKOL_ASSERT(!ctx->in_begin); |
| 3745 | _sgl_begin(ctx, SGL_PRIMITIVETYPE_LINE_STRIP); |
| 3746 | } |
| 3747 | |
| 3748 | SOKOL_API_IMPL void sgl_begin_triangles(void) { |
| 3749 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3750 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3751 | if (!ctx) { |
| 3752 | return; |
| 3753 | } |
| 3754 | SOKOL_ASSERT(!ctx->in_begin); |
| 3755 | _sgl_begin(ctx, SGL_PRIMITIVETYPE_TRIANGLES); |
| 3756 | } |
| 3757 | |
| 3758 | SOKOL_API_IMPL void sgl_begin_triangle_strip(void) { |
| 3759 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3760 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3761 | if (!ctx) { |
| 3762 | return; |
| 3763 | } |
| 3764 | SOKOL_ASSERT(!ctx->in_begin); |
| 3765 | _sgl_begin(ctx, SGL_PRIMITIVETYPE_TRIANGLE_STRIP); |
| 3766 | } |
| 3767 | |
| 3768 | SOKOL_API_IMPL void sgl_begin_quads(void) { |
| 3769 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3770 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3771 | if (!ctx) { |
| 3772 | return; |
| 3773 | } |
| 3774 | SOKOL_ASSERT(!ctx->in_begin); |
| 3775 | _sgl_begin(ctx, SGL_PRIMITIVETYPE_QUADS); |
| 3776 | } |
| 3777 | |
| 3778 | SOKOL_API_IMPL void sgl_end(void) { |
| 3779 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 3780 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3781 | if (!ctx) { |
| 3782 | return; |
| 3783 | } |
| 3784 | SOKOL_ASSERT(ctx->in_begin); |
| 3785 | SOKOL_ASSERT(ctx->vertices.next >= ctx->base_vertex); |
| 3786 | ctx->in_begin = false; |
| 3787 | bool matrix_dirty = ctx->matrix_dirty; |
| 3788 | if (matrix_dirty) { |
| 3789 | ctx->matrix_dirty = false; |
| 3790 | _sgl_uniform_t* uni = _sgl_next_uniform(ctx); |
| 3791 | if (uni) { |
| 3792 | _sgl_matmul4(&uni->mvp, _sgl_matrix_projection(ctx), _sgl_matrix_modelview(ctx)); |
| 3793 | uni->tm = *_sgl_matrix_texture(ctx); |
| 3794 | } |
| 3795 | } |
| 3796 | // check if command can be merged with current command |
| 3797 | sg_pipeline pip = _sgl_get_pipeline(ctx->pip_stack[ctx->pip_tos], ctx->cur_prim_type); |
| 3798 | sg_image img = ctx->texturing_enabled ? ctx->cur_img : _sgl.def_img; |
| 3799 | sg_sampler smp = ctx->texturing_enabled ? ctx->cur_smp : _sgl.def_smp; |
| 3800 | _sgl_command_t* cur_cmd = _sgl_cur_command(ctx); |
| 3801 | bool merge_cmd = false; |
| 3802 | if (cur_cmd) { |
| 3803 | if ((cur_cmd->cmd == SGL_COMMAND_DRAW) && |
| 3804 | (cur_cmd->layer_id == ctx->layer_id) && |
| 3805 | (ctx->cur_prim_type != SGL_PRIMITIVETYPE_LINE_STRIP) && |
| 3806 | (ctx->cur_prim_type != SGL_PRIMITIVETYPE_TRIANGLE_STRIP) && |
| 3807 | !matrix_dirty && |
| 3808 | (cur_cmd->args.draw.img.id == img.id) && |
| 3809 | (cur_cmd->args.draw.smp.id == smp.id) && |
| 3810 | (cur_cmd->args.draw.pip.id == pip.id)) |
| 3811 | { |
| 3812 | merge_cmd = true; |
| 3813 | } |
| 3814 | } |
| 3815 | if (merge_cmd) { |
| 3816 | // draw command can be merged with the previous command |
| 3817 | cur_cmd->args.draw.num_vertices += ctx->vertices.next - ctx->base_vertex; |
| 3818 | } else { |
| 3819 | // append a new draw command |
| 3820 | _sgl_command_t* cmd = _sgl_next_command(ctx); |
| 3821 | if (cmd) { |
| 3822 | SOKOL_ASSERT(ctx->uniforms.next > 0); |
| 3823 | cmd->cmd = SGL_COMMAND_DRAW; |
| 3824 | cmd->layer_id = ctx->layer_id; |
| 3825 | cmd->args.draw.img = img; |
| 3826 | cmd->args.draw.smp = smp; |
| 3827 | cmd->args.draw.pip = _sgl_get_pipeline(ctx->pip_stack[ctx->pip_tos], ctx->cur_prim_type); |
| 3828 | cmd->args.draw.base_vertex = ctx->base_vertex; |
| 3829 | cmd->args.draw.num_vertices = ctx->vertices.next - ctx->base_vertex; |
| 3830 | cmd->args.draw.uniform_index = ctx->uniforms.next - 1; |
| 3831 | } |
| 3832 | } |
| 3833 | } |
| 3834 | |
| 3835 | SOKOL_API_IMPL void sgl_point_size(float s) { |
| 3836 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3837 | if (ctx) { |
| 3838 | ctx->point_size = s; |
| 3839 | } |
| 3840 | } |
| 3841 | |
| 3842 | SOKOL_API_IMPL void sgl_t2f(float u, float v) { |
| 3843 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3844 | if (ctx) { |
| 3845 | ctx->u = u; |
| 3846 | ctx->v = v; |
| 3847 | } |
| 3848 | } |
| 3849 | |
| 3850 | SOKOL_API_IMPL void sgl_c3f(float r, float g, float b) { |
| 3851 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3852 | if (ctx) { |
| 3853 | ctx->rgba = _sgl_pack_rgbaf(r, g, b, 1.0f); |
| 3854 | } |
| 3855 | } |
| 3856 | |
| 3857 | SOKOL_API_IMPL void sgl_c4f(float r, float g, float b, float a) { |
| 3858 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3859 | if (ctx) { |
| 3860 | ctx->rgba = _sgl_pack_rgbaf(r, g, b, a); |
| 3861 | } |
| 3862 | } |
| 3863 | |
| 3864 | SOKOL_API_IMPL void sgl_c3b(uint8_t r, uint8_t g, uint8_t b) { |
| 3865 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3866 | if (ctx) { |
| 3867 | ctx->rgba = _sgl_pack_rgbab(r, g, b, 255); |
| 3868 | } |
| 3869 | } |
| 3870 | |
| 3871 | SOKOL_API_IMPL void sgl_c4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a) { |
| 3872 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3873 | if (ctx) { |
| 3874 | ctx->rgba = _sgl_pack_rgbab(r, g, b, a); |
| 3875 | } |
| 3876 | } |
| 3877 | |
| 3878 | SOKOL_API_IMPL void sgl_c1i(uint32_t rgba) { |
| 3879 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3880 | if (ctx) { |
| 3881 | ctx->rgba = rgba; |
| 3882 | } |
| 3883 | } |
| 3884 | |
| 3885 | SOKOL_API_IMPL void sgl_v2f(float x, float y) { |
| 3886 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3887 | if (ctx) { |
| 3888 | _sgl_vtx(ctx, x, y, 0.0f, ctx->u, ctx->v, ctx->rgba); |
| 3889 | } |
| 3890 | } |
| 3891 | |
| 3892 | SOKOL_API_IMPL void sgl_v3f(float x, float y, float z) { |
| 3893 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3894 | if (ctx) { |
| 3895 | _sgl_vtx(ctx, x, y, z, ctx->u, ctx->v, ctx->rgba); |
| 3896 | } |
| 3897 | } |
| 3898 | |
| 3899 | SOKOL_API_IMPL void sgl_v2f_t2f(float x, float y, float u, float v) { |
| 3900 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3901 | if (ctx) { |
| 3902 | _sgl_vtx(ctx, x, y, 0.0f, u, v, ctx->rgba); |
| 3903 | } |
| 3904 | } |
| 3905 | |
| 3906 | SOKOL_API_IMPL void sgl_v3f_t2f(float x, float y, float z, float u, float v) { |
| 3907 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3908 | if (ctx) { |
| 3909 | _sgl_vtx(ctx, x, y, z, u, v, ctx->rgba); |
| 3910 | } |
| 3911 | } |
| 3912 | |
| 3913 | SOKOL_API_IMPL void sgl_v2f_c3f(float x, float y, float r, float g, float b) { |
| 3914 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3915 | if (ctx) { |
| 3916 | _sgl_vtx(ctx, x, y, 0.0f, ctx->u, ctx->v, _sgl_pack_rgbaf(r, g, b, 1.0f)); |
| 3917 | } |
| 3918 | } |
| 3919 | |
| 3920 | SOKOL_API_IMPL void sgl_v2f_c3b(float x, float y, uint8_t r, uint8_t g, uint8_t b) { |
| 3921 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3922 | if (ctx) { |
| 3923 | _sgl_vtx(ctx, x, y, 0.0f, ctx->u, ctx->v, _sgl_pack_rgbab(r, g, b, 255)); |
| 3924 | } |
| 3925 | } |
| 3926 | |
| 3927 | SOKOL_API_IMPL void sgl_v2f_c4f(float x, float y, float r, float g, float b, float a) { |
| 3928 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3929 | if (ctx) { |
| 3930 | _sgl_vtx(ctx, x, y, 0.0f, ctx->u, ctx->v, _sgl_pack_rgbaf(r, g, b, a)); |
| 3931 | } |
| 3932 | } |
| 3933 | |
| 3934 | SOKOL_API_IMPL void sgl_v2f_c4b(float x, float y, uint8_t r, uint8_t g, uint8_t b, uint8_t a) { |
| 3935 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3936 | if (ctx) { |
| 3937 | _sgl_vtx(ctx, x, y, 0.0f, ctx->u, ctx->v, _sgl_pack_rgbab(r, g, b, a)); |
| 3938 | } |
| 3939 | } |
| 3940 | |
| 3941 | SOKOL_API_IMPL void sgl_v2f_c1i(float x, float y, uint32_t rgba) { |
| 3942 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3943 | if (ctx) { |
| 3944 | _sgl_vtx(ctx, x, y, 0.0f, ctx->u, ctx->v, rgba); |
| 3945 | } |
| 3946 | } |
| 3947 | |
| 3948 | SOKOL_API_IMPL void sgl_v3f_c3f(float x, float y, float z, float r, float g, float b) { |
| 3949 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3950 | if (ctx) { |
| 3951 | _sgl_vtx(ctx, x, y, z, ctx->u, ctx->v, _sgl_pack_rgbaf(r, g, b, 1.0f)); |
| 3952 | } |
| 3953 | } |
| 3954 | |
| 3955 | SOKOL_API_IMPL void sgl_v3f_c3b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b) { |
| 3956 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3957 | if (ctx) { |
| 3958 | _sgl_vtx(ctx, x, y, z, ctx->u, ctx->v, _sgl_pack_rgbab(r, g, b, 255)); |
| 3959 | } |
| 3960 | } |
| 3961 | |
| 3962 | SOKOL_API_IMPL void sgl_v3f_c4f(float x, float y, float z, float r, float g, float b, float a) { |
| 3963 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3964 | if (ctx) { |
| 3965 | _sgl_vtx(ctx, x, y, z, ctx->u, ctx->v, _sgl_pack_rgbaf(r, g, b, a)); |
| 3966 | } |
| 3967 | } |
| 3968 | |
| 3969 | 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) { |
| 3970 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3971 | if (ctx) { |
| 3972 | _sgl_vtx(ctx, x, y, z, ctx->u, ctx->v, _sgl_pack_rgbab(r, g, b, a)); |
| 3973 | } |
| 3974 | } |
| 3975 | |
| 3976 | SOKOL_API_IMPL void sgl_v3f_c1i(float x, float y, float z, uint32_t rgba) { |
| 3977 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3978 | if (ctx) { |
| 3979 | _sgl_vtx(ctx, x, y, z, ctx->u, ctx->v, rgba); |
| 3980 | } |
| 3981 | } |
| 3982 | |
| 3983 | SOKOL_API_IMPL void sgl_v2f_t2f_c3f(float x, float y, float u, float v, float r, float g, float b) { |
| 3984 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3985 | if (ctx) { |
| 3986 | _sgl_vtx(ctx, x, y, 0.0f, u, v, _sgl_pack_rgbaf(r, g, b, 1.0f)); |
| 3987 | } |
| 3988 | } |
| 3989 | |
| 3990 | 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) { |
| 3991 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3992 | if (ctx) { |
| 3993 | _sgl_vtx(ctx, x, y, 0.0f, u, v, _sgl_pack_rgbab(r, g, b, 255)); |
| 3994 | } |
| 3995 | } |
| 3996 | |
| 3997 | SOKOL_API_IMPL void sgl_v2f_t2f_c4f(float x, float y, float u, float v, float r, float g, float b, float a) { |
| 3998 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 3999 | if (ctx) { |
| 4000 | _sgl_vtx(ctx, x, y, 0.0f, u, v, _sgl_pack_rgbaf(r, g, b, a)); |
| 4001 | } |
| 4002 | } |
| 4003 | |
| 4004 | 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) { |
| 4005 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4006 | if (ctx) { |
| 4007 | _sgl_vtx(ctx, x, y, 0.0f, u, v, _sgl_pack_rgbab(r, g, b, a)); |
| 4008 | } |
| 4009 | } |
| 4010 | |
| 4011 | SOKOL_API_IMPL void sgl_v2f_t2f_c1i(float x, float y, float u, float v, uint32_t rgba) { |
| 4012 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4013 | if (ctx) { |
| 4014 | _sgl_vtx(ctx, x, y, 0.0f, u, v, rgba); |
| 4015 | } |
| 4016 | } |
| 4017 | |
| 4018 | SOKOL_API_IMPL void sgl_v3f_t2f_c3f(float x, float y, float z, float u, float v, float r, float g, float b) { |
| 4019 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4020 | if (ctx) { |
| 4021 | _sgl_vtx(ctx, x, y, z, u, v, _sgl_pack_rgbaf(r, g, b, 1.0f)); |
| 4022 | } |
| 4023 | } |
| 4024 | |
| 4025 | 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) { |
| 4026 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4027 | if (ctx) { |
| 4028 | _sgl_vtx(ctx, x, y, z, u, v, _sgl_pack_rgbab(r, g, b, 255)); |
| 4029 | } |
| 4030 | } |
| 4031 | |
| 4032 | 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) { |
| 4033 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4034 | if (ctx) { |
| 4035 | _sgl_vtx(ctx, x, y, z, u, v, _sgl_pack_rgbaf(r, g, b, a)); |
| 4036 | } |
| 4037 | } |
| 4038 | |
| 4039 | 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) { |
| 4040 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4041 | if (ctx) { |
| 4042 | _sgl_vtx(ctx, x, y, z, u, v, _sgl_pack_rgbab(r, g, b, a)); |
| 4043 | } |
| 4044 | } |
| 4045 | |
| 4046 | SOKOL_API_IMPL void sgl_v3f_t2f_c1i(float x, float y, float z, float u, float v, uint32_t rgba) { |
| 4047 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4048 | if (ctx) { |
| 4049 | _sgl_vtx(ctx,x, y, z, u, v, rgba); |
| 4050 | } |
| 4051 | } |
| 4052 | |
| 4053 | SOKOL_API_IMPL void sgl_matrix_mode_modelview(void) { |
| 4054 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4055 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4056 | if (ctx) { |
| 4057 | ctx->cur_matrix_mode = SGL_MATRIXMODE_MODELVIEW; |
| 4058 | } |
| 4059 | } |
| 4060 | |
| 4061 | SOKOL_API_IMPL void sgl_matrix_mode_projection(void) { |
| 4062 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4063 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4064 | if (ctx) { |
| 4065 | ctx->cur_matrix_mode = SGL_MATRIXMODE_PROJECTION; |
| 4066 | } |
| 4067 | } |
| 4068 | |
| 4069 | SOKOL_API_IMPL void sgl_matrix_mode_texture(void) { |
| 4070 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4071 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4072 | if (ctx) { |
| 4073 | ctx->cur_matrix_mode = SGL_MATRIXMODE_TEXTURE; |
| 4074 | } |
| 4075 | } |
| 4076 | |
| 4077 | SOKOL_API_IMPL void sgl_load_identity(void) { |
| 4078 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4079 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4080 | if (!ctx) { |
| 4081 | return; |
| 4082 | } |
| 4083 | ctx->matrix_dirty = true; |
| 4084 | _sgl_identity(_sgl_matrix(ctx)); |
| 4085 | } |
| 4086 | |
| 4087 | SOKOL_API_IMPL void sgl_load_matrix(const float m[16]) { |
| 4088 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4089 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4090 | if (!ctx) { |
| 4091 | return; |
| 4092 | } |
| 4093 | ctx->matrix_dirty = true; |
| 4094 | memcpy(&_sgl_matrix(ctx)->v[0][0], &m[0], 64); |
| 4095 | } |
| 4096 | |
| 4097 | SOKOL_API_IMPL void sgl_load_transpose_matrix(const float m[16]) { |
| 4098 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4099 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4100 | if (!ctx) { |
| 4101 | return; |
| 4102 | } |
| 4103 | ctx->matrix_dirty = true; |
| 4104 | _sgl_transpose(_sgl_matrix(ctx), (const _sgl_matrix_t*) &m[0]); |
| 4105 | } |
| 4106 | |
| 4107 | SOKOL_API_IMPL void sgl_mult_matrix(const float m[16]) { |
| 4108 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4109 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4110 | if (!ctx) { |
| 4111 | return; |
| 4112 | } |
| 4113 | ctx->matrix_dirty = true; |
| 4114 | const _sgl_matrix_t* m0 = (const _sgl_matrix_t*) &m[0]; |
| 4115 | _sgl_mul(_sgl_matrix(ctx), m0); |
| 4116 | } |
| 4117 | |
| 4118 | SOKOL_API_IMPL void sgl_mult_transpose_matrix(const float m[16]) { |
| 4119 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4120 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4121 | if (!ctx) { |
| 4122 | return; |
| 4123 | } |
| 4124 | ctx->matrix_dirty = true; |
| 4125 | _sgl_matrix_t m0; |
| 4126 | _sgl_transpose(&m0, (const _sgl_matrix_t*) &m[0]); |
| 4127 | _sgl_mul(_sgl_matrix(ctx), &m0); |
| 4128 | } |
| 4129 | |
| 4130 | SOKOL_API_IMPL void sgl_rotate(float angle_rad, float x, float y, float z) { |
| 4131 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4132 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4133 | if (!ctx) { |
| 4134 | return; |
| 4135 | } |
| 4136 | ctx->matrix_dirty = true; |
| 4137 | _sgl_rotate(_sgl_matrix(ctx), angle_rad, x, y, z); |
| 4138 | } |
| 4139 | |
| 4140 | SOKOL_API_IMPL void sgl_scale(float x, float y, float z) { |
| 4141 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4142 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4143 | if (!ctx) { |
| 4144 | return; |
| 4145 | } |
| 4146 | ctx->matrix_dirty = true; |
| 4147 | _sgl_scale(_sgl_matrix(ctx), x, y, z); |
| 4148 | } |
| 4149 | |
| 4150 | SOKOL_API_IMPL void sgl_translate(float x, float y, float z) { |
| 4151 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4152 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4153 | if (!ctx) { |
| 4154 | return; |
| 4155 | } |
| 4156 | ctx->matrix_dirty = true; |
| 4157 | _sgl_translate(_sgl_matrix(ctx), x, y, z); |
| 4158 | } |
| 4159 | |
| 4160 | SOKOL_API_IMPL void sgl_frustum(float l, float r, float b, float t, float n, float f) { |
| 4161 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4162 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4163 | if (!ctx) { |
| 4164 | return; |
| 4165 | } |
| 4166 | ctx->matrix_dirty = true; |
| 4167 | _sgl_frustum(_sgl_matrix(ctx), l, r, b, t, n, f); |
| 4168 | } |
| 4169 | |
| 4170 | SOKOL_API_IMPL void sgl_ortho(float l, float r, float b, float t, float n, float f) { |
| 4171 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4172 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4173 | if (!ctx) { |
| 4174 | return; |
| 4175 | } |
| 4176 | ctx->matrix_dirty = true; |
| 4177 | _sgl_ortho(_sgl_matrix(ctx), l, r, b, t, n, f); |
| 4178 | } |
| 4179 | |
| 4180 | SOKOL_API_IMPL void sgl_perspective(float fov_y, float aspect, float z_near, float z_far) { |
| 4181 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4182 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4183 | if (!ctx) { |
| 4184 | return; |
| 4185 | } |
| 4186 | ctx->matrix_dirty = true; |
| 4187 | _sgl_perspective(_sgl_matrix(ctx), fov_y, aspect, z_near, z_far); |
| 4188 | } |
| 4189 | |
| 4190 | 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) { |
| 4191 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4192 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4193 | if (!ctx) { |
| 4194 | return; |
| 4195 | } |
| 4196 | ctx->matrix_dirty = true; |
| 4197 | _sgl_lookat(_sgl_matrix(ctx), eye_x, eye_y, eye_z, center_x, center_y, center_z, up_x, up_y, up_z); |
| 4198 | } |
| 4199 | |
| 4200 | SOKOL_GL_API_DECL void sgl_push_matrix(void) { |
| 4201 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4202 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4203 | if (!ctx) { |
| 4204 | return; |
| 4205 | } |
| 4206 | SOKOL_ASSERT((ctx->cur_matrix_mode >= 0) && (ctx->cur_matrix_mode < SGL_NUM_MATRIXMODES)); |
| 4207 | ctx->matrix_dirty = true; |
| 4208 | if (ctx->matrix_tos[ctx->cur_matrix_mode] < (_SGL_MAX_STACK_DEPTH - 1)) { |
| 4209 | const _sgl_matrix_t* src = _sgl_matrix(ctx); |
| 4210 | ctx->matrix_tos[ctx->cur_matrix_mode]++; |
| 4211 | _sgl_matrix_t* dst = _sgl_matrix(ctx); |
| 4212 | *dst = *src; |
| 4213 | } else { |
| 4214 | ctx->error = SGL_ERROR_STACK_OVERFLOW; |
| 4215 | } |
| 4216 | } |
| 4217 | |
| 4218 | SOKOL_GL_API_DECL void sgl_pop_matrix(void) { |
| 4219 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4220 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4221 | if (!ctx) { |
| 4222 | return; |
| 4223 | } |
| 4224 | SOKOL_ASSERT((ctx->cur_matrix_mode >= 0) && (ctx->cur_matrix_mode < SGL_NUM_MATRIXMODES)); |
| 4225 | ctx->matrix_dirty = true; |
| 4226 | if (ctx->matrix_tos[ctx->cur_matrix_mode] > 0) { |
| 4227 | ctx->matrix_tos[ctx->cur_matrix_mode]--; |
| 4228 | } else { |
| 4229 | ctx->error = SGL_ERROR_STACK_UNDERFLOW; |
| 4230 | } |
| 4231 | } |
| 4232 | |
| 4233 | SOKOL_API_IMPL void sgl_draw(void) { |
| 4234 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4235 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4236 | if (ctx) { |
| 4237 | _sgl_draw(ctx, 0); |
| 4238 | } |
| 4239 | } |
| 4240 | |
| 4241 | SOKOL_API_IMPL void sgl_draw_layer(int layer_id) { |
| 4242 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4243 | _sgl_context_t* ctx = _sgl.cur_ctx; |
| 4244 | if (ctx) { |
| 4245 | _sgl_draw(ctx, layer_id); |
| 4246 | } |
| 4247 | } |
| 4248 | |
| 4249 | SOKOL_API_IMPL void sgl_context_draw(sgl_context ctx_id) { |
| 4250 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4251 | _sgl_context_t* ctx = _sgl_lookup_context(ctx_id.id); |
| 4252 | if (ctx) { |
| 4253 | _sgl_draw(ctx, 0); |
| 4254 | } |
| 4255 | } |
| 4256 | |
| 4257 | SOKOL_API_IMPL void sgl_context_draw_layer(sgl_context ctx_id, int layer_id) { |
| 4258 | SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); |
| 4259 | _sgl_context_t* ctx = _sgl_lookup_context(ctx_id.id); |
| 4260 | if (ctx) { |
| 4261 | _sgl_draw(ctx, layer_id); |
| 4262 | } |
| 4263 | } |
| 4264 | |
| 4265 | #endif /* SOKOL_GL_IMPL */ |
| 4266 | |