docs(rendering): sync infinite grid and depth style pass docs
This commit is contained in:
@@ -10,6 +10,14 @@
|
|||||||
|
|
||||||
## 概览
|
## 概览
|
||||||
|
|
||||||
|
## 2026-04-10 同步补充
|
||||||
|
|
||||||
|
以下内容以当前 `BuiltinDepthStylePassBase.h/.cpp` 为准:
|
||||||
|
|
||||||
|
- `PipelineStateKey` 现在显式包含 `sampleCount` 与 `sampleQuality`,因此 depth-style pipeline cache 不再只按 render state、shader、format 和 keyword 签名区分。
|
||||||
|
- 自动状态切换现在同时覆盖 color 与 depth:进入 pass 前会读取 `GetColorStateBefore()` / `GetDepthStateBefore()`,结束后恢复到 `GetColorStateAfter()` / `GetDepthStateAfter()`。
|
||||||
|
- depth-style surface 兼容性现在按 `IsDepthStyleCompatibleSurface(...)` 判断,要求的是“零或一个颜色附件 + 已知 depth format + 合法 sample 描述”,而不是早期那种更死板的固定表述。
|
||||||
|
|
||||||
`BuiltinDepthStylePassBase` 把两类 pass 的公共逻辑集中在一起:
|
`BuiltinDepthStylePassBase` 把两类 pass 的公共逻辑集中在一起:
|
||||||
|
|
||||||
- 按 `BuiltinMaterialPass` 解析可兼容的 shader pass。
|
- 按 `BuiltinMaterialPass` 解析可兼容的 shader pass。
|
||||||
|
|||||||
@@ -6,6 +6,14 @@
|
|||||||
bool Execute(const RenderPassContext& context) override;
|
bool Execute(const RenderPassContext& context) override;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 2026-04-10 更新
|
||||||
|
|
||||||
|
- 当 `surface.IsAutoTransitionEnabled()` 为 `true` 时,当前实现会同时切换 color 与 depth:
|
||||||
|
- 颜色附件从 `GetColorStateBefore()` 切到 `RenderTarget`
|
||||||
|
- depth 附件从 `GetDepthStateBefore()` 切到 `DepthWrite`
|
||||||
|
- 结束后分别恢复到各自的 `after` 状态
|
||||||
|
- `Execute(...)` 依赖 `IsDepthStyleCompatibleSurface(...)` 判断 surface 是否兼容;当前要求的是零或一个颜色附件、已知 depth format,以及合法的 sample 描述。
|
||||||
|
|
||||||
## 当前流程
|
## 当前流程
|
||||||
|
|
||||||
1. 校验 `renderContext`、第一个颜色附件、深度附件和 `surface.GetRenderArea()`
|
1. 校验 `renderContext`、第一个颜色附件、深度附件和 `surface.GetRenderArea()`
|
||||||
|
|||||||
@@ -10,6 +10,15 @@
|
|||||||
|
|
||||||
## 概述
|
## 概述
|
||||||
|
|
||||||
|
## 2026-04-10 同步补充
|
||||||
|
|
||||||
|
以下内容以当前 `BuiltinInfiniteGridPass.h/.cpp` 为准:
|
||||||
|
|
||||||
|
- 当前实现不再把“`backendType == D3D12`”写成硬编码前置条件;只要配置 shader 在当前 backend 上存在兼容 graphics variant,就可以创建并执行。
|
||||||
|
- `EnsureInitialized(...)` / `CreateResources(...)` 现在按 backend、目标颜色格式、深度格式和目标 `sampleCount` 重新建资源;surface 配置变化时会销毁旧的 pipeline / descriptor 再创建。
|
||||||
|
- grid 的 viewport / scissor、视锥宽高比与投影视口尺寸都按 `surface.GetRenderArea()` 计算,不再固定覆盖整张 surface。
|
||||||
|
- 当 `surface.IsAutoTransitionEnabled()` 为 `true` 时,pass 会把颜色附件从 `surface.GetColorStateAfter()` 切到 `RenderTarget`,并把 depth 附件从 `surface.GetDepthStateAfter()` 切到 `DepthWrite`,结束后再恢复。
|
||||||
|
|
||||||
`BuiltinInfiniteGridPass` 是当前 Scene View 里“地面参考网格”效果的实际执行者。
|
`BuiltinInfiniteGridPass` 是当前 Scene View 里“地面参考网格”效果的实际执行者。
|
||||||
|
|
||||||
它消费一份 [InfiniteGridPassData](InfiniteGridPassData.md),在运行时先推导
|
它消费一份 [InfiniteGridPassData](InfiniteGridPassData.md),在运行时先推导
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ bool Render(
|
|||||||
const InfiniteGridPassData& data);
|
const InfiniteGridPassData& data);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 2026-04-10 更新
|
||||||
|
|
||||||
|
- 当前路径不再把 `backendType == D3D12` 作为固定失败条件;真正是否能执行,取决于当前 backend 上是否能解析到兼容的 grid shader variant。
|
||||||
|
- `EnsureInitialized(...)` 现在显式接收 `surface`,并按 backend、render target format、depth format 与 `sampleCount` 重新建资源。
|
||||||
|
- viewport、scissor,以及用于构建 grid 投影的宽高比,都会读取 `surface.GetRenderArea()`。
|
||||||
|
- 当 `surface.IsAutoTransitionEnabled()` 为 `true` 时,会在进入 pass 前切换颜色 / depth 资源状态,并在结束后恢复到 `surface` 记录的 `after` 状态。
|
||||||
|
|
||||||
## 作用
|
## 作用
|
||||||
|
|
||||||
把当前无限网格效果绘制到 `surface` 的第一个颜色附件上。
|
把当前无限网格效果绘制到 `surface` 的第一个颜色附件上。
|
||||||
|
|||||||
Reference in New Issue
Block a user