# render_pipeline.h ## Index
`tm_render_pipeline_o`
`struct tm_render_pipeline_update_frame_parameters_t`
`struct tm_render_pipeline_shader_system_t`
`enum tm_render_pipeline_global_shader_system`

`struct tm_render_pipeline_vt`
`name()`
`load()`
`create()`
`destroy()`
`main_module()`
`begin()`
`end()`
`editor_submenu()`
`editor_toolbars()`
`global_shader_system()`
`update_frame_parameters()`

`tm_render_pipeline_vt_version`
`TM_RENDER_PIPELINE_BLACKBOARD_KEY`

`struct tm_render_pipeline_i`
`inst`
`api`

## API
### `tm_render_pipeline_o`
~~~c typedef struct tm_render_pipeline_o tm_render_pipeline_o; ~~~
### `struct tm_render_pipeline_update_frame_parameters_t`
~~~c typedef struct tm_render_pipeline_update_frame_parameters_t { float last_time; float time; float delta_time; uint32_t frame_number; tm_vec4_t selection_outline_color; } tm_render_pipeline_update_frame_parameters_t; ~~~
### `struct tm_render_pipeline_shader_system_t`
~~~c typedef struct tm_render_pipeline_shader_system_t { struct tm_shader_system_o *system; struct tm_shader_constant_buffer_instance_t *constants; struct tm_shader_resource_binder_instance_t *resources; } tm_render_pipeline_shader_system_t; ~~~
### `enum tm_render_pipeline_global_shader_system`
~~~c typedef enum tm_render_pipeline_global_shader_system { // The Machinery will try to enable global frame parameters before rendering a viewport. It will // also try to call [[update_frame_parameters()]] to expose the current time, delta_time and frame // number to the shader system. TM_RENDER_PIPELINE_FRAME_PARAMETERS, // A correctly implemented [[tm_ci_render_i]] component will try to enable the editor selection // system before rendering selected objects. TM_RENDER_PIPELINE_EDITOR_SELECTION, // A correctly implemented [[tm_ci_render_i]] component will try to enable the dynamic object // system before rendering an object whose transforms is changing between frames. TM_RENDER_PIPELINE_DYNAMIC_OBJECT, TM_RENDER_PIPELINE_SHADER_SYSTEMS_MAX } tm_render_pipeline_global_shader_system; ~~~
### `struct tm_render_pipeline_vt`
Render pipeline API. #### `name()` ~~~c const char *(*name)(void); ~~~ Return a human-readable name of the pipeline, used for enumeration of registered pipelines. #### `load()` ~~~c void (*load)(struct tm_allocator_i *allocator, bool load); ~~~ Optional callbacks for setting up resources shared between pipeline instances (e.g lookup tables), if implemented `load()` will be called when the renderer is up and running. #### `create()` ~~~c struct tm_render_pipeline_o *(*create)(struct tm_allocator_i *allocator, struct tm_renderer_resource_command_buffer_o *res_buf, const char *main_module_name); ~~~ Create / destroy pipeline instance. #### `destroy()` ~~~c void (*destroy)(struct tm_render_pipeline_o *inst, struct tm_renderer_resource_command_buffer_o *res_buf); ~~~ #### `main_module()` ~~~c struct tm_render_graph_module_o *(*main_module)(tm_render_pipeline_o *inst); ~~~ Returns the main render graph module to execute for rendering a viewport using the pipeline. #### `begin()` ~~~c void (*begin)(tm_render_pipeline_o *inst, struct tm_render_graph_o *graph, struct tm_shader_system_context_o *context); ~~~ Callbacks to allow render pipeline to activate shader systems and register resources / write info on the render graph blackboard. `begin()` is called right before graph execution and `end()` is called after all rendering using the pipeline is done. #### `end()` ~~~c void (*end)(tm_render_pipeline_o *inst, struct tm_render_graph_o *graph, struct tm_shader_system_context_o *context); ~~~ #### `editor_submenu()` ~~~c void (*editor_submenu)(tm_render_pipeline_o *inst, struct tm_ui_o *ui, const struct tm_ui_style_t *uistyle, tm_vec2_t submenu_pos); ~~~ Callback for render pipeline menu options. #### `editor_toolbars()` ~~~c struct tm_toolbar_i *(*editor_toolbars)(tm_render_pipeline_o *inst, struct tm_temp_allocator_i *ta); ~~~ Returns a carray of toolbars that the pipeline wants to render. #### `global_shader_system()` ~~~c bool (*global_shader_system)(tm_render_pipeline_o *inst, tm_render_pipeline_global_shader_system system_id, tm_render_pipeline_shader_system_t *system); ~~~ Request a global shader system from the pipeline. If the pipeline doesn't expose one, this function should return `false`. #### `update_frame_parameters()` ~~~c void (*update_frame_parameters)(tm_render_pipeline_o *inst, const tm_render_pipeline_update_frame_parameters_t *frame_params, struct tm_renderer_resource_command_buffer_o *res_buf); ~~~ Callback from The Machinery to update global frame parameters.
### `tm_render_pipeline_vt_version`
~~~c #define tm_render_pipeline_vt_version ~~~
### `TM_RENDER_PIPELINE_BLACKBOARD_KEY`
~~~c #define TM_RENDER_PIPELINE_BLACKBOARD_KEY ~~~
### `struct tm_render_pipeline_i`
Abstract interface for render pipelines. #### `inst` ~~~c tm_render_pipeline_o *inst; ~~~ #### `api` ~~~c tm_render_pipeline_vt *api; ~~~