Skip to content

Commit

Permalink
Add rendering for GEVulkanDynamicSPMBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Benau committed Dec 1, 2022
1 parent 392bdbf commit 1d00e44
Show file tree
Hide file tree
Showing 6 changed files with 269 additions and 79 deletions.
7 changes: 7 additions & 0 deletions lib/graphics_engine/include/ge_vulkan_driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <array>
#include <memory>
#include <mutex>
#include <set>
#include <string>
#include <vector>

Expand All @@ -26,6 +27,7 @@ namespace GE
class GESPM;
class GEVulkanDepthTexture;
class GEVulkanDrawCall;
class GEVulkanDynamicSPMBuffer;
class GEVulkanFBOTexture;
class GEVulkanMeshCache;
class GEVulkanTextureDescriptor;
Expand Down Expand Up @@ -366,6 +368,10 @@ namespace GE
std::unique_ptr<GEVulkanDrawCall> getDrawCallFromCache();
GESPM* getBillboardQuad() const { return m_billboard_quad; }
int getCurrentBufferIdx() const { return m_current_buffer_idx; }
void addDynamicSPMBuffer(GEVulkanDynamicSPMBuffer* buffer)
{ m_dynamic_spm_buffers.insert(buffer); }
void removeDynamicSPMBuffer(GEVulkanDynamicSPMBuffer* buffer)
{ m_dynamic_spm_buffers.erase(buffer); }
private:
struct SwapChainSupportDetails
{
Expand Down Expand Up @@ -511,6 +517,7 @@ namespace GE
std::vector<std::unique_ptr<GEVulkanDrawCall> > m_draw_calls_cache;
GESPM* m_billboard_quad;
int m_current_buffer_idx;
std::set<GEVulkanDynamicSPMBuffer*> m_dynamic_spm_buffers;

void createInstance(SDL_Window* window);
void findPhysicalDevice();
Expand Down
4 changes: 4 additions & 0 deletions lib/graphics_engine/include/ge_vulkan_dynamic_spm_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class GEVulkanDynamicSPMBuffer : public GESPMBuffer
virtual void createVertexIndexBuffer() {}
// ------------------------------------------------------------------------
virtual void destroyVertexIndexBuffer() {}
// ------------------------------------------------------------------------
void updateVertexIndexBuffer(int buffer_index);
// ------------------------------------------------------------------------
void drawDynamicVertexIndexBuffer(VkCommandBuffer cmd, int buffer_index);
};

} // end namespace GE
Expand Down
Loading

0 comments on commit 1d00e44

Please sign in to comment.