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:
Piotr Krygier committed 2023-09-26 14:15:21 +02:00
1 parent 3a58bd8756
commit 252a0820ed
6 files changed
+175 -102

No files matched your search

+2 -3
View File
@@ -48,7 +48,6 @@ uint8_t rse_graphics_run(void)
{{0.5f, 0.5f, 0.0f}, {0.0f, 0.0f, 1.0f}},
{{-0.5f, 0.5f, 0.0f}, {1.0f, 0.0f, 1.0f}}};
struct rse_vertex_t vertices2[] = {{{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 1.0f}},
{{0.5f, -0.5f, 0.0f}, {0.0f, 1.0f, 0.0f}},
{{0.5f, 0.5f, 0.0f}, {0.0f, 1.0f, 0.0f}},
{{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 0.0f}}};
@@ -56,7 +55,7 @@ uint8_t rse_graphics_run(void)
// FIXME: Temporary array of vertices, for testing purposes
uint16_t indices[] = {0, 1, 2, 2, 3, 0};
uint16_t mesh_id = create_mesh(vertices, indices, 24, 6);
uint16_t mesh_id = create_mesh(vertices, indices, 8, 6);
create_mesh_instance(mesh_id, (struct rse_instance_data_t){
{0.0f, 0.0f, 0.0f},
{0.0f, 0.0f, rse_math_deg_to_radians(45.0f)},
@@ -69,7 +68,7 @@ uint8_t rse_graphics_run(void)
1.0f
});
mesh_id = create_mesh(vertices, indices, 24, 6);
mesh_id = create_mesh(vertices2, indices, 8, 6);
create_mesh_instance(mesh_id, (struct rse_instance_data_t){
{0.0f, 1.0f, 0.0f},
{0.0f, 0.0f, rse_math_deg_to_radians(0.0f)},