diff --git a/physical_device.cpp b/physical_device.cpp index 58527da..e0eed2c 100644 --- a/physical_device.cpp +++ b/physical_device.cpp @@ -18,6 +18,7 @@ #include "./physical_device.hpp" #include "./except.hpp" +#include "./surface.hpp" using cruft::vk::physical_device; @@ -61,10 +62,10 @@ physical_device::features (void) const //----------------------------------------------------------------------------- VkSurfaceCapabilitiesKHR -physical_device::surface_capabilities (VkSurfaceKHR surface) const +physical_device::surface_capabilities (surface &_surface) const { return error::try_query ( - vkGetPhysicalDeviceSurfaceCapabilitiesKHR, id (), surface + vkGetPhysicalDeviceSurfaceCapabilitiesKHR, id (), _surface.id () ); } @@ -94,6 +95,28 @@ physical_device::queue_families (void) const } +/////////////////////////////////////////////////////////////////////////////// +std::vector +physical_device::surface_formats (surface &_surface) +{ + return error::try_array ( + vkGetPhysicalDeviceSurfaceFormatsKHR, + id (), _surface.id () + ); +} + + +//----------------------------------------------------------------------------- +std::vector +physical_device::present_modes (surface &_surface) +{ + return error::try_array ( + vkGetPhysicalDeviceSurfacePresentModesKHR, + id (), _surface.id () + ); +} + + /////////////////////////////////////////////////////////////////////////////// std::string physical_device::name (void) const diff --git a/physical_device.hpp b/physical_device.hpp index 65a29b6..d65ac8f 100644 --- a/physical_device.hpp +++ b/physical_device.hpp @@ -33,11 +33,14 @@ namespace cruft::vk { VkPhysicalDeviceProperties properties (void) const; VkPhysicalDeviceFeatures features (void) const; - VkSurfaceCapabilitiesKHR surface_capabilities (VkSurfaceKHR) const; + VkSurfaceCapabilitiesKHR surface_capabilities (surface&) const; VkPhysicalDeviceMemoryProperties memory_properties (void) const; std::vector queue_families (void) const; + std::vector surface_formats (surface&); + std::vector present_modes (surface&); + std::string name (void) const; }; }