#include <vulkan/vulkan.h>
+#define VERTEX_ATTRIB_BIT (1 << VKU_BIND_VERTEX)
+#define NORMAL_ATTRIB_BIT (1 << VKU_BIND_NORMAL)
+#define TEX_COORD_ATTRIB_BIT (1 << VKU_BIND_TEX_COORD)
+
+enum VkuVertexBindings {
+ VKU_BIND_VERTEX,
+ VKU_BIND_NORMAL,
+ VKU_BIND_TEX_COORD
+};
+
enum VkuDynState {
VKU_DS_VIEWPORT = 1 << 0,
VKU_DS_SCISSOR = 1 << 1,
class VkuPipelineGenerator {
private:
VkPipelineShaderStageCreateInfo sdri[2];
- VkPipelineVertexInputStateCreateInfo verti;
VkPipelineInputAssemblyStateCreateInfo asmi;
VkPipelineViewportStateCreateInfo viewpi;
VkPipelineRasterizationStateCreateInfo rasti;
VkPipelineDepthStencilStateCreateInfo depthi;
VkPipelineColorBlendStateCreateInfo cblendi;
- VkPipelineLayout layout;
+ /* attributes */
+ std::vector<VkVertexInputBindingDescription> bind_descriptions;
+ std::vector<VkVertexInputAttributeDescription> attr_descriptions;
+
+ /* uniforms */
+ std::vector<VkDescriptorSetLayout> dset_layouts;
+ std::vector<VkPushConstantRange> push_const_ranges;
public:
VkuPipelineGenerator();
VkPipeline generate(VkuDynState dyn_flags) const;
void set_shader_modules(VkShaderModule vs, VkShaderModule fs);
+ void set_attribute(uint32_t binding, uint32_t stride, uint32_t location,
+ VkFormat format);
+ void set_descriptor_set_layout(const vku_descriptor &desc);
- // TODO
- void set_vertex_attributes();
- void set_blend_state();
- void set_layout();
+ void set_push_constant(); //TODO
};
#endif // VKUTIL_PIPELINE_H_