RESOLVED FIXED 264449
[WebGPU] Clamp depth values to the viewport range
https://bugs.webkit.org/show_bug.cgi?id=264449
Summary [WebGPU] Clamp depth values to the viewport range
Mike Wyrzykowski
Reported 2023-11-08 16:13:03 PST
[WGSL] Emit code gen for clamping depth to the viewport This only impacts when frag_depth / ([[depth(any)]] ) is used in the shader. Something like this I think would work: struct FragOutput { ... float depthValue [[depth(any)]]; }; void fragmentShader(const constant unsigned* __DynamicOffsets [[buffer(4)]]) { FragOutput o; ... float minDepth = as_type<float>(__DynamicOffsets[maxDynamicOffsetIndex + 1]); float maxDepth = as_type<float>(__DynamicOffsets[maxDynamicOffsetIndex + 2]); o.depthValue = clamp(o.depthValue, minDepth, maxDepth); }
Attachments
Radar WebKit Bug Importer
Comment 1 2023-11-08 16:13:20 PST
Mike Wyrzykowski
Comment 2 2024-02-07 14:50:42 PST
EWS
Comment 3 2024-02-14 15:12:12 PST
Committed 274666@main (d8d655468dab): <https://commits.webkit.org/274666@main> Reviewed commits have been landed. Closing PR #24039 and removing active labels.
Mike Wyrzykowski
Comment 4 2024-02-15 13:07:03 PST
Mike Wyrzykowski
Comment 5 2024-02-15 13:07:04 PST
EWS
Comment 6 2024-02-15 14:54:32 PST
Committed 274769@main (b9e6095447e8): <https://commits.webkit.org/274769@main> Reviewed commits have been landed. Closing PR #24536 and removing active labels.
Mike Wyrzykowski
Comment 7 2024-02-15 15:46:35 PST
EWS
Comment 8 2024-02-16 11:03:49 PST
Committed 274856@main (57f26e7cc5c4): <https://commits.webkit.org/274856@main> Reviewed commits have been landed. Closing PR #24558 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.