/Hiss

Hiss is a tiny game engine written in rust.

Primary LanguageRust

Hiss Engine

Build macOS

Hiss Engine Logo

Hiss Engine is a tiny game engine written in rust and inspired by Piccolo.

Github Project

features

easy to test

  • RHI can be created without a window handle, so you can add a unit test and run it in the background thread.
  • Hiss offers a series of test supports, like:
    • dump_memory: you can dump any vulkan device memory without runtim performance loss.
#[cfg(test)]
mod test {
    use super::*;

    #[test]
    pub fn vertex_buffer() {
        let vertex = MeshVertexDataDefinition {
            px: 3.0,
            py: 4.0,
            pz: 5.0,
            ..Default::default()
        };
        let default_position = VulkanMeshVertexPosition {
            position: glam::vec3(vertex.px, vertex.py, vertex.pz),
        };

        let rhi = VulkanRHI::new(None);
        let vertex_count = 32_usize;
        let vertex_data = vec![vertex; vertex_count];

        let mut vertex_buffer = TempVertexBuffer::from_vertices(&rhi, &vertex_data);

        rhi.dump_memory(&mut vertex_buffer.position_buffer_mem, |ptr| unsafe {
            for position in std::slice::from_raw_parts(ptr as *const VulkanMeshVertexPosition, vertex_count) {
                let dis = (position.position - default_position.position).length();
                assert!(dis < f32::EPSILON);
            }
        });

        // TODO 检查 vertex buffer 是否正确

        vertex_buffer.destroy(&rhi);
    }
}

DOC

current_frame_index 的改变时机:在 submit_rendering 时改变。

MainCameraPass 的 Graph(还不完善,留待后续):

MainCamrePass