diff options
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 |