17 virtual void Bind()
const override;
18 virtual void UnBind()
const override {}
20 virtual void AddVertexBuffer(
const std::shared_ptr<VertexBuffer>& vertexBuffer)
override;
21 virtual void SetIndexBuffer(
const std::shared_ptr<IndexBuffer>& indexBuffer)
override;
23 virtual void SetMesh(std::shared_ptr<Mesh> mesh)
override;
25 virtual void SetMaterial(std::shared_ptr<Material> material)
override;
27 virtual void SetShader(std::shared_ptr<Shader> shader)
override;
29 void CreateDescriptorSetLayout();
30 void CreatePipelineLayout();
31 void CreateGraphicsPipeline();
32 void CreateDescriptorPool();
33 void CreateDescriptorSets();
35 void CreateExternalViewPort(
float startX,
float startY,
float width,
float height);
39 void GenerateVulkanVA();
41 void RecreateVulkanVA();
42 void CleanupPipeline();
45 VkShaderModule CreateShaderModule(
const std::vector<uint32_t>& code);
48 VkPipeline GetGraphicsPipeline()
const {
return m_graphicsPipeline; }
49 VkPipelineLayout GetGraphicsPipelineLayout()
const {
return m_pipelineLayout; }
50 const std::shared_ptr<VulkanShader>& GetShader()
const {
return m_Shader; }
52 const std::shared_ptr<VulkanVertexBuffer>& GetVertexBuffer()
const {
return m_VertexBuffer; }
53 const std::vector<VkDescriptorSet>& GetDescriptorSets()
const {
return m_descriptorSets; }
55 virtual std::shared_ptr<Material> GetMaterial()
const override {
return m_Materials.at(0); }
57 virtual void UpdateProcessAndSetReadyForSubmission()
const override;
60 virtual const std::vector<std::shared_ptr<VertexBuffer>>& GetVertexBuffers()
const override {
return m_VertexBuffers; }
61 virtual const VulkanIndexBuffer* GetIndexBuffer()
const override {
return m_IndexBuffer.get(); }
67 std::vector<std::shared_ptr<VertexBuffer>> m_VertexBuffers;
68 std::shared_ptr<VulkanVertexBuffer> m_VertexBuffer;
69 std::shared_ptr<VulkanIndexBuffer> m_IndexBuffer;
72 std::vector<std::shared_ptr<Material>> m_Materials;
73 std::vector<std::shared_ptr<VulkanShader>> m_Shaders;
74 std::shared_ptr<VulkanShader> m_Shader;
78 VkPipelineLayout m_pipelineLayout;
79 VkDescriptorSetLayout m_descriptorSetLayout;
81 VkPipeline m_graphicsPipeline;
82 VkDescriptorPool m_descriptorPool;
83 std::vector<VkDescriptorSet> m_descriptorSets;
85 VkVertexInputBindingDescription m_bindingDescription{};
86 std::vector<VkVertexInputAttributeDescription> m_attributeDescriptions;
88 const VkPhysicalDeviceFeatures& m_SupportedDeviceFeatures;
90 VkViewport m_ExternalViewPort;
91 bool m_UseExternalViewPort;