vault backup: 2025-06-14 17:20:30
This commit is contained in:
parent
ce8fae60a8
commit
d4967d811b
@ -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}}}}
|
154
03-UnrealEngine/Rendering/Debug/RDG Debug笔记.md
Normal file
154
03-UnrealEngine/Rendering/Debug/RDG Debug笔记.md
Normal 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文件:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
执行OpenGPUDumpViewer.bat打开网页,默认只支持chrome浏览器,可以通过修改脚本调用别的浏览器:
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
可以看到各个Pass的信息:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
显示当前帧所有CVar的值:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
比较像素的值:
|
||||||
|
|
||||||
|

|
BIN
08-Assets/Images/ImageBag/Rendering/RDG/RDG_Immediate.png
(Stored with Git LFS)
Normal file
BIN
08-Assets/Images/ImageBag/Rendering/RDG/RDG_Immediate.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
08-Assets/Images/ImageBag/Rendering/RDG/RDG_ValidateShaderParameters.png
(Stored with Git LFS)
Normal file
BIN
08-Assets/Images/ImageBag/Rendering/RDG/RDG_ValidateShaderParameters.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
08-Assets/Images/ImageBag/Rendering/RDG/RDG_Vis.jpg
(Stored with Git LFS)
Normal file
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
BIN
08-Assets/Images/ImageBag/Rendering/RDG/RDG_Vis_RTName.jpg
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user