[webkit-changes] [WebKit/WebKit] 57f26e: [WebGPU] Clamp depth values to the viewport range

mwyrzykowski noreply at github.com
Fri Feb 16 11:03:56 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 57f26e7cc5c4f537b774d38c4c6e70dad94116b9
      https://github.com/WebKit/WebKit/commit/57f26e7cc5c4f537b774d38c4c6e70dad94116b9
  Author: Mike Wyrzykowski <mwyrzykowski at apple.com>
  Date:   2024-02-16 (Fri, 16 Feb 2024)

  Changed paths:
    M LayoutTests/http/tests/webgpu/webgpu/api/operation/rendering/depth_clip_clamp-expected.txt
    M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp
    M Source/WebGPU/WGSL/Metal/MetalFunctionWriter.cpp
    M Source/WebGPU/WebGPU/CommandEncoder.mm
    M Source/WebGPU/WebGPU/RenderPassEncoder.h
    M Source/WebGPU/WebGPU/RenderPassEncoder.mm
    M Source/WebGPU/WebGPU/ShaderModule.h
    M Source/WebGPU/WebGPU/ShaderModule.mm

  Log Message:
  -----------
  [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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list