Skip to content

Commit 1f91ff4

Browse files
committed
[update] specification.
1 parent 415167f commit 1f91ff4

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

docs/specs/depth-stencil-msaa.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: "Depth/Stencil and Multi-Sample Rendering"
33
document_id: "depth-stencil-msaa-2025-11-11"
44
status: "draft"
55
created: "2025-11-11T00:00:00Z"
6-
last_updated: "2025-11-21T21:27:43Z"
7-
version: "0.4.0"
6+
last_updated: "2025-11-21T22:00:00Z"
7+
version: "0.4.1"
88
engine_workspace_version: "2023.1.30"
99
wgpu_version: "26.0.1"
1010
shader_backend_default: "naga"
1111
winit_version: "0.29.10"
12-
repo_commit: "deb8aff8fe4caed5f6d1941962cefcf2a14b7890"
12+
repo_commit: "415167f4238c21debb385eef1192e2da7476c586"
1313
owners: ["lambda-sh"]
1414
reviewers: ["engine", "rendering"]
1515
tags: ["spec", "rendering", "depth", "stencil", "msaa"]
@@ -104,23 +104,27 @@ App Code
104104
```
105105
- Behavior
106106
- Defaults
107-
- If depth is not requested on the pass (`with_depth*`), the pass MUST NOT
107+
- If neither depth nor stencil is requested on the pass, the pass MUST NOT
108108
create a depth attachment and depth testing is disabled.
109-
- Depth clear defaults to `1.0` when depth is enabled on the pass and no
110-
explicit clear is provided.
109+
- When depth operations are enabled on the pass, the depth aspect defaults
110+
to a clear value of `1.0` when no explicit clear is provided.
111111
- Pipeline depth compare defaults to `CompareFunction::Less` when depth is
112112
enabled for a pipeline and no explicit compare is provided.
113113
- `MultiSample.sample_count` defaults to `1` (no multi-sampling).
114114
- Attachment creation
115115
- When depth is requested (`with_depth`/`with_depth_clear`), the pass MUST
116-
create a depth attachment. When stencil operations are requested on the
117-
pass (`with_stencil`/`with_stencil_clear`), the pass MUST attach a
116+
create a depth attachment.
117+
- When stencil operations are requested on the pass
118+
(`with_stencil`/`with_stencil_clear`), the pass MUST attach a
118119
depth/stencil view and the depth format MUST include a stencil aspect.
119120
- If stencil is requested but the current depth format lacks a stencil
120121
aspect, the engine upgrades to `Depth24PlusStencil8` at pass build time
121122
or during encoding and logs an error.
122-
- The pass MUST clear the depth aspect to `1.0` by default (or the provided
123-
value) and clear/load stencil according to the requested ops.
123+
- When depth operations are present, the depth aspect MUST be cleared or
124+
loaded according to the configured depth ops (defaulting to a clear of
125+
`1.0` when no explicit clear is provided). When only stencil operations
126+
are present, the stencil aspect MUST be cleared or loaded according to
127+
the configured stencil ops and the depth aspect MUST remain untouched.
124128
- Multi-sample semantics
125129
- When `sample_count > 1`, the pass MUST render into a multi-sampled color
126130
target and resolve to the single-sample swap chain target before present.
@@ -175,7 +179,9 @@ Always-on safeguards (release and debug)
175179
platform layer MUST query support before allocation.
176180
- Depth clear values MUST be clamped to [0.0, 1.0] during validation.
177181
- When the pass has no depth attachment, pipelines MUST behave as if depth
178-
testing and depth writes are disabled.
182+
testing and depth writes are disabled. Stencil-only passes still bind a
183+
depth/stencil attachment; in this case the stencil aspect is active and the
184+
depth aspect MUST remain unchanged when no depth operations are configured.
179185

180186
## Performance Considerations
181187

@@ -237,6 +243,9 @@ Always-on safeguards (release and debug)
237243
defaults (no depth, no multi-sampling) unless explicitly configured.
238244

239245
## Changelog
246+
- 2025-11-21 (v0.4.1) — Clarify depth attachment and clear behavior for
247+
stencil-only passes; align specification with engine behavior that preserves
248+
depth when only stencil operations are configured.
240249
- 2025-11-21 (v0.4.0) — Add device/format sample-count validation with fallback to 1; update metadata and checklist; record implementation references for depth/stencil/MSAA.
241250
- 2025-11-17 (v0.3.1) — Remove umbrella validation flags from this spec; list
242251
only feature flags related to MSAA, depth, and stencil; metadata updated.

0 commit comments

Comments
 (0)