Skip to content

Commit

Permalink
[WebGPU] Device::createRenderPipeline will crash (MTLReportFailure) i…
Browse files Browse the repository at this point in the history
…f fragmentDescriptor.targetCount > 8

https://bugs.webkit.org/show_bug.cgi?id=265851
<radar://119169360>

Reviewed by Dan Glastonbury.

Further validation will be added but this prevents a crash
while running the CTS when more than 8 color targets are used.

* Source/WebGPU/WebGPU/RenderPipeline.mm:
(WebGPU::Device::validateRenderPipeline):

Canonical link: https://commits.webkit.org/271540@main
  • Loading branch information
mwyrzykowski committed Dec 5, 2023
1 parent 53d6c36 commit 73cbb93
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/WebGPU/WebGPU/RenderPipeline.mm
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,12 @@ static MTLPrimitiveTopologyClass topologyType(WGPUPrimitiveTopology topology)
// FIXME: Implement this according to the description in
// https://gpuweb.github.io/gpuweb/#abstract-opdef-validating-gpurenderpipelinedescriptor

UNUSED_PARAM(descriptor);
if (descriptor.fragment) {
const auto& fragmentDescriptor = *descriptor.fragment;

if (fragmentDescriptor.targetCount > limits().maxColorAttachments)
return false;
}

return true;
}
Expand Down

0 comments on commit 73cbb93

Please sign in to comment.