Add GEVulkanDynamicSPMBuffer

This commit is contained in:
Benau 2022-11-28 15:16:28 +08:00
parent fd579111e1
commit d5fdcb2d98
3 changed files with 53 additions and 0 deletions

View File

@ -81,6 +81,7 @@ set(GE_SOURCES
src/ge_vulkan_driver.cpp
src/ge_vulkan_draw_call.cpp
src/ge_vulkan_dynamic_buffer.cpp
src/ge_vulkan_dynamic_spm_buffer.cpp
src/ge_vulkan_fbo_texture.cpp
src/ge_vulkan_features.cpp
src/ge_vulkan_mesh_cache.cpp

View File

@ -0,0 +1,25 @@
#ifndef HEADER_GE_VULKAN_DYNAMIC_SPM_BUFFER_HPP
#define HEADER_GE_VULKAN_DYNAMIC_SPM_BUFFER_HPP
#include "ge_spm_buffer.hpp"
namespace GE
{
class GEVulkanDynamicBuffer;
class GEVulkanDynamicSPMBuffer : public GESPMBuffer
{
private:
GEVulkanDynamicBuffer* m_vertex_buffer;
GEVulkanDynamicBuffer* m_index_buffer;
public:
// ------------------------------------------------------------------------
GEVulkanDynamicSPMBuffer();
// ------------------------------------------------------------------------
~GEVulkanDynamicSPMBuffer();
};
} // end namespace GE
#endif

View File

@ -0,0 +1,27 @@
#include "ge_vulkan_dynamic_spm_buffer.hpp"
#include "ge_vulkan_driver.hpp"
#include "ge_vulkan_dynamic_buffer.hpp"
namespace GE
{
// ----------------------------------------------------------------------------
GEVulkanDynamicSPMBuffer::GEVulkanDynamicSPMBuffer()
{
m_vertex_buffer = new GEVulkanDynamicBuffer(
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, 100,
GEVulkanDriver::getMaxFrameInFlight() + 1, 0);
m_index_buffer = new GEVulkanDynamicBuffer(
VK_BUFFER_USAGE_INDEX_BUFFER_BIT, 100,
GEVulkanDriver::getMaxFrameInFlight() + 1, 0);
} // GEVulkanDynamicSPMBuffer
// ----------------------------------------------------------------------------
GEVulkanDynamicSPMBuffer::~GEVulkanDynamicSPMBuffer()
{
delete m_vertex_buffer;
delete m_index_buffer;
} // ~GEVulkanDynamicSPMBuffer
} // end namespace GE