10#include "components/ErrorUtils.hpp"
21 struct DrawIndexedIndirectCommand;
44 void extractTransparentTriangles(
45 const glm::mat4& modelMatrix,
46 const glm::vec3& cameraPos,
50 std::vector<TransparentTriangle>& outTriangles
63 void draw(VkCommandBuffer cmd, VkPipelineLayout pipelineLayout,
80 VkPipelineLayout pipelineLayout,
84 uint32_t submeshIndex,
85 glm::mat4 modelMatrix,
104 VkBuffer vertexBuffer;
105 VmaAllocation vertexAlloc;
106 VkBuffer indexBuffer;
107 VmaAllocation indexAlloc;
116 void StreamToGPU(
void* dst,
const void* src,
size_t sizeBytes);
119 std::vector<SubmeshBuffers> m_submeshBuffers;
120 std::vector<std::string> m_submeshTextures;
121 int numOfInstances = 0;
123 std::vector<Submesh> m_cpuSubmeshData;
129 float distanceToCamera;
135 uint32_t submeshIndex;
Contains basic components like transform, camera, name components..
This file defines MeshData struct and all other structs needed for it.
This file defines VulkanResources Class.
Class defining mesh object with vulkan specific data and methods.
int getNumOfInstances() const
Helper function to get number of mesh components using this VulkanMesh instance, needed for mesh mana...
void StreamToGPU(void *dst, const void *src, size_t sizeBytes)
Helper function to stream data to GPU memory.
void removeInstance()
decrements number of mesh components using this VulkanMesh instance.
VulkanMesh(VulkanContext &context)
Constructor for VulkanMesh class.
void draw(VkCommandBuffer cmd, VkPipelineLayout pipelineLayout, VulkanResources &resources, uint32_t frameIndex, uint32_t modelIndex, glm::mat4 modelMatrix, const MeshComponent &mc) const
Draws the mesh to the screen.
void upload(const MeshData &meshData)
Uploads mesh data to the GPU.
void bindAndDrawBatched(VkCommandBuffer cmd, VkPipelineLayout pipelineLayout, VulkanResources &resources, uint32_t frameIndex, uint32_t modelIndex, uint32_t submeshIndex, glm::mat4 modelMatrix, bool modelChanged, bool submeshChanged, const MeshComponent &mc) const
Batch-optimized draw call for sorted transparent triangles.
void addInstance()
increments number of mesh components using this VulkanMesh instance.
This class manages resources like textures, descriptor sets, and uniform buffers.
This file defines struct holding all vulkan data, like device, surface, swapchain,...
uint32_t Entity
Type alias representing a unique entity identifier in the ECS system.
Struct containing raw meshData, mesh id, texture paths and material properties. It just template and ...
Mesh data structure for loading and managing mesh data.
struct used to held transparent triangles data for sorting and special rendering
Struct holding all vulkan data, like device, surface, swapchain, images, views, and more.
struct used to hold buffers and allocations for each submesh in single object.