src/draw_call.c
 1#include "alba.h"
 2#include "internal.h"
 3
 4void create_draw_call(DrawCall* draw_call)
 5{
 6    draw_call->new_vertices = alba_create_array(sizeof(AlbaVector), 0);
 7    draw_call->new_attributes = alba_create_array(sizeof(AlbaAttribute), 0);
 8    draw_call->new_indices = alba_create_array(sizeof(uint32_t), 0);
 9}
10
11void draw_call_release(const DrawCall* draw_call)
12{
13    wgpuBufferDestroy(draw_call->vertices);
14    wgpuBufferRelease(draw_call->vertices);
15    alba_array_release(&draw_call->new_vertices);
16
17    wgpuBufferDestroy(draw_call->attributes);
18    wgpuBufferRelease(draw_call->attributes);
19    alba_array_release(&draw_call->new_attributes);
20
21    wgpuBufferDestroy(draw_call->indices);
22    wgpuBufferRelease(draw_call->indices);
23    alba_array_release(&draw_call->new_indices);
24
25    wgpuTextureViewRelease(draw_call->view);
26    wgpuTextureDestroy(draw_call->texture);
27    wgpuTextureRelease(draw_call->texture);
28    wgpuBindGroupRelease(draw_call->bind_group);
29}