MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / load_model

Method load_model

framework/api_vulkan_sample.cpp:1330–1343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1328}
1329
1330std::unique_ptr<vkb::sg::SubMesh> ApiVulkanSample::load_model(const std::string &file, uint32_t index, bool storage_buffer, VkBufferUsageFlags additional_buffer_usage_flags)
1331{
1332 vkb::GLTFLoader loader{get_device()};
1333
1334 std::unique_ptr<vkb::sg::SubMesh> model = loader.read_model_from_file(file, index, storage_buffer, additional_buffer_usage_flags);
1335
1336 if (!model)
1337 {
1338 LOGE("Cannot load model from file: {}", file.c_str());
1339 throw std::runtime_error("Cannot load model from: " + file);
1340 }
1341
1342 return model;
1343}
1344
1345void ApiVulkanSample::draw_model(std::unique_ptr<vkb::sg::SubMesh> &model, VkCommandBuffer command_buffer, uint32_t instance_count)
1346{

Callers

nothing calls this directly

Calls 1

read_model_from_fileMethod · 0.45

Tested by

no test coverage detected