UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

21 lines (20 loc) 634 B
import { DebugGraphics } from "../../platform/graphics/debug-graphics.js"; import { RenderPass } from "../../platform/graphics/render-pass.js"; class RenderPassQuad extends RenderPass { constructor(device, quad, rect, scissorRect) { super(device); this.quad = quad; this.rect = rect; this.scissorRect = scissorRect; } execute() { const { device } = this; DebugGraphics.pushGpuMarker(device, `${this.name}:${this.quad.shader.name}`); device.setDrawStates(device.blendState); this.quad.render(this.rect, this.scissorRect); DebugGraphics.popGpuMarker(device); } } export { RenderPassQuad };