[webkit-changes] [WebKit/WebKit] e1551b: [WGSL] texture_external as a global generates inco...

Tadeu Zagallo noreply at github.com
Mon Oct 30 22:38:16 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e1551b11d288edb551694c530411a026b42c7747
      https://github.com/WebKit/WebKit/commit/e1551b11d288edb551694c530411a026b42c7747
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-10-30 (Mon, 30 Oct 2023)

  Changed paths:
    M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp
    M Source/WebGPU/WGSL/WGSL.h
    A Source/WebGPU/WGSL/tests/valid/texture-external.wgsl
    M Source/WebGPU/WebGPU/BindGroup.mm
    M Source/WebGPU/WebGPU/BindGroupLayout.mm
    M Source/WebGPU/WebGPU/Device.h
    M Source/WebGPU/WebGPU/RenderPipeline.mm

  Log Message:
  -----------
  [WGSL] texture_external as a global generates incorrect indices
https://bugs.webkit.org/show_bug.cgi?id=263564
rdar://117379167

Reviewed by Mike Wyrzykowski.

The generated auto layout shouldn't use the user-provided @binding values directly,
but instead generate new binding IDs. This solves the problem for texture_external
as well as generates contiguous IDs. The code can be simplified further, but for
now it exposes extra information for the API about the offsets of the bufferSize
special entries, while keeping the current behavior working. Once we update the API
we can simplify the code without breaking anything.

* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::determineUsedGlobals):
(WGSL::RewriteGlobalVariables::insertStructs):
* Source/WebGPU/WGSL/tests/valid/texture-external.wgsl: Added.

(WGSL::RewriteGlobalVariables::insertStructs):
* Source/WebGPU/WGSL/WGSL.h:
* Source/WebGPU/WebGPU/BindGroup.mm:
(WebGPU::Device::createBindGroup):
* Source/WebGPU/WebGPU/BindGroupLayout.mm:
(WebGPU::Device::createBindGroupLayout):
* Source/WebGPU/WebGPU/Device.h:
* Source/WebGPU/WebGPU/RenderPipeline.mm:
(WebGPU::Device::addPipelineLayouts):
(WebGPU::Device::generatePipelineLayout):
Update BindGroupLayout generation to match the compiler change.

Canonical link: https://commits.webkit.org/269996@main




More information about the webkit-changes mailing list