MCPcopy Index your code
hub / github.com/processing/p5.js / _returnShaderBuffersToPool

Method _returnShaderBuffersToPool

src/webgpu/p5.RendererWebGPU.js:1686–1703  ·  view source on GitHub ↗
(shader)

Source from the content-addressed store, hash-verified

1684 }
1685
1686 _returnShaderBuffersToPool(shader) {
1687 if (shader._uniformBufferGroups) {
1688 for (const bufferGroup of shader._uniformBufferGroups) {
1689 while (bufferGroup.nextBufferPool.length > 0) {
1690 bufferGroup.bufferPool.push(bufferGroup.nextBufferPool.pop());
1691 }
1692 for (const bufferInfo of bufferGroup.buffersInUse.keys()) {
1693 if (bufferInfo !== bufferGroup.currentBuffer) {
1694 bufferGroup.nextBufferPool.push(bufferInfo);
1695 }
1696 }
1697 bufferGroup.buffersInUse.clear();
1698 if (bufferGroup.currentBuffer) {
1699 bufferGroup.buffersInUse.add(bufferGroup.currentBuffer);
1700 }
1701 }
1702 }
1703 }
1704
1705 flushDraw() {
1706 this._finishActiveRenderPass();

Callers 1

Calls 4

pushMethod · 0.45
popMethod · 0.45
clearMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected