Topaz 5.0
Topaz Game Engine
Loading...
Searching...
No Matches
tz::gpu::pass_info Struct Reference

Description

Specifies creation flags for a new pass.

See tz::gpu::create_pass for usage.

#include "pass.hpp"

Public Attributes

pass_graphics_state graphics = {}
 Describe the graphics state. If the pass is a compute pass, this is ignored.
 
pass_compute_state compute = {}
 Describe the compute state. If the pass is a graphics pass, this is ignored.
 
shader_handle shader = tz::nullhand
 Corresponds to the shader that will run during execution. This must refer to a valid shader program created via create_graphics_shader or create_compute_shader.
 
std::span< const resource_handleresources = {}
 List of all resources used in the shader program.
 
pass_flag flags = static_cast<pass_flag>(0)
 Specifies extra optional behaviour for the pass.
 
const char * name = "<untitled pass>"
 Name identifying the pass. Debug tools/error checking will refer to the pass by this name if you provide one. If you do not provide a name, one will be automatically generated for you.
 

Member Data Documentation

◆ graphics

pass_graphics_state tz::gpu::pass_info::graphics = {}

Describe the graphics state. If the pass is a compute pass, this is ignored.

◆ compute

pass_compute_state tz::gpu::pass_info::compute = {}

Describe the compute state. If the pass is a graphics pass, this is ignored.

◆ shader

shader_handle tz::gpu::pass_info::shader = tz::nullhand

Corresponds to the shader that will run during execution. This must refer to a valid shader program created via create_graphics_shader or create_compute_shader.

◆ resources

std::span<const resource_handle> tz::gpu::pass_info::resources = {}

List of all resources used in the shader program.

There are several restrictions you must adhere to when defining a set of resources:

The order in which you provide the list of resources may affect the buffer resource index you need to use in the shader.

  • The id of the buffer is unaffected by any preceding images, and the id of the image is unaffected by any preceding buffers. This means you are free to intersperse as many images between buffers as you want (and vice-versa), without affecting the buffer ids. For example: .resources = {myimage0, mybuffer0, myimage1, mybuffer1, myimage2, myimage3, mybuffer2} Note that the number at the end of each resource name in the above example represents its buffer/image id used in the shader, i.e: resource(id = 1) const buffer mybuffer1{...}; vec4 myimage1_colour = sample(1, some_uv);

◆ flags

pass_flag tz::gpu::pass_info::flags = static_cast<pass_flag>(0)

Specifies extra optional behaviour for the pass.

◆ name

const char* tz::gpu::pass_info::name = "<untitled pass>"

Name identifying the pass. Debug tools/error checking will refer to the pass by this name if you provide one. If you do not provide a name, one will be automatically generated for you.