fix: 阴影光源错误绑定 FillLight + 截图 usage 警告 + nodiscard

- LightComponent 增加 castShadow 标志;灯收集排序键改为
  castShadow 方向光 > 方向光 > 点光(此前稳定排序把收集序靠前的
  FillLight 排到 lights[0],KeyLight 方向滑条自然不影响阴影)
- TextureDesc 增加 extraUsage:HDRColor 声明 TRANSFER_SRC,
  消除截图 copy 的 3 条 usage 不匹配运行时警告
- waitForFences nodiscard 返回值显式丢弃,消除编译警告
This commit is contained in:
2026-09-24 11:59:18 +08:00
parent 4d3963e291
commit 42fd9d5f30
9 changed files with 40 additions and 13 deletions
+5 -2
View File
@@ -290,9 +290,11 @@ namespace Engine
// HDR 颜色图:Forward 的输出(线性光照值 + 抖动),TAA 显式完成
// 时域累积后写入 TAAColor(对齐 UE/Unity 管线)
// extraUsage:调试截图需要 TRANSFER_SRC(第 60 帧 copy 到 buffer)
m_HDRColor = m_RenderGraph->CreateTexture(
"HDRColor",
RG::TextureDesc{vk::Format::eR16G16B16A16Sfloat});
RG::TextureDesc{vk::Format::eR16G16B16A16Sfloat, 0, 0, 1.0f,
vk::ImageUsageFlagBits::eTransferSrc});
// velocity:clip 空间运动向量(TAA 反推历史像素位置)
m_Velocity = m_RenderGraph->CreateTexture(
@@ -577,7 +579,8 @@ namespace Engine
// 调试截图落盘:等 fence(copy 已提交完成)→ fp16 → BMP
if (doCapture) {
m_Device->GetDevice().waitForFences(
// 诊断截图落盘:等 fence(copy 已提交完成)→ BMP(返回值仅超时标志)
(void)m_Device->GetDevice().waitForFences(
m_SyncManager->GetFrameFence(frameSlot), VK_TRUE,
UINT64_MAX);
WriteHdrBMP("capture.bmp", m_CaptureAlloc.MappedPtr,