|
Kohi Game Engine
|
Go to the source code of this file.
Data Structures | |
| struct | kshader_system_config |
| Configuration for the shader system. More... | |
Typedefs | |
| typedef struct kshader_system_config | kshader_system_config |
| Configuration for the shader system. More... | |
Functions | |
| b8 | kshader_system_initialize (u64 *memory_requirement, void *memory, void *config) |
| Initializes the shader system using the supplied configuration. NOTE: Call this twice, once to obtain memory requirement (memory = 0) and a second time including allocated memory. More... | |
| void | kshader_system_shutdown (void *state) |
| Shuts down the shader system. More... | |
| KAPI kshader | kshader_system_get (kname name, kname package_name) |
| Returns a handle to a shader with the given name. Attempts to load the shader if not already loaded. More... | |
| KAPI kshader | kshader_system_get_from_source (kname name, const char *shader_config_source) |
| Returns a handle to a shader with the given name based on the provided config source. Attempts to load the shader if not already loaded. More... | |
| KAPI void | kshader_system_destroy (kshader *shader) |
| Attempts to destroy the shader with the given handle. Handle will be invalidated. More... | |
| KAPI b8 | kshader_system_set_wireframe (kshader shader, b8 wireframe_enabled) |
| Attempts to set wireframe mode on the given shader. If the renderer backend, or the shader does not support this , it will fail when attempting to enable. Disabling will always succeed. More... | |
| KAPI b8 | kshader_system_use (kshader shader, u8 vertex_layout_index) |
| Uses the shader with the given handle and the shader's default topology. More... | |
| KAPI b8 | kshader_system_use_with_topology (kshader shader, primitive_topology_type topology, u8 vertex_layout_index) |
| Uses the shader with the given handle and the provided topology. More... | |
| KAPI void | kshader_set_immediate_data (kshader shader, const void *data, u8 size) |
| KAPI void | kshader_set_binding_data (kshader shader, u8 binding_set, u32 instance_id, u8 binding_index, u64 offset, void *data, u64 size) |
| KAPI void | kshader_set_binding_texture (kshader shader, u8 binding_set, u32 instance_id, u8 binding_index, u8 array_index, ktexture texture) |
| KAPI void | kshader_set_binding_sampler (kshader shader, u8 binding_set, u32 instance_id, u8 binding_index, u8 array_index, ksampler_backend sampler) |
| KAPI u32 | kshader_acquire_binding_set_instance (kshader shader, u8 binding_set) |
| KAPI void | kshader_release_binding_set_instance (kshader shader, u8 binding_set, u32 instance_id) |
| KAPI u32 | kshader_binding_set_instance_count_get (kshader shader, u8 binding_set) |
| KAPI b8 | kshader_apply_binding_set (kshader shader, u8 binding_set, u32 instance_id) |
| typedef struct kshader_system_config kshader_system_config |
Configuration for the shader system.
| KAPI void kshader_set_binding_data | ( | kshader | shader, |
| u8 | binding_set, | ||
| u32 | instance_id, | ||
| u8 | binding_index, | ||
| u64 | offset, | ||
| void * | data, | ||
| u64 | size | ||
| ) |
| KAPI void kshader_set_binding_sampler | ( | kshader | shader, |
| u8 | binding_set, | ||
| u32 | instance_id, | ||
| u8 | binding_index, | ||
| u8 | array_index, | ||
| ksampler_backend | sampler | ||
| ) |
| KAPI void kshader_set_binding_texture | ( | kshader | shader, |
| u8 | binding_set, | ||
| u32 | instance_id, | ||
| u8 | binding_index, | ||
| u8 | array_index, | ||
| ktexture | texture | ||
| ) |
Attempts to destroy the shader with the given handle. Handle will be invalidated.
| shader_name | A pointer to a handle to the shader to destroy. Handle will be invalidated. |
Returns a handle to a shader with the given name. Attempts to load the shader if not already loaded.
| shader_name | The kname to search for. |
| package_name | The package to get the shader from if not already loaded. Pass INVALID_KNAME to search all packages. |
Returns a handle to a shader with the given name based on the provided config source. Attempts to load the shader if not already loaded.
| shader_name | The name of the new shader. |
| shader_config_source | A string containing the shader's configuration source as if it were loaded from an asset. |
Initializes the shader system using the supplied configuration. NOTE: Call this twice, once to obtain memory requirement (memory = 0) and a second time including allocated memory.
| memory_requirement | A pointer to hold the memory requirement of this system in bytes. |
| memory | A memory block to be used to hold the state of this system. Pass 0 on the first call to get memory requirement. |
| config | The configuration (kshader_system_config) to be used when initializing the system. |
Attempts to set wireframe mode on the given shader. If the renderer backend, or the shader does not support this , it will fail when attempting to enable. Disabling will always succeed.
| shader | A handle to the shader to set wireframe mode for. |
| wireframe_enabled | Indicates if wireframe mode should be enabled. |
| void kshader_system_shutdown | ( | void * | state | ) |
Shuts down the shader system.
| state | A pointer to the system state. |
Uses the shader with the given handle and the shader's default topology.
| shader | A handle to the shader to be used. |
| KAPI b8 kshader_system_use_with_topology | ( | kshader | shader, |
| primitive_topology_type | topology, | ||
| u8 | vertex_layout_index | ||
| ) |
Uses the shader with the given handle and the provided topology.
| shader | A handle to the shader to be used. |
| topology | The topology type to use. |