Reorganize directory layout: editor panels/, grouped shaders, drop stale header
- App/editor: move 7 panels into panels/ (Editor core stays at root) - shaders/: group into pbr/ post/ debug/ env/ (runtime load paths updated) - Delete outdated duplicate Engine/src/Renderer/VulkanAssetUploader.h
This commit is contained in:
+3
-1
@@ -1,7 +1,9 @@
|
||||
# App 层源文件:main + editor/(docking 编辑器)+ scripts/(C++ 原生脚本)
|
||||
file(GLOB EDITOR_SOURCES CONFIGURE_DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/editor/*.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/editor/*.h)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/editor/*.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/editor/panels/*.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/editor/panels/*.h)
|
||||
|
||||
file(GLOB SCRIPT_SOURCES CONFIGURE_DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/scripts/*.cpp)
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
//
|
||||
|
||||
#include "Editor.h"
|
||||
#include "AssetBrowserPanel.h"
|
||||
#include "HierarchyPanel.h"
|
||||
#include "InspectorPanel.h"
|
||||
#include "MaterialEditorPanel.h"
|
||||
#include "ControllerEditorPanel.h"
|
||||
#include "ViewportPanel.h"
|
||||
#include "StatsPanel.h"
|
||||
#include "panels/AssetBrowserPanel.h"
|
||||
#include "panels/HierarchyPanel.h"
|
||||
#include "panels/InspectorPanel.h"
|
||||
#include "panels/MaterialEditorPanel.h"
|
||||
#include "panels/ControllerEditorPanel.h"
|
||||
#include "panels/ViewportPanel.h"
|
||||
#include "panels/StatsPanel.h"
|
||||
|
||||
#include <Engine/Core/Log.h>
|
||||
#include <Engine/Core/Time.h>
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
#define HELLOVULKAN_EDITOR_H
|
||||
|
||||
#include "EditorContext.h"
|
||||
#include "ViewportPanel.h" // ViewportInputState(成员按值持有)
|
||||
#include "panels/ViewportPanel.h" // ViewportInputState(成员按值持有)
|
||||
|
||||
#include <Engine/Core/Types.h> // u32(SelectEntity 位模式转换)
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Engine
|
||||
m_LutLayout = descriptors.CreatePipelineLayout(
|
||||
{m_LutSetLayout}, 0, vk::ShaderStageFlagBits::eCompute);
|
||||
|
||||
const std::string dir = "shaders/";
|
||||
const std::string dir = "shaders/env/";
|
||||
m_ToCubeShader = shaders.CreateFromFile(
|
||||
dir + "ibl_equirect_to_cube.comp.spv",
|
||||
vk::ShaderStageFlagBits::eCompute,
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Engine::Passes
|
||||
m_Layout = descriptors.CreatePipelineLayout(
|
||||
std::vector<vk::DescriptorSetLayout>{}, sizeof(glm::mat4));
|
||||
|
||||
const std::string shaderDir = "shaders/";
|
||||
const std::string shaderDir = "shaders/debug/";
|
||||
auto wireVert = shaders.CreateFromFile(
|
||||
shaderDir + "debug_line.vert.spv",
|
||||
vk::ShaderStageFlagBits::eVertex,
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Engine::Passes
|
||||
.setAddressModeV(vk::SamplerAddressMode::eClampToEdge)
|
||||
.setAddressModeW(vk::SamplerAddressMode::eClampToEdge));
|
||||
|
||||
const std::string shaderDir = "shaders/";
|
||||
const std::string shaderDir = "shaders/post/"; // tonemap/bloom/TAA 全属后处理
|
||||
auto vertShader = shaders.CreateFromFile(
|
||||
shaderDir + "tonemap.vert.spv",
|
||||
vk::ShaderStageFlagBits::eVertex,
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Engine::Passes
|
||||
m_Layout = descriptors.CreatePipelineLayout(
|
||||
std::vector<vk::DescriptorSetLayout>{gpu.uboSetLayout}, 0);
|
||||
|
||||
const std::string shaderDir = "shaders/";
|
||||
const std::string shaderDir = "shaders/debug/";
|
||||
auto vert = shaders.CreateFromFile(
|
||||
shaderDir + "hitproxy.vert.spv",
|
||||
vk::ShaderStageFlagBits::eVertex,
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Engine::Passes
|
||||
: m_Gpu(gpu), m_Frame(frame), m_Mask(mask), m_Present(present),
|
||||
m_Color(color), m_WidthPx(widthPx) {
|
||||
m_Frag = shaders.CreateFromFile(
|
||||
"shaders/outline.frag.spv",
|
||||
"shaders/debug/outline.frag.spv",
|
||||
vk::ShaderStageFlagBits::eFragment,
|
||||
std::vector<vk::DescriptorSetLayout>{gpu.setLayout},
|
||||
sizeof(FullscreenPush));
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Engine::Passes
|
||||
m_Layout = descriptors.CreatePipelineLayout(
|
||||
std::vector<vk::DescriptorSetLayout>{}, sizeof(glm::mat4));
|
||||
|
||||
const std::string shaderDir = "shaders/";
|
||||
const std::string shaderDir = "shaders/debug/";
|
||||
auto vert = shaders.CreateFromFile(
|
||||
shaderDir + "debug_line.vert.spv",
|
||||
vk::ShaderStageFlagBits::eVertex,
|
||||
|
||||
@@ -86,7 +86,8 @@ namespace Engine::Passes
|
||||
std::vector<vk::DescriptorSetLayout>{uboSetLayout},
|
||||
sizeof(glm::mat4));
|
||||
|
||||
const std::string shaderDir = "shaders/";
|
||||
const std::string shaderDir = "shaders/pbr/";
|
||||
const std::string envShaderDir = "shaders/env/";
|
||||
// forward vert/frag 均无 push(range 定义一致:都没有,VUID-08878)
|
||||
auto vert = shaders.CreateFromFile(
|
||||
shaderDir + "simple_shader.vert.spv",
|
||||
@@ -104,12 +105,12 @@ namespace Engine::Passes
|
||||
|
||||
// shadow shader:depth-only,push = lightVP
|
||||
auto shadowVertShader = shaders.CreateFromFile(
|
||||
shaderDir + "shadow.vert.spv",
|
||||
envShaderDir + "shadow.vert.spv",
|
||||
vk::ShaderStageFlagBits::eVertex,
|
||||
std::vector<vk::DescriptorSetLayout>{uboSetLayout},
|
||||
sizeof(glm::mat4));
|
||||
auto shadowFragShader = shaders.CreateFromFile(
|
||||
shaderDir + "shadow.frag.spv",
|
||||
envShaderDir + "shadow.frag.spv",
|
||||
vk::ShaderStageFlagBits::eFragment,
|
||||
std::vector<vk::DescriptorSetLayout>{uboSetLayout},
|
||||
sizeof(glm::mat4));
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Engine::Passes
|
||||
// 要求同程序各 shader 的 set layouts 逐项相同,VUID-08879),
|
||||
// 本 shader 只用 Set0,多声明是合法超集
|
||||
m_Frag = shaders.CreateFromFile(
|
||||
"shaders/sel_mask.frag.spv",
|
||||
"shaders/debug/sel_mask.frag.spv",
|
||||
vk::ShaderStageFlagBits::eFragment,
|
||||
std::vector<vk::DescriptorSetLayout>{
|
||||
gpu.uboSetLayout, gpu.textureSetLayout, gpu.shadowSetLayout},
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Engine::Passes
|
||||
std::vector<vk::DescriptorSetLayout>{m_SetLayout},
|
||||
sizeof(glm::mat4));
|
||||
|
||||
const std::string shaderDir = "shaders/";
|
||||
const std::string shaderDir = "shaders/env/";
|
||||
auto vert = shaders.CreateFromFile(
|
||||
shaderDir + "skybox.vert.spv",
|
||||
vk::ShaderStageFlagBits::eVertex,
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
//
|
||||
// Created by atdunbg on 2026/9/23.
|
||||
//
|
||||
// VulkanAssetUploader:IAssetUploader 的渲染层实现。
|
||||
//
|
||||
// 属于渲染层对资产层提供的服务:持有 GPU 上下文,负责把解析后的
|
||||
// 资产数据创建为 Vulkan 资源。资产层(AssetManager)只看到接口,
|
||||
// 不知道 Device/Allocator 的存在——依赖方向:Assets → IAssetUploader
|
||||
// ← VulkanAssetUploader(渲染层),永远不出现 Assets → Vulkan 具体。
|
||||
//
|
||||
|
||||
#ifndef HELLOVULKAN_VULKANASSETUPLOADER_H
|
||||
#define HELLOVULKAN_VULKANASSETUPLOADER_H
|
||||
|
||||
#include <Engine/Assets/IAssetUploader.h>
|
||||
|
||||
namespace Engine {
|
||||
|
||||
class Device;
|
||||
class MemoryAllocator;
|
||||
class DescriptorManager;
|
||||
class IblGenerator;
|
||||
|
||||
class VulkanAssetUploader final : public Assets::IAssetUploader {
|
||||
public:
|
||||
VulkanAssetUploader(Device& device, MemoryAllocator& allocator,
|
||||
DescriptorManager& descriptors,
|
||||
vk::DescriptorSetLayout textureLayout,
|
||||
IblGenerator& ibl)
|
||||
: m_Device(device), m_Allocator(allocator),
|
||||
m_Descriptors(descriptors), m_TextureLayout(textureLayout),
|
||||
m_Ibl(ibl) {}
|
||||
|
||||
Scope<Model> LoadModel(const std::string& path) override;
|
||||
Scope<Model> LoadModel(const std::string& path,
|
||||
ParsedModel&& parsed) override;
|
||||
Scope<Model> CreatePlane(f32 halfSize, u8 r, u8 g, u8 b) override;
|
||||
Scope<Model> CreateTransparentPlane(f32 halfSize,
|
||||
u8 r, u8 g, u8 b, u8 a) override;
|
||||
Scope<Cubemap> LoadEnvironment(const std::string& path) override;
|
||||
Scope<Cubemap> LoadEnvironment(const std::string& path,
|
||||
DecodedEquirect&& decoded) override;
|
||||
Scope<MaterialAsset> CreateMaterial(
|
||||
MaterialAssetData&& data) override;
|
||||
void WaitDeviceIdle() override;
|
||||
|
||||
private:
|
||||
// 惰性创建的共享默认纹理集(空槽/加载失败兜底;全体材质资产
|
||||
// 共用一份,非拥有引用进各 MaterialAsset)
|
||||
void InitSharedDefaultTextures();
|
||||
|
||||
Device& m_Device;
|
||||
MemoryAllocator& m_Allocator;
|
||||
DescriptorManager& m_Descriptors;
|
||||
vk::DescriptorSetLayout m_TextureLayout;
|
||||
IblGenerator& m_Ibl; // 环境 IBL 预积分的 compute 生成端
|
||||
|
||||
std::array<Scope<Texture>, Material::kSlotCount> m_DefaultTextures;
|
||||
};
|
||||
|
||||
} // namespace Engine
|
||||
|
||||
#endif //HELLOVULKAN_VULKANASSETUPLOADER_H
|
||||
Reference in New Issue
Block a user