Kohi Game Engine
|
This file contains a collection fo Vulkan-specific types used for the Vulkan backend. More...
#include <vulkan/vulkan.h>
#include "core_render_types.h"
#include "debug/kassert.h"
#include "defines.h"
#include "identifiers/khandle.h"
#include "kresources/kresource_types.h"
#include "platform/vulkan_platform.h"
#include "renderer/renderer_types.h"
#include "vulkan/vulkan_core.h"
Go to the source code of this file.
Data Structures | |
struct | vulkan_buffer |
Represents a Vulkan-specific buffer. Used to load data onto the GPU. More... | |
struct | vulkan_swapchain_support_info |
Contains swapchain support information and capabilities. More... | |
struct | vulkan_device |
A representation of both the physical and logical Vulkan devices. Also contains handles to queues, command pools, and various properties of the devices. More... | |
struct | vulkan_image |
A representation of a Vulkan image. This can be thought of as a texture. Also contains the view and memory used by the internal image. More... | |
struct | vulkan_swapchain |
Representation of the Vulkan swapchain. More... | |
struct | vulkan_command_buffer |
Represents a Vulkan-specific command buffer, which holds a list of commands and is submitted to a queue for execution. More... | |
struct | vulkan_shader_stage |
Represents a single shader stage. More... | |
struct | vulkan_pipeline_config |
A configuration structure for Vulkan pipelines. More... | |
struct | vulkan_pipeline |
Holds a Vulkan pipeline and its layout. More... | |
struct | vulkan_descriptor_set_config |
The configuration for a descriptor set. More... | |
struct | vulkan_descriptor_state |
Represents a state for a given descriptor. This is used to determine when a descriptor needs updating. There is a state per frame (with a max of 3). More... | |
struct | vulkan_uniform_sampler_state |
struct | vulkan_uniform_texture_state |
struct | vulkan_shader_frequency_state |
The frequency-level state for a shader (i.e. per-frame, per-group, per-draw). More... | |
struct | vulkan_shader_frequency_info |
Contains vulkan shader frequency specific info for UBOs. More... | |
struct | vulkan_shader |
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... | |
struct | kwindow_renderer_backend_state |
The Vulkan-specific backend window state. More... | |
struct | vulkan_sampler_handle_data |
struct | vulkan_texture_handle_data |
Represents Vulkan-specific texture data. More... | |
struct | vulkan_context |
The overall Vulkan context for the backend. Holds and maintains global renderer backend state, Vulkan instance, etc. More... | |
Macros | |
#define | VULKAN_MAX_FRAMES_IN_FLIGHT 2 |
#define | VULKAN_MAX_COLOUR_BUFFER_COUNT 3 |
#define | VULKAN_RESOURCE_IMAGE_COUNT 3 |
#define | VK_CHECK(expr) |
Checks the given expression's return value against VK_SUCCESS. More... | |
#define | VULKAN_SHADER_MAX_STAGES 8 |
Put some hard limits in place for the count of supported textures, attributes, uniforms, etc. This is to maintain memory locality and avoid dynamic allocations. More... | |
#define | VULKAN_SHADER_MAX_TEXTURE_BINDINGS 16 |
The maximum number of texture bindings allowed at once. More... | |
#define | VULKAN_SHADER_MAX_SAMPLER_BINDINGS 16 |
The maximum number of sampler bindings allowed at once. More... | |
#define | VULKAN_SHADER_MAX_ATTRIBUTES 16 |
The maximum number of vertex input attributes allowed. More... | |
#define | VULKAN_SHADER_MAX_UNIFORMS 128 |
The maximum number of uniforms and samplers allowed at the global, instance and local levels combined. It's probably more than will ever be needed. More... | |
#define | VULKAN_SHADER_MAX_PUSH_CONST_RANGES 32 |
The maximum number of push constant ranges for a shader. More... | |
#define | VULKAN_SHADER_DESCRIPTOR_SET_LAYOUT_COUNT 3 |
Typedefs | |
typedef struct vulkan_buffer | vulkan_buffer |
Represents a Vulkan-specific buffer. Used to load data onto the GPU. More... | |
typedef struct vulkan_swapchain_support_info | vulkan_swapchain_support_info |
Contains swapchain support information and capabilities. More... | |
typedef enum vulkan_device_support_flag_bits | vulkan_device_support_flag_bits |
typedef u32 | vulkan_device_support_flags |
Bitwise flags for device support. More... | |
typedef struct vulkan_device | vulkan_device |
A representation of both the physical and logical Vulkan devices. Also contains handles to queues, command pools, and various properties of the devices. More... | |
typedef struct vulkan_image | vulkan_image |
A representation of a Vulkan image. This can be thought of as a texture. Also contains the view and memory used by the internal image. More... | |
typedef struct vulkan_swapchain | vulkan_swapchain |
Representation of the Vulkan swapchain. More... | |
typedef enum vulkan_command_buffer_state | vulkan_command_buffer_state |
Represents all of the available states that a command buffer can be in. More... | |
typedef struct vulkan_command_buffer | vulkan_command_buffer |
Represents a Vulkan-specific command buffer, which holds a list of commands and is submitted to a queue for execution. More... | |
typedef struct vulkan_shader_stage | vulkan_shader_stage |
Represents a single shader stage. More... | |
typedef enum vulkan_topology_class | vulkan_topology_class |
typedef struct vulkan_pipeline_config | vulkan_pipeline_config |
A configuration structure for Vulkan pipelines. More... | |
typedef struct vulkan_pipeline | vulkan_pipeline |
Holds a Vulkan pipeline and its layout. More... | |
typedef struct vulkan_descriptor_set_config | vulkan_descriptor_set_config |
The configuration for a descriptor set. More... | |
typedef struct vulkan_descriptor_state | vulkan_descriptor_state |
Represents a state for a given descriptor. This is used to determine when a descriptor needs updating. There is a state per frame (with a max of 3). More... | |
typedef struct vulkan_uniform_sampler_state | vulkan_uniform_sampler_state |
typedef struct vulkan_uniform_texture_state | vulkan_uniform_texture_state |
typedef struct vulkan_shader_frequency_state | vulkan_shader_frequency_state |
The frequency-level state for a shader (i.e. per-frame, per-group, per-draw). More... | |
typedef struct vulkan_shader_frequency_info | vulkan_shader_frequency_info |
Contains vulkan shader frequency specific info for UBOs. More... | |
typedef struct vulkan_shader | vulkan_shader |
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... | |
typedef struct kwindow_renderer_backend_state | kwindow_renderer_backend_state |
The Vulkan-specific backend window state. More... | |
typedef struct vulkan_sampler_handle_data | vulkan_sampler_handle_data |
typedef struct vulkan_texture_handle_data | vulkan_texture_handle_data |
Represents Vulkan-specific texture data. More... | |
typedef struct vulkan_context | vulkan_context |
The overall Vulkan context for the backend. Holds and maintains global renderer backend state, Vulkan instance, etc. More... | |
Enumerations | |
enum | vulkan_device_support_flag_bits { VULKAN_DEVICE_SUPPORT_FLAG_NONE_BIT = 0x00 , VULKAN_DEVICE_SUPPORT_FLAG_NATIVE_DYNAMIC_STATE_BIT = 0x01 , VULKAN_DEVICE_SUPPORT_FLAG_DYNAMIC_STATE_BIT = 0x02 , VULKAN_DEVICE_SUPPORT_FLAG_LINE_SMOOTH_RASTERISATION_BIT = 0x04 } |
enum | vulkan_command_buffer_state { COMMAND_BUFFER_STATE_READY , COMMAND_BUFFER_STATE_RECORDING , COMMAND_BUFFER_STATE_IN_RENDER_PASS , COMMAND_BUFFER_STATE_RECORDING_ENDED , COMMAND_BUFFER_STATE_SUBMITTED , COMMAND_BUFFER_STATE_NOT_ALLOCATED } |
Represents all of the available states that a command buffer can be in. More... | |
enum | vulkan_topology_class { VULKAN_TOPOLOGY_CLASS_POINT = 0 , VULKAN_TOPOLOGY_CLASS_LINE = 1 , VULKAN_TOPOLOGY_CLASS_TRIANGLE = 2 , VULKAN_TOPOLOGY_CLASS_MAX = VULKAN_TOPOLOGY_CLASS_TRIANGLE + 1 } |
This file contains a collection fo Vulkan-specific types used for the Vulkan backend.
#define VK_CHECK | ( | expr | ) |
Checks the given expression's return value against VK_SUCCESS.
expr | The expression whose result should be checked. |
#define VULKAN_MAX_COLOUR_BUFFER_COUNT 3 |
#define VULKAN_MAX_FRAMES_IN_FLIGHT 2 |
#define VULKAN_RESOURCE_IMAGE_COUNT 3 |
#define VULKAN_SHADER_DESCRIPTOR_SET_LAYOUT_COUNT 3 |
#define VULKAN_SHADER_MAX_ATTRIBUTES 16 |
The maximum number of vertex input attributes allowed.
#define VULKAN_SHADER_MAX_PUSH_CONST_RANGES 32 |
The maximum number of push constant ranges for a shader.
#define VULKAN_SHADER_MAX_SAMPLER_BINDINGS 16 |
The maximum number of sampler bindings allowed at once.
#define VULKAN_SHADER_MAX_STAGES 8 |
Put some hard limits in place for the count of supported textures, attributes, uniforms, etc. This is to maintain memory locality and avoid dynamic allocations.
The maximum number of stages (such as vertex, fragment, compute, etc.) allowed.
#define VULKAN_SHADER_MAX_TEXTURE_BINDINGS 16 |
The maximum number of texture bindings allowed at once.
#define VULKAN_SHADER_MAX_UNIFORMS 128 |
The maximum number of uniforms and samplers allowed at the global, instance and local levels combined. It's probably more than will ever be needed.
typedef struct kwindow_renderer_backend_state kwindow_renderer_backend_state |
The Vulkan-specific backend window state.
This owns all resources associated with the window (i.e swapchain) and anything tied to it or max_frames_in_flight (sync objects, staging buffer, command buffers, etc.).
typedef struct vulkan_buffer vulkan_buffer |
Represents a Vulkan-specific buffer. Used to load data onto the GPU.
typedef struct vulkan_command_buffer vulkan_command_buffer |
Represents a Vulkan-specific command buffer, which holds a list of commands and is submitted to a queue for execution.
typedef enum vulkan_command_buffer_state vulkan_command_buffer_state |
Represents all of the available states that a command buffer can be in.
typedef struct vulkan_context vulkan_context |
The overall Vulkan context for the backend. Holds and maintains global renderer backend state, Vulkan instance, etc.
typedef struct vulkan_descriptor_set_config vulkan_descriptor_set_config |
The configuration for a descriptor set.
typedef struct vulkan_descriptor_state vulkan_descriptor_state |
Represents a state for a given descriptor. This is used to determine when a descriptor needs updating. There is a state per frame (with a max of 3).
typedef struct vulkan_device vulkan_device |
A representation of both the physical and logical Vulkan devices. Also contains handles to queues, command pools, and various properties of the devices.
typedef u32 vulkan_device_support_flags |
Bitwise flags for device support.
typedef struct vulkan_image vulkan_image |
A representation of a Vulkan image. This can be thought of as a texture. Also contains the view and memory used by the internal image.
typedef struct vulkan_pipeline vulkan_pipeline |
Holds a Vulkan pipeline and its layout.
typedef struct vulkan_pipeline_config vulkan_pipeline_config |
A configuration structure for Vulkan pipelines.
typedef struct vulkan_sampler_handle_data vulkan_sampler_handle_data |
typedef struct vulkan_shader vulkan_shader |
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.
typedef struct vulkan_shader_frequency_info vulkan_shader_frequency_info |
Contains vulkan shader frequency specific info for UBOs.
typedef struct vulkan_shader_frequency_state vulkan_shader_frequency_state |
The frequency-level state for a shader (i.e. per-frame, per-group, per-draw).
typedef struct vulkan_shader_stage vulkan_shader_stage |
Represents a single shader stage.
typedef struct vulkan_swapchain vulkan_swapchain |
Representation of the Vulkan swapchain.
typedef struct vulkan_swapchain_support_info vulkan_swapchain_support_info |
Contains swapchain support information and capabilities.
typedef struct vulkan_texture_handle_data vulkan_texture_handle_data |
Represents Vulkan-specific texture data.
typedef enum vulkan_topology_class vulkan_topology_class |
typedef struct vulkan_uniform_sampler_state vulkan_uniform_sampler_state |
typedef struct vulkan_uniform_texture_state vulkan_uniform_texture_state |
Represents all of the available states that a command buffer can be in.