[webkit-changes] [WebKit/WebKit] 6a8101: [WebGPU] WGPUBindGroupEntry::offset is not used wh...

mwyrzykowski noreply at github.com
Thu Jan 5 15:44:41 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6a81017aa27aca988157447ba83d5d545f48b169
      https://github.com/WebKit/WebKit/commit/6a81017aa27aca988157447ba83d5d545f48b169
  Author: Mike Wyrzykowski <mwyrzykowski at apple.com>
  Date:   2023-01-05 (Thu, 05 Jan 2023)

  Changed paths:
    M Source/WebGPU/WebGPU/BindGroup.mm
    M Source/WebGPU/WebGPU/BindGroupLayout.h
    M Source/WebGPU/WebGPU/BindGroupLayout.mm
    A Websites/webkit.org/demos/webgpu/scripts/two-cubes.js
    A Websites/webkit.org/demos/webgpu/two-cubes.html

  Log Message:
  -----------
  [WebGPU] WGPUBindGroupEntry::offset is not used while creating the bind group
https://bugs.webkit.org/show_bug.cgi?id=249834
<radar://103606837>

Reviewed by Myles C. Maxfield.

Use data offset member while creating the bind group.

This allows amongst other things sharing one buffer across
multiple bind groups where each bind group has a unique result.

Attached sample modeled after https://austin-eng.com/webgpu-samples/samples/twoCubes

* Source/WebGPU/WebGPU/BindGroup.mm:
(WebGPU::sizeOfEntries):
(WebGPU::Device::createBindGroup):
Correct aliasing of buffers where multiple bind groups share
the same bind group layout.

* Source/WebGPU/WebGPU/BindGroupLayout.h:
(WebGPU::BindGroupLayout::create):
(WebGPU::BindGroupLayout::isValid const):
(WebGPU::BindGroupLayout::vertexArgumentBuffer const): Deleted.
(WebGPU::BindGroupLayout::fragmentArgumentBuffer const): Deleted.
(WebGPU::BindGroupLayout::computeArgumentBuffer const): Deleted.
Bind group layout shouldn't contain MTLBuffer instances since one
bind group layout can be shared amongst multiple bind groups.

* Source/WebGPU/WebGPU/BindGroupLayout.mm:
(WebGPU::Device::createBindGroupLayout):
(WebGPU::BindGroupLayout::BindGroupLayout):
(WebGPU::BindGroupLayout::stagesForBinding const):
(WebGPU::BindGroupLayout::~BindGroupLayout): Deleted.
Can default this now that the union is removed.

(WebGPU::BindGroupLayout::stageForBinding const): Deleted.

* Websites/webkit.org/demos/webgpu/scripts/two-cubes.js: Added.
(async helloCube.frameUpdate):
(async helloCube):
* Websites/webkit.org/demos/webgpu/two-cubes.html: Added.
Sample creates two bind groups from the same buffer with different offsets.

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




More information about the webkit-changes mailing list