Skip to content

Commit c2b2d77

Browse files
authored
depthClearValue is undefined iff NaN (#467)
1 parent 2e778e4 commit c2b2d77

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

webgpu.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2455,6 +2455,12 @@ typedef struct WGPURenderPassDepthStencilAttachment {
24552455
*/
24562456
WGPUStoreOp depthStoreOp;
24572457
/**
2458+
* If NaN, indicates an `undefined` value (as defined by the JS spec).
2459+
* Use @ref WGPU_DEPTH_CLEAR_VALUE_UNDEFINED to indicate this semantically.
2460+
*
2461+
* NaN is determined by `isnan(depthClearValue) != 0`.
2462+
* (Do not use an equality check, because `NaN == NaN` is false.)
2463+
*
24582464
* The `INIT` macro sets this to @ref WGPU_DEPTH_CLEAR_VALUE_UNDEFINED.
24592465
*/
24602466
float depthClearValue;

webgpu.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2454,7 +2454,11 @@ structs:
24542454
default: undefined
24552455
- name: depth_clear_value
24562456
doc: |
2457-
TODO
2457+
If NaN, indicates an `undefined` value (as defined by the JS spec).
2458+
Use @ref WGPU_DEPTH_CLEAR_VALUE_UNDEFINED to indicate this semantically.
2459+
2460+
NaN is determined by `isnan(depthClearValue) != 0`.
2461+
(Do not use an equality check, because `NaN == NaN` is false.)
24582462
type: float32
24592463
default: constant.depth_clear_value_undefined
24602464
- name: depth_read_only

0 commit comments

Comments
 (0)