Topaz 5.0
Topaz Game Engine
|
Documentation for render/compute passes - each a single node within Graphs.
Typedefs | |
using | tz::gpu::pass_handle = tz::handle<pass_info> |
Corresponds to a previously-created pass. | |
Classes | |
struct | tz::gpu::pass_graphics_state |
Specifies creation flags for a new graphics pass. More... | |
struct | tz::gpu::pass_compute_state |
Specifies creation flags for a new compute pass. More... | |
struct | tz::gpu::pass_info |
Specifies creation flags for a new pass. More... | |
std::expected< pass_handle, tz::error_code > tz::gpu::create_pass | ( | pass_info | ) |
Create a new pass.
Once you successfully create a pass, you can add it to a TODO: write docs on timelines
Once you're done with a pass, you can manually destroy it using destroy_pass.
void tz::gpu::pass_set_triangle_count | ( | pass_handle | graphics_pass, |
std::size_t | triangle_count ) |
Set the triangle count of an existing graphics pass.
graphics_pass | Graphics pass to target. If you provide a compute pass, nothing interesting happens. |
triangle_count | New number of triangles to render every frame. |
When you created a graphics pass, you set an initial triangle count via pass_graphics_state::triangle_count. This function will override that count, meaning the next time a pass submits GPU work, the new number of triangles will be rendered.
There are no GPU-sync considerations involved when calling this function.
void tz::gpu::pass_set_kernel | ( | pass_handle | compute_pass, |
tz::v3u | kernel ) |
Set the compute kernel of an existing compute pass.
compute_pass | Compute pass to target. If you provide a graphics pass, nothing interesting happens. |
kernel | New workgroup dimensions to be dispatched every frame. |
When you created a compute pass, you set an initial kernel size via pass_compute_state::kernel. This function will override those dimensions, meaning the next time a pass submits GPU work, the new workgroup dimensions will be dispatched.
There are no GPU-sync considerations involved when calling this function.
void tz::gpu::pass_set_scissor | ( | pass_handle | graphics_pass, |
tz::v4u | scissor ) |
Set the scissor rectangle of an existing graphics pass.
graphics_pass | Graphics pass to target. If you provide a graphics pass, nothing interesting happens. |
scissor | Scissor rectangle, see pass_graphics_state::scissor for further details. |
When you created a graphics pass, you may or may not have explicitly set an initial scissor rectangle via pass_graphics_state::scissor. This function will override those dimensions, meaning the next time a pass submits GPU work, the new scissor rectangle will be used.
There are no GPU-sync considerations involved when calling this function.
tz::error_code tz::gpu::pass_add_image_resource | ( | pass_handle | pass, |
resource_handle | res ) |
Add a new image resource to be used in the pass.
This will permanently increase the number of resources used in the pass. It is not possible to change the shader used by a pass, so the shader associated with the pass is expected to conditionally use the new image id anyway.
All other resources used by the pass are unchanged. The index of this new image to be used in the shader will be equal to the previous number of images.
void tz::gpu::destroy_pass | ( | pass_handle | ) |
Manually destroy a pass.
Passes can be quite heavy in the context of both CPU and GPU memory. This is due to internal components such as recorded command buffers, synchronisation primitives and compiled shader code.
Because of this, it might sometimes be necessary to manually destroy a pass once you are certain you have no further use of it. This will free up a bunch of CPU/GPU memory.
using tz::gpu::pass_handle = tz::handle<pass_info> |
Corresponds to a previously-created pass.
|
strong |
Specifies optional behaviours for a graphics pass.
Enumerator | |
---|---|
dont_clear | Do not clear the colour target images prior to rendering - whatever data they held previously will be loaded prior to rendering. |
no_depth_test | Disable depth testing - i.e fragments that are behind another may still draw over it. |
no_depth_write | Disable depth writes - i.e when a depth test is passed by a fragment, the old depth value is not overwritten, but stays as it was before.
|
|
strong |
|
constexpr |
Meta-pass that acts as an action to present the system image to the screen.