feat: DDS 纹理加载器(BC 压缩直传 + mip 链,参考 Horizon 实现)

- Assets::Dds 解析器:中性 DdsFormat 枚举(Assets 层禁 Vulkan 头铁律),
  支持 legacy fourcc(DXT1/3/5/ATI1/2)+ DX10 头(BC1..BC7/RGBA8/BGRA8)
  + 未压缩 32bpp + 2D mip 链;数据不解码,直接上传由硬件采样解码
- Texture:按扩展名分发(.dds → InitFromDds);渲染侧负责格式映射与
  sRGB 语义(颜色图走 SRGB 变体,BC4/5/6H 数据图保持线性);view/sampler
  覆盖完整 mip 链;逐 mip copyBufferToImage(紧凑排布)
- Model::GetOrLoadTexture:FBX/DCC 路径反斜杠归一化(否则 Linux 全挂)
- DescriptorManager 池 1000 → 4096(SunTemple 1056 材质集打爆过;
  材质去重属材质系统任务)
- main.cpp 临时挂 SunTemple 场景验证:48 张 DDS 全部加载(2048²、12 mips),
  1056 mesh 渲染正常,validation 零警告
This commit is contained in:
2026-09-23 14:21:39 +08:00
parent 0328d4aaeb
commit a0c92af5db
8 changed files with 469 additions and 40 deletions
+6 -1
View File
@@ -15,6 +15,7 @@
#include <assimp/postprocess.h>
#include <filesystem>
#include <algorithm>
namespace Engine {
@@ -110,8 +111,12 @@ void Model::ProcessNode(aiNode* node, const aiScene* scene)
}
}
Texture* Model::GetOrLoadTexture(const std::string& path)
Texture* Model::GetOrLoadTexture(const std::string& rawPath)
{
// FBX/DCC 导出的路径常带反斜杠(Windows 语义),统一成正斜杠
std::string path = rawPath;
std::replace(path.begin(), path.end(), '\\', '/');
auto it = m_TextureCache.find(path);
if (it != m_TextureCache.end()) {
return it->second.get();