MCPcopy Create free account
hub / github.com/ChartGPU/ChartGPU / render

Function render

src/renderers/createScatterRenderer.ts:342–360  ·  view source on GitHub ↗
(passEncoder)

Source from the content-addressed store, hash-verified

340 };
341
342 const render: ScatterRenderer['render'] = (passEncoder) => {
343 assertNotDisposed();
344 if (!instanceBuffer || instanceCount === 0) return;
345
346 // Clip to plot area when available.
347 if (lastScissor && lastCanvasWidth > 0 && lastCanvasHeight > 0) {
348 passEncoder.setScissorRect(lastScissor.x, lastScissor.y, lastScissor.w, lastScissor.h);
349 }
350
351 passEncoder.setPipeline(pipeline);
352 passEncoder.setBindGroup(0, bindGroup);
353 passEncoder.setVertexBuffer(0, instanceBuffer);
354 passEncoder.draw(6, instanceCount);
355
356 // Reset scissor to full canvas to avoid impacting later renderers.
357 if (lastScissor && lastCanvasWidth > 0 && lastCanvasHeight > 0) {
358 passEncoder.setScissorRect(0, 0, lastCanvasWidth, lastCanvasHeight);
359 }
360 };
361
362 const dispose: ScatterRenderer['dispose'] = () => {
363 if (disposed) return;

Callers

nothing calls this directly

Calls 1

assertNotDisposedFunction · 0.70

Tested by

no test coverage detected