From e25b20717523e579bb6f1e0d17b635c71bad6fab Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 29 Dec 2024 23:28:00 +1100 Subject: resource names --- model.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'model.cpp') diff --git a/model.cpp b/model.cpp index f102a07..dd14085 100644 --- a/model.cpp +++ b/model.cpp @@ -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 -- cgit v1.2.3-54-g00ecf