Kohi Game Engine
|
Represents a generic Vulkan shader. This uses a set of inputs and parameters, as well as the shader programs contained in SPIR-V files to construct a shader for use in rendering. More...
#include <vulkan_types.h>
Data Fields | |
kname | name |
void * | mapped_uniform_buffer_blocks [VULKAN_RESOURCE_IMAGE_COUNT] |
The block of memory mapped to the each per-colourbuffer-image uniform buffer. More... | |
void * | per_draw_push_constant_block |
The block of memory used for push constants, 128B. More... | |
u32 | id |
The shader identifier. More... | |
u16 | max_descriptor_set_count |
The max number of descriptor sets that can be allocated from this shader. Should typically be a decently high number. More... | |
u8 | descriptor_set_count |
The total number of descriptor sets configured for this shader. More... | |
vulkan_descriptor_set_config | descriptor_set_configs [VULKAN_SHADER_DESCRIPTOR_SET_LAYOUT_COUNT] |
Descriptor sets, max of 3. Index 0=per_frame, 1=per_group, 2=per_draw. More... | |
u8 | attribute_count |
The number of vertex attributes in the shader. More... | |
VkVertexInputAttributeDescription | attributes [VULKAN_SHADER_MAX_ATTRIBUTES] |
An array of attribute descriptions for this shader. More... | |
u32 | uniform_count |
The number of uniforms in the shader. More... | |
shader_uniform * | uniforms |
An array of uniforms in the shader. More... | |
u32 | attribute_stride |
The size of all attributes combined, a.k.a. the size of a vertex. More... | |
face_cull_mode | cull_mode |
Face culling mode, provided by the front end. More... | |
u32 | topology_types |
The topology types for the shader pipeline. See primitive_topology_type. Defaults to "triangle list" if unspecified. More... | |
u32 | max_groups |
u32 | max_per_draw_count |
u8 | stage_count |
The number of shader stages in this shader. More... | |
vulkan_shader_stage | stages [VULKAN_SHADER_MAX_STAGES] |
An array of stages (such as vertex and fragment) for this shader. Count is located in config. More... | |
u32 | pool_size_count |
VkDescriptorPoolSize | pool_sizes [3] |
An array of descriptor pool sizes. More... | |
VkDescriptorPool | descriptor_pool |
The descriptor pool used for this shader. More... | |
VkDescriptorSetLayout | descriptor_set_layouts [VULKAN_SHADER_DESCRIPTOR_SET_LAYOUT_COUNT] |
Descriptor set layouts, max of 3. More... | |
renderbuffer | uniform_buffers [VULKAN_RESOURCE_IMAGE_COUNT] |
The uniform buffers used by this shader, one per colourbuffer image. More... | |
vulkan_pipeline ** | pipelines |
An array of pointers to pipelines associated with this shader. More... | |
vulkan_pipeline ** | wireframe_pipelines |
An array of pointers to wireframe pipelines associated with this shader. More... | |
u8 | bound_pipeline_index |
The currently bound pipeline index. More... | |
VkPrimitiveTopology | current_topology |
The currently-selected topology. More... | |
vulkan_shader_frequency_state | per_frame_state |
The per-frame frequency state. More... | |
vulkan_shader_frequency_state * | group_states |
The per-group frequency states for all groups. More... | |
vulkan_shader_frequency_state * | per_draw_states |
The per-draw states for all local things/entities/actors/whatever. More... | |
u64 | required_ubo_alignment |
The amount of bytes that are required for UBO alignment. More... | |
vulkan_shader_frequency_info | per_frame_info |
vulkan_shader_frequency_info | per_group_info |
vulkan_shader_frequency_info | per_draw_info |
shader_flags | flags |
Represents a generic Vulkan shader. This uses a set of inputs and parameters, as well as the shader programs contained in SPIR-V files to construct a shader for use in rendering.
u8 attribute_count |
The number of vertex attributes in the shader.
u32 attribute_stride |
The size of all attributes combined, a.k.a. the size of a vertex.
VkVertexInputAttributeDescription attributes[VULKAN_SHADER_MAX_ATTRIBUTES] |
An array of attribute descriptions for this shader.
u8 bound_pipeline_index |
The currently bound pipeline index.
face_cull_mode cull_mode |
Face culling mode, provided by the front end.
VkPrimitiveTopology current_topology |
The currently-selected topology.
VkDescriptorPool descriptor_pool |
The descriptor pool used for this shader.
vulkan_descriptor_set_config descriptor_set_configs[VULKAN_SHADER_DESCRIPTOR_SET_LAYOUT_COUNT] |
Descriptor sets, max of 3. Index 0=per_frame, 1=per_group, 2=per_draw.
u8 descriptor_set_count |
The total number of descriptor sets configured for this shader.
VkDescriptorSetLayout descriptor_set_layouts[VULKAN_SHADER_DESCRIPTOR_SET_LAYOUT_COUNT] |
Descriptor set layouts, max of 3.
shader_flags flags |
vulkan_shader_frequency_state* group_states |
The per-group frequency states for all groups.
u32 id |
The shader identifier.
void* mapped_uniform_buffer_blocks[VULKAN_RESOURCE_IMAGE_COUNT] |
The block of memory mapped to the each per-colourbuffer-image uniform buffer.
u16 max_descriptor_set_count |
The max number of descriptor sets that can be allocated from this shader. Should typically be a decently high number.
u32 max_groups |
u32 max_per_draw_count |
kname name |
vulkan_shader_frequency_info per_draw_info |
void* per_draw_push_constant_block |
The block of memory used for push constants, 128B.
vulkan_shader_frequency_state* per_draw_states |
The per-draw states for all local things/entities/actors/whatever.
vulkan_shader_frequency_info per_frame_info |
vulkan_shader_frequency_state per_frame_state |
The per-frame frequency state.
vulkan_shader_frequency_info per_group_info |
vulkan_pipeline** pipelines |
An array of pointers to pipelines associated with this shader.
u32 pool_size_count |
VkDescriptorPoolSize pool_sizes[3] |
An array of descriptor pool sizes.
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).
u8 stage_count |
The number of shader stages in this shader.
An array of stages (such as vertex and fragment) for this shader. Count is located in config.
u32 topology_types |
The topology types for the shader pipeline. See primitive_topology_type. Defaults to "triangle list" if unspecified.
renderbuffer uniform_buffers[VULKAN_RESOURCE_IMAGE_COUNT] |
The uniform buffers used by this shader, one per colourbuffer image.
u32 uniform_count |
The number of uniforms in the shader.
shader_uniform* uniforms |
An array of uniforms in the shader.
vulkan_pipeline** wireframe_pipelines |
An array of pointers to wireframe pipelines associated with this shader.