[WebGPU] BindGroupLayout and Device::createBindGroupLayout
<rdar://problem/46816659>
Created attachment 357597 [details] Patch
Comment on attachment 357597 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=357597&action=review > Source/WebCore/Modules/webgpu/WebGPUBindGroupLayout.cpp:41 > + UNUSED_PARAM(layout); Remove this. You use the parameter. > Source/WebCore/Modules/webgpu/WebGPUDevice.cpp:71 > + return layout ? static_cast<RefPtr<WebGPUBindGroupLayout>>(WebGPUBindGroupLayout::create(layout.releaseNonNull())) : nullptr; Why do you have to cast? I think the compiler will handle this. > Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.cpp:35 > + return adoptRef(new GPUBindGroupLayout(WTFMove(descriptor))); So for now it will never fail to return a layout? But it will in the future, hence the try name?
(In reply to Dean Jackson from comment #3) > Comment on attachment 357597 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=357597&action=review > > > Source/WebCore/Modules/webgpu/WebGPUDevice.cpp:71 > > + return layout ? static_cast<RefPtr<WebGPUBindGroupLayout>>(WebGPUBindGroupLayout::create(layout.releaseNonNull())) : nullptr; > > Why do you have to cast? I think the compiler will handle this. > > > Source/WebCore/platform/graphics/gpu/GPUBindGroupLayout.cpp:35 > > + return adoptRef(new GPUBindGroupLayout(WTFMove(descriptor))); > > So for now it will never fail to return a layout? But it will in the future, > hence the try name? Since there's no way to fail to create a layout right now, I've refactored the ::create s to return a Ref, obviating the need for a conditional null check.
Created attachment 357600 [details] Patch for landing
Comment on attachment 357600 [details] Patch for landing Clearing flags on attachment: 357600 Committed r239351: <https://trac.webkit.org/changeset/239351>
All reviewed patches have been landed. Closing bug.