[WebGPU] Replace Vectors with HashSets for tracking resources used by GPUCommandBuffer
Created attachment 375036 [details] Patch
Created attachment 375038 [details] Patch
Created attachment 375039 [details] Patch
Comment on attachment 375039 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375039&action=review > Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:-347 > - auto addResult = m_unnamedTypeMapping.add(&unnamedType, &*iterator); How did this ever compile? I thought unused variables produced errors > Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h:103 > + void useBuffer(Ref<GPUBuffer>&& buffer) { m_usedBuffers.addVoid(WTFMove(buffer)); } > + void useTexture(Ref<GPUTexture>&& texture) { m_usedTextures.addVoid(WTFMove(texture)); } I see a lot of production, but no consumption. Do the functions that we're using for consumption just happen to be named the same between Vectors and HashSets?
Comment on attachment 375039 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375039&action=review >> Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:-347 >> - auto addResult = m_unnamedTypeMapping.add(&unnamedType, &*iterator); > > How did this ever compile? I thought unused variables produced errors No idea. Maybe saam has some local flags turned off. EWS doesn't build WebGPU anymore right? >> Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h:103 >> + void useTexture(Ref<GPUTexture>&& texture) { m_usedTextures.addVoid(WTFMove(texture)); } > > I see a lot of production, but no consumption. Do the functions that we're using for consumption just happen to be named the same between Vectors and HashSets? Command buffers can't be reused in our impl, so I iterate through this container to process them rather than removing from them. They get released when the command buffer is released. Bind groups are immutable once created so no issues there.
Created attachment 375090 [details] Patch for landing
Comment on attachment 375090 [details] Patch for landing Clearing flags on attachment: 375090 Committed r247930: <https://trac.webkit.org/changeset/247930>
All reviewed patches have been landed. Closing bug.
<rdar://problem/53686819>