![]() |
Topaz 5.0
Topaz Game Engine
|
Specifies creation flags for a new graphics pass.
See tz::gpu::pass_info for usage.
#include "pass.hpp"
Public Attributes | |
| tz::v4f | clear_colour = {0.0f, 0.0f, 0.0f, 1.0f} |
| When a colour target is cleared, what colour (RGBA normalised floats) should it be cleared to? | |
| tz::v4u | scissor = tz::v4u::filled(-1) |
Scissor rectangle, components represent {offsetx, offsety, extentx, extenty} in pixels. If all values are -1, the scissor offset will be {0, 0} and the extent equal to the dimensions of the colour_targets you have provided. | |
| std::span< const resource_handle > | colour_targets = {} |
| List of all colour targets. The n'th colour target specified here will be the n'th output of the fragment shader. If you want the window itself to be a colour target, pass tz::gpu::window_resource. You must provide at least one colour target, and all colour targets must have the same dimensions. | |
| resource_handle | depth_target = tz::nullhand |
| Optional depth target. This will act as the depth image when performing depth testing/writes. | |
| resource_handle | index_buffer = tz::nullhand |
| Buffer containing indices drawn in a single invocation of the pass. | |
| resource_handle | draw_buffer = tz::nullhand |
| Buffer containing an initial count and draw commands which may or may not be used in a single invocation of the pass. | |
| cull | culling = cull::back |
| Describe which faces will be culled during rendering. | |
| graphics_flag | flags = static_cast<graphics_flag>(0) |
| Specifies extra optional behaviour for the pass. | |
| std::size_t | triangle_count = 0 |
| Number of triangles to draw in a single invocation of the pass. | |
| tz::v4f tz::gpu::pass_graphics_state::clear_colour = {0.0f, 0.0f, 0.0f, 1.0f} |
When a colour target is cleared, what colour (RGBA normalised floats) should it be cleared to?
| tz::v4u tz::gpu::pass_graphics_state::scissor = tz::v4u::filled(-1) |
Scissor rectangle, components represent {offsetx, offsety, extentx, extenty} in pixels. If all values are -1, the scissor offset will be {0, 0} and the extent equal to the dimensions of the colour_targets you have provided.
| std::span<const resource_handle> tz::gpu::pass_graphics_state::colour_targets = {} |
List of all colour targets. The n'th colour target specified here will be the n'th output of the fragment shader. If you want the window itself to be a colour target, pass tz::gpu::window_resource. You must provide at least one colour target, and all colour targets must have the same dimensions.
| resource_handle tz::gpu::pass_graphics_state::depth_target = tz::nullhand |
Optional depth target. This will act as the depth image when performing depth testing/writes.
| resource_handle tz::gpu::pass_graphics_state::index_buffer = tz::nullhand |
Buffer containing indices drawn in a single invocation of the pass.
The memory contents of the index buffer are expected to be:
{indices...}
Where a single index is equal to a index_t.
| resource_handle tz::gpu::pass_graphics_state::draw_buffer = tz::nullhand |
Buffer containing an initial count and draw commands which may or may not be used in a single invocation of the pass.
The memory contents of the draw buffer are expected to be:
{drawcount, draws...}
Where drawcount is a unsigned 32-bit integer representing the number of proceeding draws which will occur in a single invocation of the pass. Following the draw count, the buffer should contain a tightly-packed array of draw commands.
| cull tz::gpu::pass_graphics_state::culling = cull::back |
Describe which faces will be culled during rendering.
| graphics_flag tz::gpu::pass_graphics_state::flags = static_cast<graphics_flag>(0) |
Specifies extra optional behaviour for the pass.
| std::size_t tz::gpu::pass_graphics_state::triangle_count = 0 |
Number of triangles to draw in a single invocation of the pass.
The count you specify affects how many vertices are drawn every frame. You can change this count later on via pass_set_triangle_count.
If you have specified an index_buffer, then 3*triangle_count indices will be drawn, sourced from the start of the index buffer.
If you have specified a draw_buffer, then this field is entirely ignored and the draw buffer becomes the only source of truth.