GPURenderPassEncoder

class wgpu.GPURenderPassEncoder

Bases: GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin, GPUObjectBase

Object to records commands for a render pass.

Create a render pass encoder using GPUCommandEncoder.begin_render_pass.

begin_occlusion_query(query_index: int)

Begins an occlusion query.

Parameters:

query_index (int) – The index in the GPUQuerySet at which to write the result of the occlusion query. The Query Set is specified as the occlusion_query_set argument in begin_render_pass().

end()

Record the end of the render pass.

end_occlusion_query()

Ends an occlusion query.

execute_bundles(bundles: List[GPURenderBundle])
Executes commands previously recorded into the render bundles

as part of this render pass.

Parameters:

bundles (Sequence[GPURenderBundle]) – A sequence of Render Bundle objects.

set_blend_constant(color: ~typing.List[float] |)

Set the blend color for the render pass.

Parameters:

color (tuple or dict) – A color with fields (r, g, b, a).

set_scissor_rect(x: int, y: int, width: int, height: int)

Set the scissor rectangle for this render pass. The scene is rendered as usual, but is only applied to this sub-rectangle.

Parameters:
  • x (int) – Horizontal coordinate.

  • y (int) – Vertical coordinate.

  • width (int) – Horizontal size.

  • height (int) – Vertical size.

set_stencil_reference(reference: int)

Set the reference stencil value for this render pass.

Parameters:

reference (int) – The reference value.

set_viewport(x: float, y: float, width: float, height: float, min_depth: float, max_depth: float)

Set the viewport for this render pass. The whole scene is rendered to this sub-rectangle.

Parameters:
  • x (int) – Horizontal coordinate.

  • y (int) – Vertical coordinate.

  • width (int) – Horizontal size.

  • height (int) – Vertical size.

  • min_depth (int) – Clipping in depth.

  • max_depth (int) – Clipping in depth.