Bug 264449
Summary: | [WebGPU] Clamp depth values to the viewport range | ||
---|---|---|---|
Product: | WebKit | Reporter: | Mike Wyrzykowski <mwyrzykowski> |
Component: | WebGPU | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Mike Wyrzykowski
[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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/118144869>
Mike Wyrzykowski
Pull request: https://github.com/WebKit/WebKit/pull/24039
EWS
Committed 274666@main (d8d655468dab): <https://commits.webkit.org/274666@main>
Reviewed commits have been landed. Closing PR #24039 and removing active labels.
Mike Wyrzykowski
Reverted by https://github.com/WebKit/WebKit/pull/24536
Mike Wyrzykowski
Pull request: https://github.com/WebKit/WebKit/pull/24536
EWS
Committed 274769@main (b9e6095447e8): <https://commits.webkit.org/274769@main>
Reviewed commits have been landed. Closing PR #24536 and removing active labels.
Mike Wyrzykowski
Re-opening for pull request https://github.com/WebKit/WebKit/pull/24558
EWS
Committed 274856@main (57f26e7cc5c4): <https://commits.webkit.org/274856@main>
Reviewed commits have been landed. Closing PR #24558 and removing active labels.