Add some extra printouts to debug crash

This commit is contained in:
2024-03-08 13:03:24 -05:00
parent 41e924a7b1
commit ef75387af4
3 changed files with 11 additions and 1 deletions

View File

@@ -472,6 +472,7 @@ namespace fgl::engine
void EngineContext::loadGameObjects()
{
std::cout << "Loading game objects" << std::endl;
auto command_buffer { Device::getInstance().beginSingleTimeCommands() };
/*
@@ -502,6 +503,8 @@ namespace fgl::engine
m_entity_renderer.getVertexBuffer(),
m_entity_renderer.getIndexBuffer() ) };
assert( model );
model->syncBuffers( command_buffer );
constexpr int val { 16 };
@@ -582,6 +585,7 @@ namespace fgl::engine
*/
Device::getInstance().endSingleTimeCommands( command_buffer );
std::cout << "Finished loading game objects" << std::endl;
}
void EngineContext::initImGui()

View File

@@ -83,13 +83,17 @@ namespace fgl::engine
std::unique_ptr< Model > Model::
createModel( Device& device, const std::filesystem::path& path, Buffer& vertex_buffer, Buffer& index_buffer )
{
std::cout << "Creating model: " << path << std::endl;
ModelBuilder builder { vertex_buffer, index_buffer };
builder.loadModel( path );
//Calculate bounding box
OrientedBoundingBox bounding_box { buildBoundingBox( builder.m_primitives ) };
return std::make_unique< Model >( device, builder, bounding_box );
auto model_ptr { std::make_unique< Model >( device, builder, bounding_box ) };
std::cout << "Finished making model: " << path << std::endl;
return model_ptr;
}
void Model::syncBuffers( vk::CommandBuffer& cmd_buffer )

View File

@@ -310,5 +310,7 @@ namespace fgl::engine
std::cout << "Scenes: " << model.scenes.size() << std::endl;
std::cout << "Meshes: " << model.meshes.size() << std::endl;
std::cout << "Finished loading model" << filepath << std::endl;
}
} // namespace fgl::engine