-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebGPU] Clamp depth values to the viewport range
https://bugs.webkit.org/show_bug.cgi?id=264449 <radar://118144869> Reviewed by Tadeu Zagallo. Reland PR with regression addressed. Add passing expectations for api,operation,rendering,depth_clip_clamp and add depth clamping when the viewport is not the default [0, 1] range. * LayoutTests/http/tests/webgpu/webgpu/api/operation/rendering/depth_clip_clamp-expected.txt: * Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp: (WGSL::Metal::FunctionDefinitionWriter::visit): * Source/WebGPU/WebGPU/CommandEncoder.h: * Source/WebGPU/WebGPU/CommandEncoder.mm: (WebGPU::CommandEncoder::runDepthClampEncoder): (WebGPU::CommandEncoder::beginRenderPass): * Source/WebGPU/WebGPU/RenderPassEncoder.h: * Source/WebGPU/WebGPU/RenderPassEncoder.mm: (WebGPU::RenderPassEncoder::RenderPassEncoder): (WebGPU::RenderPassEncoder::quantizedDepthValue): (WebGPU::RenderPassEncoder::setPipeline): (WebGPU::RenderPassEncoder::setViewport): * Source/WebGPU/WGSL/GlobalVariableRewriter.cpp: (WGSL::RewriteGlobalVariables::insertParameter): (WGSL::RewriteGlobalVariables::visitEntryPoint): (WGSL::RewriteGlobalVariables::insertDynamicOffsetsBufferIfNeeded): (WGSL::RewriteGlobalVariables::insertParameters): The staging buffer needs to be emitted whenever frag depth is possibly used. There is no harm in always emitting it as we always call setFragmentBytes on the last buffer index. Canonical link: https://commits.webkit.org/274856@main
- Loading branch information
1 parent
c75cf46
commit 57f26e7
Showing
8 changed files
with
240 additions
and
52 deletions.
There are no files selected for viewing
83 changes: 82 additions & 1 deletion
83
LayoutTests/http/tests/webgpu/webgpu/api/operation/rendering/depth_clip_clamp-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,82 @@ | ||
(Populate me when we're ready to investigate this test) | ||
|
||
PASS :depth_clamp_and_clip:format="depth16unorm";unclippedDepth="_undef_";writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth16unorm";unclippedDepth="_undef_";writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth16unorm";unclippedDepth="_undef_";writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth16unorm";unclippedDepth="_undef_";writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth16unorm";unclippedDepth=false;writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth16unorm";unclippedDepth=false;writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth16unorm";unclippedDepth=false;writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth16unorm";unclippedDepth=false;writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth16unorm";unclippedDepth=true;writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth16unorm";unclippedDepth=true;writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth16unorm";unclippedDepth=true;writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth16unorm";unclippedDepth=true;writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth32float";unclippedDepth="_undef_";writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth32float";unclippedDepth="_undef_";writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth32float";unclippedDepth="_undef_";writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth32float";unclippedDepth="_undef_";writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth32float";unclippedDepth=false;writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth32float";unclippedDepth=false;writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth32float";unclippedDepth=false;writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth32float";unclippedDepth=false;writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth32float";unclippedDepth=true;writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth32float";unclippedDepth=true;writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth32float";unclippedDepth=true;writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth32float";unclippedDepth=true;writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth24plus";unclippedDepth="_undef_";writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth24plus";unclippedDepth="_undef_";writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth24plus";unclippedDepth="_undef_";writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth24plus";unclippedDepth="_undef_";writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth24plus";unclippedDepth=false;writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth24plus";unclippedDepth=false;writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth24plus";unclippedDepth=false;writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth24plus";unclippedDepth=false;writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth24plus";unclippedDepth=true;writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth24plus";unclippedDepth=true;writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth24plus";unclippedDepth=true;writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth24plus";unclippedDepth=true;writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth24plus-stencil8";unclippedDepth="_undef_";writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth24plus-stencil8";unclippedDepth="_undef_";writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth24plus-stencil8";unclippedDepth="_undef_";writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth24plus-stencil8";unclippedDepth="_undef_";writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth24plus-stencil8";unclippedDepth=false;writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth24plus-stencil8";unclippedDepth=false;writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth24plus-stencil8";unclippedDepth=false;writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth24plus-stencil8";unclippedDepth=false;writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth24plus-stencil8";unclippedDepth=true;writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth24plus-stencil8";unclippedDepth=true;writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth24plus-stencil8";unclippedDepth=true;writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth24plus-stencil8";unclippedDepth=true;writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth32float-stencil8";unclippedDepth="_undef_";writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth32float-stencil8";unclippedDepth="_undef_";writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth32float-stencil8";unclippedDepth="_undef_";writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth32float-stencil8";unclippedDepth="_undef_";writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth32float-stencil8";unclippedDepth=false;writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth32float-stencil8";unclippedDepth=false;writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth32float-stencil8";unclippedDepth=false;writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth32float-stencil8";unclippedDepth=false;writeDepth=true;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth32float-stencil8";unclippedDepth=true;writeDepth=false;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth32float-stencil8";unclippedDepth=true;writeDepth=false;multisampled=true | ||
PASS :depth_clamp_and_clip:format="depth32float-stencil8";unclippedDepth=true;writeDepth=true;multisampled=false | ||
PASS :depth_clamp_and_clip:format="depth32float-stencil8";unclippedDepth=true;writeDepth=true;multisampled=true | ||
PASS :depth_test_input_clamped:format="depth16unorm";unclippedDepth=false;multisampled=false | ||
PASS :depth_test_input_clamped:format="depth16unorm";unclippedDepth=false;multisampled=true | ||
PASS :depth_test_input_clamped:format="depth16unorm";unclippedDepth=true;multisampled=false | ||
PASS :depth_test_input_clamped:format="depth16unorm";unclippedDepth=true;multisampled=true | ||
PASS :depth_test_input_clamped:format="depth32float";unclippedDepth=false;multisampled=false | ||
PASS :depth_test_input_clamped:format="depth32float";unclippedDepth=false;multisampled=true | ||
PASS :depth_test_input_clamped:format="depth32float";unclippedDepth=true;multisampled=false | ||
PASS :depth_test_input_clamped:format="depth32float";unclippedDepth=true;multisampled=true | ||
PASS :depth_test_input_clamped:format="depth24plus";unclippedDepth=false;multisampled=false | ||
PASS :depth_test_input_clamped:format="depth24plus";unclippedDepth=false;multisampled=true | ||
PASS :depth_test_input_clamped:format="depth24plus";unclippedDepth=true;multisampled=false | ||
PASS :depth_test_input_clamped:format="depth24plus";unclippedDepth=true;multisampled=true | ||
PASS :depth_test_input_clamped:format="depth24plus-stencil8";unclippedDepth=false;multisampled=false | ||
PASS :depth_test_input_clamped:format="depth24plus-stencil8";unclippedDepth=false;multisampled=true | ||
PASS :depth_test_input_clamped:format="depth24plus-stencil8";unclippedDepth=true;multisampled=false | ||
PASS :depth_test_input_clamped:format="depth24plus-stencil8";unclippedDepth=true;multisampled=true | ||
PASS :depth_test_input_clamped:format="depth32float-stencil8";unclippedDepth=false;multisampled=false | ||
PASS :depth_test_input_clamped:format="depth32float-stencil8";unclippedDepth=false;multisampled=true | ||
PASS :depth_test_input_clamped:format="depth32float-stencil8";unclippedDepth=true;multisampled=false | ||
PASS :depth_test_input_clamped:format="depth32float-stencil8";unclippedDepth=true;multisampled=true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.