Move to bindless design
Replaced DrawIndexed with DrawIndexedIndirect function. This way less parameters are passed from CPU and are store in GPU mapped memory. Multiple meshes with multiple instances also work.
This commit is contained in:
1 parent
3a58bd8756
commit
252a0820ed
6 files changed
+175
-102
No files matched your search
@@ -6,6 +6,17 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define MAX_MESH_NUMBER 256
|
||||
|
||||
/**
|
||||
* @brief Represents data within vertex or instance buffer.
|
||||
*
|
||||
*/
|
||||
struct rse_buffer_data_t
|
||||
{
|
||||
size_t count;
|
||||
size_t buffer_offset;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Create buffers needed by vulkan pipeline
|
||||
@@ -25,22 +36,24 @@ void update_uniform_buffers();
|
||||
*
|
||||
* @param vertices Vertices to add
|
||||
* @param indices Indices to add
|
||||
* @param vertices_num Number of vertices to add
|
||||
* @param indices_num Number of indices to add
|
||||
* @return uint8_t VULKAN_ERROR_NO_ERROR on success
|
||||
* @param vertex_data Mutable vertex data. Count will be read and buffer offset will be set
|
||||
* @param index_data Mutable index data. Count will be read and buffer offset will be set
|
||||
* @return uint8_t
|
||||
*/
|
||||
uint8_t update_mesh_buffers(const struct rse_vertex_t* vertices,
|
||||
const uint16_t* indices,
|
||||
size_t vertices_num,
|
||||
size_t indices_num);
|
||||
uint8_t rse_add_vertices(uint16_t mesh_id,
|
||||
const struct rse_vertex_t* vertices,
|
||||
const uint16_t* indices,
|
||||
struct rse_buffer_data_t* vertex_data,
|
||||
struct rse_buffer_data_t* index_data);
|
||||
|
||||
/**
|
||||
* @brief Add instance data to vulkan buffers
|
||||
*
|
||||
* @param mesh_id Mesh ID
|
||||
* @param instance_data Instance data
|
||||
* @return uint8_t VULKAN_ERROR_NO_ERROR on success
|
||||
*/
|
||||
uint8_t update_mesh_instances(struct rse_instance_data_t* instance_data);
|
||||
uint8_t update_mesh_instances(uint16_t mesh_id, struct rse_instance_data_t* instance_data);
|
||||
|
||||
/**
|
||||
* @brief Record commands for given image index
|
||||
|
||||
Reference in new issue
Block a user