GPURenderPassEncoder¶
- class wgpu.GPURenderPassEncoder¶
Bases:
GPUCommandsMixin,GPUDebugCommandsMixin,GPUBindingCommandsMixin,GPURenderCommandsMixin,GPUObjectBaseObject to records commands for a render pass.
Create a render pass encoder using GPUCommandEncoder.begin_render_pass.
- begin_occlusion_query(query_index)¶
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)¶
- 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)¶
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, y, width, height)¶
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)¶
Set the reference stencil value for this render pass.
- Parameters:
reference (int) – The reference value.
- set_viewport(x, y, width, height, min_depth, max_depth)¶
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.