[WIP] Continue working on pipeline

This commit is contained in:
Piotr Krygier committed 2025-06-20 13:44:33 +02:00
1 parent f8eb98ddf4
commit daed76f02f
28 files changed
+467 -2156

No files matched your search

+10 -35
View File
@@ -14,6 +14,7 @@
#include <vulkan/vulkan.h>
#include <vulkan/vulkan_core.h>
#include "graphics_context.h"
#include "utilities/commons.h"
#include "utilities/linked_list.h"
@@ -41,7 +42,8 @@ rse_err_t pipeline_builder_init(struct pipeline_t** pipeline);
* @param[in] shader_stage Shader stage to add
* @return RSE_SUCCESS on success, error code otherwise
*/
rse_err_t pipeline_add_shader_stage(struct graphics_context_t* context, struct pipeline_t* pipeline, const char* shader_path, const VkShaderStageFlagBits shader_stage);
rse_err_t pipeline_add_shader_stage(struct graphics_context_t* context, struct pipeline_t* pipeline,
const char* shader_path, const VkShaderStageFlagBits shader_stage);
/**
* @brief Add vertex input binding to pipeline
@@ -53,7 +55,7 @@ rse_err_t pipeline_add_shader_stage(struct graphics_context_t* context, struct p
* @return RSE_SUCCESS on success, error code otherwise
*/
rse_err_t pipeline_add_vertex_input_binding(struct pipeline_t* pipeline, const uint8_t binding, const uint8_t stride,
const VkVertexInputRate input_rate);
const VkVertexInputRate input_rate);
/**
* @brief Add vertex attribute to shader in pipeline
@@ -66,9 +68,7 @@ rse_err_t pipeline_add_vertex_input_binding(struct pipeline_t* pipeline, const u
* @return RSE_SUCCESS on success, error code otherwise
*/
rse_err_t pipeline_add_vertex_input_attribute(struct pipeline_t* pipeline, const uint8_t binding,
const uint8_t location,
const VkFormat format,
const uint8_t offset);
const uint8_t location, const VkFormat format, const uint8_t offset);
/**
* @brief Add dynamic state to pipeline
@@ -80,40 +80,14 @@ rse_err_t pipeline_add_vertex_input_attribute(struct pipeline_t* pipeline, const
rse_err_t pipeline_add_dynamic_state(struct pipeline_t* pipeline, const VkDynamicState dynamic_state);
/**
* @brief Add descriptor pool
*
* @param[in] context Graphics context handle
* @param[in] pipeline Pipeline to add descriptor pool to
* @param[in] descriptor_type Type of descriptors to be stored in this pool.
* @return RSE_SUCCESS on success, error code otherwise
*/
rse_err_t pipeline_add_descriptor_pool(struct graphics_context_t* context,
struct pipeline_t* pipeline,
enum VkDescriptorType descriptor_type);
/**
* @brief Add required dynamic state to pipeline
*
* @param[in] context Graphics context handle
* @param[in] binding_infos Binding infos to add
* @param[in] binding_count Number of binding infos
* @param[out] descriptor_set_index Index of descriptor set
* @return RSE_SUCCESS on success, error code otherwise
*/
rse_err_t pipeline_add_descriptor_layout(struct graphics_context_t* context,
struct binding_info_t* binding_infos,
size_t binding_count,
size_t* descriptor_set_index);
/**
* @brief Build pipeline from added components. This function should be called after adding all necessary components. After call, pipeline is ready to be used and all added components are cleared, ready for next pipeline to be built.
* @brief Build pipeline from added components. This function should be called after adding all necessary components.
* After call, pipeline is ready to be used and all added components are cleared, ready for next pipeline to be built.
*
* param[in/out] context Graphics context handle
* @param[in] pipeline Pipelines list to build
* @return RSE_SUCCESS on success, error code otherwise
*/
rse_err_t pipelines_build(struct graphics_context_t* context,
struct pipeline_infos_list_t* pipelines);
rse_err_t pipelines_build(struct graphics_context_t* context, struct pipeline_infos_list_t* pipelines);
/**
* @brief Add pipeline to list of pipelines
@@ -123,7 +97,8 @@ rse_err_t pipelines_build(struct graphics_context_t* context,
* @param[out] pipeline_info List of pipelines infos, where new info should be added
* @return RSE_SUCCESS on success, error code otherwise
*/
rse_err_t add_pipeline(const struct graphics_context_t* context, struct pipeline_t* pipeline, struct pipeline_infos_list_t** pipelines);
rse_err_t add_pipeline(const struct graphics_context_t* context, struct pipeline_t* pipeline,
struct pipeline_infos_list_t** pipelines);
/**
* @brief Destroy all pipelines