14 virtual void Bind()
const override;
15 virtual void UnBind()
const override;
21 virtual void SetLayout(
const BufferLayout& layout)
override
26 void CreateBuffer(VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties,
27 VkBuffer& buffer, VkDeviceMemory& bufferMemory);
28 void CopyBuffer(VkBuffer srcBuffer, VkBuffer dstBuffer, VkDeviceSize size);
30 uint32_t FindMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags properties);
32 inline VkBuffer GetVertexBuffer()
const {
return m_VertexBuffer; }
33 inline VkDeviceMemory GetVertexBufferMemory()
const {
return m_VertexBufferMemory; }
35 inline size_t GetBufferSize() {
return m_BufferSize; }
41 VkBuffer m_VertexBuffer;
42 VkDeviceMemory m_VertexBufferMemory;
53 virtual void Bind()
const override;
54 virtual void UnBind()
const override;
56 void CreateBuffer(VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties,
57 VkBuffer& buffer, VkDeviceMemory& bufferMemory);
58 void CopyBuffer(VkBuffer srcBuffer, VkBuffer dstBuffer, VkDeviceSize size);
60 uint32_t FindMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags properties);
62 virtual uint32_t GetCount()
const override {
return m_Count; }
63 inline VkBuffer GetIndexBuffer()
const {
return m_IndexBuffer; }
64 inline VkDeviceMemory GetIndexBufferMemory()
const {
return m_IndexBufferMemory; }
66 inline size_t GetBufferSize() {
return m_BufferSize; }
72 VkBuffer m_IndexBuffer;
73 VkDeviceMemory m_IndexBufferMemory;
84 void CreateBuffer(VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties,
85 VkBuffer& buffer, VkDeviceMemory& bufferMemory);
86 uint32_t FindMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags properties);
87 const std::vector<VkBuffer>& GetUniformBuffers()
const {
return m_UniformBuffers; }
90 void BufferCreation();
92 void UploadUniformBuffer(
size_t frameIndex);
96 std::vector<VkBuffer> m_UniformBuffers;
97 std::vector<VkDeviceMemory> m_UniformBuffersMemory;
105 void CreateBuffer(VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties,
106 VkBuffer& buffer, VkDeviceMemory& bufferMemory);
107 uint32_t FindMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags properties);
108 const inline VkBuffer& GetBuffer()
const {
return m_StagingBuffer; }
111 int GetTextureWidth()
const {
return texWidth; }
112 int GetTextureHeight()
const {
return texHeight; }
113 int GetTextureChannels()
const {
return texChannels; }
117 VkBuffer m_StagingBuffer;
118 VkDeviceMemory m_StagingBufferMemory;