Kohi Game Engine
vulkan_shader Struct Reference

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

void * mapped_uniform_buffer_block
 The block of memory mapped to the uniform buffer. More...
 
u32 id
 The shader identifier. More...
 
vulkan_shader_config config
 The configuration of the shader generated by vulkan_create_shader(). More...
 
vulkan_renderpassrenderpass
 A pointer to the renderpass to be used with 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...
 
VkDescriptorPool descriptor_pool
 The descriptor pool used for this shader. More...
 
VkDescriptorSetLayout descriptor_set_layouts [2]
 Descriptor set layouts, max of 2. Index 0=global, 1=instance. More...
 
VkDescriptorSet global_descriptor_sets [3]
 Global descriptor sets, one per frame. More...
 
renderbuffer uniform_buffer
 The uniform buffer used by this shader. More...
 
vulkan_pipeline ** pipelines
 An array of pointers to pipelines associated with this shader. More...
 
vulkan_pipeline ** clockwise_pipelines
 An array of pointers to pipelines associated with this shader. Clockwise winding. Only used if native/extension support doesn't exitst. More...
 
u8 bound_pipeline_index
 The currently bound pipeline index. More...
 
VkPrimitiveTopology current_topology
 The currently-selected topology. More...
 
u32 instance_count
 The instance states for all instances. More...
 
vulkan_shader_instance_state instance_states [VULKAN_MAX_MATERIAL_COUNT]
 
u8 global_uniform_count
 The number of global non-sampler uniforms. More...
 
u8 global_uniform_sampler_count
 The number of global sampler uniforms. More...
 
u8 instance_uniform_count
 The number of instance non-sampler uniforms. More...
 
u8 instance_uniform_sampler_count
 The number of instance sampler uniforms. More...
 
u8 local_uniform_count
 The number of local non-sampler uniforms. More...
 

Detailed Description

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.

Field Documentation

◆ bound_pipeline_index

u8 bound_pipeline_index

The currently bound pipeline index.

◆ clockwise_pipelines

vulkan_pipeline** clockwise_pipelines

An array of pointers to pipelines associated with this shader. Clockwise winding. Only used if native/extension support doesn't exitst.

◆ config

The configuration of the shader generated by vulkan_create_shader().

◆ current_topology

VkPrimitiveTopology current_topology

The currently-selected topology.

◆ descriptor_pool

VkDescriptorPool descriptor_pool

The descriptor pool used for this shader.

◆ descriptor_set_layouts

VkDescriptorSetLayout descriptor_set_layouts[2]

Descriptor set layouts, max of 2. Index 0=global, 1=instance.

◆ global_descriptor_sets

VkDescriptorSet global_descriptor_sets[3]

Global descriptor sets, one per frame.

◆ global_uniform_count

u8 global_uniform_count

The number of global non-sampler uniforms.

◆ global_uniform_sampler_count

u8 global_uniform_sampler_count

The number of global sampler uniforms.

◆ id

u32 id

The shader identifier.

◆ instance_count

u32 instance_count

The instance states for all instances.

Todo:
TODO: make dynamic

◆ instance_states

◆ instance_uniform_count

u8 instance_uniform_count

The number of instance non-sampler uniforms.

◆ instance_uniform_sampler_count

u8 instance_uniform_sampler_count

The number of instance sampler uniforms.

◆ local_uniform_count

u8 local_uniform_count

The number of local non-sampler uniforms.

◆ mapped_uniform_buffer_block

void* mapped_uniform_buffer_block

The block of memory mapped to the uniform buffer.

◆ pipelines

vulkan_pipeline** pipelines

An array of pointers to pipelines associated with this shader.

◆ renderpass

A pointer to the renderpass to be used with this shader.

◆ stages

An array of stages (such as vertex and fragment) for this shader. Count is located in config.

◆ uniform_buffer

renderbuffer uniform_buffer

The uniform buffer used by this shader.


The documentation for this struct was generated from the following file: