physical_device: add surface queries
This commit is contained in:
parent
140a94759f
commit
d18362e542
@ -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<VkSurfaceFormatKHR>
|
||||
physical_device::surface_formats (surface &_surface)
|
||||
{
|
||||
return error::try_array (
|
||||
vkGetPhysicalDeviceSurfaceFormatsKHR,
|
||||
id (), _surface.id ()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::vector<VkPresentModeKHR>
|
||||
physical_device::present_modes (surface &_surface)
|
||||
{
|
||||
return error::try_array (
|
||||
vkGetPhysicalDeviceSurfacePresentModesKHR,
|
||||
id (), _surface.id ()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
std::string
|
||||
physical_device::name (void) const
|
||||
|
@ -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<VkQueueFamilyProperties> queue_families (void) const;
|
||||
|
||||
std::vector<VkSurfaceFormatKHR> surface_formats (surface&);
|
||||
std::vector<VkPresentModeKHR> present_modes (surface&);
|
||||
|
||||
std::string name (void) const;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user