Replace uniform with storage buffer for instances

Signed-off-by: Piotr Krygier <piotrkrygier@everyonecancode@xyz>
This commit is contained in:
Piotr Krygier
2026-02-10 19:07:40 +01:00
parent ff527767b9
commit de597ebc5d
3 changed files with 16 additions and 12 deletions
+3 -4
View File
@@ -5,7 +5,6 @@
#include <SDL3/SDL_render.h>
#include <cglm/util.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <vulkan/vulkan_core.h>
@@ -203,14 +202,14 @@ rse_err_t rse_graphics_test_function(struct rse_graphics_context_t* rse_context)
STATUS_CHECK(sampler_create(context, &context->vulkan_handles.sampler));
STATUS_CHECK(descriptor_pool_add_type(context, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1));
STATUS_CHECK(descriptor_pool_add_type(context, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1));
STATUS_CHECK(descriptor_pool_add_type(context, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, TEXTURES_COUNT));
STATUS_CHECK(descriptor_pool_initialize(context));
/* Normal rendering */
STATUS_CHECK(descriptor_create_new_set(context, &descriptor_set_handle));
STATUS_CHECK(
descriptor_add_layout(&layout_bindings, 0, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT));
descriptor_add_layout(&layout_bindings, 0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT));
STATUS_CHECK(descriptor_add_layout(&layout_bindings,
1,
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
@@ -223,7 +222,7 @@ rse_err_t rse_graphics_test_function(struct rse_graphics_context_t* rse_context)
descriptor_set_handle,
&context->render_targets[RENDER_TARGET_3D].instance_buffer,
0,
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER));
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER));
STATUS_CHECK(descriptor_attach_images(context,
descriptor_set_handle,