EDIT: folder structure refactoring (src/core)

This commit is contained in:
2025-11-27 11:26:57 +09:00
parent a816864c88
commit 2182b02f4a
79 changed files with 291 additions and 277 deletions

View File

@@ -2,7 +2,7 @@
Per-frame struct that owns the command buffer, semaphores/fence, a transient descriptor allocator, and a small deletion queue. Frames are indexed by `FRAME_OVERLAP` (currently 2) and rotated by `_frameNumber` in `VulkanEngine`.
- File: `src/core/frame_resources.h/.cpp`
- File: `src/core/frame/resources.h/.cpp`
### Responsibilities
- Command recording: `_mainCommandBuffer` allocated from a per-frame `_commandPool` with RESET flag.

View File

@@ -1,7 +1,7 @@
Image-Based Lighting (IBL)
Overview
- IBL assets (environment maps + BRDF LUT + SH coefficients) are managed by `IBLManager` (`src/core/ibl_manager.{h,cpp}`) and exposed to passes via `EngineContext::ibl`.
- IBL assets (environment maps + BRDF LUT + SH coefficients) are managed by `IBLManager` (`src/core/assets/ibl_manager.{h,cpp}`) and exposed to passes via `EngineContext::ibl`.
- Shaders share a common include, `shaders/ibl_common.glsl`, which defines the IBL bindings for descriptor set 3 and helper functions used by deferred, forward, and background passes.
- The engine currently supports:
- Specular environment from an equirectangular 2D texture with prefiltered mips (`sampler2D iblSpec2D`).
@@ -11,7 +11,7 @@ Overview
Data Flow
- Init:
- `VulkanEngine::init_vulkan()` creates an `IBLManager`, calls `init(context)`, and publishes it via `EngineContext::ibl`.
- The engine optionally loads default IBL assets (`IBLPaths` in `src/core/vk_engine.cpp`), typically a BRDF LUT plus a specular environment `.ktx2`.
- The engine optionally loads default IBL assets (`IBLPaths` in `src/core/engine.cpp`), typically a BRDF LUT plus a specular environment `.ktx2`.
- Loading (IBLManager):
- `IBLManager::load(const IBLPaths&)`:
- Specular:

View File

@@ -2,7 +2,7 @@
Extends the rendering pipeline to support multiple dynamic point lights alongside the existing directional sun light. All lighting calculations use a shared PBR (Cook-Torrance) BRDF implementation.
- Files: `src/scene/vk_scene.h/.cpp`, `src/core/vk_types.h`, `shaders/lighting_common.glsl`
- Files: `src/scene/vk_scene.h/.cpp`, `src/core/types.h`, `shaders/lighting_common.glsl`
### Data Structures

View File

@@ -2,7 +2,7 @@
Optional subsystem that enables hybrid or full ray traced shadows via Ray Query. It builds and caches BLAS per mesh and rebuilds a TLAS from the current `DrawContext` when enabled.
- Files: `src/core/vk_raytracing.h/.cpp`
- Files: `src/core/raytracing/raytracing.h/.cpp`
### Device Feature & Extension Enablement
- Feature detection happens in `DeviceManager::init_vulkan()` and sets:

View File

@@ -10,7 +10,7 @@ Lightweight render graph that builds a perframe DAG from pass declarations, c
### HighLevel Flow
- Engine creates the graph each frame and imports swapchain/GBuffer images: `src/core/vk_engine.cpp:303`.
- Engine creates the graph each frame and imports swapchain/GBuffer images: `src/core/engine.cpp:303`.
- Each pass registers its work by calling `register_graph(graph, ...)` and declaring resources via a builder.
- The graph appends a present chain (copy HDR `drawImage` → swapchain, then transition to `PRESENT`), optionally inserting ImGui before present.
- `compile()` topologically sorts passes by data dependencies (read/write) and computes perpass barriers.
@@ -112,7 +112,7 @@ Buffer usage → stage/access examples:
### BuiltIn Pass Wiring (Current)
- Resource uploads (if any) → Background (compute) → Geometry (GBuffer) → Lighting (deferred) → Transparent → CopyToSwapchain → ImGui → PreparePresent.
- See registrations: `src/core/vk_engine.cpp:321``src/core/vk_engine.cpp:352`.
- See registrations: `src/core/engine.cpp:321``src/core/engine.cpp:352`.
### Notes & Limits

View File

@@ -9,7 +9,7 @@ Central allocator and uploader built on VMA. Provides creation helpers, an immed
- Integrate with `FrameResources` deletion queues to match lifetimes to the frame.
- Expose a Render Graph pass that batches all pending uploads.
### Key APIs (src/core/vk_resource.h)
### Key APIs (src/core/frame/resource.h)
- Creation
- `AllocatedBuffer create_buffer(size, usage, memUsage)`
@@ -37,7 +37,7 @@ Central allocator and uploader built on VMA. Provides creation helpers, an immed
### Render Graph Interaction
- `register_upload_pass` is called during frame build before other passes (see `src/core/vk_engine.cpp:315`).
- `register_upload_pass` is called during frame build before other passes (see `src/core/engine.cpp:315`).
- It uses graph `import_buffer` / `import_image` to deduplicate external resources and attach initial stage/layout.
- Barriers and final layouts for uploaded images are handled in the pass recording (`generate_mipmaps` path transitions to `SHADER_READ_ONLY_OPTIMAL`).

View File

@@ -1,12 +1,12 @@
Texture Loading & Streaming
Overview
- Streaming cache: `src/core/texture_cache.{h,cpp}` asynchronously decodes images (stb_image) on a small worker pool (14 threads, clamped by hardware concurrency) and uploads them via `ResourceManager` with optional mipmaps. For FilePath keys, a sibling `<stem>.ktx2` (or direct `.ktx2`) is preferred over PNG/JPEG. Descriptors registered upfront are patched inplace once the texture becomes resident. Large decodes can be downscaled on workers before upload to cap peak memory.
- Uploads: `src/core/vk_resource.{h,cpp}` stages pixel data and either submits immediately or registers a Render Graph transfer pass. Mipmaps use `vkutil::generate_mipmaps(...)` and finish in `SHADER_READ_ONLY_OPTIMAL`.
- Streaming cache: `src/core/assets/texture_cache.{h,cpp}` asynchronously decodes images (stb_image) on a small worker pool (14 threads, clamped by hardware concurrency) and uploads them via `ResourceManager` with optional mipmaps. For FilePath keys, a sibling `<stem>.ktx2` (or direct `.ktx2`) is preferred over PNG/JPEG. Descriptors registered upfront are patched inplace once the texture becomes resident. Large decodes can be downscaled on workers before upload to cap peak memory.
- Uploads: `src/core/frame/resource.{h,cpp}` stages pixel data and either submits immediately or registers a Render Graph transfer pass. Mipmaps use `vkutil::generate_mipmaps(...)` and finish in `SHADER_READ_ONLY_OPTIMAL`.
- Integration points:
- Materials: layouts use `UPDATE_AFTER_BIND`; descriptors can be rewritten after bind.
- glTF loader: `src/scene/vk_loader.cpp` builds keys, requests handles, and registers descriptor patches with the cache.
- Primitives/adhoc: `src/core/asset_manager.cpp` builds materials and registers texture watches.
- Primitives/adhoc: `src/core/assets/manager.cpp` builds materials and registers texture watches.
- Visibility: `src/render/passes/geometry.cpp` and `src/render/passes/transparent.cpp` call `TextureCache::markSetUsed(...)` for sets that are actually drawn.
- IBL: highdynamicrange environment textures are typically loaded directly as `.ktx2` via `IBLManager` instead of the generic streaming cache. See “ImageBased Lighting (IBL)” below.
@@ -32,11 +32,11 @@ Data Flow
- `evictToBudget(bytes)` rewrites watchers to fallbacks, destroys images, and marks entries `Evicted`. Evicted entries can reload automatically when seen again and a short cooldown has passed (default ~2 frames), avoiding immediate thrash.
Runtime UI
- ImGui → Debug → Textures (see `src/core/vk_engine.cpp`)
- ImGui → Debug → Textures (see `src/core/engine.cpp`)
- Shows: devicelocal budget/usage (from VMA), texture streaming budget (~35% of devicelocal by default), resident MiB, CPU source MiB, counts per state, and a TopN table of consumers.
- Controls: `Loads/Frame`, `Upload Budget (MiB)` (bytebased throttle), `Keep Source Bytes`, `CPU Source Budget (MiB)`, `Max Upload Dimension` (progressive downscale cap), and `Trim To Budget Now`.
Key APIs (src/core/texture_cache.h)
Key APIs (src/core/assets/texture_cache.h)
- `TextureHandle request(const TextureKey&, VkSampler)`
- `void watchBinding(TextureHandle, VkDescriptorSet, uint32_t binding, VkSampler, VkImageView fallback)`
- `void unwatchSet(VkDescriptorSet)` — call before destroying descriptor pools/sets
@@ -49,11 +49,11 @@ Defaults & Budgets
- Worker threads: 14 decode threads depending on hardware.
- Loads per pump: default 4.
- Upload byte budget: default 128 MiB per frame.
- GPU budget: unlimited until the engine sets one each frame. The engine queries ~35% of devicelocal memory (via VMA) and calls `set_gpu_budget_bytes(...)`, then runs `evictToBudget(...)` and `pumpLoads(...)` during the frame loop (`src/core/vk_engine.cpp`).
- GPU budget: unlimited until the engine sets one each frame. The engine queries ~35% of devicelocal memory (via VMA) and calls `set_gpu_budget_bytes(...)`, then runs `evictToBudget(...)` and `pumpLoads(...)` during the frame loop (`src/core/engine.cpp`).
- CPU source bytes: default budget 64 MiB; `keep_source_bytes` defaults to false. Retention only applies to entries created from Bytes keys.
Examples
- Asset materials (`src/core/asset_manager.cpp`)
- Asset materials (`src/core/assets/manager.cpp`)
- Create materials with visible fallbacks (checkerboard/white/flatnormal), then:
- Build a key from an asset path, `request(key, sampler)`, and `watchBinding(handle, materialSet, binding, sampler, fallbackView)` for albedo (1), metalrough (2), normal (3).
- glTF loader (`src/scene/vk_loader.cpp`)
@@ -92,7 +92,7 @@ Operational Tips
- To debug VMA allocations and name images, set `VE_VMA_DEBUG=1`.
ImageBased Lighting (IBL) Textures
- Manager: `src/core/ibl_manager.{h,cpp}` owns IBL GPU resources and the shared descriptor set layout for set=3.
- Manager: `src/core/assets/ibl_manager.{h,cpp}` owns IBL GPU resources and the shared descriptor set layout for set=3.
- Inputs (`IBLPaths`):
- `specularCube`: preferred is a GPUready `.ktx2` (BC6H or `R16G16B16A16_SFLOAT`) containing either a cubemap or an equirectangular 2D env with prefiltered mips.
- `diffuseCube`: optional `.ktx2` cubemap for diffuse irradiance. If missing, diffuse IBL falls back to SH only.

View File

@@ -1,49 +1,56 @@
# Add source to this project's executable.
add_executable (vulkan_engine
add_executable (vulkan_engine
main.cpp
# core
core/vk_types.h
core/vk_initializers.cpp
core/vk_initializers.h
core/vk_images.h
core/vk_images.cpp
core/vk_debug.h
core/vk_debug.cpp
core/vk_descriptors.h
core/vk_descriptors.cpp
core/vk_device.h
core/vk_device.cpp
core/vk_swapchain.h
core/vk_swapchain.cpp
core/vk_resource.h
core/vk_resource.cpp
core/engine_context.h
core/engine_context.cpp
core/vk_descriptor_manager.h
core/vk_descriptor_manager.cpp
core/vk_sampler_manager.h
core/vk_sampler_manager.cpp
core/asset_locator.h
core/asset_locator.cpp
core/asset_manager.h
core/asset_manager.cpp
core/vk_pipeline_manager.h
core/vk_pipeline_manager.cpp
core/frame_resources.h
core/frame_resources.cpp
core/texture_cache.h
core/texture_cache.cpp
core/ktx_loader.h
core/ktx_loader.cpp
# core root
core/types.h
core/config.h
core/vk_engine.h
core/vk_engine.cpp
core/vk_engine_ui.cpp
core/vk_raytracing.h
core/vk_raytracing.cpp
core/ibl_manager.h
core/ibl_manager.cpp
core/context.h
core/context.cpp
core/engine.h
core/engine.cpp
core/engine_ui.cpp
# core/device
core/device/device.h
core/device/device.cpp
core/device/swapchain.h
core/device/swapchain.cpp
core/device/resource.h
core/device/resource.cpp
core/device/images.h
core/device/images.cpp
# core/descriptor
core/descriptor/descriptors.h
core/descriptor/descriptors.cpp
core/descriptor/manager.h
core/descriptor/manager.cpp
# core/pipeline
core/pipeline/manager.h
core/pipeline/manager.cpp
core/pipeline/sampler.h
core/pipeline/sampler.cpp
# core/assets
core/assets/locator.h
core/assets/locator.cpp
core/assets/manager.h
core/assets/manager.cpp
core/assets/texture_cache.h
core/assets/texture_cache.cpp
core/assets/ktx_loader.h
core/assets/ktx_loader.cpp
core/assets/ibl_manager.h
core/assets/ibl_manager.cpp
# core/frame
core/frame/resources.h
core/frame/resources.cpp
# core/util
core/util/initializers.h
core/util/initializers.cpp
core/util/debug.h
core/util/debug.cpp
# core/raytracing
core/raytracing/raytracing.h
core/raytracing/raytracing.cpp
# render
render/pipelines.h
render/pipelines.cpp
@@ -97,6 +104,13 @@ target_compile_definitions(vulkan_engine PUBLIC GLM_FORCE_DEPTH_ZERO_TO_ONE)
target_include_directories(vulkan_engine PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/core"
"${CMAKE_CURRENT_SOURCE_DIR}/core/device"
"${CMAKE_CURRENT_SOURCE_DIR}/core/descriptor"
"${CMAKE_CURRENT_SOURCE_DIR}/core/pipeline"
"${CMAKE_CURRENT_SOURCE_DIR}/core/assets"
"${CMAKE_CURRENT_SOURCE_DIR}/core/frame"
"${CMAKE_CURRENT_SOURCE_DIR}/core/util"
"${CMAKE_CURRENT_SOURCE_DIR}/core/raytracing"
"${CMAKE_CURRENT_SOURCE_DIR}/render"
"${CMAKE_CURRENT_SOURCE_DIR}/render/passes"
"${CMAKE_CURRENT_SOURCE_DIR}/render/graph"

View File

@@ -1,12 +1,12 @@
#include <compute/vk_compute.h>
#include <core/engine_context.h>
#include <core/context.h>
#include <render/pipelines.h>
#include <core/vk_initializers.h>
#include <core/util/initializers.h>
#include <iostream>
#include "vk_device.h"
#include "core/vk_resource.h"
#include "frame_resources.h"
#include "core/device/device.h"
#include "core/device/resource.h"
#include "core/frame/resources.h"
ComputeBinding ComputeBinding::uniformBuffer(uint32_t binding, VkBuffer buffer, VkDeviceSize size, VkDeviceSize offset)
{

View File

@@ -1,7 +1,7 @@
# pragma once
#include <core/vk_types.h>
#include <core/vk_descriptors.h>
#include <core/types.h>
#include <core/descriptor/descriptors.h>
#include <functional>
#include <unordered_map>
#include <glm/glm.hpp>

View File

@@ -1,15 +1,15 @@
#include "ibl_manager.h"
#include <core/engine_context.h>
#include <core/vk_resource.h>
#include <core/ktx_loader.h>
#include <core/vk_sampler_manager.h>
#include <core/vk_descriptors.h>
#include <core/context.h>
#include <core/device/resource.h>
#include <core/assets/ktx_loader.h>
#include <core/pipeline/sampler.h>
#include <core/descriptor/descriptors.h>
#include <cmath>
#include <algorithm>
#include <ktx.h>
#include <SDL_stdinc.h>
#include "vk_device.h"
#include "core/device/device.h"
bool IBLManager::load(const IBLPaths &paths)
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <string>
class EngineContext;

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <vector>
// Simple KTX2 helpers focused on IBL assets.

View File

@@ -1,4 +1,4 @@
#include "asset_locator.h"
#include "locator.h"
#include <cstdlib>

View File

@@ -1,17 +1,17 @@
#include "asset_manager.h"
#include "manager.h"
#include <cstdlib>
#include <iostream>
#include <core/vk_engine.h>
#include <core/vk_resource.h>
#include <core/engine.h>
#include <core/device/resource.h>
#include <render/materials.h>
#include <render/primitives.h>
#include <scene/tangent_space.h>
#include <scene/mesh_bvh.h>
#include <stb_image.h>
#include "asset_locator.h"
#include <core/texture_cache.h>
#include "locator.h"
#include <core/assets/texture_cache.h>
#include <fastgltf/parser.hpp>
#include <fastgltf/util.hpp>
#include <fastgltf/tools.hpp>

View File

@@ -10,10 +10,10 @@
#include <utility>
#include <scene/vk_loader.h>
#include <core/vk_types.h>
#include <core/types.h>
#include "materials.h"
#include "asset_locator.h"
#include "render/materials.h"
#include "locator.h"
class VulkanEngine;
class MeshAsset;

View File

@@ -1,15 +1,15 @@
#include "texture_cache.h"
#include <core/engine_context.h>
#include <core/vk_resource.h>
#include <core/vk_descriptors.h>
#include <core/context.h>
#include <core/device/resource.h>
#include <core/descriptor/descriptors.h>
#include <core/config.h>
#include <algorithm>
#include "stb_image.h"
#include <ktx.h>
#include <ktxvulkan.h>
#include <algorithm>
#include "vk_device.h"
#include "core/device/device.h"
#include <cstring>
#include <filesystem>
#include <fstream>

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <cstdint>
#include <string>
#include <vector>

View File

@@ -1,4 +1,4 @@
#include "engine_context.h"
#include "context.h"
#include "scene/vk_scene.h"
const GPUSceneData &EngineContext::getSceneData() const

View File

@@ -1,8 +1,8 @@
#pragma once
#include <memory>
#include <core/vk_types.h>
#include <core/vk_descriptors.h>
#include <core/types.h>
#include <core/descriptor/descriptors.h>
// Avoid including vk_scene.h here to prevent cycles
struct EngineStats

View File

@@ -1,4 +1,4 @@
#include <core/vk_descriptors.h>
#include <core/descriptor/descriptors.h>
void DescriptorLayoutBuilder::add_binding(uint32_t binding, VkDescriptorType type, uint32_t count)
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
struct DescriptorLayoutBuilder

View File

@@ -1,6 +1,6 @@
#include "vk_descriptor_manager.h"
#include "vk_device.h"
#include "vk_descriptors.h"
#include "manager.h"
#include "core/device/device.h"
#include "descriptors.h"
void DescriptorManager::init(DeviceManager *deviceManager)
{

View File

@@ -1,9 +1,9 @@
#pragma once
#include <core/vk_types.h>
#include <core/vk_descriptors.h>
#include <core/types.h>
#include <core/descriptor/descriptors.h>
#include "vk_device.h"
#include "device/device.h"
class DeviceManager;

View File

@@ -1,4 +1,4 @@
#include "vk_device.h"
#include "device.h"
#include "config.h"
#include "SDL2/SDL.h"
#include "SDL2/SDL_vulkan.h"

View File

@@ -1,5 +1,5 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include "VkBootstrap.h"

View File

@@ -1,11 +1,11 @@
#include <core/vk_images.h>
#include <core/vk_initializers.h>
#include <core/device/images.h>
#include <core/util/initializers.h>
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
//> transition
#include <core/vk_initializers.h>
#include <core/util/initializers.h>
void vkutil::transition_image(VkCommandBuffer cmd, VkImage image, VkImageLayout currentLayout, VkImageLayout newLayout)
{

View File

@@ -1,5 +1,5 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
namespace vkutil {

View File

@@ -1,14 +1,14 @@
#include "vk_resource.h"
#include "vk_device.h"
#include "vk_images.h"
#include "vk_initializers.h"
#include "resource.h"
#include "device.h"
#include "images.h"
#include "core/util/initializers.h"
#include "vk_mem_alloc.h"
#include <render/graph/graph.h>
#include <render/graph/builder.h>
#include <render/graph/resources.h>
#include "frame_resources.h"
#include "core/frame/resources.h"
#include <memory>
#include <string>

View File

@@ -1,5 +1,5 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <functional>
#include <vector>

View File

@@ -1,11 +1,11 @@
#include "vk_swapchain.h"
#include "swapchain.h"
#include <SDL_video.h>
#include "SDL2/SDL_vulkan.h"
#include "vk_device.h"
#include "vk_initializers.h"
#include "vk_resource.h"
#include "device.h"
#include "core/util/initializers.h"
#include "resource.h"
// Swapchain + per-frame targets (HDR draw, depth, GBuffer) management.
//

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
class ResourceManager;
class DeviceManager;

View File

@@ -13,12 +13,12 @@
// - docs/RayTracing.md
//
//> includes
#include "vk_engine.h"
#include "engine.h"
#include "SDL2/SDL.h"
#include <core/vk_initializers.h>
#include <core/vk_types.h>
#include <core/util/initializers.h>
#include <core/types.h>
#include "VkBootstrap.h"
@@ -43,11 +43,11 @@
#include "render/passes/transparent.h"
#include "render/passes/tonemap.h"
#include "render/passes/shadow.h"
#include "vk_resource.h"
#include "engine_context.h"
#include "core/vk_pipeline_manager.h"
#include "core/texture_cache.h"
#include "core/ibl_manager.h"
#include "device/resource.h"
#include "context.h"
#include "core/pipeline/manager.h"
#include "core/assets/texture_cache.h"
#include "core/assets/ibl_manager.h"
// ImGui debug UI (tabs, inspectors, etc.) is implemented in core/vk_engine_ui.cpp.
void vk_engine_draw_debug_ui(VulkanEngine *eng);

View File

@@ -3,36 +3,36 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <vector>
#include <string>
#include <unordered_map>
#include "vk_mem_alloc.h"
#include <deque>
#include <functional>
#include "vk_descriptors.h"
#include "descriptor/descriptors.h"
#include "scene/vk_loader.h"
#include "compute/vk_compute.h"
#include <scene/camera.h>
#include "vk_device.h"
#include "device/device.h"
#include "render/renderpass.h"
#include "render/passes/background.h"
#include "vk_resource.h"
#include "vk_swapchain.h"
#include "device/resource.h"
#include "device/swapchain.h"
#include "scene/vk_scene.h"
#include "render/materials.h"
#include "frame_resources.h"
#include "vk_descriptor_manager.h"
#include "vk_sampler_manager.h"
#include "core/engine_context.h"
#include "core/vk_pipeline_manager.h"
#include "core/asset_manager.h"
#include "frame/resources.h"
#include "descriptor/manager.h"
#include "pipeline/sampler.h"
#include "core/context.h"
#include "core/pipeline/manager.h"
#include "core/assets/manager.h"
#include "render/graph/graph.h"
#include "core/vk_raytracing.h"
#include "core/texture_cache.h"
#include "core/ibl_manager.h"
#include "core/raytracing/raytracing.h"
#include "core/assets/texture_cache.h"
#include "core/assets/ibl_manager.h"
// Number of frames-in-flight. Affects per-frame command buffers, fences,
// semaphores, and transient descriptor pools in FrameResources.

View File

@@ -4,7 +4,7 @@
// statistics, render-graph inspection, texture streaming controls, etc.
// The main frame loop in vk_engine.cpp simply calls vk_engine_draw_debug_ui().
#include "vk_engine.h"
#include "engine.h"
#include "imgui.h"
#include "ImGuizmo.h"
@@ -16,11 +16,11 @@
#include <glm/gtx/euler_angles.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include "render/graph/graph.h"
#include "core/vk_pipeline_manager.h"
#include "core/texture_cache.h"
#include "core/ibl_manager.h"
#include "engine_context.h"
#include <vk_types.h>
#include "core/pipeline/manager.h"
#include "core/assets/texture_cache.h"
#include "core/assets/ibl_manager.h"
#include "context.h"
#include <core/types.h>
#include "mesh_bvh.h"

View File

@@ -1,9 +1,9 @@
#include "frame_resources.h"
#include "resources.h"
#include <span>
#include "vk_descriptors.h"
#include "vk_device.h"
#include "vk_initializers.h"
#include "vk_types.h"
#include "core/descriptor/descriptors.h"
#include "core/device/device.h"
#include "core/util/initializers.h"
#include "core/types.h"
void FrameResources::init(DeviceManager *deviceManager,
std::span<DescriptorAllocatorGrowable::PoolSizeRatio> framePoolSizes)

View File

@@ -1,7 +1,7 @@
#pragma once
#include <core/vk_types.h>
#include <core/vk_descriptors.h>
#include <core/types.h>
#include <core/descriptor/descriptors.h>
class DeviceManager;

View File

@@ -1,10 +1,10 @@
#include <core/vk_pipeline_manager.h>
#include <core/pipeline/manager.h>
#include <core/engine_context.h>
#include <core/vk_initializers.h>
#include <core/context.h>
#include <core/util/initializers.h>
#include <render/pipelines.h>
#include <vk_device.h>
#include <core/device/device.h>
#include <filesystem>

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <render/pipelines.h>
#include <compute/vk_compute.h>

View File

@@ -1,5 +1,5 @@
#include "vk_sampler_manager.h"
#include "vk_device.h"
#include "sampler.h"
#include "core/device/device.h"
void SamplerManager::init(DeviceManager *deviceManager)
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
class DeviceManager;

View File

@@ -1,7 +1,7 @@
#include "vk_raytracing.h"
#include "vk_device.h"
#include "vk_resource.h"
#include "vk_initializers.h"
#include "raytracing.h"
#include "core/device/device.h"
#include "core/device/resource.h"
#include "core/util/initializers.h"
#include "scene/vk_loader.h"
#include "scene/vk_scene.h"
#include <cstring>

View File

@@ -1,5 +1,5 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <unordered_map>
#include <vector>
#include <memory>

View File

@@ -1,4 +1,4 @@
#include <core/vk_debug.h>
#include <core/util/debug.h>
#include <cstring>

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
namespace vkdebug
{

View File

@@ -1,4 +1,4 @@
#include <core/vk_initializers.h>
#include <core/util/initializers.h>
//> init_cmd
VkCommandPoolCreateInfo vkinit::command_pool_create_info(uint32_t queueFamilyIndex,

View File

@@ -3,7 +3,7 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
namespace vkinit
{

View File

@@ -1,4 +1,4 @@
#include "core/vk_engine.h"
#include "core/engine.h"
int main(int argc, char* argv[])
{

View File

@@ -1,7 +1,7 @@
#include "graph.h"
#include <core/engine_context.h>
#include <core/vk_images.h>
#include <core/vk_initializers.h>
#include <core/context.h>
#include <core/device/images.h>
#include <core/util/initializers.h>
#include <unordered_map>
#include <unordered_set>
@@ -9,12 +9,12 @@
#include <algorithm>
#include <cstdio>
#include <core/vk_swapchain.h>
#include <core/vk_initializers.h>
#include <core/vk_debug.h>
#include <core/device/swapchain.h>
#include <core/util/initializers.h>
#include <core/util/debug.h>
#include <fmt/core.h>
#include "vk_device.h"
#include "core/device/device.h"
#include <chrono>
void RenderGraph::init(EngineContext *ctx)

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <render/graph/types.h>
#include <render/graph/resources.h>
#include <render/graph/builder.h>

View File

@@ -1,11 +1,11 @@
#include "resources.h"
#include <core/engine_context.h>
#include <core/vk_resource.h>
#include <core/context.h>
#include <core/device/resource.h>
#include <vk_mem_alloc.h>
#include <core/config.h>
#include "frame_resources.h"
#include "vk_device.h"
#include "core/frame/resources.h"
#include "core/device/device.h"
void RGResourceRegistry::reset()
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <render/graph/types.h>
#include <string>
#include <vector>

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <string>
#include <vector>

View File

@@ -1,10 +1,10 @@
#include "materials.h"
#include "core/vk_engine.h"
#include "core/engine.h"
#include "render/pipelines.h"
#include "core/vk_initializers.h"
#include "core/vk_pipeline_manager.h"
#include "core/asset_manager.h"
#include "core/util/initializers.h"
#include "core/pipeline/manager.h"
#include "core/assets/manager.h"
namespace vkutil { bool load_shader_module(const char*, VkDevice, VkShaderModule*); }

View File

@@ -1,7 +1,7 @@
#pragma once
#include <core/vk_types.h>
#include <core/vk_descriptors.h>
#include <core/types.h>
#include <core/descriptor/descriptors.h>
class VulkanEngine;

View File

@@ -1,19 +1,19 @@
#include "background.h"
#include <string_view>
#include "vk_swapchain.h"
#include "core/engine_context.h"
#include "core/vk_resource.h"
#include "core/vk_pipeline_manager.h"
#include "core/asset_manager.h"
#include "core/device/swapchain.h"
#include "core/context.h"
#include "core/device/resource.h"
#include "core/pipeline/manager.h"
#include "core/assets/manager.h"
#include "render/graph/graph.h"
#include <cstring>
#include "frame_resources.h"
#include "ibl_manager.h"
#include "vk_descriptor_manager.h"
#include "vk_device.h"
#include "vk_sampler_manager.h"
#include "core/frame/resources.h"
#include "core/assets/ibl_manager.h"
#include "core/descriptor/manager.h"
#include "core/device/device.h"
#include "core/pipeline/sampler.h"
void BackgroundPass::init(EngineContext *context)
{

View File

@@ -3,17 +3,17 @@
#include <chrono>
#include <unordered_set>
#include "frame_resources.h"
#include "texture_cache.h"
#include "vk_descriptor_manager.h"
#include "vk_device.h"
#include "core/engine_context.h"
#include "core/vk_initializers.h"
#include "core/vk_resource.h"
#include "core/frame/resources.h"
#include "core/assets/texture_cache.h"
#include "core/descriptor/manager.h"
#include "core/device/device.h"
#include "core/context.h"
#include "core/util/initializers.h"
#include "core/device/resource.h"
#include "vk_mem_alloc.h"
#include "vk_scene.h"
#include "vk_swapchain.h"
#include "scene/vk_scene.h"
#include "core/device/swapchain.h"
#include "render/graph/graph.h"
// Basic conservative frustum test against RenderObject AABB.

View File

@@ -3,10 +3,10 @@
#include "imgui.h"
#include "imgui_impl_sdl2.h"
#include "imgui_impl_vulkan.h"
#include "vk_device.h"
#include "vk_swapchain.h"
#include "core/vk_initializers.h"
#include "core/engine_context.h"
#include "core/device/device.h"
#include "core/device/swapchain.h"
#include "core/util/initializers.h"
#include "core/context.h"
#include "render/graph/graph.h"
void ImGuiPass::init(EngineContext *context)

View File

@@ -1,6 +1,6 @@
#pragma once
#include "render/renderpass.h"
#include "core/vk_types.h"
#include "core/types.h"
#include <render/graph/types.h>
class ImGuiPass : public IRenderPass

View File

@@ -1,26 +1,26 @@
#include "lighting.h"
#include "frame_resources.h"
#include "vk_descriptor_manager.h"
#include "vk_device.h"
#include "core/engine_context.h"
#include "core/vk_initializers.h"
#include "core/vk_resource.h"
#include "core/frame/resources.h"
#include "core/descriptor/manager.h"
#include "core/device/device.h"
#include "core/context.h"
#include "core/util/initializers.h"
#include "core/device/resource.h"
#include "render/pipelines.h"
#include "core/vk_pipeline_manager.h"
#include "core/asset_manager.h"
#include "core/vk_descriptors.h"
#include "core/pipeline/manager.h"
#include "core/assets/manager.h"
#include "core/descriptor/descriptors.h"
#include "core/config.h"
#include "vk_mem_alloc.h"
#include "vk_sampler_manager.h"
#include "vk_swapchain.h"
#include "core/pipeline/sampler.h"
#include "core/device/swapchain.h"
#include "render/graph/graph.h"
#include <array>
#include <cstring>
#include "ibl_manager.h"
#include "vk_raytracing.h"
#include "core/assets/ibl_manager.h"
#include "core/raytracing/raytracing.h"
void LightingPass::init(EngineContext *context)
{

View File

@@ -3,20 +3,20 @@
#include <unordered_set>
#include <string>
#include "core/engine_context.h"
#include "core/context.h"
#include "render/graph/graph.h"
#include "render/graph/builder.h"
#include "vk_swapchain.h"
#include "vk_scene.h"
#include "frame_resources.h"
#include "vk_descriptor_manager.h"
#include "vk_device.h"
#include "vk_resource.h"
#include "core/vk_initializers.h"
#include "core/vk_pipeline_manager.h"
#include "core/asset_manager.h"
#include "core/device/swapchain.h"
#include "scene/vk_scene.h"
#include "core/frame/resources.h"
#include "core/descriptor/manager.h"
#include "core/device/device.h"
#include "core/device/resource.h"
#include "core/util/initializers.h"
#include "core/pipeline/manager.h"
#include "core/assets/manager.h"
#include "render/pipelines.h"
#include "core/vk_types.h"
#include "core/types.h"
#include "core/config.h"
void ShadowPass::init(EngineContext *context)

View File

@@ -1,17 +1,17 @@
#include "tonemap.h"
#include <core/engine_context.h>
#include <core/vk_descriptors.h>
#include <core/vk_descriptor_manager.h>
#include <core/vk_pipeline_manager.h>
#include <core/asset_manager.h>
#include <core/vk_device.h>
#include <core/vk_resource.h>
#include <vk_sampler_manager.h>
#include <core/context.h>
#include <core/descriptor/descriptors.h>
#include <core/descriptor/manager.h>
#include <core/pipeline/manager.h>
#include <core/assets/manager.h>
#include <core/device/device.h>
#include <core/device/resource.h>
#include <core/pipeline/sampler.h>
#include <render/graph/graph.h>
#include <render/graph/resources.h>
#include "frame_resources.h"
#include "core/frame/resources.h"
struct TonemapPush
{

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <render/renderpass.h>
#include <render/graph/types.h>

View File

@@ -3,16 +3,16 @@
#include <algorithm>
#include <unordered_set>
#include "ibl_manager.h"
#include "texture_cache.h"
#include "vk_sampler_manager.h"
#include "vk_scene.h"
#include "vk_swapchain.h"
#include "core/engine_context.h"
#include "core/vk_resource.h"
#include "core/vk_device.h"
#include "core/vk_descriptor_manager.h"
#include "core/frame_resources.h"
#include "core/assets/ibl_manager.h"
#include "core/assets/texture_cache.h"
#include "core/pipeline/sampler.h"
#include "scene/vk_scene.h"
#include "core/device/swapchain.h"
#include "core/context.h"
#include "core/device/resource.h"
#include "core/device/device.h"
#include "core/descriptor/manager.h"
#include "core/frame/resources.h"
#include "render/graph/graph.h"
void TransparentPass::init(EngineContext *context)

View File

@@ -1,6 +1,6 @@
#include "pipelines.h"
#include <fstream>
#include <core/vk_initializers.h>
#include <core/util/initializers.h>
bool vkutil::load_shader_module(const char *filePath, VkDevice device, VkShaderModule *outShaderModule)
{

View File

@@ -1,8 +1,8 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <fstream>
#include <core/vk_initializers.h>
#include <core/util/initializers.h>
namespace vkutil
{

View File

@@ -4,7 +4,7 @@
#include <cmath>
#include <glm/glm.hpp>
#include <glm/gtc/constants.hpp>
#include "core/vk_types.h"
#include "core/types.h"
#include "glm/gtx/compatibility.hpp"
#include "glm/gtx/norm.hpp"

View File

@@ -1,5 +1,5 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <vector>
#include <memory>
#include <functional>

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <SDL_events.h>
#include "glm/vec3.hpp"

View File

@@ -8,7 +8,7 @@
#include <glm/mat4x4.hpp>
#include <glm/vec3.hpp>
#include <core/vk_types.h>
#include <core/types.h>
#include <bvh/BVH.h>
struct MeshAsset;

View File

@@ -2,7 +2,7 @@
#include <vector>
#include <cstddef>
#include <core/vk_types.h>
#include <core/types.h>
namespace geom {

View File

@@ -3,12 +3,12 @@
#include <algorithm>
#include <cmath>
#include "vk_loader.h"
#include "core/texture_cache.h"
#include "core/assets/texture_cache.h"
#include "core/vk_engine.h"
#include "core/engine.h"
#include "render/materials.h"
#include "core/vk_initializers.h"
#include "core/vk_types.h"
#include "core/util/initializers.h"
#include "core/types.h"
#include "core/config.h"
#include <glm/gtx/quaternion.hpp>

View File

@@ -3,9 +3,9 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include "core/vk_descriptors.h"
#include "core/descriptor/descriptors.h"
#include <unordered_map>
#include <filesystem>

View File

@@ -4,8 +4,8 @@
#include <unordered_set>
#include <chrono>
#include "vk_swapchain.h"
#include "core/engine_context.h"
#include "core/device/swapchain.h"
#include "core/context.h"
#include "core/config.h"
#include "glm/gtx/transform.hpp"
#include <glm/gtc/matrix_transform.hpp>
@@ -15,7 +15,7 @@
#include <limits>
#include <cmath>
#include "frame_resources.h"
#include "core/frame/resources.h"
#include "core/config.h"
#include <fmt/core.h>

View File

@@ -1,5 +1,5 @@
#pragma once
#include <core/vk_types.h>
#include <core/types.h>
#include <scene/camera.h>
#include <unordered_map>
#include <memory>

View File

@@ -1,7 +1,7 @@
#include "vk_scene.h"
#include "vk_swapchain.h"
#include "core/engine_context.h"
#include "core/device/swapchain.h"
#include "core/context.h"
#include "mesh_bvh.h"
#include "glm/gtx/transform.hpp"