vault backup: 2025-06-14 17:20:30

This commit is contained in:
BlueRose 2025-06-14 17:20:30 +08:00
parent ce8fae60a8
commit d4967d811b
6 changed files with 167 additions and 1 deletions

View File

@ -1 +1 @@
{"BlueprintCosmetic":{"BlueprintCosmetic":{"internalLink":{"count":1,"lastUpdated":1741951657866}}},"ReflectionsColor":{"ReflectionsColor":{"currentFile":{"count":1,"lastUpdated":1742739458164}}},"主要执行了:":{"主要执行了:":{"currentFile":{"count":1,"lastUpdated":1742830096172}}},"尝试平滑Lumen中的SH。":{"尝试平滑Lumen中的SH。":{"currentFile":{"count":1,"lastUpdated":1742910977705}}},"SupportDynamicSliderMinValue":{"SupportDynamicSliderMinValue":{"internalLink":{"count":1,"lastUpdated":1743066829865}}},"4DGaussians":{"4DGaussians":{"internalLink":{"count":1,"lastUpdated":1743173207988}}},"DMX灯光优化":{"DMX灯光优化":{"currentFile":{"count":1,"lastUpdated":1743327201208}}},"Addtivte":{"Addtivte":{"currentFile":{"count":1,"lastUpdated":1743329217204}}},"Dual-Ego":{"Dual-Ego":{"currentFile":{"count":1,"lastUpdated":1743338268824}}},"Merge、":{"Merge、":{"currentFile":{"count":1,"lastUpdated":1743339455484}}},"Nightglow":{"Nightglow":{"currentFile":{"count":1,"lastUpdated":1743341217248}}},"Nanite":{"Nanite":{"currentFile":{"count":1,"lastUpdated":1743344181589}}},"另一个位更加偏向于虚拟偶像直播,主要负责:":{"另一个位更加偏向于虚拟偶像直播,主要负责:":{"currentFile":{"count":1,"lastUpdated":1743396187936}}},"角色换装&道具:":{"角色换装&道具:":{"currentFile":{"count":1,"lastUpdated":1743405142805}}},"Dynamics主要用于模拟布料以及刚体头发。":{"Dynamics主要用于模拟布料以及刚体头发。":{"currentFile":{"count":1,"lastUpdated":1743413286078}}},"主要解决了:":{"主要解决了:":{"currentFile":{"count":1,"lastUpdated":1743413294305}}},"日常问题解决":{"日常问题解决":{"currentFile":{"count":1,"lastUpdated":1743426012684}}},"每章节解锁新的解谜道具增加了可玩性深度:":{"每章节解锁新的解谜道具增加了可玩性深度:":{"currentFile":{"count":1,"lastUpdated":1743665897310}}},"之后,这部分抓取参考场景的颜色值,将它们转换为参考显示。":{"之后,这部分抓取参考场景的颜色值,将它们转换为参考显示。":{"currentFile":{"count":1,"lastUpdated":1744380033457}}}}
{"AsyncCompute":{"AsyncCompute":{"currentFile":{"count":1,"lastUpdated":1749890609632}}}}

View File

@ -0,0 +1,154 @@
---
title: RDG Debug笔记
date: 2025-06-14 15:44:47
excerpt:
tags:
rating: ⭐
---
# 前言
- [UE5 Render Dependency Graph-实用指南](https://zhuanlan.zhihu.com/p/637889120)
# Command
- r.rdg
- AsyncCompute
- BreakPoint
## Reference
```c++
FAutoConsoleVariableRef CVarRDGDebug(
TEXT("r.RDG.Debug"),
GRDGDebug,
TEXT("Allow to output warnings for inefficiencies found during wiring and execution of the passes.\n")
TEXT(" 0: disabled;\n")
TEXT(" 1: emit warning once (default);\n")
TEXT(" 2: emit warning everytime issue is detected."),
ECVF_RenderThreadSafe);
FAutoConsoleVariableRef CVarRDGClobberResources(
TEXT("r.RDG.ClobberResources"),
GRDGClobberResources,
TEXT("Clears all render targets and texture / buffer UAVs with the requested clear color at allocation time. Useful for debugging.\n")
TEXT(" 0:off (default);\n")
TEXT(" 1: 1000 on RGBA channels;\n")
TEXT(" 2: NaN on RGBA channels;\n")
TEXT(" 3: +INFINITY on RGBA channels.\n"),
ECVF_Cheat | ECVF_RenderThreadSafe);
FAutoConsoleVariableRef CVarRDGOverlapUAVs(
TEXT("r.RDG.OverlapUAVs"), GRDGOverlapUAVs,
TEXT("RDG will overlap UAV work when requested; if disabled, UAV barriers are always inserted."),
ECVF_RenderThreadSafe);
FAutoConsoleVariableRef CVarRDGTransitionLog(
TEXT("r.RDG.TransitionLog"), GRDGTransitionLog,
TEXT("Logs resource transitions to the console.\n")
TEXT(" 0: disabled(default);\n")
TEXT(">0: enabled for N frames;\n")
TEXT("<0: enabled;\n"),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<FString> CVarRDGDebugPassFilter(
TEXT("r.RDG.Debug.PassFilter"), TEXT(""),
TEXT("Filters certain debug events to specific passes. Set to 'None' to reset.\n"),
ECVF_Default);
TAutoConsoleVariable<FString> CVarRDGDebugResourceFilter(
TEXT("r.RDG.Debug.ResourceFilter"), TEXT(""),
TEXT("Filters certain debug events to a specific resource. Set to 'None' to reset.\n"),
ECVF_Default);
FAutoConsoleVariableRef CVarRDGParallelSetup(
TEXT("r.RDG.ParallelSetup"), GRDGParallelSetup,
TEXT("RDG will setup passes in parallel when prompted by calls to FRDGBuilder::FlushSetupQueue.")
TEXT(" 0: pass setup is done synchronously in AddPass;")
TEXT(" 1: pass setup is done asynchronously (default);"),
ECVF_RenderThreadSafe);
```
# Visualize Texture Integration
**vis**
使用vis指令可以打印vis指令帮助信息以及当前帧使用到的所有的资源信息
![[RDG_Vis.jpg|1200]]
**vis [RT Name]**
使用vis [RT Name]可以实时预览当前RT的内容在调试渲染特性的时候可以很方便的Debug
![[RDG_Vis_RTName.jpg|800]]
**vis [RT Name] bump**
打印当前RT到Saved/Screenshots
**vis off**
关闭当前帧的debug模式
# r.RDG.ImmediateMode
将RDG设置成理解执行模式方便进行资源绑定Debug以及断点。
- RDG立即执行模式:
- 立刻执行Pass在其被添加的时候
- 产生和延后执行时一样的功能
- 如果打断点,会非常容易检查其创建的代码
- 由于这个原因所以不能在AddPass后再去更改Pass参数
- 可以利用r.RDG.ImmediateMode在运行时切换
- 会消耗更多的内存可以考虑使用r.Test.SecondaryUpscaleOverride运行在低分辨率下。r.Test.SecondaryUpscaleOverride 设置的参数越大越模糊)
![[RDG_Immediate.png|800]]
- **r.RDG.ImmediateMode 1** / -rdgimmediate : 去除RDG的影响
- **r.RHICmdBypass 1** 去除RHI和并行渲染的影响
- r.RDG.ParallelExecute=0
- r.RDG.ParallelSetup=0
## RDG Async Compute
1.直接设置ComputePassFlags为ERDGPassFlags::AsyncCompute剩下的工作交给RDG自动判断和设置
```c++
ERDGPassFlags ComputePassFlags = (GSupportsEfficientAsyncCompute && CVarTSRAsyncCompute.GetValueOnRenderThread() != 0) ? ERDGPassFlags::AsyncCompute : ERDGPassFlags::Compute;
TShaderMapRef<FTSRClearPrevTexturesCS> ComputeShader(View.ShaderMap);
FComputeShaderUtils::AddPass(
GraphBuilder,
RDG_EVENT_NAME("TSR ClearPrevTextures %dx%d", InputRect.Width(), InputRect.Height()),
ComputePassFlags,
ComputeShader,
PassParameters,
FComputeShaderUtils::GetGroupCount(InputRect.Size(), 8 * 2));
```
2.在Render层调整Pass顺序为RDG提供更多Async Compute Overlap的可能性
# ValidateShaderParameters
ValidateShaderParameters()可以检测RDG绑定的资源是否都存在。
# -rdgdebug
`r.RDG.Debug = 1`来开启。
# RDG Insight
开启RDG Insight Plugin之后即可在UnrealInsight看到额外添加RDG Channel。
命令行启动游戏:
`Game.exe -trace=rdg,defaults`
# DumpGPU
使用DumpGPU指令可以将当前帧的所有Pass和资源信息打印可以很方便的进行查看。
在Console中输入DumpGPU指令会弹出生成好的html文件
![](https://pica.zhimg.com/v2-675aa8a985ccd280ef78e7578d509f16_1440w.jpg)
执行OpenGPUDumpViewer.bat打开网页默认只支持chrome浏览器可以通过修改脚本调用别的浏览器
![](https://pic1.zhimg.com/v2-2fb3021428caca29b8c41b2cb01a0f26_1440w.jpg)
可以看到各个Pass的信息
![](https://pic1.zhimg.com/v2-3732fc0379732e15eaf15d341b08586c_1440w.jpg)
显示当前帧所有CVar的值
![](https://pica.zhimg.com/v2-79ba2f962e6167dfec0f88f08ac3c2aa_1440w.jpg)
比较像素的值:
![](https://picx.zhimg.com/v2-16e264f19d4c0d98b3942fb485115ecf_1440w.jpg)

BIN
08-Assets/Images/ImageBag/Rendering/RDG/RDG_Immediate.png (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
08-Assets/Images/ImageBag/Rendering/RDG/RDG_Vis.jpg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
08-Assets/Images/ImageBag/Rendering/RDG/RDG_Vis_RTName.jpg (Stored with Git LFS) Normal file

Binary file not shown.