MCPcopy Create free account
hub / github.com/Ipotrick/Daxa / initialize

Method initialize

src/impl_device.cpp:70–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68} // namespace
69
70auto daxa_ImplDevice::ImplQueue::initialize(VkDevice a_vk_device) -> daxa_Result
71{
72 VkSemaphoreTypeCreateInfo timeline_ci{
73 .sType = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO,
74 .pNext = nullptr,
75 .semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE,
76 .initialValue = 0,
77 };
78
79 VkSemaphoreCreateInfo const vk_semaphore_create_info{
80 .sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,
81 .pNext = r_cast<void *>(&timeline_ci),
82 .flags = {},
83 };
84
85 vkGetDeviceQueue(a_vk_device, vk_queue_type_index, queue_index, &this->vk_queue);
86 daxa_Result result = DAXA_RESULT_SUCCESS;
87 if (this->vk_queue == VK_NULL_HANDLE)
88 {
89 result = DAXA_RESULT_ERROR_COULD_NOT_QUERY_QUEUE;
90 }
91 _DAXA_RETURN_IF_ERROR(result, result)
92
93 result = static_cast<daxa_Result>(vkCreateSemaphore(a_vk_device, &vk_semaphore_create_info, nullptr, &this->gpu_queue_local_timeline));
94 _DAXA_RETURN_IF_ERROR(result, result)
95
96 return result;
97}
98
99void daxa_ImplDevice::ImplQueue::cleanup(VkDevice device)
100{

Callers 2

create_2Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected