1 // machine generated, do not edit 2 3 module sokol.gfx; 4 5 extern(C) 6 struct Buffer { 7 uint id = 0; 8 } 9 extern(C) 10 struct Image { 11 uint id = 0; 12 } 13 extern(C) 14 struct Sampler { 15 uint id = 0; 16 } 17 extern(C) 18 struct Shader { 19 uint id = 0; 20 } 21 extern(C) 22 struct Pipeline { 23 uint id = 0; 24 } 25 extern(C) 26 struct Attachments { 27 uint id = 0; 28 } 29 extern(C) 30 struct Range { 31 const(void)* ptr = null; 32 size_t size = 0; 33 } 34 enum invalid_id = 0; 35 enum num_inflight_frames = 2; 36 enum max_color_attachments = 4; 37 enum max_uniformblock_members = 16; 38 enum max_vertex_attributes = 16; 39 enum max_mipmaps = 16; 40 enum max_texturearray_layers = 128; 41 enum max_uniformblock_bindslots = 8; 42 enum max_vertexbuffer_bindslots = 8; 43 enum max_image_bindslots = 16; 44 enum max_sampler_bindslots = 16; 45 enum max_storagebuffer_bindslots = 8; 46 enum max_image_sampler_pairs = 16; 47 extern(C) 48 struct Color { 49 float r = 0.0f; 50 float g = 0.0f; 51 float b = 0.0f; 52 float a = 0.0f; 53 } 54 enum Backend { 55 Glcore, 56 Gles3, 57 D3d11, 58 Metal_ios, 59 Metal_macos, 60 Metal_simulator, 61 Wgpu, 62 Dummy, 63 } 64 enum PixelFormat { 65 Default, 66 None, 67 R8, 68 R8sn, 69 R8ui, 70 R8si, 71 R16, 72 R16sn, 73 R16ui, 74 R16si, 75 R16f, 76 Rg8, 77 Rg8sn, 78 Rg8ui, 79 Rg8si, 80 R32ui, 81 R32si, 82 R32f, 83 Rg16, 84 Rg16sn, 85 Rg16ui, 86 Rg16si, 87 Rg16f, 88 Rgba8, 89 Srgb8a8, 90 Rgba8sn, 91 Rgba8ui, 92 Rgba8si, 93 Bgra8, 94 Rgb10a2, 95 Rg11b10f, 96 Rgb9e5, 97 Rg32ui, 98 Rg32si, 99 Rg32f, 100 Rgba16, 101 Rgba16sn, 102 Rgba16ui, 103 Rgba16si, 104 Rgba16f, 105 Rgba32ui, 106 Rgba32si, 107 Rgba32f, 108 Depth, 109 Depth_stencil, 110 Bc1_rgba, 111 Bc2_rgba, 112 Bc3_rgba, 113 Bc3_srgba, 114 Bc4_r, 115 Bc4_rsn, 116 Bc5_rg, 117 Bc5_rgsn, 118 Bc6h_rgbf, 119 Bc6h_rgbuf, 120 Bc7_rgba, 121 Bc7_srgba, 122 Pvrtc_rgb_2bpp, 123 Pvrtc_rgb_4bpp, 124 Pvrtc_rgba_2bpp, 125 Pvrtc_rgba_4bpp, 126 Etc2_rgb8, 127 Etc2_srgb8, 128 Etc2_rgb8a1, 129 Etc2_rgba8, 130 Etc2_srgb8a8, 131 Eac_r11, 132 Eac_r11sn, 133 Eac_rg11, 134 Eac_rg11sn, 135 Astc_4x4_rgba, 136 Astc_4x4_srgba, 137 Num, 138 } 139 extern(C) 140 struct PixelformatInfo { 141 bool sample = false; 142 bool filter = false; 143 bool render = false; 144 bool blend = false; 145 bool msaa = false; 146 bool depth = false; 147 bool compressed = false; 148 int bytes_per_pixel = 0; 149 } 150 extern(C) 151 struct Features { 152 bool origin_top_left = false; 153 bool image_clamp_to_border = false; 154 bool mrt_independent_blend_state = false; 155 bool mrt_independent_write_mask = false; 156 bool storage_buffer = false; 157 } 158 extern(C) 159 struct Limits { 160 int max_image_size_2d = 0; 161 int max_image_size_cube = 0; 162 int max_image_size_3d = 0; 163 int max_image_size_array = 0; 164 int max_image_array_layers = 0; 165 int max_vertex_attrs = 0; 166 int gl_max_vertex_uniform_components = 0; 167 int gl_max_combined_texture_image_units = 0; 168 } 169 enum ResourceState { 170 Initial, 171 Alloc, 172 Valid, 173 Failed, 174 Invalid, 175 } 176 enum Usage { 177 Default, 178 Immutable, 179 Dynamic, 180 Stream, 181 Num, 182 } 183 enum BufferType { 184 Default, 185 Vertexbuffer, 186 Indexbuffer, 187 Storagebuffer, 188 Num, 189 } 190 enum IndexType { 191 Default, 192 None, 193 Uint16, 194 Uint32, 195 Num, 196 } 197 enum ImageType { 198 Default, 199 _2d, 200 Cube, 201 _3d, 202 Array, 203 Num, 204 } 205 enum ImageSampleType { 206 Default, 207 Float, 208 Depth, 209 Sint, 210 Uint, 211 Unfilterable_float, 212 Num, 213 } 214 enum SamplerType { 215 Default, 216 Filtering, 217 Nonfiltering, 218 Comparison, 219 Num, 220 } 221 enum CubeFace { 222 Pos_x, 223 Neg_x, 224 Pos_y, 225 Neg_y, 226 Pos_z, 227 Neg_z, 228 Num, 229 } 230 enum PrimitiveType { 231 Default, 232 Points, 233 Lines, 234 Line_strip, 235 Triangles, 236 Triangle_strip, 237 Num, 238 } 239 enum Filter { 240 Default, 241 Nearest, 242 Linear, 243 Num, 244 } 245 enum Wrap { 246 Default, 247 Repeat, 248 Clamp_to_edge, 249 Clamp_to_border, 250 Mirrored_repeat, 251 Num, 252 } 253 enum BorderColor { 254 Default, 255 Transparent_black, 256 Opaque_black, 257 Opaque_white, 258 Num, 259 } 260 enum VertexFormat { 261 Invalid, 262 Float, 263 Float2, 264 Float3, 265 Float4, 266 Byte4, 267 Byte4n, 268 Ubyte4, 269 Ubyte4n, 270 Short2, 271 Short2n, 272 Ushort2n, 273 Short4, 274 Short4n, 275 Ushort4n, 276 Uint10_n2, 277 Half2, 278 Half4, 279 Num, 280 } 281 enum VertexStep { 282 Default, 283 Per_vertex, 284 Per_instance, 285 Num, 286 } 287 enum UniformType { 288 Invalid, 289 Float, 290 Float2, 291 Float3, 292 Float4, 293 Int, 294 Int2, 295 Int3, 296 Int4, 297 Mat4, 298 Num, 299 } 300 enum UniformLayout { 301 Default, 302 Native, 303 Std140, 304 Num, 305 } 306 enum CullMode { 307 Default, 308 None, 309 Front, 310 Back, 311 Num, 312 } 313 enum FaceWinding { 314 Default, 315 Ccw, 316 Cw, 317 Num, 318 } 319 enum CompareFunc { 320 Default, 321 Never, 322 Less, 323 Equal, 324 Less_equal, 325 Greater, 326 Not_equal, 327 Greater_equal, 328 Always, 329 Num, 330 } 331 enum StencilOp { 332 Default, 333 Keep, 334 Zero, 335 Replace, 336 Incr_clamp, 337 Decr_clamp, 338 Invert, 339 Incr_wrap, 340 Decr_wrap, 341 Num, 342 } 343 enum BlendFactor { 344 Default, 345 Zero, 346 One, 347 Src_color, 348 One_minus_src_color, 349 Src_alpha, 350 One_minus_src_alpha, 351 Dst_color, 352 One_minus_dst_color, 353 Dst_alpha, 354 One_minus_dst_alpha, 355 Src_alpha_saturated, 356 Blend_color, 357 One_minus_blend_color, 358 Blend_alpha, 359 One_minus_blend_alpha, 360 Num, 361 } 362 enum BlendOp { 363 Default, 364 Add, 365 Subtract, 366 Reverse_subtract, 367 Num, 368 } 369 enum ColorMask { 370 Default = 0, 371 None = 16, 372 R = 1, 373 G = 2, 374 Rg = 3, 375 B = 4, 376 Rb = 5, 377 Gb = 6, 378 Rgb = 7, 379 A = 8, 380 Ra = 9, 381 Ga = 10, 382 Rga = 11, 383 Ba = 12, 384 Rba = 13, 385 Gba = 14, 386 Rgba = 15, 387 } 388 enum LoadAction { 389 Default, 390 Clear, 391 Load, 392 Dontcare, 393 } 394 enum StoreAction { 395 Default, 396 Store, 397 Dontcare, 398 } 399 extern(C) 400 struct ColorAttachmentAction { 401 LoadAction load_action; 402 StoreAction store_action; 403 Color clear_value; 404 } 405 extern(C) 406 struct DepthAttachmentAction { 407 LoadAction load_action; 408 StoreAction store_action; 409 float clear_value = 0.0f; 410 } 411 extern(C) 412 struct StencilAttachmentAction { 413 LoadAction load_action; 414 StoreAction store_action; 415 ubyte clear_value = 0; 416 } 417 extern(C) 418 struct PassAction { 419 ColorAttachmentAction[4] colors; 420 DepthAttachmentAction depth; 421 StencilAttachmentAction stencil; 422 } 423 extern(C) 424 struct MetalSwapchain { 425 const(void)* current_drawable = null; 426 const(void)* depth_stencil_texture = null; 427 const(void)* msaa_color_texture = null; 428 } 429 extern(C) 430 struct D3d11Swapchain { 431 const(void)* render_view = null; 432 const(void)* resolve_view = null; 433 const(void)* depth_stencil_view = null; 434 } 435 extern(C) 436 struct WgpuSwapchain { 437 const(void)* render_view = null; 438 const(void)* resolve_view = null; 439 const(void)* depth_stencil_view = null; 440 } 441 extern(C) 442 struct GlSwapchain { 443 uint framebuffer = 0; 444 } 445 extern(C) 446 struct Swapchain { 447 int width = 0; 448 int height = 0; 449 int sample_count = 0; 450 PixelFormat color_format; 451 PixelFormat depth_format; 452 MetalSwapchain metal; 453 D3d11Swapchain d3d11; 454 WgpuSwapchain wgpu; 455 GlSwapchain gl; 456 } 457 extern(C) 458 struct Pass { 459 uint _start_canary = 0; 460 PassAction action; 461 Attachments attachments; 462 Swapchain swapchain; 463 const(char)* label = null; 464 uint _end_canary = 0; 465 } 466 extern(C) 467 struct Bindings { 468 uint _start_canary = 0; 469 Buffer[8] vertex_buffers; 470 int[8] vertex_buffer_offsets = 0; 471 Buffer index_buffer; 472 int index_buffer_offset = 0; 473 Image[16] images; 474 Sampler[16] samplers; 475 Buffer[8] storage_buffers; 476 uint _end_canary = 0; 477 } 478 extern(C) 479 struct BufferDesc { 480 uint _start_canary = 0; 481 size_t size = 0; 482 BufferType type; 483 Usage usage; 484 Range data; 485 const(char)* label = null; 486 uint[2] gl_buffers = 0; 487 const(void)*[2] mtl_buffers = null; 488 const(void)* d3d11_buffer = null; 489 const(void)* wgpu_buffer = null; 490 uint _end_canary = 0; 491 } 492 extern(C) 493 struct ImageData { 494 Range[6][16] subimage; 495 } 496 extern(C) 497 struct ImageDesc { 498 uint _start_canary = 0; 499 ImageType type; 500 bool render_target = false; 501 int width = 0; 502 int height = 0; 503 int num_slices = 0; 504 int num_mipmaps = 0; 505 Usage usage; 506 PixelFormat pixel_format; 507 int sample_count = 0; 508 ImageData data; 509 const(char)* label = null; 510 uint[2] gl_textures = 0; 511 uint gl_texture_target = 0; 512 const(void)*[2] mtl_textures = null; 513 const(void)* d3d11_texture = null; 514 const(void)* d3d11_shader_resource_view = null; 515 const(void)* wgpu_texture = null; 516 const(void)* wgpu_texture_view = null; 517 uint _end_canary = 0; 518 } 519 extern(C) 520 struct SamplerDesc { 521 uint _start_canary = 0; 522 Filter min_filter; 523 Filter mag_filter; 524 Filter mipmap_filter; 525 Wrap wrap_u; 526 Wrap wrap_v; 527 Wrap wrap_w; 528 float min_lod = 0.0f; 529 float max_lod = 0.0f; 530 BorderColor border_color; 531 CompareFunc compare; 532 uint max_anisotropy = 0; 533 const(char)* label = null; 534 uint gl_sampler = 0; 535 const(void)* mtl_sampler = null; 536 const(void)* d3d11_sampler = null; 537 const(void)* wgpu_sampler = null; 538 uint _end_canary = 0; 539 } 540 enum ShaderStage { 541 None, 542 Vertex, 543 Fragment, 544 } 545 extern(C) 546 struct ShaderFunction { 547 const(char)* source = null; 548 Range bytecode; 549 const(char)* entry = null; 550 const(char)* d3d11_target = null; 551 } 552 extern(C) 553 struct ShaderVertexAttr { 554 const(char)* glsl_name = null; 555 const(char)* hlsl_sem_name = null; 556 ubyte hlsl_sem_index = 0; 557 } 558 extern(C) 559 struct GlslShaderUniform { 560 UniformType type; 561 ushort array_count = 0; 562 const(char)* glsl_name = null; 563 } 564 extern(C) 565 struct ShaderUniformBlock { 566 ShaderStage stage; 567 uint size = 0; 568 ubyte hlsl_register_b_n = 0; 569 ubyte msl_buffer_n = 0; 570 ubyte wgsl_group0_binding_n = 0; 571 UniformLayout layout; 572 GlslShaderUniform[16] glsl_uniforms; 573 } 574 extern(C) 575 struct ShaderImage { 576 ShaderStage stage; 577 ImageType image_type; 578 ImageSampleType sample_type; 579 bool multisampled = false; 580 ubyte hlsl_register_t_n = 0; 581 ubyte msl_texture_n = 0; 582 ubyte wgsl_group1_binding_n = 0; 583 } 584 extern(C) 585 struct ShaderSampler { 586 ShaderStage stage; 587 SamplerType sampler_type; 588 ubyte hlsl_register_s_n = 0; 589 ubyte msl_sampler_n = 0; 590 ubyte wgsl_group1_binding_n = 0; 591 } 592 extern(C) 593 struct ShaderStorageBuffer { 594 ShaderStage stage; 595 bool readonly = false; 596 ubyte hlsl_register_t_n = 0; 597 ubyte msl_buffer_n = 0; 598 ubyte wgsl_group1_binding_n = 0; 599 ubyte glsl_binding_n = 0; 600 } 601 extern(C) 602 struct ShaderImageSamplerPair { 603 ShaderStage stage; 604 ubyte image_slot = 0; 605 ubyte sampler_slot = 0; 606 const(char)* glsl_name = null; 607 } 608 extern(C) 609 struct ShaderDesc { 610 uint _start_canary = 0; 611 ShaderFunction vertex_func; 612 ShaderFunction fragment_func; 613 ShaderVertexAttr[16] attrs; 614 ShaderUniformBlock[8] uniform_blocks; 615 ShaderStorageBuffer[8] storage_buffers; 616 ShaderImage[16] images; 617 ShaderSampler[16] samplers; 618 ShaderImageSamplerPair[16] image_sampler_pairs; 619 const(char)* label = null; 620 uint _end_canary = 0; 621 } 622 extern(C) 623 struct VertexBufferLayoutState { 624 int stride = 0; 625 VertexStep step_func; 626 int step_rate = 0; 627 } 628 extern(C) 629 struct VertexAttrState { 630 int buffer_index = 0; 631 int offset = 0; 632 VertexFormat format; 633 } 634 extern(C) 635 struct VertexLayoutState { 636 VertexBufferLayoutState[8] buffers; 637 VertexAttrState[16] attrs; 638 } 639 extern(C) 640 struct StencilFaceState { 641 CompareFunc compare; 642 StencilOp fail_op; 643 StencilOp depth_fail_op; 644 StencilOp pass_op; 645 } 646 extern(C) 647 struct StencilState { 648 bool enabled = false; 649 StencilFaceState front; 650 StencilFaceState back; 651 ubyte read_mask = 0; 652 ubyte write_mask = 0; 653 ubyte _ref = 0; 654 } 655 extern(C) 656 struct DepthState { 657 PixelFormat pixel_format; 658 CompareFunc compare; 659 bool write_enabled = false; 660 float bias = 0.0f; 661 float bias_slope_scale = 0.0f; 662 float bias_clamp = 0.0f; 663 } 664 extern(C) 665 struct BlendState { 666 bool enabled = false; 667 BlendFactor src_factor_rgb; 668 BlendFactor dst_factor_rgb; 669 BlendOp op_rgb; 670 BlendFactor src_factor_alpha; 671 BlendFactor dst_factor_alpha; 672 BlendOp op_alpha; 673 } 674 extern(C) 675 struct ColorTargetState { 676 PixelFormat pixel_format; 677 ColorMask write_mask; 678 BlendState blend; 679 } 680 extern(C) 681 struct PipelineDesc { 682 uint _start_canary = 0; 683 Shader shader; 684 VertexLayoutState layout; 685 DepthState depth; 686 StencilState stencil; 687 int color_count = 0; 688 ColorTargetState[4] colors; 689 PrimitiveType primitive_type; 690 IndexType index_type; 691 CullMode cull_mode; 692 FaceWinding face_winding; 693 int sample_count = 0; 694 Color blend_color; 695 bool alpha_to_coverage_enabled = false; 696 const(char)* label = null; 697 uint _end_canary = 0; 698 } 699 extern(C) 700 struct AttachmentDesc { 701 Image image; 702 int mip_level = 0; 703 int slice = 0; 704 } 705 extern(C) 706 struct AttachmentsDesc { 707 uint _start_canary = 0; 708 AttachmentDesc[4] colors; 709 AttachmentDesc[4] resolves; 710 AttachmentDesc depth_stencil; 711 const(char)* label = null; 712 uint _end_canary = 0; 713 } 714 extern(C) 715 struct TraceHooks { 716 void* user_data = null; 717 extern(C) void function(void*) reset_state_cache = null; 718 extern(C) void function(const BufferDesc *, Buffer, void*) make_buffer = null; 719 extern(C) void function(const ImageDesc *, Image, void*) make_image = null; 720 extern(C) void function(const SamplerDesc *, Sampler, void*) make_sampler = null; 721 extern(C) void function(const ShaderDesc *, Shader, void*) make_shader = null; 722 extern(C) void function(const PipelineDesc *, Pipeline, void*) make_pipeline = null; 723 extern(C) void function(const AttachmentsDesc *, Attachments, void*) make_attachments = null; 724 extern(C) void function(Buffer, void*) destroy_buffer = null; 725 extern(C) void function(Image, void*) destroy_image = null; 726 extern(C) void function(Sampler, void*) destroy_sampler = null; 727 extern(C) void function(Shader, void*) destroy_shader = null; 728 extern(C) void function(Pipeline, void*) destroy_pipeline = null; 729 extern(C) void function(Attachments, void*) destroy_attachments = null; 730 extern(C) void function(Buffer, const Range *, void*) update_buffer = null; 731 extern(C) void function(Image, const ImageData *, void*) update_image = null; 732 extern(C) void function(Buffer, const Range *, int, void*) append_buffer = null; 733 extern(C) void function(const Pass *, void*) begin_pass = null; 734 extern(C) void function(int, int, int, int, bool, void*) apply_viewport = null; 735 extern(C) void function(int, int, int, int, bool, void*) apply_scissor_rect = null; 736 extern(C) void function(Pipeline, void*) apply_pipeline = null; 737 extern(C) void function(const Bindings *, void*) apply_bindings = null; 738 extern(C) void function(int, const Range *, void*) apply_uniforms = null; 739 extern(C) void function(int, int, int, void*) draw = null; 740 extern(C) void function(void*) end_pass = null; 741 extern(C) void function(void*) commit = null; 742 extern(C) void function(Buffer, void*) alloc_buffer = null; 743 extern(C) void function(Image, void*) alloc_image = null; 744 extern(C) void function(Sampler, void*) alloc_sampler = null; 745 extern(C) void function(Shader, void*) alloc_shader = null; 746 extern(C) void function(Pipeline, void*) alloc_pipeline = null; 747 extern(C) void function(Attachments, void*) alloc_attachments = null; 748 extern(C) void function(Buffer, void*) dealloc_buffer = null; 749 extern(C) void function(Image, void*) dealloc_image = null; 750 extern(C) void function(Sampler, void*) dealloc_sampler = null; 751 extern(C) void function(Shader, void*) dealloc_shader = null; 752 extern(C) void function(Pipeline, void*) dealloc_pipeline = null; 753 extern(C) void function(Attachments, void*) dealloc_attachments = null; 754 extern(C) void function(Buffer, const BufferDesc *, void*) init_buffer = null; 755 extern(C) void function(Image, const ImageDesc *, void*) init_image = null; 756 extern(C) void function(Sampler, const SamplerDesc *, void*) init_sampler = null; 757 extern(C) void function(Shader, const ShaderDesc *, void*) init_shader = null; 758 extern(C) void function(Pipeline, const PipelineDesc *, void*) init_pipeline = null; 759 extern(C) void function(Attachments, const AttachmentsDesc *, void*) init_attachments = null; 760 extern(C) void function(Buffer, void*) uninit_buffer = null; 761 extern(C) void function(Image, void*) uninit_image = null; 762 extern(C) void function(Sampler, void*) uninit_sampler = null; 763 extern(C) void function(Shader, void*) uninit_shader = null; 764 extern(C) void function(Pipeline, void*) uninit_pipeline = null; 765 extern(C) void function(Attachments, void*) uninit_attachments = null; 766 extern(C) void function(Buffer, void*) fail_buffer = null; 767 extern(C) void function(Image, void*) fail_image = null; 768 extern(C) void function(Sampler, void*) fail_sampler = null; 769 extern(C) void function(Shader, void*) fail_shader = null; 770 extern(C) void function(Pipeline, void*) fail_pipeline = null; 771 extern(C) void function(Attachments, void*) fail_attachments = null; 772 extern(C) void function(const(char)*, void*) push_debug_group = null; 773 extern(C) void function(void*) pop_debug_group = null; 774 } 775 extern(C) 776 struct SlotInfo { 777 ResourceState state; 778 uint res_id = 0; 779 } 780 extern(C) 781 struct BufferInfo { 782 SlotInfo slot; 783 uint update_frame_index = 0; 784 uint append_frame_index = 0; 785 int append_pos = 0; 786 bool append_overflow = false; 787 int num_slots = 0; 788 int active_slot = 0; 789 } 790 extern(C) 791 struct ImageInfo { 792 SlotInfo slot; 793 uint upd_frame_index = 0; 794 int num_slots = 0; 795 int active_slot = 0; 796 } 797 extern(C) 798 struct SamplerInfo { 799 SlotInfo slot; 800 } 801 extern(C) 802 struct ShaderInfo { 803 SlotInfo slot; 804 } 805 extern(C) 806 struct PipelineInfo { 807 SlotInfo slot; 808 } 809 extern(C) 810 struct AttachmentsInfo { 811 SlotInfo slot; 812 } 813 extern(C) 814 struct FrameStatsGl { 815 uint num_bind_buffer = 0; 816 uint num_active_texture = 0; 817 uint num_bind_texture = 0; 818 uint num_bind_sampler = 0; 819 uint num_use_program = 0; 820 uint num_render_state = 0; 821 uint num_vertex_attrib_pointer = 0; 822 uint num_vertex_attrib_divisor = 0; 823 uint num_enable_vertex_attrib_array = 0; 824 uint num_disable_vertex_attrib_array = 0; 825 uint num_uniform = 0; 826 } 827 extern(C) 828 struct FrameStatsD3d11Pass { 829 uint num_om_set_render_targets = 0; 830 uint num_clear_render_target_view = 0; 831 uint num_clear_depth_stencil_view = 0; 832 uint num_resolve_subresource = 0; 833 } 834 extern(C) 835 struct FrameStatsD3d11Pipeline { 836 uint num_rs_set_state = 0; 837 uint num_om_set_depth_stencil_state = 0; 838 uint num_om_set_blend_state = 0; 839 uint num_ia_set_primitive_topology = 0; 840 uint num_ia_set_input_layout = 0; 841 uint num_vs_set_shader = 0; 842 uint num_vs_set_constant_buffers = 0; 843 uint num_ps_set_shader = 0; 844 uint num_ps_set_constant_buffers = 0; 845 } 846 extern(C) 847 struct FrameStatsD3d11Bindings { 848 uint num_ia_set_vertex_buffers = 0; 849 uint num_ia_set_index_buffer = 0; 850 uint num_vs_set_shader_resources = 0; 851 uint num_ps_set_shader_resources = 0; 852 uint num_vs_set_samplers = 0; 853 uint num_ps_set_samplers = 0; 854 } 855 extern(C) 856 struct FrameStatsD3d11Uniforms { 857 uint num_update_subresource = 0; 858 } 859 extern(C) 860 struct FrameStatsD3d11Draw { 861 uint num_draw_indexed_instanced = 0; 862 uint num_draw_indexed = 0; 863 uint num_draw_instanced = 0; 864 uint num_draw = 0; 865 } 866 extern(C) 867 struct FrameStatsD3d11 { 868 FrameStatsD3d11Pass pass; 869 FrameStatsD3d11Pipeline pipeline; 870 FrameStatsD3d11Bindings bindings; 871 FrameStatsD3d11Uniforms uniforms; 872 FrameStatsD3d11Draw draw; 873 uint num_map = 0; 874 uint num_unmap = 0; 875 } 876 extern(C) 877 struct FrameStatsMetalIdpool { 878 uint num_added = 0; 879 uint num_released = 0; 880 uint num_garbage_collected = 0; 881 } 882 extern(C) 883 struct FrameStatsMetalPipeline { 884 uint num_set_blend_color = 0; 885 uint num_set_cull_mode = 0; 886 uint num_set_front_facing_winding = 0; 887 uint num_set_stencil_reference_value = 0; 888 uint num_set_depth_bias = 0; 889 uint num_set_render_pipeline_state = 0; 890 uint num_set_depth_stencil_state = 0; 891 } 892 extern(C) 893 struct FrameStatsMetalBindings { 894 uint num_set_vertex_buffer = 0; 895 uint num_set_vertex_texture = 0; 896 uint num_set_vertex_sampler_state = 0; 897 uint num_set_fragment_buffer = 0; 898 uint num_set_fragment_texture = 0; 899 uint num_set_fragment_sampler_state = 0; 900 } 901 extern(C) 902 struct FrameStatsMetalUniforms { 903 uint num_set_vertex_buffer_offset = 0; 904 uint num_set_fragment_buffer_offset = 0; 905 } 906 extern(C) 907 struct FrameStatsMetal { 908 FrameStatsMetalIdpool idpool; 909 FrameStatsMetalPipeline pipeline; 910 FrameStatsMetalBindings bindings; 911 FrameStatsMetalUniforms uniforms; 912 } 913 extern(C) 914 struct FrameStatsWgpuUniforms { 915 uint num_set_bindgroup = 0; 916 uint size_write_buffer = 0; 917 } 918 extern(C) 919 struct FrameStatsWgpuBindings { 920 uint num_set_vertex_buffer = 0; 921 uint num_skip_redundant_vertex_buffer = 0; 922 uint num_set_index_buffer = 0; 923 uint num_skip_redundant_index_buffer = 0; 924 uint num_create_bindgroup = 0; 925 uint num_discard_bindgroup = 0; 926 uint num_set_bindgroup = 0; 927 uint num_skip_redundant_bindgroup = 0; 928 uint num_bindgroup_cache_hits = 0; 929 uint num_bindgroup_cache_misses = 0; 930 uint num_bindgroup_cache_collisions = 0; 931 uint num_bindgroup_cache_invalidates = 0; 932 uint num_bindgroup_cache_hash_vs_key_mismatch = 0; 933 } 934 extern(C) 935 struct FrameStatsWgpu { 936 FrameStatsWgpuUniforms uniforms; 937 FrameStatsWgpuBindings bindings; 938 } 939 extern(C) 940 struct FrameStats { 941 uint frame_index = 0; 942 uint num_passes = 0; 943 uint num_apply_viewport = 0; 944 uint num_apply_scissor_rect = 0; 945 uint num_apply_pipeline = 0; 946 uint num_apply_bindings = 0; 947 uint num_apply_uniforms = 0; 948 uint num_draw = 0; 949 uint num_update_buffer = 0; 950 uint num_append_buffer = 0; 951 uint num_update_image = 0; 952 uint size_apply_uniforms = 0; 953 uint size_update_buffer = 0; 954 uint size_append_buffer = 0; 955 uint size_update_image = 0; 956 FrameStatsGl gl; 957 FrameStatsD3d11 d3d11; 958 FrameStatsMetal metal; 959 FrameStatsWgpu wgpu; 960 } 961 enum LogItem { 962 Ok, 963 Malloc_failed, 964 Gl_texture_format_not_supported, 965 Gl_3d_textures_not_supported, 966 Gl_array_textures_not_supported, 967 Gl_shader_compilation_failed, 968 Gl_shader_linking_failed, 969 Gl_vertex_attribute_not_found_in_shader, 970 Gl_image_sampler_name_not_found_in_shader, 971 Gl_framebuffer_status_undefined, 972 Gl_framebuffer_status_incomplete_attachment, 973 Gl_framebuffer_status_incomplete_missing_attachment, 974 Gl_framebuffer_status_unsupported, 975 Gl_framebuffer_status_incomplete_multisample, 976 Gl_framebuffer_status_unknown, 977 D3d11_create_buffer_failed, 978 D3d11_create_buffer_srv_failed, 979 D3d11_create_depth_texture_unsupported_pixel_format, 980 D3d11_create_depth_texture_failed, 981 D3d11_create_2d_texture_unsupported_pixel_format, 982 D3d11_create_2d_texture_failed, 983 D3d11_create_2d_srv_failed, 984 D3d11_create_3d_texture_unsupported_pixel_format, 985 D3d11_create_3d_texture_failed, 986 D3d11_create_3d_srv_failed, 987 D3d11_create_msaa_texture_failed, 988 D3d11_create_sampler_state_failed, 989 D3d11_load_d3dcompiler_47_dll_failed, 990 D3d11_shader_compilation_failed, 991 D3d11_shader_compilation_output, 992 D3d11_create_constant_buffer_failed, 993 D3d11_create_input_layout_failed, 994 D3d11_create_rasterizer_state_failed, 995 D3d11_create_depth_stencil_state_failed, 996 D3d11_create_blend_state_failed, 997 D3d11_create_rtv_failed, 998 D3d11_create_dsv_failed, 999 D3d11_map_for_update_buffer_failed, 1000 D3d11_map_for_append_buffer_failed, 1001 D3d11_map_for_update_image_failed, 1002 Metal_create_buffer_failed, 1003 Metal_texture_format_not_supported, 1004 Metal_create_texture_failed, 1005 Metal_create_sampler_failed, 1006 Metal_shader_compilation_failed, 1007 Metal_shader_creation_failed, 1008 Metal_shader_compilation_output, 1009 Metal_shader_entry_not_found, 1010 Metal_create_rps_failed, 1011 Metal_create_rps_output, 1012 Metal_create_dss_failed, 1013 Wgpu_bindgroups_pool_exhausted, 1014 Wgpu_bindgroupscache_size_greater_one, 1015 Wgpu_bindgroupscache_size_pow2, 1016 Wgpu_createbindgroup_failed, 1017 Wgpu_create_buffer_failed, 1018 Wgpu_create_texture_failed, 1019 Wgpu_create_texture_view_failed, 1020 Wgpu_create_sampler_failed, 1021 Wgpu_create_shader_module_failed, 1022 Wgpu_shader_create_bindgroup_layout_failed, 1023 Wgpu_create_pipeline_layout_failed, 1024 Wgpu_create_render_pipeline_failed, 1025 Wgpu_attachments_create_texture_view_failed, 1026 Draw_required_bindings_or_uniforms_missing, 1027 Identical_commit_listener, 1028 Commit_listener_array_full, 1029 Trace_hooks_not_enabled, 1030 Dealloc_buffer_invalid_state, 1031 Dealloc_image_invalid_state, 1032 Dealloc_sampler_invalid_state, 1033 Dealloc_shader_invalid_state, 1034 Dealloc_pipeline_invalid_state, 1035 Dealloc_attachments_invalid_state, 1036 Init_buffer_invalid_state, 1037 Init_image_invalid_state, 1038 Init_sampler_invalid_state, 1039 Init_shader_invalid_state, 1040 Init_pipeline_invalid_state, 1041 Init_attachments_invalid_state, 1042 Uninit_buffer_invalid_state, 1043 Uninit_image_invalid_state, 1044 Uninit_sampler_invalid_state, 1045 Uninit_shader_invalid_state, 1046 Uninit_pipeline_invalid_state, 1047 Uninit_attachments_invalid_state, 1048 Fail_buffer_invalid_state, 1049 Fail_image_invalid_state, 1050 Fail_sampler_invalid_state, 1051 Fail_shader_invalid_state, 1052 Fail_pipeline_invalid_state, 1053 Fail_attachments_invalid_state, 1054 Buffer_pool_exhausted, 1055 Image_pool_exhausted, 1056 Sampler_pool_exhausted, 1057 Shader_pool_exhausted, 1058 Pipeline_pool_exhausted, 1059 Pass_pool_exhausted, 1060 Beginpass_attachment_invalid, 1061 Draw_without_bindings, 1062 Validate_bufferdesc_canary, 1063 Validate_bufferdesc_size, 1064 Validate_bufferdesc_data, 1065 Validate_bufferdesc_data_size, 1066 Validate_bufferdesc_no_data, 1067 Validate_bufferdesc_storagebuffer_supported, 1068 Validate_bufferdesc_storagebuffer_size_multiple_4, 1069 Validate_imagedata_nodata, 1070 Validate_imagedata_data_size, 1071 Validate_imagedesc_canary, 1072 Validate_imagedesc_width, 1073 Validate_imagedesc_height, 1074 Validate_imagedesc_rt_pixelformat, 1075 Validate_imagedesc_nonrt_pixelformat, 1076 Validate_imagedesc_msaa_but_no_rt, 1077 Validate_imagedesc_no_msaa_rt_support, 1078 Validate_imagedesc_msaa_num_mipmaps, 1079 Validate_imagedesc_msaa_3d_image, 1080 Validate_imagedesc_depth_3d_image, 1081 Validate_imagedesc_rt_immutable, 1082 Validate_imagedesc_rt_no_data, 1083 Validate_imagedesc_injected_no_data, 1084 Validate_imagedesc_dynamic_no_data, 1085 Validate_imagedesc_compressed_immutable, 1086 Validate_samplerdesc_canary, 1087 Validate_samplerdesc_anistropic_requires_linear_filtering, 1088 Validate_shaderdesc_canary, 1089 Validate_shaderdesc_source, 1090 Validate_shaderdesc_bytecode, 1091 Validate_shaderdesc_source_or_bytecode, 1092 Validate_shaderdesc_no_bytecode_size, 1093 Validate_shaderdesc_no_cont_ub_members, 1094 Validate_shaderdesc_ub_size_is_zero, 1095 Validate_shaderdesc_ub_metal_buffer_slot_out_of_range, 1096 Validate_shaderdesc_ub_metal_buffer_slot_collision, 1097 Validate_shaderdesc_ub_hlsl_register_b_out_of_range, 1098 Validate_shaderdesc_ub_hlsl_register_b_collision, 1099 Validate_shaderdesc_ub_wgsl_group0_binding_out_of_range, 1100 Validate_shaderdesc_ub_wgsl_group0_binding_collision, 1101 Validate_shaderdesc_no_ub_members, 1102 Validate_shaderdesc_ub_uniform_glsl_name, 1103 Validate_shaderdesc_ub_size_mismatch, 1104 Validate_shaderdesc_ub_array_count, 1105 Validate_shaderdesc_ub_std140_array_type, 1106 Validate_shaderdesc_storagebuffer_metal_buffer_slot_out_of_range, 1107 Validate_shaderdesc_storagebuffer_metal_buffer_slot_collision, 1108 Validate_shaderdesc_storagebuffer_hlsl_register_t_out_of_range, 1109 Validate_shaderdesc_storagebuffer_hlsl_register_t_collision, 1110 Validate_shaderdesc_storagebuffer_glsl_binding_out_of_range, 1111 Validate_shaderdesc_storagebuffer_glsl_binding_collision, 1112 Validate_shaderdesc_storagebuffer_wgsl_group1_binding_out_of_range, 1113 Validate_shaderdesc_storagebuffer_wgsl_group1_binding_collision, 1114 Validate_shaderdesc_storagebuffer_readonly, 1115 Validate_shaderdesc_image_metal_texture_slot_out_of_range, 1116 Validate_shaderdesc_image_metal_texture_slot_collision, 1117 Validate_shaderdesc_image_hlsl_register_t_out_of_range, 1118 Validate_shaderdesc_image_hlsl_register_t_collision, 1119 Validate_shaderdesc_image_wgsl_group1_binding_out_of_range, 1120 Validate_shaderdesc_image_wgsl_group1_binding_collision, 1121 Validate_shaderdesc_sampler_metal_sampler_slot_out_of_range, 1122 Validate_shaderdesc_sampler_metal_sampler_slot_collision, 1123 Validate_shaderdesc_sampler_hlsl_register_s_out_of_range, 1124 Validate_shaderdesc_sampler_hlsl_register_s_collision, 1125 Validate_shaderdesc_sampler_wgsl_group1_binding_out_of_range, 1126 Validate_shaderdesc_sampler_wgsl_group1_binding_collision, 1127 Validate_shaderdesc_image_sampler_pair_image_slot_out_of_range, 1128 Validate_shaderdesc_image_sampler_pair_sampler_slot_out_of_range, 1129 Validate_shaderdesc_image_sampler_pair_image_stage_mismatch, 1130 Validate_shaderdesc_image_sampler_pair_sampler_stage_mismatch, 1131 Validate_shaderdesc_image_sampler_pair_glsl_name, 1132 Validate_shaderdesc_nonfiltering_sampler_required, 1133 Validate_shaderdesc_comparison_sampler_required, 1134 Validate_shaderdesc_image_not_referenced_by_image_sampler_pairs, 1135 Validate_shaderdesc_sampler_not_referenced_by_image_sampler_pairs, 1136 Validate_shaderdesc_attr_string_too_long, 1137 Validate_pipelinedesc_canary, 1138 Validate_pipelinedesc_shader, 1139 Validate_pipelinedesc_no_cont_attrs, 1140 Validate_pipelinedesc_layout_stride4, 1141 Validate_pipelinedesc_attr_semantics, 1142 Validate_attachmentsdesc_canary, 1143 Validate_attachmentsdesc_no_attachments, 1144 Validate_attachmentsdesc_no_cont_color_atts, 1145 Validate_attachmentsdesc_image, 1146 Validate_attachmentsdesc_miplevel, 1147 Validate_attachmentsdesc_face, 1148 Validate_attachmentsdesc_layer, 1149 Validate_attachmentsdesc_slice, 1150 Validate_attachmentsdesc_image_no_rt, 1151 Validate_attachmentsdesc_color_inv_pixelformat, 1152 Validate_attachmentsdesc_depth_inv_pixelformat, 1153 Validate_attachmentsdesc_image_sizes, 1154 Validate_attachmentsdesc_image_sample_counts, 1155 Validate_attachmentsdesc_resolve_color_image_msaa, 1156 Validate_attachmentsdesc_resolve_image, 1157 Validate_attachmentsdesc_resolve_sample_count, 1158 Validate_attachmentsdesc_resolve_miplevel, 1159 Validate_attachmentsdesc_resolve_face, 1160 Validate_attachmentsdesc_resolve_layer, 1161 Validate_attachmentsdesc_resolve_slice, 1162 Validate_attachmentsdesc_resolve_image_no_rt, 1163 Validate_attachmentsdesc_resolve_image_sizes, 1164 Validate_attachmentsdesc_resolve_image_format, 1165 Validate_attachmentsdesc_depth_image, 1166 Validate_attachmentsdesc_depth_miplevel, 1167 Validate_attachmentsdesc_depth_face, 1168 Validate_attachmentsdesc_depth_layer, 1169 Validate_attachmentsdesc_depth_slice, 1170 Validate_attachmentsdesc_depth_image_no_rt, 1171 Validate_attachmentsdesc_depth_image_sizes, 1172 Validate_attachmentsdesc_depth_image_sample_count, 1173 Validate_beginpass_canary, 1174 Validate_beginpass_attachments_exists, 1175 Validate_beginpass_attachments_valid, 1176 Validate_beginpass_color_attachment_image, 1177 Validate_beginpass_resolve_attachment_image, 1178 Validate_beginpass_depthstencil_attachment_image, 1179 Validate_beginpass_swapchain_expect_width, 1180 Validate_beginpass_swapchain_expect_width_notset, 1181 Validate_beginpass_swapchain_expect_height, 1182 Validate_beginpass_swapchain_expect_height_notset, 1183 Validate_beginpass_swapchain_expect_samplecount, 1184 Validate_beginpass_swapchain_expect_samplecount_notset, 1185 Validate_beginpass_swapchain_expect_colorformat, 1186 Validate_beginpass_swapchain_expect_colorformat_notset, 1187 Validate_beginpass_swapchain_expect_depthformat_notset, 1188 Validate_beginpass_swapchain_metal_expect_currentdrawable, 1189 Validate_beginpass_swapchain_metal_expect_currentdrawable_notset, 1190 Validate_beginpass_swapchain_metal_expect_depthstenciltexture, 1191 Validate_beginpass_swapchain_metal_expect_depthstenciltexture_notset, 1192 Validate_beginpass_swapchain_metal_expect_msaacolortexture, 1193 Validate_beginpass_swapchain_metal_expect_msaacolortexture_notset, 1194 Validate_beginpass_swapchain_d3d11_expect_renderview, 1195 Validate_beginpass_swapchain_d3d11_expect_renderview_notset, 1196 Validate_beginpass_swapchain_d3d11_expect_resolveview, 1197 Validate_beginpass_swapchain_d3d11_expect_resolveview_notset, 1198 Validate_beginpass_swapchain_d3d11_expect_depthstencilview, 1199 Validate_beginpass_swapchain_d3d11_expect_depthstencilview_notset, 1200 Validate_beginpass_swapchain_wgpu_expect_renderview, 1201 Validate_beginpass_swapchain_wgpu_expect_renderview_notset, 1202 Validate_beginpass_swapchain_wgpu_expect_resolveview, 1203 Validate_beginpass_swapchain_wgpu_expect_resolveview_notset, 1204 Validate_beginpass_swapchain_wgpu_expect_depthstencilview, 1205 Validate_beginpass_swapchain_wgpu_expect_depthstencilview_notset, 1206 Validate_beginpass_swapchain_gl_expect_framebuffer_notset, 1207 Validate_apip_pipeline_valid_id, 1208 Validate_apip_pipeline_exists, 1209 Validate_apip_pipeline_valid, 1210 Validate_apip_shader_exists, 1211 Validate_apip_shader_valid, 1212 Validate_apip_curpass_attachments_exists, 1213 Validate_apip_curpass_attachments_valid, 1214 Validate_apip_att_count, 1215 Validate_apip_color_format, 1216 Validate_apip_depth_format, 1217 Validate_apip_sample_count, 1218 Validate_abnd_pipeline, 1219 Validate_abnd_pipeline_exists, 1220 Validate_abnd_pipeline_valid, 1221 Validate_abnd_expected_vb, 1222 Validate_abnd_vb_exists, 1223 Validate_abnd_vb_type, 1224 Validate_abnd_vb_overflow, 1225 Validate_abnd_no_ib, 1226 Validate_abnd_ib, 1227 Validate_abnd_ib_exists, 1228 Validate_abnd_ib_type, 1229 Validate_abnd_ib_overflow, 1230 Validate_abnd_expected_image_binding, 1231 Validate_abnd_img_exists, 1232 Validate_abnd_image_type_mismatch, 1233 Validate_abnd_image_msaa, 1234 Validate_abnd_expected_filterable_image, 1235 Validate_abnd_expected_depth_image, 1236 Validate_abnd_expected_sampler_binding, 1237 Validate_abnd_unexpected_sampler_compare_never, 1238 Validate_abnd_expected_sampler_compare_never, 1239 Validate_abnd_expected_nonfiltering_sampler, 1240 Validate_abnd_smp_exists, 1241 Validate_abnd_expected_storagebuffer_binding, 1242 Validate_abnd_storagebuffer_exists, 1243 Validate_abnd_storagebuffer_binding_buffertype, 1244 Validate_aub_no_pipeline, 1245 Validate_aub_no_ub_at_slot, 1246 Validate_aub_size, 1247 Validate_updatebuf_usage, 1248 Validate_updatebuf_size, 1249 Validate_updatebuf_once, 1250 Validate_updatebuf_append, 1251 Validate_appendbuf_usage, 1252 Validate_appendbuf_size, 1253 Validate_appendbuf_update, 1254 Validate_updimg_usage, 1255 Validate_updimg_once, 1256 Validation_failed, 1257 } 1258 extern(C) 1259 struct EnvironmentDefaults { 1260 PixelFormat color_format; 1261 PixelFormat depth_format; 1262 int sample_count = 0; 1263 } 1264 extern(C) 1265 struct MetalEnvironment { 1266 const(void)* device = null; 1267 } 1268 extern(C) 1269 struct D3d11Environment { 1270 const(void)* device = null; 1271 const(void)* device_context = null; 1272 } 1273 extern(C) 1274 struct WgpuEnvironment { 1275 const(void)* device = null; 1276 } 1277 extern(C) 1278 struct Environment { 1279 EnvironmentDefaults defaults; 1280 MetalEnvironment metal; 1281 D3d11Environment d3d11; 1282 WgpuEnvironment wgpu; 1283 } 1284 extern(C) 1285 struct CommitListener { 1286 extern(C) void function(void*) func = null; 1287 void* user_data = null; 1288 } 1289 extern(C) 1290 struct Allocator { 1291 extern(C) void* function(size_t, void*) alloc_fn = null; 1292 extern(C) void function(void*, void*) free_fn = null; 1293 void* user_data = null; 1294 } 1295 extern(C) 1296 struct Logger { 1297 extern(C) void function(const(char)*, uint, uint, const(char)*, uint, const(char)*, void*) func = null; 1298 void* user_data = null; 1299 } 1300 extern(C) 1301 struct Desc { 1302 uint _start_canary = 0; 1303 int buffer_pool_size = 0; 1304 int image_pool_size = 0; 1305 int sampler_pool_size = 0; 1306 int shader_pool_size = 0; 1307 int pipeline_pool_size = 0; 1308 int attachments_pool_size = 0; 1309 int uniform_buffer_size = 0; 1310 int max_commit_listeners = 0; 1311 bool disable_validation = false; 1312 bool d3d11_shader_debugging = false; 1313 bool mtl_force_managed_storage_mode = false; 1314 bool mtl_use_command_buffer_with_retained_references = false; 1315 bool wgpu_disable_bindgroups_cache = false; 1316 int wgpu_bindgroups_cache_size = 0; 1317 Allocator allocator; 1318 Logger logger; 1319 Environment environment; 1320 uint _end_canary = 0; 1321 } 1322 extern(C) void sg_setup(const Desc *) @system @nogc nothrow; 1323 void setup(scope ref Desc desc) @trusted @nogc nothrow { 1324 sg_setup(&desc); 1325 } 1326 extern(C) void sg_shutdown() @system @nogc nothrow; 1327 void shutdown() @trusted @nogc nothrow { 1328 sg_shutdown(); 1329 } 1330 extern(C) bool sg_isvalid() @system @nogc nothrow; 1331 bool isvalid() @trusted @nogc nothrow { 1332 return sg_isvalid(); 1333 } 1334 extern(C) void sg_reset_state_cache() @system @nogc nothrow; 1335 void resetStateCache() @trusted @nogc nothrow { 1336 sg_reset_state_cache(); 1337 } 1338 extern(C) TraceHooks sg_install_trace_hooks(const TraceHooks *) @system @nogc nothrow; 1339 TraceHooks installTraceHooks(scope ref TraceHooks trace_hooks) @trusted @nogc nothrow { 1340 return sg_install_trace_hooks(&trace_hooks); 1341 } 1342 extern(C) void sg_push_debug_group(const(char)*) @system @nogc nothrow; 1343 void pushDebugGroup(scope const(char)* name) @trusted @nogc nothrow { 1344 sg_push_debug_group(name); 1345 } 1346 extern(C) void sg_pop_debug_group() @system @nogc nothrow; 1347 void popDebugGroup() @trusted @nogc nothrow { 1348 sg_pop_debug_group(); 1349 } 1350 extern(C) bool sg_add_commit_listener(CommitListener) @system @nogc nothrow; 1351 bool addCommitListener(CommitListener listener) @trusted @nogc nothrow { 1352 return sg_add_commit_listener(listener); 1353 } 1354 extern(C) bool sg_remove_commit_listener(CommitListener) @system @nogc nothrow; 1355 bool removeCommitListener(CommitListener listener) @trusted @nogc nothrow { 1356 return sg_remove_commit_listener(listener); 1357 } 1358 extern(C) Buffer sg_make_buffer(const BufferDesc *) @system @nogc nothrow; 1359 Buffer makeBuffer(scope ref BufferDesc desc) @trusted @nogc nothrow { 1360 return sg_make_buffer(&desc); 1361 } 1362 extern(C) Image sg_make_image(const ImageDesc *) @system @nogc nothrow; 1363 Image makeImage(scope ref ImageDesc desc) @trusted @nogc nothrow { 1364 return sg_make_image(&desc); 1365 } 1366 extern(C) Sampler sg_make_sampler(const SamplerDesc *) @system @nogc nothrow; 1367 Sampler makeSampler(scope ref SamplerDesc desc) @trusted @nogc nothrow { 1368 return sg_make_sampler(&desc); 1369 } 1370 extern(C) Shader sg_make_shader(const ShaderDesc *) @system @nogc nothrow; 1371 Shader makeShader(scope ref ShaderDesc desc) @trusted @nogc nothrow { 1372 return sg_make_shader(&desc); 1373 } 1374 extern(C) Pipeline sg_make_pipeline(const PipelineDesc *) @system @nogc nothrow; 1375 Pipeline makePipeline(scope ref PipelineDesc desc) @trusted @nogc nothrow { 1376 return sg_make_pipeline(&desc); 1377 } 1378 extern(C) Attachments sg_make_attachments(const AttachmentsDesc *) @system @nogc nothrow; 1379 Attachments makeAttachments(scope ref AttachmentsDesc desc) @trusted @nogc nothrow { 1380 return sg_make_attachments(&desc); 1381 } 1382 extern(C) void sg_destroy_buffer(Buffer) @system @nogc nothrow; 1383 void destroyBuffer(Buffer buf) @trusted @nogc nothrow { 1384 sg_destroy_buffer(buf); 1385 } 1386 extern(C) void sg_destroy_image(Image) @system @nogc nothrow; 1387 void destroyImage(Image img) @trusted @nogc nothrow { 1388 sg_destroy_image(img); 1389 } 1390 extern(C) void sg_destroy_sampler(Sampler) @system @nogc nothrow; 1391 void destroySampler(Sampler smp) @trusted @nogc nothrow { 1392 sg_destroy_sampler(smp); 1393 } 1394 extern(C) void sg_destroy_shader(Shader) @system @nogc nothrow; 1395 void destroyShader(Shader shd) @trusted @nogc nothrow { 1396 sg_destroy_shader(shd); 1397 } 1398 extern(C) void sg_destroy_pipeline(Pipeline) @system @nogc nothrow; 1399 void destroyPipeline(Pipeline pip) @trusted @nogc nothrow { 1400 sg_destroy_pipeline(pip); 1401 } 1402 extern(C) void sg_destroy_attachments(Attachments) @system @nogc nothrow; 1403 void destroyAttachments(Attachments atts) @trusted @nogc nothrow { 1404 sg_destroy_attachments(atts); 1405 } 1406 extern(C) void sg_update_buffer(Buffer, const Range *) @system @nogc nothrow; 1407 void updateBuffer(Buffer buf, scope ref Range data) @trusted @nogc nothrow { 1408 sg_update_buffer(buf, &data); 1409 } 1410 extern(C) void sg_update_image(Image, const ImageData *) @system @nogc nothrow; 1411 void updateImage(Image img, scope ref ImageData data) @trusted @nogc nothrow { 1412 sg_update_image(img, &data); 1413 } 1414 extern(C) int sg_append_buffer(Buffer, const Range *) @system @nogc nothrow; 1415 int appendBuffer(Buffer buf, scope ref Range data) @trusted @nogc nothrow { 1416 return sg_append_buffer(buf, &data); 1417 } 1418 extern(C) bool sg_query_buffer_overflow(Buffer) @system @nogc nothrow; 1419 bool queryBufferOverflow(Buffer buf) @trusted @nogc nothrow { 1420 return sg_query_buffer_overflow(buf); 1421 } 1422 extern(C) bool sg_query_buffer_will_overflow(Buffer, size_t) @system @nogc nothrow; 1423 bool queryBufferWillOverflow(Buffer buf, size_t size) @trusted @nogc nothrow { 1424 return sg_query_buffer_will_overflow(buf, size); 1425 } 1426 extern(C) void sg_begin_pass(const Pass *) @system @nogc nothrow; 1427 void beginPass(scope ref Pass pass) @trusted @nogc nothrow { 1428 sg_begin_pass(&pass); 1429 } 1430 extern(C) void sg_apply_viewport(int, int, int, int, bool) @system @nogc nothrow; 1431 void applyViewport(int x, int y, int width, int height, bool origin_top_left) @trusted @nogc nothrow { 1432 sg_apply_viewport(x, y, width, height, origin_top_left); 1433 } 1434 extern(C) void sg_apply_viewportf(float, float, float, float, bool) @system @nogc nothrow; 1435 void applyViewportf(float x, float y, float width, float height, bool origin_top_left) @trusted @nogc nothrow { 1436 sg_apply_viewportf(x, y, width, height, origin_top_left); 1437 } 1438 extern(C) void sg_apply_scissor_rect(int, int, int, int, bool) @system @nogc nothrow; 1439 void applyScissorRect(int x, int y, int width, int height, bool origin_top_left) @trusted @nogc nothrow { 1440 sg_apply_scissor_rect(x, y, width, height, origin_top_left); 1441 } 1442 extern(C) void sg_apply_scissor_rectf(float, float, float, float, bool) @system @nogc nothrow; 1443 void applyScissorRectf(float x, float y, float width, float height, bool origin_top_left) @trusted @nogc nothrow { 1444 sg_apply_scissor_rectf(x, y, width, height, origin_top_left); 1445 } 1446 extern(C) void sg_apply_pipeline(Pipeline) @system @nogc nothrow; 1447 void applyPipeline(Pipeline pip) @trusted @nogc nothrow { 1448 sg_apply_pipeline(pip); 1449 } 1450 extern(C) void sg_apply_bindings(const Bindings *) @system @nogc nothrow; 1451 void applyBindings(scope ref Bindings bindings) @trusted @nogc nothrow { 1452 sg_apply_bindings(&bindings); 1453 } 1454 extern(C) void sg_apply_uniforms(uint, const Range *) @system @nogc nothrow; 1455 void applyUniforms(uint ub_slot, scope ref Range data) @trusted @nogc nothrow { 1456 sg_apply_uniforms(ub_slot, &data); 1457 } 1458 extern(C) void sg_draw(uint, uint, uint) @system @nogc nothrow; 1459 void draw(uint base_element, uint num_elements, uint num_instances) @trusted @nogc nothrow { 1460 sg_draw(base_element, num_elements, num_instances); 1461 } 1462 extern(C) void sg_end_pass() @system @nogc nothrow; 1463 void endPass() @trusted @nogc nothrow { 1464 sg_end_pass(); 1465 } 1466 extern(C) void sg_commit() @system @nogc nothrow; 1467 void commit() @trusted @nogc nothrow { 1468 sg_commit(); 1469 } 1470 extern(C) Desc sg_query_desc() @system @nogc nothrow; 1471 Desc queryDesc() @trusted @nogc nothrow { 1472 return sg_query_desc(); 1473 } 1474 extern(C) Backend sg_query_backend() @system @nogc nothrow; 1475 Backend queryBackend() @trusted @nogc nothrow { 1476 return sg_query_backend(); 1477 } 1478 extern(C) Features sg_query_features() @system @nogc nothrow; 1479 Features queryFeatures() @trusted @nogc nothrow { 1480 return sg_query_features(); 1481 } 1482 extern(C) Limits sg_query_limits() @system @nogc nothrow; 1483 Limits queryLimits() @trusted @nogc nothrow { 1484 return sg_query_limits(); 1485 } 1486 extern(C) PixelformatInfo sg_query_pixelformat(PixelFormat) @system @nogc nothrow; 1487 PixelformatInfo queryPixelformat(PixelFormat fmt) @trusted @nogc nothrow { 1488 return sg_query_pixelformat(fmt); 1489 } 1490 extern(C) int sg_query_row_pitch(PixelFormat, int, int) @system @nogc nothrow; 1491 int queryRowPitch(PixelFormat fmt, int width, int row_align_bytes) @trusted @nogc nothrow { 1492 return sg_query_row_pitch(fmt, width, row_align_bytes); 1493 } 1494 extern(C) int sg_query_surface_pitch(PixelFormat, int, int, int) @system @nogc nothrow; 1495 int querySurfacePitch(PixelFormat fmt, int width, int height, int row_align_bytes) @trusted @nogc nothrow { 1496 return sg_query_surface_pitch(fmt, width, height, row_align_bytes); 1497 } 1498 extern(C) ResourceState sg_query_buffer_state(Buffer) @system @nogc nothrow; 1499 ResourceState queryBufferState(Buffer buf) @trusted @nogc nothrow { 1500 return sg_query_buffer_state(buf); 1501 } 1502 extern(C) ResourceState sg_query_image_state(Image) @system @nogc nothrow; 1503 ResourceState queryImageState(Image img) @trusted @nogc nothrow { 1504 return sg_query_image_state(img); 1505 } 1506 extern(C) ResourceState sg_query_sampler_state(Sampler) @system @nogc nothrow; 1507 ResourceState querySamplerState(Sampler smp) @trusted @nogc nothrow { 1508 return sg_query_sampler_state(smp); 1509 } 1510 extern(C) ResourceState sg_query_shader_state(Shader) @system @nogc nothrow; 1511 ResourceState queryShaderState(Shader shd) @trusted @nogc nothrow { 1512 return sg_query_shader_state(shd); 1513 } 1514 extern(C) ResourceState sg_query_pipeline_state(Pipeline) @system @nogc nothrow; 1515 ResourceState queryPipelineState(Pipeline pip) @trusted @nogc nothrow { 1516 return sg_query_pipeline_state(pip); 1517 } 1518 extern(C) ResourceState sg_query_attachments_state(Attachments) @system @nogc nothrow; 1519 ResourceState queryAttachmentsState(Attachments atts) @trusted @nogc nothrow { 1520 return sg_query_attachments_state(atts); 1521 } 1522 extern(C) BufferInfo sg_query_buffer_info(Buffer) @system @nogc nothrow; 1523 BufferInfo queryBufferInfo(Buffer buf) @trusted @nogc nothrow { 1524 return sg_query_buffer_info(buf); 1525 } 1526 extern(C) ImageInfo sg_query_image_info(Image) @system @nogc nothrow; 1527 ImageInfo queryImageInfo(Image img) @trusted @nogc nothrow { 1528 return sg_query_image_info(img); 1529 } 1530 extern(C) SamplerInfo sg_query_sampler_info(Sampler) @system @nogc nothrow; 1531 SamplerInfo querySamplerInfo(Sampler smp) @trusted @nogc nothrow { 1532 return sg_query_sampler_info(smp); 1533 } 1534 extern(C) ShaderInfo sg_query_shader_info(Shader) @system @nogc nothrow; 1535 ShaderInfo queryShaderInfo(Shader shd) @trusted @nogc nothrow { 1536 return sg_query_shader_info(shd); 1537 } 1538 extern(C) PipelineInfo sg_query_pipeline_info(Pipeline) @system @nogc nothrow; 1539 PipelineInfo queryPipelineInfo(Pipeline pip) @trusted @nogc nothrow { 1540 return sg_query_pipeline_info(pip); 1541 } 1542 extern(C) AttachmentsInfo sg_query_attachments_info(Attachments) @system @nogc nothrow; 1543 AttachmentsInfo queryAttachmentsInfo(Attachments atts) @trusted @nogc nothrow { 1544 return sg_query_attachments_info(atts); 1545 } 1546 extern(C) BufferDesc sg_query_buffer_desc(Buffer) @system @nogc nothrow; 1547 BufferDesc queryBufferDesc(Buffer buf) @trusted @nogc nothrow { 1548 return sg_query_buffer_desc(buf); 1549 } 1550 extern(C) ImageDesc sg_query_image_desc(Image) @system @nogc nothrow; 1551 ImageDesc queryImageDesc(Image img) @trusted @nogc nothrow { 1552 return sg_query_image_desc(img); 1553 } 1554 extern(C) SamplerDesc sg_query_sampler_desc(Sampler) @system @nogc nothrow; 1555 SamplerDesc querySamplerDesc(Sampler smp) @trusted @nogc nothrow { 1556 return sg_query_sampler_desc(smp); 1557 } 1558 extern(C) ShaderDesc sg_query_shader_desc(Shader) @system @nogc nothrow; 1559 ShaderDesc queryShaderDesc(Shader shd) @trusted @nogc nothrow { 1560 return sg_query_shader_desc(shd); 1561 } 1562 extern(C) PipelineDesc sg_query_pipeline_desc(Pipeline) @system @nogc nothrow; 1563 PipelineDesc queryPipelineDesc(Pipeline pip) @trusted @nogc nothrow { 1564 return sg_query_pipeline_desc(pip); 1565 } 1566 extern(C) AttachmentsDesc sg_query_attachments_desc(Attachments) @system @nogc nothrow; 1567 AttachmentsDesc queryAttachmentsDesc(Attachments atts) @trusted @nogc nothrow { 1568 return sg_query_attachments_desc(atts); 1569 } 1570 extern(C) BufferDesc sg_query_buffer_defaults(const BufferDesc *) @system @nogc nothrow; 1571 BufferDesc queryBufferDefaults(scope ref BufferDesc desc) @trusted @nogc nothrow { 1572 return sg_query_buffer_defaults(&desc); 1573 } 1574 extern(C) ImageDesc sg_query_image_defaults(const ImageDesc *) @system @nogc nothrow; 1575 ImageDesc queryImageDefaults(scope ref ImageDesc desc) @trusted @nogc nothrow { 1576 return sg_query_image_defaults(&desc); 1577 } 1578 extern(C) SamplerDesc sg_query_sampler_defaults(const SamplerDesc *) @system @nogc nothrow; 1579 SamplerDesc querySamplerDefaults(scope ref SamplerDesc desc) @trusted @nogc nothrow { 1580 return sg_query_sampler_defaults(&desc); 1581 } 1582 extern(C) ShaderDesc sg_query_shader_defaults(const ShaderDesc *) @system @nogc nothrow; 1583 ShaderDesc queryShaderDefaults(scope ref ShaderDesc desc) @trusted @nogc nothrow { 1584 return sg_query_shader_defaults(&desc); 1585 } 1586 extern(C) PipelineDesc sg_query_pipeline_defaults(const PipelineDesc *) @system @nogc nothrow; 1587 PipelineDesc queryPipelineDefaults(scope ref PipelineDesc desc) @trusted @nogc nothrow { 1588 return sg_query_pipeline_defaults(&desc); 1589 } 1590 extern(C) AttachmentsDesc sg_query_attachments_defaults(const AttachmentsDesc *) @system @nogc nothrow; 1591 AttachmentsDesc queryAttachmentsDefaults(scope ref AttachmentsDesc desc) @trusted @nogc nothrow { 1592 return sg_query_attachments_defaults(&desc); 1593 } 1594 extern(C) Buffer sg_alloc_buffer() @system @nogc nothrow; 1595 Buffer allocBuffer() @trusted @nogc nothrow { 1596 return sg_alloc_buffer(); 1597 } 1598 extern(C) Image sg_alloc_image() @system @nogc nothrow; 1599 Image allocImage() @trusted @nogc nothrow { 1600 return sg_alloc_image(); 1601 } 1602 extern(C) Sampler sg_alloc_sampler() @system @nogc nothrow; 1603 Sampler allocSampler() @trusted @nogc nothrow { 1604 return sg_alloc_sampler(); 1605 } 1606 extern(C) Shader sg_alloc_shader() @system @nogc nothrow; 1607 Shader allocShader() @trusted @nogc nothrow { 1608 return sg_alloc_shader(); 1609 } 1610 extern(C) Pipeline sg_alloc_pipeline() @system @nogc nothrow; 1611 Pipeline allocPipeline() @trusted @nogc nothrow { 1612 return sg_alloc_pipeline(); 1613 } 1614 extern(C) Attachments sg_alloc_attachments() @system @nogc nothrow; 1615 Attachments allocAttachments() @trusted @nogc nothrow { 1616 return sg_alloc_attachments(); 1617 } 1618 extern(C) void sg_dealloc_buffer(Buffer) @system @nogc nothrow; 1619 void deallocBuffer(Buffer buf) @trusted @nogc nothrow { 1620 sg_dealloc_buffer(buf); 1621 } 1622 extern(C) void sg_dealloc_image(Image) @system @nogc nothrow; 1623 void deallocImage(Image img) @trusted @nogc nothrow { 1624 sg_dealloc_image(img); 1625 } 1626 extern(C) void sg_dealloc_sampler(Sampler) @system @nogc nothrow; 1627 void deallocSampler(Sampler smp) @trusted @nogc nothrow { 1628 sg_dealloc_sampler(smp); 1629 } 1630 extern(C) void sg_dealloc_shader(Shader) @system @nogc nothrow; 1631 void deallocShader(Shader shd) @trusted @nogc nothrow { 1632 sg_dealloc_shader(shd); 1633 } 1634 extern(C) void sg_dealloc_pipeline(Pipeline) @system @nogc nothrow; 1635 void deallocPipeline(Pipeline pip) @trusted @nogc nothrow { 1636 sg_dealloc_pipeline(pip); 1637 } 1638 extern(C) void sg_dealloc_attachments(Attachments) @system @nogc nothrow; 1639 void deallocAttachments(Attachments attachments) @trusted @nogc nothrow { 1640 sg_dealloc_attachments(attachments); 1641 } 1642 extern(C) void sg_init_buffer(Buffer, const BufferDesc *) @system @nogc nothrow; 1643 void initBuffer(Buffer buf, scope ref BufferDesc desc) @trusted @nogc nothrow { 1644 sg_init_buffer(buf, &desc); 1645 } 1646 extern(C) void sg_init_image(Image, const ImageDesc *) @system @nogc nothrow; 1647 void initImage(Image img, scope ref ImageDesc desc) @trusted @nogc nothrow { 1648 sg_init_image(img, &desc); 1649 } 1650 extern(C) void sg_init_sampler(Sampler, const SamplerDesc *) @system @nogc nothrow; 1651 void initSampler(Sampler smg, scope ref SamplerDesc desc) @trusted @nogc nothrow { 1652 sg_init_sampler(smg, &desc); 1653 } 1654 extern(C) void sg_init_shader(Shader, const ShaderDesc *) @system @nogc nothrow; 1655 void initShader(Shader shd, scope ref ShaderDesc desc) @trusted @nogc nothrow { 1656 sg_init_shader(shd, &desc); 1657 } 1658 extern(C) void sg_init_pipeline(Pipeline, const PipelineDesc *) @system @nogc nothrow; 1659 void initPipeline(Pipeline pip, scope ref PipelineDesc desc) @trusted @nogc nothrow { 1660 sg_init_pipeline(pip, &desc); 1661 } 1662 extern(C) void sg_init_attachments(Attachments, const AttachmentsDesc *) @system @nogc nothrow; 1663 void initAttachments(Attachments attachments, scope ref AttachmentsDesc desc) @trusted @nogc nothrow { 1664 sg_init_attachments(attachments, &desc); 1665 } 1666 extern(C) void sg_uninit_buffer(Buffer) @system @nogc nothrow; 1667 void uninitBuffer(Buffer buf) @trusted @nogc nothrow { 1668 sg_uninit_buffer(buf); 1669 } 1670 extern(C) void sg_uninit_image(Image) @system @nogc nothrow; 1671 void uninitImage(Image img) @trusted @nogc nothrow { 1672 sg_uninit_image(img); 1673 } 1674 extern(C) void sg_uninit_sampler(Sampler) @system @nogc nothrow; 1675 void uninitSampler(Sampler smp) @trusted @nogc nothrow { 1676 sg_uninit_sampler(smp); 1677 } 1678 extern(C) void sg_uninit_shader(Shader) @system @nogc nothrow; 1679 void uninitShader(Shader shd) @trusted @nogc nothrow { 1680 sg_uninit_shader(shd); 1681 } 1682 extern(C) void sg_uninit_pipeline(Pipeline) @system @nogc nothrow; 1683 void uninitPipeline(Pipeline pip) @trusted @nogc nothrow { 1684 sg_uninit_pipeline(pip); 1685 } 1686 extern(C) void sg_uninit_attachments(Attachments) @system @nogc nothrow; 1687 void uninitAttachments(Attachments atts) @trusted @nogc nothrow { 1688 sg_uninit_attachments(atts); 1689 } 1690 extern(C) void sg_fail_buffer(Buffer) @system @nogc nothrow; 1691 void failBuffer(Buffer buf) @trusted @nogc nothrow { 1692 sg_fail_buffer(buf); 1693 } 1694 extern(C) void sg_fail_image(Image) @system @nogc nothrow; 1695 void failImage(Image img) @trusted @nogc nothrow { 1696 sg_fail_image(img); 1697 } 1698 extern(C) void sg_fail_sampler(Sampler) @system @nogc nothrow; 1699 void failSampler(Sampler smp) @trusted @nogc nothrow { 1700 sg_fail_sampler(smp); 1701 } 1702 extern(C) void sg_fail_shader(Shader) @system @nogc nothrow; 1703 void failShader(Shader shd) @trusted @nogc nothrow { 1704 sg_fail_shader(shd); 1705 } 1706 extern(C) void sg_fail_pipeline(Pipeline) @system @nogc nothrow; 1707 void failPipeline(Pipeline pip) @trusted @nogc nothrow { 1708 sg_fail_pipeline(pip); 1709 } 1710 extern(C) void sg_fail_attachments(Attachments) @system @nogc nothrow; 1711 void failAttachments(Attachments atts) @trusted @nogc nothrow { 1712 sg_fail_attachments(atts); 1713 } 1714 extern(C) void sg_enable_frame_stats() @system @nogc nothrow; 1715 void enableFrameStats() @trusted @nogc nothrow { 1716 sg_enable_frame_stats(); 1717 } 1718 extern(C) void sg_disable_frame_stats() @system @nogc nothrow; 1719 void disableFrameStats() @trusted @nogc nothrow { 1720 sg_disable_frame_stats(); 1721 } 1722 extern(C) bool sg_frame_stats_enabled() @system @nogc nothrow; 1723 bool frameStatsEnabled() @trusted @nogc nothrow { 1724 return sg_frame_stats_enabled(); 1725 } 1726 extern(C) FrameStats sg_query_frame_stats() @system @nogc nothrow; 1727 FrameStats queryFrameStats() @trusted @nogc nothrow { 1728 return sg_query_frame_stats(); 1729 } 1730 extern(C) 1731 struct D3d11BufferInfo { 1732 const(void)* buf = null; 1733 } 1734 extern(C) 1735 struct D3d11ImageInfo { 1736 const(void)* tex2d = null; 1737 const(void)* tex3d = null; 1738 const(void)* res = null; 1739 const(void)* srv = null; 1740 } 1741 extern(C) 1742 struct D3d11SamplerInfo { 1743 const(void)* smp = null; 1744 } 1745 extern(C) 1746 struct D3d11ShaderInfo { 1747 const(void)*[8] cbufs = null; 1748 const(void)* vs = null; 1749 const(void)* fs = null; 1750 } 1751 extern(C) 1752 struct D3d11PipelineInfo { 1753 const(void)* il = null; 1754 const(void)* rs = null; 1755 const(void)* dss = null; 1756 const(void)* bs = null; 1757 } 1758 extern(C) 1759 struct D3d11AttachmentsInfo { 1760 const(void)*[4] color_rtv = null; 1761 const(void)*[4] resolve_rtv = null; 1762 const(void)* dsv = null; 1763 } 1764 extern(C) 1765 struct MtlBufferInfo { 1766 const(void)*[2] buf = null; 1767 int active_slot = 0; 1768 } 1769 extern(C) 1770 struct MtlImageInfo { 1771 const(void)*[2] tex = null; 1772 int active_slot = 0; 1773 } 1774 extern(C) 1775 struct MtlSamplerInfo { 1776 const(void)* smp = null; 1777 } 1778 extern(C) 1779 struct MtlShaderInfo { 1780 const(void)* vertex_lib = null; 1781 const(void)* fragment_lib = null; 1782 const(void)* vertex_func = null; 1783 const(void)* fragment_func = null; 1784 } 1785 extern(C) 1786 struct MtlPipelineInfo { 1787 const(void)* rps = null; 1788 const(void)* dss = null; 1789 } 1790 extern(C) 1791 struct WgpuBufferInfo { 1792 const(void)* buf = null; 1793 } 1794 extern(C) 1795 struct WgpuImageInfo { 1796 const(void)* tex = null; 1797 const(void)* view = null; 1798 } 1799 extern(C) 1800 struct WgpuSamplerInfo { 1801 const(void)* smp = null; 1802 } 1803 extern(C) 1804 struct WgpuShaderInfo { 1805 const(void)* vs_mod = null; 1806 const(void)* fs_mod = null; 1807 const(void)* bgl = null; 1808 } 1809 extern(C) 1810 struct WgpuPipelineInfo { 1811 const(void)* pip = null; 1812 } 1813 extern(C) 1814 struct WgpuAttachmentsInfo { 1815 const(void)*[4] color_view = null; 1816 const(void)*[4] resolve_view = null; 1817 const(void)* ds_view = null; 1818 } 1819 extern(C) 1820 struct GlBufferInfo { 1821 uint[2] buf = 0; 1822 int active_slot = 0; 1823 } 1824 extern(C) 1825 struct GlImageInfo { 1826 uint[2] tex = 0; 1827 uint tex_target = 0; 1828 uint msaa_render_buffer = 0; 1829 int active_slot = 0; 1830 } 1831 extern(C) 1832 struct GlSamplerInfo { 1833 uint smp = 0; 1834 } 1835 extern(C) 1836 struct GlShaderInfo { 1837 uint prog = 0; 1838 } 1839 extern(C) 1840 struct GlAttachmentsInfo { 1841 uint framebuffer = 0; 1842 uint[4] msaa_resolve_framebuffer = 0; 1843 } 1844 extern(C) const(void)* sg_d3d11_device() @system @nogc nothrow; 1845 scope const(void)* d3d11Device() @trusted @nogc nothrow { 1846 return sg_d3d11_device(); 1847 } 1848 extern(C) const(void)* sg_d3d11_device_context() @system @nogc nothrow; 1849 scope const(void)* d3d11DeviceContext() @trusted @nogc nothrow { 1850 return sg_d3d11_device_context(); 1851 } 1852 extern(C) D3d11BufferInfo sg_d3d11_query_buffer_info(Buffer) @system @nogc nothrow; 1853 D3d11BufferInfo d3d11QueryBufferInfo(Buffer buf) @trusted @nogc nothrow { 1854 return sg_d3d11_query_buffer_info(buf); 1855 } 1856 extern(C) D3d11ImageInfo sg_d3d11_query_image_info(Image) @system @nogc nothrow; 1857 D3d11ImageInfo d3d11QueryImageInfo(Image img) @trusted @nogc nothrow { 1858 return sg_d3d11_query_image_info(img); 1859 } 1860 extern(C) D3d11SamplerInfo sg_d3d11_query_sampler_info(Sampler) @system @nogc nothrow; 1861 D3d11SamplerInfo d3d11QuerySamplerInfo(Sampler smp) @trusted @nogc nothrow { 1862 return sg_d3d11_query_sampler_info(smp); 1863 } 1864 extern(C) D3d11ShaderInfo sg_d3d11_query_shader_info(Shader) @system @nogc nothrow; 1865 D3d11ShaderInfo d3d11QueryShaderInfo(Shader shd) @trusted @nogc nothrow { 1866 return sg_d3d11_query_shader_info(shd); 1867 } 1868 extern(C) D3d11PipelineInfo sg_d3d11_query_pipeline_info(Pipeline) @system @nogc nothrow; 1869 D3d11PipelineInfo d3d11QueryPipelineInfo(Pipeline pip) @trusted @nogc nothrow { 1870 return sg_d3d11_query_pipeline_info(pip); 1871 } 1872 extern(C) D3d11AttachmentsInfo sg_d3d11_query_attachments_info(Attachments) @system @nogc nothrow; 1873 D3d11AttachmentsInfo d3d11QueryAttachmentsInfo(Attachments atts) @trusted @nogc nothrow { 1874 return sg_d3d11_query_attachments_info(atts); 1875 } 1876 extern(C) const(void)* sg_mtl_device() @system @nogc nothrow; 1877 scope const(void)* mtlDevice() @trusted @nogc nothrow { 1878 return sg_mtl_device(); 1879 } 1880 extern(C) const(void)* sg_mtl_render_command_encoder() @system @nogc nothrow; 1881 scope const(void)* mtlRenderCommandEncoder() @trusted @nogc nothrow { 1882 return sg_mtl_render_command_encoder(); 1883 } 1884 extern(C) MtlBufferInfo sg_mtl_query_buffer_info(Buffer) @system @nogc nothrow; 1885 MtlBufferInfo mtlQueryBufferInfo(Buffer buf) @trusted @nogc nothrow { 1886 return sg_mtl_query_buffer_info(buf); 1887 } 1888 extern(C) MtlImageInfo sg_mtl_query_image_info(Image) @system @nogc nothrow; 1889 MtlImageInfo mtlQueryImageInfo(Image img) @trusted @nogc nothrow { 1890 return sg_mtl_query_image_info(img); 1891 } 1892 extern(C) MtlSamplerInfo sg_mtl_query_sampler_info(Sampler) @system @nogc nothrow; 1893 MtlSamplerInfo mtlQuerySamplerInfo(Sampler smp) @trusted @nogc nothrow { 1894 return sg_mtl_query_sampler_info(smp); 1895 } 1896 extern(C) MtlShaderInfo sg_mtl_query_shader_info(Shader) @system @nogc nothrow; 1897 MtlShaderInfo mtlQueryShaderInfo(Shader shd) @trusted @nogc nothrow { 1898 return sg_mtl_query_shader_info(shd); 1899 } 1900 extern(C) MtlPipelineInfo sg_mtl_query_pipeline_info(Pipeline) @system @nogc nothrow; 1901 MtlPipelineInfo mtlQueryPipelineInfo(Pipeline pip) @trusted @nogc nothrow { 1902 return sg_mtl_query_pipeline_info(pip); 1903 } 1904 extern(C) const(void)* sg_wgpu_device() @system @nogc nothrow; 1905 scope const(void)* wgpuDevice() @trusted @nogc nothrow { 1906 return sg_wgpu_device(); 1907 } 1908 extern(C) const(void)* sg_wgpu_queue() @system @nogc nothrow; 1909 scope const(void)* wgpuQueue() @trusted @nogc nothrow { 1910 return sg_wgpu_queue(); 1911 } 1912 extern(C) const(void)* sg_wgpu_command_encoder() @system @nogc nothrow; 1913 scope const(void)* wgpuCommandEncoder() @trusted @nogc nothrow { 1914 return sg_wgpu_command_encoder(); 1915 } 1916 extern(C) const(void)* sg_wgpu_render_pass_encoder() @system @nogc nothrow; 1917 scope const(void)* wgpuRenderPassEncoder() @trusted @nogc nothrow { 1918 return sg_wgpu_render_pass_encoder(); 1919 } 1920 extern(C) WgpuBufferInfo sg_wgpu_query_buffer_info(Buffer) @system @nogc nothrow; 1921 WgpuBufferInfo wgpuQueryBufferInfo(Buffer buf) @trusted @nogc nothrow { 1922 return sg_wgpu_query_buffer_info(buf); 1923 } 1924 extern(C) WgpuImageInfo sg_wgpu_query_image_info(Image) @system @nogc nothrow; 1925 WgpuImageInfo wgpuQueryImageInfo(Image img) @trusted @nogc nothrow { 1926 return sg_wgpu_query_image_info(img); 1927 } 1928 extern(C) WgpuSamplerInfo sg_wgpu_query_sampler_info(Sampler) @system @nogc nothrow; 1929 WgpuSamplerInfo wgpuQuerySamplerInfo(Sampler smp) @trusted @nogc nothrow { 1930 return sg_wgpu_query_sampler_info(smp); 1931 } 1932 extern(C) WgpuShaderInfo sg_wgpu_query_shader_info(Shader) @system @nogc nothrow; 1933 WgpuShaderInfo wgpuQueryShaderInfo(Shader shd) @trusted @nogc nothrow { 1934 return sg_wgpu_query_shader_info(shd); 1935 } 1936 extern(C) WgpuPipelineInfo sg_wgpu_query_pipeline_info(Pipeline) @system @nogc nothrow; 1937 WgpuPipelineInfo wgpuQueryPipelineInfo(Pipeline pip) @trusted @nogc nothrow { 1938 return sg_wgpu_query_pipeline_info(pip); 1939 } 1940 extern(C) WgpuAttachmentsInfo sg_wgpu_query_attachments_info(Attachments) @system @nogc nothrow; 1941 WgpuAttachmentsInfo wgpuQueryAttachmentsInfo(Attachments atts) @trusted @nogc nothrow { 1942 return sg_wgpu_query_attachments_info(atts); 1943 } 1944 extern(C) GlBufferInfo sg_gl_query_buffer_info(Buffer) @system @nogc nothrow; 1945 GlBufferInfo glQueryBufferInfo(Buffer buf) @trusted @nogc nothrow { 1946 return sg_gl_query_buffer_info(buf); 1947 } 1948 extern(C) GlImageInfo sg_gl_query_image_info(Image) @system @nogc nothrow; 1949 GlImageInfo glQueryImageInfo(Image img) @trusted @nogc nothrow { 1950 return sg_gl_query_image_info(img); 1951 } 1952 extern(C) GlSamplerInfo sg_gl_query_sampler_info(Sampler) @system @nogc nothrow; 1953 GlSamplerInfo glQuerySamplerInfo(Sampler smp) @trusted @nogc nothrow { 1954 return sg_gl_query_sampler_info(smp); 1955 } 1956 extern(C) GlShaderInfo sg_gl_query_shader_info(Shader) @system @nogc nothrow; 1957 GlShaderInfo glQueryShaderInfo(Shader shd) @trusted @nogc nothrow { 1958 return sg_gl_query_shader_info(shd); 1959 } 1960 extern(C) GlAttachmentsInfo sg_gl_query_attachments_info(Attachments) @system @nogc nothrow; 1961 GlAttachmentsInfo glQueryAttachmentsInfo(Attachments atts) @trusted @nogc nothrow { 1962 return sg_gl_query_attachments_info(atts); 1963 }