From 54e1255f9d9997203e9379037f12a6cae8a00c9a Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 8 Sep 2017 17:11:35 +1000 Subject: [PATCH] object: rename `id' as `native' --- command_buffer.cpp | 24 ++++++++--------- command_pool.cpp | 2 +- device.cpp | 4 +-- device_memory.cpp | 6 ++--- event.cpp | 6 ++--- fence.cpp | 10 ++++--- instance.hpp | 2 +- object.cpp | 28 +++++++++---------- object.hpp | 62 ++++++++++++++++++++++++++---------------- physical_device.cpp | 20 +++++++------- queue.cpp | 2 +- tools/hello.cpp | 66 ++++++++++++++++++++++----------------------- 12 files changed, 125 insertions(+), 107 deletions(-) diff --git a/command_buffer.cpp b/command_buffer.cpp index 10baad3..05839db 100644 --- a/command_buffer.cpp +++ b/command_buffer.cpp @@ -29,7 +29,7 @@ using cruft::vk::command_buffer; void command_buffer::reset (VkCommandBufferResetFlags flags) { - auto err = vkResetCommandBuffer (id (), flags); + auto err = vkResetCommandBuffer (native (), flags); error::try_code (err); } @@ -38,7 +38,7 @@ command_buffer::reset (VkCommandBufferResetFlags flags) void command_buffer::begin (const VkCommandBufferBeginInfo &info) { - auto err = vkBeginCommandBuffer (id (), &info); + auto err = vkBeginCommandBuffer (native (), &info); error::try_code (err); } @@ -47,7 +47,7 @@ command_buffer::begin (const VkCommandBufferBeginInfo &info) void command_buffer::begin (const VkRenderPassBeginInfo &info, VkSubpassContents contents) { - vkCmdBeginRenderPass (id (), &info, contents); + vkCmdBeginRenderPass (native (), &info, contents); } @@ -55,7 +55,7 @@ command_buffer::begin (const VkRenderPassBeginInfo &info, VkSubpassContents cont void command_buffer::end (void) { - auto err = vkEndCommandBuffer (id ()); + auto err = vkEndCommandBuffer (native ()); error::try_code (err); } @@ -64,7 +64,7 @@ command_buffer::end (void) void command_buffer::end_pass (void) { - vkCmdEndRenderPass (id ()); + vkCmdEndRenderPass (native ()); } @@ -73,7 +73,7 @@ template void command_buffer::execute (const command_buffer (&buffers)[N]) { - vkCmdExecuteCOmmands (id (), N, buffers); + vkCmdExecuteCOmmands (native (), N, buffers); } @@ -81,7 +81,7 @@ command_buffer::execute (const command_buffer (&buffers)[N]) void command_buffer::next_subpass (const VkSubpassContents contents) { - vkCmdNextSubpass (id (), contents); + vkCmdNextSubpass (native (), contents); } @@ -89,7 +89,7 @@ command_buffer::next_subpass (const VkSubpassContents contents) void command_buffer::bind (VkPipelineBindPoint point, const pipeline &p) { - vkCmdBindPipeline (id (), point, p.id ()); + vkCmdBindPipeline (native (), point, p.native ()); } @@ -97,7 +97,7 @@ command_buffer::bind (VkPipelineBindPoint point, const pipeline &p) void command_buffer::set (const event &ev, VkPipelineStageFlags flags) { - vkCmdSetEvent (id (), ev.id (), flags); + vkCmdSetEvent (native (), ev.native (), flags); } @@ -105,7 +105,7 @@ command_buffer::set (const event &ev, VkPipelineStageFlags flags) void command_buffer::reset (const event &ev, VkPipelineStageFlags flags) { - vkCmdResetEvent (id (), ev.id (), flags); + vkCmdResetEvent (native (), ev.native (), flags); } @@ -118,8 +118,8 @@ command_buffer::wait (util::view events, util::view VkBufferMemoryBarriers, util::view VkImageMemoryBarriers) { - vkCmdWaitEvents (id (), - trunc_cast (events.size ()), &events.cbegin ()->id (), + vkCmdWaitEvents (native (), + trunc_cast (events.size ()), &events.cbegin ()->native (), src_mask, dst_mask, trunc_cast (VkMemoryBarriers.size ()), VkMemoryBarriers.cbegin (), trunc_cast (VkBufferMemoryBarriers.size ()), VkBufferMemoryBarriers.cbegin (), diff --git a/command_pool.cpp b/command_pool.cpp index ecd1a3b..34bf4b0 100644 --- a/command_pool.cpp +++ b/command_pool.cpp @@ -26,6 +26,6 @@ using cruft::vk::command_pool; void command_pool::reset (const device &dev, VkCommandPoolResetFlags flags) { - auto err = vkResetCommandPool (dev.id (), id (), flags); + auto err = vkResetCommandPool (dev.native (), native (), flags); error::try_code (err); } diff --git a/device.cpp b/device.cpp index e2b9a03..6d02f6d 100644 --- a/device.cpp +++ b/device.cpp @@ -48,7 +48,7 @@ device::flush (const VkMappedMemoryRange *first, { CHECK_LE (first, last); - auto err = vkFlushMappedMemoryRanges (id (), trunc_cast (last - first), first); + auto err = vkFlushMappedMemoryRanges (native (), trunc_cast (last - first), first); error::try_code (err); } @@ -60,7 +60,7 @@ device::invalidate (const VkMappedMemoryRange *first, { CHECK_LE (first, last); - auto err = vkInvalidateMappedMemoryRanges (id (), trunc_cast (last - first), first); + auto err = vkInvalidateMappedMemoryRanges (native (), trunc_cast (last - first), first); error::try_code (err); } diff --git a/device_memory.cpp b/device_memory.cpp index 1f8fef7..0d13a57 100644 --- a/device_memory.cpp +++ b/device_memory.cpp @@ -31,7 +31,7 @@ device_memory::map (const device &dev, { void *res; - auto err = vkMapMemory (dev.id (), id (), offset, size, flags, &res); + auto err = vkMapMemory (dev.native (), native (), offset, size, flags, &res); error::try_code (err); return res; @@ -42,7 +42,7 @@ device_memory::map (const device &dev, void device_memory::unmap (const device &dev) { - vkUnmapMemory (dev.id (), id ()); + vkUnmapMemory (dev.native (), native ()); } @@ -51,6 +51,6 @@ VkDeviceSize device_memory::commitment (const device &dev) const { VkDeviceSize size; - vkGetDeviceMemoryCommitment (dev.id (), id (), &size); + vkGetDeviceMemoryCommitment (dev.native (), native (), &size); return size; } diff --git a/event.cpp b/event.cpp index 1f75aad..eda7540 100644 --- a/event.cpp +++ b/event.cpp @@ -26,7 +26,7 @@ using cruft::vk::event; bool event::is_set (const device &dev) const { - auto res = vkGetEventStatus (dev.id (), id ()); + auto res = vkGetEventStatus (dev.native (), native ()); error::try_code (res); return res == VK_EVENT_SET; } @@ -36,7 +36,7 @@ event::is_set (const device &dev) const void event::set (const device &dev) { - auto err = vkSetEvent (dev.id (), id ()); + auto err = vkSetEvent (dev.native (), native ()); error::try_code (err); } @@ -45,6 +45,6 @@ event::set (const device &dev) void event::reset (const device &dev) { - auto err = vkResetEvent (dev.id (), id ()); + auto err = vkResetEvent (dev.native (), native ()); error::try_code (err); } diff --git a/fence.cpp b/fence.cpp index 3b8259d..b0733ef 100644 --- a/fence.cpp +++ b/fence.cpp @@ -29,7 +29,7 @@ using cruft::vk::fence; bool fence::is_ready (const device &dev) { - auto res = vkGetFenceStatus (dev.id (), id ()); + auto res = vkGetFenceStatus (dev.native (), native ()); error::try_code (res); return res == VK_SUCCESS; } @@ -42,7 +42,7 @@ fence::reset (const device &dev, fence *first, fence *last) CHECK_LE (first, last); cruft::vk::error::try_func ( - vkResetFences, dev.id (), trunc_cast (last - first), &first->id () + vkResetFences, dev.native (), trunc_cast (last - first), &first->native () ); } @@ -54,7 +54,8 @@ fence::wait (const device &d, fence *first, fence *last, uint64_t timeout) CHECK_LE (first, last); cruft::vk::error::try_func ( - vkWaitForFences, d.id (), trunc_cast (last - first), &first->id (), VK_FALSE, timeout + vkWaitForFences, + d.native (), trunc_cast (last - first), &first->native (), VK_FALSE, timeout ); } @@ -66,6 +67,7 @@ fence::wait_all (const device &d, fence *first, fence *last, uint64_t timeout) CHECK_LE (first, last); cruft::vk::error::try_func ( - vkWaitForFences, d.id (), trunc_cast (last - first), &first->id (), VK_TRUE, timeout + vkWaitForFences, + d.native (), trunc_cast (last - first), &first->native (), VK_TRUE, timeout ); } diff --git a/instance.hpp b/instance.hpp index 46a2c7a..e865d02 100644 --- a/instance.hpp +++ b/instance.hpp @@ -50,7 +50,7 @@ namespace cruft::vk { T proc (const char *name) { - auto ret = vkGetInstanceProcAddr (id (), name); + auto ret = vkGetInstanceProcAddr (native (), name); if (!ret) throw vk::invalid_argument ("invalid procedure name"); diff --git a/object.cpp b/object.cpp index 60de879..1dbf9a2 100644 --- a/object.cpp +++ b/object.cpp @@ -29,37 +29,37 @@ using cruft::vk::enumerated; /////////////////////////////////////////////////////////////////////////////// template -object::object (id_t _id): - m_id (_id) +object::object (native_t _native): + m_native (_native) { - CHECK_NEQ (m_id, VK_NULL_HANDLE); + CHECK_NEQ (m_native, VK_NULL_HANDLE); } //----------------------------------------------------------------------------- template object::object (object &&rhs): - m_id (VK_NULL_HANDLE) + m_native (VK_NULL_HANDLE) { - std::swap (m_id, rhs.m_id); + std::swap (m_native, rhs.m_native); } //----------------------------------------------------------------------------- template -const typename object::id_t& -object::id (void) const& +const typename object::native_t& +object::native (void) const& { - return m_id; + return m_native; } //----------------------------------------------------------------------------- template -typename object::id_t& -object::id (void) & +typename object::native_t& +object::native (void) & { - return m_id; + return m_native; } @@ -79,12 +79,12 @@ std::vector cruft::vk::enumerated::find (const instance &parent) { // find the total number of objects uint32_t expected = 0; - error::try_code (enum_traits::enumerate (parent.id (), &expected, nullptr)); + error::try_code (enum_traits::enumerate (parent.native (), &expected, nullptr)); // allocate an array of handles and fetch them uint32_t found = expected; - typename T::id_t handles[expected]; - error::try_code (enum_traits::enumerate (parent.id (), &found, handles)); + typename T::native_t handles[expected]; + error::try_code (enum_traits::enumerate (parent.native (), &found, handles)); // return an collection of objects from the handles return std::vector (handles, handles + found); diff --git a/object.hpp b/object.hpp index 3c45b30..9a6248a 100644 --- a/object.hpp +++ b/object.hpp @@ -29,23 +29,24 @@ namespace cruft::vk { /// management. template struct object { - using id_t = typename id_traits::id_t; + using native_t = id_t; - object (id_t); + object (native_t); object (object&&); + object (const object&) = delete; - const id_t& id (void) const&; - id_t& id (void) &; + const native_t& native (void) const&; + native_t& native (void) &; protected: - id_t m_id; + native_t m_native; }; template struct root : public object { - using id_t = typename object::id_t; + using native_t = typename object::native_t; template root (Args &&...args): @@ -54,15 +55,15 @@ namespace cruft::vk { ~root () { - life_traits::destroy (this->id (), nullptr); + life_traits::destroy (this->native (), nullptr); } private: template - static id_t + static native_t make (Args &&...args) { - id_t id; + native_t id; auto res = life_traits::create (std::forward (args)..., &id); error::try_code (res); return id; @@ -75,7 +76,7 @@ namespace cruft::vk { /// another object. template struct descendant : public object { - using id_t = typename object::id_t; + using native_t = typename object::native_t; template descendant (Args &&...args): @@ -84,16 +85,16 @@ namespace cruft::vk { ~descendant () { - life_traits::destroy (this->id (), nullptr); + life_traits::destroy (this->native (), nullptr); } private: template static - id_t make (Base &&base, Args &&...args) + native_t make (Base &&base, Args &&...args) { - id_t id; - auto res = life_traits::create (base.id (), std::forward (args)..., &id); + native_t id; + auto res = life_traits::create (base.native (), std::forward (args)..., &id); error::try_code (res); return id; } @@ -116,30 +117,45 @@ namespace cruft::vk { /// the parent object. template struct owned : public object { - using id_t = typename object::id_t; + using native_t = typename object::native_t; using owner_t = OwnerT; using object::object; - + /////////////////////////////////////////////////////////////////////// template - owned (Args &&...args): - object (make (std::forward (args)...)) + owned (OwnerT &owner, Args &&...args): + object ( + error::try_query ( + life_traits::create, + owner.native (), + std::forward (args)... + ) + ) { ; } + //--------------------------------------------------------------------- + owned (owned &&rhs): + object (std::move (rhs)) + { ; } + + + //--------------------------------------------------------------------- ~owned () { - CHECK_EQ (this->id (), VK_NULL_HANDLE); + CHECK_EQ (this->native (), VK_NULL_HANDLE); } + //--------------------------------------------------------------------- void - destroy (OwnerT &parent) + destroy (OwnerT &owner) { - life_traits::destroy (parent.id (), this->id (), nullptr); - this->m_id = VK_NULL_HANDLE; + life_traits::destroy (owner.native (), this->native (), nullptr); + this->m_native = VK_NULL_HANDLE; } + }; private: @@ -152,6 +168,6 @@ namespace cruft::vk { return id; } }; -} +}; #endif diff --git a/physical_device.cpp b/physical_device.cpp index e0eed2c..30df6ed 100644 --- a/physical_device.cpp +++ b/physical_device.cpp @@ -28,11 +28,11 @@ std::set physical_device::extensions (void) const { uint32_t expected = 0; - error::try_code (vkEnumerateDeviceExtensionProperties (id (), nullptr, &expected, nullptr)); + error::try_code (vkEnumerateDeviceExtensionProperties (native (), nullptr, &expected, nullptr)); VkExtensionProperties props[expected]; uint32_t found = expected; - error::try_code (vkEnumerateDeviceExtensionProperties (id (), nullptr, &found, props)); + error::try_code (vkEnumerateDeviceExtensionProperties (native (), nullptr, &found, props)); std::set ext; for (const auto &i: props) @@ -45,7 +45,7 @@ VkPhysicalDeviceProperties physical_device::properties (void) const { VkPhysicalDeviceProperties props; - vkGetPhysicalDeviceProperties (id (), &props); + vkGetPhysicalDeviceProperties (native (), &props); return props; } @@ -55,7 +55,7 @@ VkPhysicalDeviceFeatures physical_device::features (void) const { VkPhysicalDeviceFeatures feat; - vkGetPhysicalDeviceFeatures (id (), &feat); + vkGetPhysicalDeviceFeatures (native (), &feat); return feat; } @@ -65,7 +65,7 @@ VkSurfaceCapabilitiesKHR physical_device::surface_capabilities (surface &_surface) const { return error::try_query ( - vkGetPhysicalDeviceSurfaceCapabilitiesKHR, id (), _surface.id () + vkGetPhysicalDeviceSurfaceCapabilitiesKHR, native (), _surface.native () ); } @@ -75,7 +75,7 @@ VkPhysicalDeviceMemoryProperties physical_device::memory_properties (void) const { return error::try_query ( - vkGetPhysicalDeviceMemoryProperties, id () + vkGetPhysicalDeviceMemoryProperties, native () ); } @@ -85,10 +85,10 @@ std::vector physical_device::queue_families (void) const { uint32_t count = 0; - vkGetPhysicalDeviceQueueFamilyProperties (id (), &count, nullptr); + vkGetPhysicalDeviceQueueFamilyProperties (native (), &count, nullptr); std::vector values (count); - vkGetPhysicalDeviceQueueFamilyProperties (id (), &count, values.data ()); + vkGetPhysicalDeviceQueueFamilyProperties (native (), &count, values.data ()); values.resize (count); return values; @@ -101,7 +101,7 @@ physical_device::surface_formats (surface &_surface) { return error::try_array ( vkGetPhysicalDeviceSurfaceFormatsKHR, - id (), _surface.id () + native (), _surface.native () ); } @@ -112,7 +112,7 @@ physical_device::present_modes (surface &_surface) { return error::try_array ( vkGetPhysicalDeviceSurfacePresentModesKHR, - id (), _surface.id () + native (), _surface.native () ); } diff --git a/queue.cpp b/queue.cpp index 009e883..8e79c19 100644 --- a/queue.cpp +++ b/queue.cpp @@ -26,7 +26,7 @@ using cruft::vk::queue; void queue::wait_idle (void) { - auto err = vkQueueWaitIdle (id ()); + auto err = vkQueueWaitIdle (native ()); error::try_code (err); } diff --git a/tools/hello.cpp b/tools/hello.cpp index cb3158d..3f76fb9 100644 --- a/tools/hello.cpp +++ b/tools/hello.cpp @@ -55,7 +55,7 @@ create_shader (cruft::vk::device &dev, const std::experimental::filesystem::path VkShaderModule value; cruft::vk::error::try_code ( - vkCreateShaderModule (dev.id (), &create_info, nullptr, &value) + vkCreateShaderModule (dev.native (), &create_info, nullptr, &value) ); return value; @@ -121,21 +121,20 @@ main (void) ; debug_info.pfnCallback = vk_debug_callback; - auto func = (decltype(&vkCreateDebugReportCallbackEXT))vkGetInstanceProcAddr (instance.id (),"vkCreateDebugReportCallbackEXT"); + auto func = (decltype(&vkCreateDebugReportCallbackEXT))vkGetInstanceProcAddr (instance.native (),"vkCreateDebugReportCallbackEXT"); cruft::vk::error::try_func ( - *func, instance.id (), &debug_info, nullptr, &callback + *func, instance.native (), &debug_info, nullptr, &callback ); } auto pdevices = cruft::vk::physical_device::find (instance); auto &pdevice = pdevices[0]; - cruft::vk::surface surface { - cruft::vk::error::try_query ( - glfwCreateWindowSurface, instance.id (), window, nullptr - ) - }; + VkSurfaceKHR surface_handle = cruft::vk::error::try_query ( + glfwCreateWindowSurface, instance.native (), window, nullptr + ); + cruft::vk::surface surface { surface_handle }; auto surface_capabilities = pdevice.surface_capabilities (surface); auto surface_formats = pdevice.surface_formats (surface); @@ -152,7 +151,7 @@ main (void) for (int i = 0, last = queues.size (); i != last; ++i) { if (cruft::vk::error::try_query (vkGetPhysicalDeviceSurfaceSupportKHR, - pdevice.id (), i, surface.id ())) { + pdevice.native (), i, surface.native ())) { present_queue_id = i; break; } @@ -229,7 +228,7 @@ main (void) .sType = cruft::vk::structure_type_v, .pNext = nullptr, .flags = {}, - .surface = surface.id (), + .surface = surface.native (), .minImageCount = image_count, .imageFormat = surface_format.format, .imageColorSpace = surface_format.colorSpace, @@ -248,15 +247,15 @@ main (void) VkSwapchainKHR swapchain; cruft::vk::error::try_code ( - vkCreateSwapchainKHR (ldevice.id (), &swap_create_info, nullptr, &swapchain) + vkCreateSwapchainKHR (ldevice.native (), &swap_create_info, nullptr, &swapchain) ); uint32_t swap_image_count = 0; cruft::vk::error::try_code ( - vkGetSwapchainImagesKHR (ldevice.id (), swapchain, &swap_image_count, nullptr) + vkGetSwapchainImagesKHR (ldevice.native (), swapchain, &swap_image_count, nullptr) ); std::vector swap_images = cruft::vk::error::try_array ( - vkGetSwapchainImagesKHR, ldevice.id (), swapchain + vkGetSwapchainImagesKHR, ldevice.native (), swapchain ); std::vector swap_image_views (swap_image_count); @@ -286,13 +285,14 @@ main (void) VkImageView v; cruft::vk::error::try_code ( - vkCreateImageView (ldevice.id (), &create_info, nullptr, &v) + vkCreateImageView (ldevice.native (), &create_info, nullptr, &v) ); return v; }); - auto graphics_queue = ldevice.queue (graphics_queue_id); + auto _graphics_queue = ldevice.queue (graphics_queue_id); + auto graphics_queue = &_graphics_queue; auto present_queue = ldevice.queue (present_queue_id); auto vert_module = create_shader (ldevice, "./hello.vert.spv"); @@ -305,11 +305,11 @@ main (void) buffer_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE; VkBuffer vertex_buffer = cruft::vk::error::try_query ( - vkCreateBuffer, ldevice.id (), &buffer_info, nullptr + vkCreateBuffer, ldevice.native (), &buffer_info, nullptr ); auto memory_requirements = cruft::vk::error::try_query ( - vkGetBufferMemoryRequirements, ldevice.id (), vertex_buffer + vkGetBufferMemoryRequirements, ldevice.native (), vertex_buffer ); auto memory_properties = pdevice.memory_properties (); @@ -327,18 +327,18 @@ main (void) } (); auto vertex_memory = cruft::vk::error::try_query ( - vkAllocateMemory, ldevice.id (), &allocate_info, nullptr + vkAllocateMemory, ldevice.native (), &allocate_info, nullptr ); cruft::vk::error::try_code ( - vkBindBufferMemory (ldevice.id (), vertex_buffer, vertex_memory, 0) + vkBindBufferMemory (ldevice.native (), vertex_buffer, vertex_memory, 0) ); auto data = cruft::vk::error::try_query ( - vkMapMemory, ldevice.id (), vertex_memory, 0, buffer_info.size, 0 + vkMapMemory, ldevice.native (), vertex_memory, 0, buffer_info.size, 0 ); memcpy (data, std::data (VERTICES), sizeof (VERTICES)); - vkUnmapMemory (ldevice.id (), vertex_memory); + vkUnmapMemory (ldevice.native (), vertex_memory); VkPipelineShaderStageCreateInfo vert_stage_info {}; vert_stage_info.sType = cruft::vk::structure_type_v; @@ -455,7 +455,7 @@ main (void) VkPipelineLayout pipeline_layout; cruft::vk::error::try_code ( - vkCreatePipelineLayout (ldevice.id (), &pipeline_layout_info, nullptr, &pipeline_layout) + vkCreatePipelineLayout (ldevice.native (), &pipeline_layout_info, nullptr, &pipeline_layout) ); VkAttachmentDescription color_attachment {}; @@ -486,7 +486,7 @@ main (void) VkRenderPass render_pass; cruft::vk::error::try_code ( - vkCreateRenderPass (ldevice.id (), &render_pass_info, nullptr, &render_pass) + vkCreateRenderPass (ldevice.native (), &render_pass_info, nullptr, &render_pass) ); VkGraphicsPipelineCreateInfo pipeline_info {}; @@ -509,7 +509,7 @@ main (void) VkPipeline graphics_pipeline; cruft::vk::error::try_code ( vkCreateGraphicsPipelines ( - ldevice.id (), VK_NULL_HANDLE, 1, &pipeline_info, nullptr, &graphics_pipeline + ldevice.native (), VK_NULL_HANDLE, 1, &pipeline_info, nullptr, &graphics_pipeline ) ); @@ -530,7 +530,7 @@ main (void) framebuffer_info.layers = 1; cruft::vk::error::try_code ( - vkCreateFramebuffer (ldevice.id (), &framebuffer_info, nullptr, &swapchain_framebuffers[i]) + vkCreateFramebuffer (ldevice.native (), &framebuffer_info, nullptr, &swapchain_framebuffers[i]) ); }; @@ -540,7 +540,7 @@ main (void) VkCommandPool command_pool; cruft::vk::error::try_code ( - vkCreateCommandPool (ldevice.id (), &pool_info, nullptr, &command_pool) + vkCreateCommandPool (ldevice.native (), &pool_info, nullptr, &command_pool) ); std::vector command_buffers (swapchain_framebuffers.size ()); @@ -550,7 +550,7 @@ main (void) alloc_info.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; alloc_info.commandBufferCount = (uint32_t) command_buffers.size(); cruft::vk::error::try_code ( - vkAllocateCommandBuffers (ldevice.id (), &alloc_info, command_buffers.data ()) + vkAllocateCommandBuffers (ldevice.native (), &alloc_info, command_buffers.data ()) ); for (size_t i = 0; i < command_buffers.size (); ++i) { @@ -591,16 +591,16 @@ main (void) semaphore_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; VkSemaphore image_semaphore, render_semaphore; cruft::vk::error::try_code ( - vkCreateSemaphore (ldevice.id (), &semaphore_info, nullptr, &image_semaphore) + vkCreateSemaphore (ldevice.native (), &semaphore_info, nullptr, &image_semaphore) ); cruft::vk::error::try_code ( - vkCreateSemaphore (ldevice.id (), &semaphore_info, nullptr, &render_semaphore) + vkCreateSemaphore (ldevice.native (), &semaphore_info, nullptr, &render_semaphore) ); uint32_t image_index; cruft::vk::error::try_code ( vkAcquireNextImageKHR ( - ldevice.id (), swapchain, + ldevice.native (), swapchain, std::numeric_limits::max (), image_semaphore, VK_NULL_HANDLE, &image_index @@ -622,7 +622,7 @@ main (void) submit_info.pSignalSemaphores = signal_semaphores; cruft::vk::error::try_code ( - vkQueueSubmit (graphics_queue.id (), 1, &submit_info, VK_NULL_HANDLE) + vkQueueSubmit (graphics_queue->native (), 1, &submit_info, VK_NULL_HANDLE) ); VkSubpassDependency dependency {}; @@ -645,14 +645,14 @@ main (void) present_info.pImageIndices = &image_index; present_info.pResults = nullptr; - cruft::vk::error::try_func (vkQueuePresentKHR, present_queue.id (), &present_info); + cruft::vk::error::try_func (vkQueuePresentKHR, present_queue.native (), &present_info); LOG_INFO ("entering runloop"); while (!glfwWindowShouldClose (window)) { glfwPollEvents (); } - cruft::vk::error::try_func (vkDeviceWaitIdle, ldevice.id ()); + cruft::vk::error::try_func (vkDeviceWaitIdle, ldevice.native ()); LOG_INFO ("terminating glfw"); glfwDestroyWindow (window);