44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
#include "./device.hpp"
|
|
|
|
#include "./physical_device.hpp"
|
|
|
|
using vk::device;
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
device::device (const physical_device &phys,
|
|
const VkDeviceCreateInfo &info):
|
|
instantiated (phys.id (), &info, nullptr)
|
|
{ ; }
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
VkPhysicalDeviceMemoryProperties
|
|
device::physical_properties (void) const
|
|
{
|
|
VkPhysicalDeviceMemoryProperties props;
|
|
vkGetPhysicalDeviceMemoryProperties (id (), &props);
|
|
return props;
|
|
}
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
void
|
|
device::flush (const VkMappedMemoryRange *first,
|
|
const VkMappedMemoryRange *last)
|
|
{
|
|
auto err = vkFlushMappedMemoryRanges (id (), last - first, first);
|
|
error::try_code (err);
|
|
}
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
void
|
|
device::invalidate (const VkMappedMemoryRange *first,
|
|
const VkMappedMemoryRange *last)
|
|
{
|
|
auto err = vkInvalidateMappedMemoryRanges (id (), last - first, first);
|
|
error::try_code (err);
|
|
}
|
|
|