hotline-rs 0.3.2

A high-performance, hot-reload graphics engine.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
// currently windows only because here we need a concrete gfx and os implementation
#![cfg(target_os = "windows")]

use std::{collections::HashMap, fmt::Debug};

use hotline_rs::prelude::*;

#[repr(C)]
struct Vertex {
    position: [f32; 3],
    color: [f32; 4],
}

#[test]
fn create_app() {
    let _app = os_platform::App::create(os::AppInfo {
        name: String::from("create_app"),
        window: false,
        num_buffers: 0,
        dpi_aware: true,
    });
}

#[test]
fn create_d3d12_device() {
    let _ = os_platform::App::create(os::AppInfo {
        name: String::from("create_d3d12_device"),
        window: false,
        num_buffers: 0,
        dpi_aware: true,
    });
    let _dev = gfx_platform::Device::create(&gfx::DeviceInfo {
        adapter_name: None,
        shader_heap_size: 1,
        render_target_heap_size: 1,
        depth_stencil_heap_size: 1,
    });
}

#[test]
fn create_window() {
    let mut app = os_platform::App::create(os::AppInfo {
        name: String::from("create_window"),
        window: false,
        num_buffers: 0,
        dpi_aware: true,
    });
    let win = app.create_window(os::WindowInfo {
        title: String::from("hello world!"),
        rect: os::Rect {
            x: 0,
            y: 0,
            width: 1280,
            height: 720,
        },
        style: os::WindowStyleFlags::NONE,
        parent_handle: None,
    });
    win.bring_to_front();
    let size = win.get_size();
    let pos = win.get_pos();
    assert_eq!(pos.x, 0);
    assert_eq!(pos.y, 0);
    assert_eq!(size.x, 1280);
    assert_eq!(size.y, 720);
}

#[test]
fn swap_chain_buffer() -> Result<(), hotline_rs::Error> {
    let mut app = os_platform::App::create(os::AppInfo {
        name: String::from("swap_chain_buffer"),
        window: false,
        num_buffers: 0,
        dpi_aware: true,
    });
    let mut dev = gfx_platform::Device::create(&gfx::DeviceInfo {
        adapter_name: None,
        shader_heap_size: 0,
        render_target_heap_size: 2,
        depth_stencil_heap_size: 0,
    });
    let mut win = app.create_window(os::WindowInfo {
        title: String::from("swap chain buffering"),
        rect: os::Rect {
            x: 0,
            y: 0,
            width: 1280,
            height: 720,
        },
        style: os::WindowStyleFlags::NONE,
        parent_handle: None,
    });
    win.bring_to_front();

    let swap_chain_info = gfx::SwapChainInfo {
        num_buffers: 2,
        format: gfx::Format::RGBA8n,
        clear_colour: None,
    };

    let mut swap_chain = dev.create_swap_chain::<os_platform::App>(&swap_chain_info, &win)?;
    let mut cmd = dev.create_cmd_buf(2);

    let clears_colours: [gfx::ClearColour; 4] = [
        gfx::ClearColour {
            r: 1.0,
            g: 0.0,
            b: 1.0,
            a: 1.0,
        },
        gfx::ClearColour {
            r: 1.0,
            g: 1.0,
            b: 0.0,
            a: 1.0,
        },
        gfx::ClearColour {
            r: 0.0,
            g: 1.0,
            b: 1.0,
            a: 1.0,
        },
        gfx::ClearColour {
            r: 0.0,
            g: 1.0,
            b: 0.0,
            a: 1.0,
        },
    ];

    let mut i = 0;
    let mut count = 0;
    while app.run() {
        win.update(&mut app);
        swap_chain.update::<os_platform::App>(&mut dev, &win, &mut cmd);

        cmd.reset(&swap_chain);

        let mut pass = swap_chain.get_backbuffer_pass_mut();
        cmd.begin_render_pass(&mut pass);
        cmd.end_render_pass();

        cmd.close()?;

        dev.execute(&cmd);
        swap_chain.swap(&dev);

        std::thread::sleep(std::time::Duration::from_millis(60));
        i = (i + 1) % clears_colours.len();
        count = count + 1;

        if count > 3 {
            break;
        }
    }

    swap_chain.wait_for_last_frame();
    cmd.reset(&swap_chain);

    Ok(())
}

#[test]
fn draw_triangle() -> Result<(), hotline_rs::Error> {
    let mut app = os_platform::App::create(os::AppInfo {
        name: String::from("draw_triangle"),
        window: false,
        num_buffers: 0,
        dpi_aware: true,
    });

    let num_buffers = 2;

    let mut device = gfx_platform::Device::create(&gfx::DeviceInfo {
        render_target_heap_size: num_buffers,
        ..Default::default()
    });

    let mut window = app.create_window(os::WindowInfo {
        title: String::from("triangle!"),
        rect: os::Rect {
            x: 0,
            y: 0,
            width: 1280,
            height: 720,
        },
        style: os::WindowStyleFlags::NONE,
        parent_handle: None,
    });

    let swap_chain_info = gfx::SwapChainInfo {
        num_buffers: num_buffers as u32,
        format: gfx::Format::RGBA8n,
        clear_colour: Some(gfx::ClearColour {
            r: 0.45,
            g: 0.55,
            b: 0.60,
            a: 1.00,
        }),
    };

    let mut swap_chain = device.create_swap_chain::<os_platform::App>(&swap_chain_info, &window)?;
    let mut cmd = device.create_cmd_buf(2);

    let vertices = [
        Vertex {
            position: [0.0, 0.25, 0.0],
            color: [1.0, 0.0, 0.0, 1.0],
        },
        Vertex {
            position: [0.25, -0.25, 0.0],
            color: [0.0, 1.0, 0.0, 1.0],
        },
        Vertex {
            position: [-0.25, -0.25, 0.0],
            color: [0.0, 0.0, 1.0, 1.0],
        },
    ];

    let info = gfx::BufferInfo {
        usage: gfx::BufferUsage::VERTEX,
        cpu_access: gfx::CpuAccessFlags::NONE,
        format: gfx::Format::Unknown,
        stride: std::mem::size_of::<Vertex>(),
        num_elements: 3,
        initial_state: gfx::ResourceState::VertexConstantBuffer
    };

    let vertex_buffer = device.create_buffer(&info, Some(gfx::as_u8_slice(&vertices)))?;

    let src = "
        struct PSInput
        {
            float4 position : SV_POSITION;
            float4 color : COLOR;
        };

        PSInput VSMain(float4 position : POSITION, float4 color : COLOR)
        {
            PSInput result;

            result.position = position;
            result.color = color;

            return result;
        }

        float4 PSMain(PSInput input) : SV_TARGET
        {
            return input.color;
        }";

    let vs_info = gfx::ShaderInfo {
        shader_type: gfx::ShaderType::Vertex,
        compile_info: Some(gfx::ShaderCompileInfo {
            entry_point: String::from("VSMain"),
            target: String::from("vs_5_0"),
            flags: gfx::ShaderCompileFlags::NONE,
        }),
    };

    let fs_info = gfx::ShaderInfo {
        shader_type: gfx::ShaderType::Fragment,
        compile_info: Some(gfx::ShaderCompileInfo {
            entry_point: String::from("PSMain"),
            target: String::from("ps_5_0"),
            flags: gfx::ShaderCompileFlags::NONE,
        }),
    };

    let vs = device.create_shader(&vs_info, src.as_bytes())?;
    let fs = device.create_shader(&fs_info, src.as_bytes())?;

    let pso = device.create_render_pipeline(&gfx::RenderPipelineInfo {
        vs: Some(&vs),
        fs: Some(&fs),
        input_layout: vec![
            gfx::InputElementInfo {
                semantic: String::from("POSITION"),
                index: 0,
                format: gfx::Format::RGB32f,
                input_slot: 0,
                aligned_byte_offset: 0,
                input_slot_class: gfx::InputSlotClass::PerVertex,
                step_rate: 0,
            },
            gfx::InputElementInfo {
                semantic: String::from("COLOR"),
                index: 0,
                format: gfx::Format::RGBA32f,
                input_slot: 0,
                aligned_byte_offset: 12,
                input_slot_class: gfx::InputSlotClass::PerVertex,
                step_rate: 0,
            },
        ],
        blend_info: gfx::BlendInfo {
            alpha_to_coverage_enabled: false,
            independent_blend_enabled: false,
            render_target: vec![gfx::RenderTargetBlendInfo::default()],
        },
        topology: gfx::Topology::TriangleList,
        pass: Some(swap_chain.get_backbuffer_pass()),
        ..Default::default()
    })?;

    while app.run() {
        // update window and swap chain
        window.update(&mut app);
        swap_chain.update::<os_platform::App>(&mut device, &window, &mut cmd);

        // update viewport from window size
        let window_rect = window.get_viewport_rect();
        let viewport = gfx::Viewport::from(window_rect);
        let scissor = gfx::ScissorRect::from(window_rect);

        // build command buffer and make draw calls
        cmd.reset(&swap_chain);
        cmd.begin_render_pass(swap_chain.get_backbuffer_pass_mut());
        cmd.set_viewport(&viewport);
        cmd.set_scissor_rect(&scissor);
        cmd.set_render_pipeline(&pso);
        cmd.set_vertex_buffer(&vertex_buffer, 0);
        cmd.draw_instanced(3, 1, 0, 0);
        cmd.end_render_pass();
        cmd.close()?;

        // execute command buffer
        device.execute(&cmd);

        // swap for the next frame
        swap_chain.swap(&device);

        break;
    }

    swap_chain.wait_for_last_frame();
    cmd.reset(&swap_chain);

    Ok(())
}

#[test]
fn align_tests() {
    // pow2
    let val = gfx::align_pow2(101, 256);
    assert_eq!(val % 256, 0);
    let val = gfx::align_pow2(8861, 64);
    assert_eq!(val % 64, 0);
    let val = gfx::align_pow2(1280, 128);
    assert_eq!(val % 128, 0);
    let val = gfx::align_pow2(5, 4);
    assert_eq!(val % 4, 0);
    let val = gfx::align_pow2(19, 2);
    assert_eq!(val % 2, 0);
    // non pow2
    let val = gfx::align(92, 133);
    assert_eq!(val % 133, 0);
    let val = gfx::align(172, 201);
    assert_eq!(val % 201, 0);
    let val = gfx::align(288, 1177);
    assert_eq!(val % 1177, 0);
    let val = gfx::align(1092, 52);
    assert_eq!(val % 52, 0);
    let val = gfx::align(5568, 21);
    assert_eq!(val % 21, 0);
}

#[test]
fn image_size_tests() {
    assert_eq!(gfx::mip_levels_for_dimension(1024, 1024), 11);
    assert_eq!(gfx::mip_levels_for_dimension(512, 512), 10);
    assert_eq!(gfx::mip_levels_for_dimension(256, 256), 9);
    assert_eq!(gfx::mip_levels_for_dimension(128, 128), 8);
    assert_eq!(gfx::mip_levels_for_dimension(64, 64), 7);
    assert_eq!(gfx::mip_levels_for_dimension(32, 32), 6);
    assert_eq!(gfx::mip_levels_for_dimension(16, 16), 5);
    assert_eq!(gfx::mip_levels_for_dimension(8, 8), 4);
    assert_eq!(gfx::mip_levels_for_dimension(4, 4), 3);
    assert_eq!(gfx::mip_levels_for_dimension(2, 2), 2);
    assert_eq!(gfx::mip_levels_for_dimension(1, 1), 1);

    assert_eq!(gfx::mip_levels_for_dimension(1024, 2048), 12);
    assert_eq!(gfx::mip_levels_for_dimension(1024 + 33, 1024 + 513), 11);
    assert_eq!(gfx::mip_levels_for_dimension(512 + 33, 512 + 263), 10);
}


// client tests must run 1 at a time, this boots the client with empty user info
#[test]
fn pmfx() -> Result<(), hotline_rs::Error> {
    // create a client
    let config = client::UserConfig {
        main_window_rect: HotlineInfo::default().window_rect,
        console_window_rect: None,
        plugins: None,
        plugin_data: Some(HashMap::new())
    };

    let mut ctx : Client<gfx_platform::Device, os_platform::App> = Client::create(HotlineInfo {
        name: "pmfx_test_client".to_string(),
        user_config: Some(config),
        ..Default::default()
    }).unwrap();

    // loads the test shaders
    ctx.pmfx.load(&hotline_rs::get_data_path("shaders/ecs_examples"))?;

    // create pipelines
    ctx.pmfx.create_render_pipeline(&ctx.device, "texture2d_array", ctx.swap_chain.get_backbuffer_pass())?;
    ctx.pmfx.create_render_pipeline(&ctx.device, "blend_additive", ctx.swap_chain.get_backbuffer_pass())?;

    // test getting pass for format
    let fmt = ctx.swap_chain.get_backbuffer_pass().get_format_hash();
    let texture_pipeline = ctx.pmfx.get_render_pipeline_for_format("texture2d_array", fmt)?;
    
    // texture array pipeline has 2 sets of push constants, so the resources bind onto 2
    // t0, space9 is Texture2DArray
    let slots = texture_pipeline.get_pipeline_slot(0, 10, gfx::DescriptorType::ShaderResource);
    assert!(slots.is_some());

    if let Some(slots) = slots {
        assert_eq!(slots.index, 2);
    }

    // colour_pipeline has no textures
    let colour_pipeline = ctx.pmfx.get_render_pipeline_for_format("blend_additive", fmt)?;
    let slots = colour_pipeline.get_pipeline_slot(0, 7, gfx::DescriptorType::ShaderResource);
    assert!(slots.is_none());

    // using resource
    let slots = colour_pipeline.get_pipeline_slot(0, 0, gfx::DescriptorType::PushConstants);
    assert!(slots.is_some());

    Ok(())
}

#[test]
// client tests must run 1 at a time, this boots the client with empty user info
fn boot_empty_client() -> Result<(), hotline_rs::Error> {
    let config = client::UserConfig {
        main_window_rect: HotlineInfo::default().window_rect,
        console_window_rect: None,
        plugins: None,
        plugin_data: Some(HashMap::new())
    };

    // create client
    let ctx : Client<gfx_platform::Device, os_platform::App> = Client::create(HotlineInfo {
        name: "boot_empty_client".to_string(),
        user_config: Some(config),
        ..Default::default()
    }).unwrap();
    
    // run
    ctx.run_once()
}

#[test]
/// Load the basic empty plugin, should print and close gracefully
fn boot_client_empty_plugin() -> Result<(), hotline_rs::Error> {
    let mut config = client::UserConfig {
        main_window_rect: HotlineInfo::default().window_rect,
        console_window_rect: None,
        plugins: Some(HashMap::new()),
        plugin_data: Some(HashMap::new())
    };

    // empty plugin
    if let Some(plugins) = &mut config.plugins {
        plugins.insert("empty".to_string(), PluginInfo {
            path: hotline_rs::get_data_path("../../plugins")
        });
    }

    // create client
    let ctx : Client<gfx_platform::Device, os_platform::App> = Client::create(HotlineInfo {
        name: "boot_client_empty_plugin".to_string(),
        user_config: Some(config),
        ..Default::default()
    }).unwrap();
    
    // run
    ctx.run_once()
}

#[test]
/// Boots the client with a plugin that does not exist, should load gracefully and notify the missing plugin
fn boot_client_missing_plugin() -> Result<(), hotline_rs::Error> {
    let mut config = client::UserConfig {
        main_window_rect: HotlineInfo::default().window_rect,
        console_window_rect: None,
        plugins: Some(HashMap::new()),
        plugin_data: Some(HashMap::new())
    };

    // empty plugin
    if let Some(plugins) = &mut config.plugins {
        plugins.insert("missing".to_string(), PluginInfo {
            path: "missing".to_string()
        });
    }

    // create client
    let ctx : Client<gfx_platform::Device, os_platform::App> = Client::create(HotlineInfo {
        name: "boot_client_missing_plugin".to_string(),
        user_config: Some(config),
        ..Default::default()
    }).unwrap();
    
    // run
    ctx.run_once()
}

#[test]
/// Boots the client with the ecs plugin and ecs_demos plugin but with no `PluginData`
fn boot_client_ecs_plugin() -> Result<(), hotline_rs::Error> {
    let mut config = client::UserConfig {
        main_window_rect: HotlineInfo::default().window_rect,
        console_window_rect: None,
        plugins: Some(HashMap::new()),
        plugin_data: Some(HashMap::new()),
    };

    // ecs plugin with no demo active
    if let Some(plugins) = &mut config.plugins {
        plugins.insert("ecs".to_string(), PluginInfo {
            path: hotline_rs::get_data_path("../../plugins")
        });
        plugins.insert("ecs_examples".to_string(), PluginInfo {
            path: hotline_rs::get_data_path("../../plugins")
        });
    }

    // create client
    let ctx : Client<gfx_platform::Device, os_platform::App> = Client::create(HotlineInfo {
        name: "boot_client_ecs_plugin".to_string(),
        user_config: Some(config),
        ..Default::default()
    }).unwrap();
    
    // run
    ctx.run_once()
}


/// Boots the client with the ecs plugin and ecs_demos with the primitives sample active
fn boot_client_ecs_plugin_demo(demo_name: &str) -> Result<(), hotline_rs::Error> {
    let mut config = client::UserConfig {
        main_window_rect: HotlineInfo::default().window_rect,
        console_window_rect: None,
        plugins: Some(HashMap::new()),
        plugin_data: Some(HashMap::new()),
    };

    // ecs plugin with no demo active
    if let Some(plugins) = &mut config.plugins {
        plugins.insert("ecs".to_string(), PluginInfo {
            path: hotline_rs::get_data_path("../../plugins")
        });
        plugins.insert("ecs_examples".to_string(), PluginInfo {
            path: hotline_rs::get_data_path("../../plugins")
        });
    }

    let user_config = hotline_rs::get_data_path("../user_config.json");
    let user_config = std::fs::read(user_config)?;
    let user_config : serde_json::Value = serde_json::from_slice(&user_config)?;

    if let Some(plugin_data) = &mut config.plugin_data {

        if let Some(user_config) = user_config.as_object() {
            if let Some(user_plugin_data) = user_config.get("plugin_data") {
                if let Some(ecs) = user_plugin_data.get("ecs") {

                    // take copy of the ecs plugin defaults
                    let mut plugin_defaults = ecs.clone();

                    // activate the current demo
                    plugin_defaults.as_object_mut().unwrap().insert(
                        "active_demo".to_string(), 
                        serde_json::Value::String(demo_name.to_string())
                    );

                    // remove serialised camera
                    if let Some(main_cam) = plugin_defaults.get_mut("main_camera") {
                        *main_cam = serde_json::Value::Null;
                    }

                    // insert the plugin defaults
                    plugin_data.insert("ecs".to_string(), plugin_defaults.clone());
                }
            }
        }
    }

    // create client
    let ctx : Client<gfx_platform::Device, os_platform::App> = Client::create(HotlineInfo {
        name: demo_name.to_string(),
        user_config: Some(config),
        ..Default::default()
    }).unwrap();
    
    // run
    ctx.run_once()
}

//
// error tests
// 
#[test]
fn test_missing_demo() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("test_missing_demo")
}

#[test]
fn test_missing_systems() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("test_missing_systems")
}

#[test]
fn test_missing_view() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("test_missing_view")
}

#[test]
fn test_missing_pipeline() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("test_missing_pipeline")
}

#[test]
fn test_missing_render_graph() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("test_missing_render_graph")
}

#[test]
fn test_failing_pipeline() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("test_failing_pipeline")
}

#[test]
fn test_missing_camera() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("test_missing_camera")
}

/*
#[test]
fn draw() -> Result<(), hotline_rs::Error> {
    for i in 0..100 {
        boot_client_ecs_plugin_demo(format!("draw{i}").as_str());
    }
    Ok(())
}
    */


//
// ecs examples
//
#[test]
fn draw() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("draw")
}

#[test]
fn draw_indexed() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("draw_indexed")
}

#[test]
fn draw_push_constants() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("draw_push_constants")
}

#[test]
fn draw_indirect() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("draw_indirect")
}

#[test]
fn geometry_primitives() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("geometry_primitives")
}

#[test]
fn draw_vertex_buffer_instanced() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("draw_vertex_buffer_instanced")
}

#[test]
fn draw_cbuffer_instanced() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("draw_cbuffer_instanced")
}

#[test]
fn bindless_texture() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("bindless_texture")
}

#[test]
fn tangent_space_normal_maps() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("tangent_space_normal_maps")
}

#[test]
fn bindless_material() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("bindless_material")
}

#[test]
fn point_lights() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("point_lights")
}

#[test]
fn spot_lights() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("spot_lights")
}

#[test]
fn directional_lights() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("directional_lights")
}

#[test]
fn gpu_frustum_culling() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("gpu_frustum_culling")
}

#[test]
fn cubemap() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("cubemap")
}

#[test]
fn texture2d_array() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("texture2d_array")
}

#[test]
fn texture3d() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("texture3d")
}

#[test]
fn read_write_texture() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("read_write_texture")
}

#[test]
fn multiple_render_targets() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("multiple_render_targets")
}

#[test]
fn raster_states() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("raster_states")
}

#[test]
fn blend_states() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("blend_states")
}

#[test]
fn generate_mip_maps() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("generate_mip_maps")
}

#[test]
fn shadow_map() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("shadow_map")
}

#[test]
fn dynamic_cubemap() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("dynamic_cubemap")
}

#[test]
fn pbr() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("pbr")
}

#[test]
fn omni_shadow_maps() -> Result<(), hotline_rs::Error> {
    boot_client_ecs_plugin_demo("omni_shadow_map")
}