A modern C++ Vulkan-based graphics engine implementation.
├── include/ # Header files
│ ├── core/ # Core engine components
│ │ ├── VulkanApp.h # Main application class
│ │ ├── VulkanDevice.h # Device management
│ │ └── WindowManager.h # GLFW window handling
│ ├── debug/ # Debug utilities
│ │ └── VulkanDebug.h # Validation and debug messaging
│ ├── rendering/ # Rendering components
│ │ ├── CommandBuffer.h # Command buffer management
│ │ ├── Framebuffer.h # Framebuffer handling
│ │ ├── GraphicsPipeline.h # Graphics pipeline setup
│ │ ├── RenderPass.h # Render pass configuration
│ │ └── SwapChain.h # Swap chain management
│ └── resources/ # Resource management (future)
│
├── src/ # Implementation files
│ ├── core/ # Core implementations
│ │ ├── VulkanApp.cpp
│ │ ├── VulkanDevice.cpp
│ │ └── WindowManager.cpp
│ ├── debug/ # Debug implementations
│ │ └── VulkanDebug.cpp
│ └── rendering/ # Rendering implementations
│ ├── CommandBuffer.cpp
│ ├── Framebuffer.cpp
│ ├── GraphicsPipeline.cpp
│ ├── RenderPass.cpp
│ └── SwapChain.cpp
│
├── shaders/ # Shader files
│ ├── compile.sh # Shader compilation script
│ ├── src/ # Shader source files
│ │ ├── shader.vert # Vertex shader
│ │ └── shader.frag # Fragment shader
│ └── compiled/ # Compiled SPIR-V shaders
│ ├── shader.vert.spv
│ └── shader.frag.spv
│
├── assets/ # Engine assets
│ ├── textures/ # Texture files
│ ├── models/ # 3D model files
│ └── materials/ # Material definitions
│
├── docs/ # Documentation
│ ├── architecture.md # Engine architecture
│ ├── setup.md # Setup instructions
│ └── api/ # API documentation
│
├── tests/ # Test files
│ ├── unit/ # Unit tests
│ └── integration/ # Integration tests
│
└── CMakeLists.txt # Build configuration
- VulkanApp: Main application class that orchestrates all Vulkan components
- VulkanDevice: Physical and logical device management
- WindowManager: GLFW window creation and management
- VulkanDebug: Validation layers and debug messaging utilities
- SwapChain: Swap chain creation and management
- RenderPass: Render pass configuration with:
- Color attachment setup
- Subpass management
- Dependencies handling
- GraphicsPipeline: Graphics pipeline setup with:
- Shader stage configuration
- Fixed-function state setup
- Pipeline layout management
- Framebuffer: Framebuffer creation and management
- CommandBuffer: Command buffer handling with:
- Command pool management
- Command recording
- Submission management
- CMake 3.20+
- Vulkan SDK
- GLFW3
- C++17 compiler
- Vulkan instance creation
- Physical device selection
- Logical device creation
- Swap chain setup
- Graphics pipeline creation
- Shader compilation
- Command buffer management
- Basic triangle rendering setup
- Vertex buffer support
- Uniform buffers
- Texture mapping
- Multiple render passes
- Ensure Vulkan SDK is installed
- Configure with CMake:
mkdir build && cd build
cmake ..- Build:
cmake --build .Shaders are automatically compiled during the build process. Source GLSL shaders are located in the shaders/ directory:
shader.vert: Vertex shadershader.frag: Fragment shader
The engine follows a modular design where each Vulkan concept is encapsulated in its own class:
-
Initialization Flow:
VulkanApp ├── WindowManager ├── VulkanDevice ├── SwapChain └── GraphicsPipeline ├── RenderPass ├── Framebuffer └── CommandBuffer -
Render Flow:
Render Loop ├── Acquire next image ├── Record command buffer ├── Submit to queue └── Present
- Memory management system
- Multiple render passes
- Depth and stencil support
- Resource management
- Scene graph
- Material system
This project is open-source and available under the MIT License.