diff options
author | quou <quou@disroot.org> | 2024-12-29 23:28:00 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-12-29 23:28:00 +1100 |
commit | e25b20717523e579bb6f1e0d17b635c71bad6fab (patch) | |
tree | dd7839c247b81554d0ea2f5207df0f52f0484637 /model.cpp | |
parent | 39fc0b5af67aa2dc0763394b0727e919840f9f57 (diff) |
resource names
Diffstat (limited to 'model.cpp')
-rw-r--r-- | model.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -19,7 +19,12 @@ void Model_Loader::init(Device* device, Asset_Arena* shader_arena) { shaders = shader_arena; } -Asset* Model_Loader::load(Arena* a, Arena* s, Pack_File* f) { +Asset* Model_Loader::load( + Arena* a, + Arena* s, + const char* filename, + Pack_File* f +) { char magic[4]; int vbo_size, ibo_size, node_count, i, coff, icoff, vcoff; uint8_t* verts; @@ -46,11 +51,13 @@ Asset* Model_Loader::load(Arena* a, Arena* s, Pack_File* f) { r->mesh_count = node_count; meshes = r->get_meshes(); stage_verts = dev->create_buffer( + "model vertex buffer stage", vbo_size, Buffer_Flags::copy_src | Buffer_Flags::cpu_readwrite ); stage_indices = dev->create_buffer( + "model index buffer stage", ibo_size, Buffer_Flags::copy_src | Buffer_Flags::cpu_readwrite @@ -96,16 +103,19 @@ Asset* Model_Loader::load(Arena* a, Arena* s, Pack_File* f) { dev->unmap_buffer(stage_verts); dev->unmap_buffer(stage_indices); r->vbo = dev->create_buffer( + filename, vbo_size, Buffer_Flags::copy_dst | Buffer_Flags::vertex_buffer ); r->ibo = dev->create_buffer( + filename, ibo_size, Buffer_Flags::copy_dst | Buffer_Flags::index_buffer ); r->mvp = dev->create_buffer( + filename, sizeof(MVP_Cbuffer) * node_count, Buffer_Flags::constant_buffer | Buffer_Flags::cpu_readwrite |