MCPcopy Create free account
hub / github.com/apache/tvm / clear

Method clear

web/src/webgpu.ts:318–342  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

316 }
317
318 clear() {
319 const commandEncoder = this.device.createCommandEncoder();
320 const passEncoder = commandEncoder.beginRenderPass({
321 colorAttachments: [
322 {
323 view: this.canvasContext.getCurrentTexture().createView(),
324 clearValue: { r: 0.0, g: 0.0, b: 0.0, a: 1.0 },
325 loadOp: "clear",
326 storeOp: "store",
327 },
328 ],
329 });
330 passEncoder.setPipeline(this.clearPipeline);
331 const renderBindingGroup = this.device.createBindGroup({
332 layout: this.renderPipeline.getBindGroupLayout(0),
333 entries: [
334 { binding: 0, resource: this.renderSampler },
335 { binding: 1, resource: this.stagingTexture.createView() },
336 ],
337 });
338 passEncoder.setBindGroup(0, renderBindingGroup);
339 passEncoder.draw(6, 1, 0, 0);
340 passEncoder.end();
341 this.device.queue.submit([commandEncoder.finish()]);
342 }
343
344 draw(buffer: GPUBuffer, height: number, width: number) {
345 // resize the staging texture

Callers 4

_visitFunction · 0.45
verify_structureFunction · 0.45
clearCanvasMethod · 0.45
invalidateMethod · 0.45

Calls 4

drawMethod · 0.80
endMethod · 0.80
submitMethod · 0.80
finishMethod · 0.80

Tested by 2

_visitFunction · 0.36
verify_structureFunction · 0.36