Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 52423d2f86de61263fce9fca956a1258dee23cf4
https://github.com/WebKit/WebKit/commit/52423d2f86de61263fce9fca956a1258dee23cf4
Author: Mike Wyrzykowski <[email protected]>
Date: 2024-06-10 (Mon, 10 Jun 2024)
Changed paths:
A LayoutTests/fast/webgpu/nocrash/fuzz-275294-expected.txt
A LayoutTests/fast/webgpu/nocrash/fuzz-275294.html
M Source/WebCore/Modules/WebGPU/Implementation/WebGPUDeviceImpl.cpp
M Source/WebGPU/WebGPU.xcodeproj/project.pbxproj
M Source/WebGPU/WebGPU/BindGroup.h
M Source/WebGPU/WebGPU/BindGroup.mm
M Source/WebGPU/WebGPU/BindGroupLayout.h
M Source/WebGPU/WebGPU/ComputePassEncoder.mm
M Source/WebGPU/WebGPU/RenderPassEncoder.mm
M Source/WebGPU/WebGPU/Sampler.h
M Source/WebGPU/WebGPU/Sampler.mm
A Source/WebGPU/WebGPU/ShaderStage.h
M Source/WebGPU/WebGPU/WebGPU.h
Log Message:
-----------
[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
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes