Kohi Game Engine
|
Represents a shader on the frontend. More...
#include <shader_system.h>
Data Fields | |
u32 | id |
The shader identifier. More... | |
char * | name |
shader_flag_bits | flags |
u32 | topology_types |
The types of topologies used by the shader and its pipeline. See primitive_topology_type. More... | |
u64 | required_ubo_alignment |
The amount of bytes that are required for UBO alignment. More... | |
u64 | global_ubo_size |
The actual size of the global uniform buffer object. More... | |
u64 | global_ubo_stride |
The stride of the global uniform buffer object. More... | |
u64 | global_ubo_offset |
The offset in bytes for the global UBO from the beginning of the uniform buffer. More... | |
u64 | ubo_size |
The actual size of the instance uniform buffer object. More... | |
u64 | ubo_stride |
The stride of the instance uniform buffer object. More... | |
u64 | push_constant_size |
The total size of all push constant ranges combined. More... | |
u64 | push_constant_stride |
The push constant stride, aligned to 4 bytes as required by Vulkan. More... | |
texture_map ** | global_texture_maps |
An array of global texture map pointers. Darray. More... | |
u8 | instance_texture_count |
The number of instance textures. More... | |
shader_scope | bound_scope |
u32 | bound_instance_id |
The identifier of the currently bound instance. More... | |
u32 | bound_ubo_offset |
The currently bound instance's ubo offset. More... | |
void * | hashtable_block |
The block of memory used by the uniform hashtable. More... | |
hashtable | uniform_lookup |
A hashtable to store uniform index/locations by name. More... | |
shader_uniform * | uniforms |
An array of uniforms in this shader. Darray. More... | |
shader_attribute * | attributes |
An array of attributes. Darray. More... | |
shader_state | state |
The internal state of the shader. More... | |
u8 | push_constant_range_count |
The number of push constant ranges. More... | |
range | push_constant_ranges [32] |
An array of push constant ranges. More... | |
u16 | attribute_stride |
The size of all attributes combined, a.k.a. the size of a vertex. More... | |
u64 | render_frame_number |
Used to ensure the shader's globals are only updated once per frame. More... | |
u8 | draw_index |
Used to ensure the shader's globals are only updated once per draw. More... | |
void * | internal_data |
An opaque pointer to hold renderer API specific data. Renderer is responsible for creation and destruction of this. More... | |
Represents a shader on the frontend.
u16 attribute_stride |
The size of all attributes combined, a.k.a. the size of a vertex.
shader_attribute* attributes |
An array of attributes. Darray.
u32 bound_instance_id |
The identifier of the currently bound instance.
shader_scope bound_scope |
u32 bound_ubo_offset |
The currently bound instance's ubo offset.
u8 draw_index |
Used to ensure the shader's globals are only updated once per draw.
shader_flag_bits flags |
texture_map** global_texture_maps |
An array of global texture map pointers. Darray.
u64 global_ubo_offset |
The offset in bytes for the global UBO from the beginning of the uniform buffer.
u64 global_ubo_size |
The actual size of the global uniform buffer object.
u64 global_ubo_stride |
The stride of the global uniform buffer object.
void* hashtable_block |
The block of memory used by the uniform hashtable.
u32 id |
The shader identifier.
u8 instance_texture_count |
The number of instance textures.
void* internal_data |
An opaque pointer to hold renderer API specific data. Renderer is responsible for creation and destruction of this.
char* name |
u8 push_constant_range_count |
The number of push constant ranges.
range push_constant_ranges[32] |
An array of push constant ranges.
u64 push_constant_size |
The total size of all push constant ranges combined.
u64 push_constant_stride |
The push constant stride, aligned to 4 bytes as required by Vulkan.
u64 render_frame_number |
Used to ensure the shader's globals are only updated once per frame.
u64 required_ubo_alignment |
The amount of bytes that are required for UBO alignment.
This is used along with the UBO size to determine the ultimate stride, which is how much the UBOs are spaced out in the buffer. For example, a required alignment of 256 means that the stride must be a multiple of 256 (true for some nVidia cards).
shader_state state |
The internal state of the shader.
u32 topology_types |
The types of topologies used by the shader and its pipeline. See primitive_topology_type.
u64 ubo_size |
The actual size of the instance uniform buffer object.
u64 ubo_stride |
The stride of the instance uniform buffer object.
hashtable uniform_lookup |
A hashtable to store uniform index/locations by name.
shader_uniform* uniforms |
An array of uniforms in this shader. Darray.