GpuFrame¶
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.
GpuFrame¶
One frame of a window surface, from GpuSurface.begin_frame until present. Draw with draw for simple cases, or record into pass for vertex buffers, textures and other settings. For extra passes, such as post-processing, use encoder; every pass runs in the order recorded, and the first frame pass clears target to the color given to begin_frame. Nothing appears on screen until present.
target¶
The texture shown when the frame is presented. Valid until present.
pass¶
The render pass that draws into target, begun on first use. Draws recorded into it appear in order with everything else in the frame.
encoder¶
The encoder that records this frame's work, for passes of your own. The frame's pass is ended first, so your passes run after the draws recorded so far.
draw¶
Draws vertex_count vertices with pipeline into target, for shaders that need no vertex buffers or bound resources.
present¶
Submits everything recorded for the frame and shows target in the window.