GpuRenderPass¶
Import: import system.gpu;
This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation. Shader-only declarations can be used only inside @compute, @vertex, @fragment, inferred helpers and ray tracing shader functions; using them elsewhere is a compile error.
GpuRenderPass¶
A render pass being recorded: draws into the targets given to GpuCommandEncoder.begin_render_pass, or into a window frame through GpuFrame.pass. Set a pipeline, bind resources and buffers, then draw. Settings stay in effect for later draws in the same pass. Recording mistakes are reported by GpuDevice.submit, or by GpuFrame.present for frame passes.
set_pipeline¶
Uses pipeline for the following draws.
set_vertex_buffer¶
Reads vertices for vertex buffer layout slot of the pipeline from buffer.
set_index_buffer¶
Reads 32-bit indexes for draw_indexed from buffer.
set_index_buffer¶
Reads 16-bit indexes for draw_indexed from buffer.
set_viewport¶
Maps clip space onto the rectangle at x, y of width by height pixels, with (0, 0) at the top-left of the target. Defaults to the whole target.
set_scissor¶
Discards pixels outside the rectangle at x, y of width by height pixels. Defaults to the whole target.
bind¶
Binds texture to the shader parameter slot.
bind¶
Binds sampler to the shader parameter slot.
bind¶
Binds scene for inline ray queries in a native render shader. The device must support GpuFeature.RayQuery; WebGPU does not support acceleration structures.
bind_buffer¶
Binds buffer to the GpuBuffer shader parameter slot.
bind_value¶
Sets the scalar, vector, matrix or struct shader parameter slot to value.
draw¶
Draws vertex_count vertices, instance_count times. The vertex shader sees vertex_id() from 0 and instance_id() from 0.
draw_indexed¶
Draws index_count vertices chosen by the index buffer, instance_count times.
end¶
Ends the pass. Ending it twice does nothing.