MCPcopy Create free account
hub / github.com/PerroEngine/Perro / test_batch

Function test_batch

perro_source/render_stack/perro_graphics/src/three_d/gpu.rs:1793–1851  ·  view source on GitHub ↗
(
        order_index: u32,
        draw_on_top: bool,
        alpha_mode: u8,
        mesh_blend: bool,
        texture_slot: u32,
        mesh_index_start: u32,
    )

Source from the content-addressed store, hash-verified

1791}
1792
1793#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
1794enum RenderBatchKind {
1795 Opaque,
1796 Alpha,
1797 MeshBlend,
1798 Overlay,
1799}
1800
1801#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1802struct RenderStateKey {
1803 pipeline_key: u64,
1804 texture_slot: u64,
1805 mesh_index_start: u32,
1806 mesh_base_vertex: i32,
1807 batch_kind: RenderBatchKind,
1808}
1809
1810#[derive(Clone, Copy, Debug, Default)]
1811struct RenderPerfCounters {
1812 pipeline_switches: u32,
1813 texture_bind_group_switches: u32,
1814 camera_bind_group_switches: u32,
1815 draw_batches: u32,
1816 // Triangles the main mesh pass submits (index_count/3 x instance_count,
1817 // summed over every batch it walks). GPU-culled batches still count their
1818 // full instance range, so this is an upper bound, not a rasterized count.
1819 triangles: u64,
1820}
1821
1822// Pass-structure counters. Written every frame by `render_pass` /
1823// `mesh_blend_screen_pass`, read by the render-pass structure tests and by
1824// `Gpu::render`, which folds them into `RenderGpuTiming` for the frame CSV.
1825// Main-view only: camera streams own separate `Gpu3D` instances with their own
1826// counters.
1827#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
1828pub(crate) struct PassCounters {
1829 // Render passes `render_pass` encodes for this frame.
1830 pub(crate) render_passes: u32,
1831 // Sky fullscreen triangles drawn inside the mesh pass.
1832 pub(crate) sky_draws: u32,
1833 // Seam passes and scene-color copies `mesh_blend_screen_pass` encodes.
1834 pub(crate) mesh_blend_seam_passes: u32,
1835 pub(crate) mesh_blend_scene_copies: u32,
1836 // Pixels covered by the seam scene copy (0 when the copy is skipped).
1837 pub(crate) mesh_blend_copy_pixels: u32,
1838 // Per-source receiver depth passes the vertex mesh-blend loop encodes, and
1839 // the sources that reused depth already resident in the shared target
1840 // (an earlier source's pass, or the frame's global blend-depth pass).
1841 pub(crate) mesh_blend_source_depth_passes: u32,
1842 pub(crate) mesh_blend_source_depth_reuses: u32,
1843 // Full-res scene-depth copies encoded for the 3D water pass.
1844 pub(crate) water_depth_copies: u32,
1845 // Depth clears encoded for the 3D water pass's private depth target (the
1846 // copy's replacement at 1 sample).
1847 pub(crate) water_depth_clears: u32,
1848 // Shadow depth layers actually re-rendered this frame (cached-valid layers
1849 // are skipped and do not count).
1850 pub(crate) shadow_layer_renders: u32,

Calls 4

draw_batch_state_keyFunction · 0.85
render_state_keyFunction · 0.85
state_hashMethod · 0.80
bitsMethod · 0.45

Tested by

no test coverage detected