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

Method draw_model

framework/api_vulkan_sample.cpp:1345–1355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1343}
1344
1345void ApiVulkanSample::draw_model(std::unique_ptr<vkb::sg::SubMesh> &model, VkCommandBuffer command_buffer, uint32_t instance_count)
1346{
1347 VkDeviceSize offsets[1] = {0};
1348
1349 const auto &vertex_buffer = model->vertex_buffers.at("vertex_buffer");
1350 auto &index_buffer = model->index_buffer;
1351
1352 vkCmdBindVertexBuffers(command_buffer, 0, 1, vertex_buffer.get(), offsets);
1353 vkCmdBindIndexBuffer(command_buffer, index_buffer->get_handle(), 0, model->index_type);
1354 vkCmdDrawIndexed(command_buffer, model->vertex_indices, instance_count, 0, 0, 0);
1355}
1356
1357void ApiVulkanSample::with_command_buffer(const std::function<void(VkCommandBuffer command_buffer)> &f, VkSemaphore signalSemaphore)
1358{

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
get_handleMethod · 0.45

Tested by

no test coverage detected