You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove the `any` keyword from the frag_depth proposal. `frag_depth(any)`
is just another way to write `frag_depth`. The latter is shorter and we
have not been adding the 'default' value entries in for other optional
values in the spec.
Closes#6233
Copy file name to clipboardExpand all lines: proposals/fragment-depth.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Fragment depth (less, greater, any)
1
+
# Fragment depth (less, greater)
2
2
3
3
* Status: [Draft](README.md#status-draft)
4
4
* Created: 2025-10-08
@@ -10,9 +10,8 @@ The ability for fragment shaders to explicitly write to the depth buffer via the
10
10
11
11
In the current WGSL specification, the mere act of writing to `@builtin(frag_depth)` often incurs a significant performance penalty because driver heuristics cannot guarantee that the fragment shader output will adhere to the depth written by the rasterizer's interpolated depth. Consequently, writing to `frag_depth` typically forces the GPU to disable crucial early-Z optimizations for the entire draw call.
12
12
13
-
The introduction of a new `depth_mode` built-in parameter for the `@builtin(frag_depth)` with modes `less`, `greater`, and `any` directly addresses this performance limitation by letting the developer express their intent to the hardware.
13
+
The introduction of a new `depth_mode` built-in parameter for the `@builtin(frag_depth)` with modes `less`, and `greater` directly addresses this performance limitation by letting the developer express their intent to the hardware.
14
14
15
-
* The `any` mode maintains the existing, unconditional behavior of `frag_depth`.
16
15
* The `less` and `greater` modes are used when a fragment shader declares it will only write depth values that are guaranteed to be less than (or greater than) the existing depth. The driver can be assured that any fragment whose interpolated depth already fails the declared comparison cannot possibly satisfy the conditional write, allowing it to be rejected early.
0 commit comments