-
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] Sampler states across all argument buffers are unbounded
https://bugs.webkit.org/show_bug.cgi?id=275294 <radar://129227428> Reviewed by Dan Glastonbury. The max number of unique samplers allowed per process is -[MTLDevice maxArgumentBufferSamplerCount] which is currently 96 on most iOS devices and 1024 on many macOS devices. We need to ensure if we create more than the limit, we dealloc one so only samplers up to the limit are created. This doesn't interfer with WebGL as it only applies to samplers created with supportArgumentBuffers = YES. We can not easily set this flag to NO without avoiding ICBs which would come with substantial performance cost. * LayoutTests/fast/webgpu/nocrash/fuzz-275294-expected.txt: Added. * LayoutTests/fast/webgpu/nocrash/fuzz-275294.html: Added. Add regression test. * Source/WebCore/Modules/WebGPU/Implementation/WebGPUDeviceImpl.cpp: (WebCore::WebGPU::DeviceImpl::createSampler): * Source/WebGPU/WebGPU.xcodeproj/project.pbxproj: * Source/WebGPU/WebGPU/BindGroup.h: (WebGPU::BindGroup::create): * Source/WebGPU/WebGPU/BindGroup.mm: (WebGPU::Device::createBindGroup): (WebGPU::BindGroup::BindGroup): (WebGPU::BindGroup::rebindSamplersIfNeeded const): * Source/WebGPU/WebGPU/BindGroupLayout.h: * Source/WebGPU/WebGPU/ComputePassEncoder.mm: (WebGPU::ComputePassEncoder::executePreDispatchCommands): * Source/WebGPU/WebGPU/RenderPassEncoder.mm: (WebGPU::RenderPassEncoder::executePreDrawCommands): * Source/WebGPU/WebGPU/Sampler.h: (WebGPU::Sampler::create): (WebGPU::Sampler::isValid const): Deleted. (WebGPU::Sampler::samplerState const): Deleted. * Source/WebGPU/WebGPU/Sampler.mm: (-[SamplerIdentifier initWithFirst:second:]): (-[SamplerIdentifier copyWithZone:]): (WebGPU::miscHash): (WebGPU::floatToUint64): (WebGPU::computeDescriptorHash): (WebGPU::createMetalDescriptorFromDescriptor): (WebGPU::Device::createSampler): (WebGPU::Sampler::Sampler): (WebGPU::Sampler::setLabel): (WebGPU::Sampler::isValid const): (WebGPU::Sampler::samplerState const): (WebGPU::Sampler::cachedSampler const): * Source/WebGPU/WebGPU/ShaderStage.h: Added. * Source/WebGPU/WebGPU/WebGPU.h: Canonical link: https://commits.webkit.org/279893@main
- Loading branch information
1 parent
a2ce771
commit 52423d2
Showing
13 changed files
with
4,391 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,10 @@ | ||
layer at (0,0) size 800x600 | ||
RenderView at (0,0) size 800x600 | ||
layer at (0,0) size 800x600 | ||
RenderBlock {HTML} at (0,0) size 800x600 [color=#99DDBBCC] [bgcolor=#102030E0] | ||
RenderBody {BODY} at (8,8) size 784x584 | ||
RenderImage {IMG} at (0,414) size 21x128 | ||
layer at (29,8) size 748x542 | ||
RenderHTMLCanvas {CANVAS} at (21,0) size 748x542 | ||
layer at (8,550) size 16x16 | ||
RenderVideo {VIDEO} at (0,542) size 16x16 |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.