Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[WebGPU] Map WebGPUBindGroupLayoutBindings from the BindGroupLayoutDe…
…scriptor for error checking and later referencing https://bugs.webkit.org/show_bug.cgi?id=193405 Reviewed by Dean Jackson. Source/WebCore: When creating a WebGPUBindGroupLayout, cache the WebGPUBindGroupLayoutDescriptor's list of BindGroupLayoutBindings in a HashMap, keyed by binding number, for quick reference during the WebGPUProgrammablePassEncoder::setBindGroups implementation to follow. Also add error-checking e.g. detecting duplicate binding numbers in the same WebGPUBindGroupLayout and non-existent binding numbers when creating the WebGPUBindGroup. No new tests. BindGroups and BindGroupLayouts reflect the (canonical?) strategy of returning empty objects upon creation failure and reporting errors elswhere. Since error reporting is not yet implemented, the error checks aren't testable from LayoutTests right now. Expected behavior unchanged and covered by existing tests. * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createBindGroup const): Number of bindings must be consistent between bindings and layout bindings. BindGroupBindings should only refer to existing BindGroupLayoutBindings. * platform/graphics/gpu/GPUBindGroup.h: * platform/graphics/gpu/GPUBindGroupLayout.h: (WebCore::GPUBindGroupLayout::bindingsMap const): Added. Cache map of BindGroupLayoutBindings. * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Disallow duplicate binding numbers in BindGroupLayoutBindings. (WebCore::GPUBindGroupLayout::tryCreate): (WebCore::GPUBindGroupLayout::GPUBindGroupLayout): LayoutTests: Small fixes that do not alter behavior. * webgpu/bind-groups.html: * webgpu/pipeline-layouts.html: Canonical link: https://commits.webkit.org/207919@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Justin Fan
committed
Jan 14, 2019
1 parent
3fdde71
commit b951c7e
Showing
8 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
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
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