fixes
[demo] / src / vulkan / vkutil-pipeline.h
index 4dac9af..281d489 100644 (file)
@@ -2,6 +2,13 @@
 #define VKUTIL_PIPELINE_H_
 
 #include <vulkan/vulkan.h>
+#include <vector>
+
+enum VkuVertexBindings {
+       VKU_BIND_VERTEX,
+       VKU_BIND_NORMAL,
+       VKU_BIND_TEX_COORD
+};
 
 enum VkuDynState {
        VKU_DS_VIEWPORT = 1 << 0,
@@ -12,7 +19,6 @@ enum VkuDynState {
 class VkuPipelineGenerator {
 private:
        VkPipelineShaderStageCreateInfo sdri[2];
-       VkPipelineVertexInputStateCreateInfo verti;
        VkPipelineInputAssemblyStateCreateInfo asmi;
        VkPipelineViewportStateCreateInfo viewpi;
        VkPipelineRasterizationStateCreateInfo rasti;
@@ -20,20 +26,26 @@ private:
        VkPipelineDepthStencilStateCreateInfo depthi;
        VkPipelineColorBlendStateCreateInfo cblendi;
 
+       /* attributes */
+       std::vector<VkVertexInputBindingDescription> bind_descriptions;
+       std::vector<VkVertexInputAttributeDescription> attr_descriptions;
+
+       /* resources */
+       std::vector<VkDescriptorSetLayout> res_layouts;
+//     std::vector<VkPushConstantRange> push_const_ranges;
+
        VkPipelineLayout layout;
 
 public:
        VkuPipelineGenerator();
        ~VkuPipelineGenerator();
 
-       VkPipeline generate(VkuDynState dyn_flags) const;
+       VkPipeline generate(VkuDynState dyn_flags);
 
        void set_shader_modules(VkShaderModule vs, VkShaderModule fs);
-
-       // TODO
-       void set_vertex_attributes();
-       void set_blend_state();
-       void set_layout();
+       void set_attribute(uint32_t binding, uint32_t stride, uint32_t location,
+                       VkFormat format);
+       void set_resources_layout(VkDescriptorSetLayout layout);
 };
 
 #endif // VKUTIL_PIPELINE_H_