Vireo  0.0
Vireo 3D Rendering Hardware Interface
Backend instances, physical devices and logical devices

The Instance, PhysicalDevice and Device are opaque classes that encapsulate the corresponding backends concepts :

  • Vulkan : VkInstance, VkPhysicalDevice and VkDevice
  • DirectX : IDXGIFactory4, IDXGIAdapter4 and ID3D12Device

These classes are responsible for the backend initialization and for selecting the best GPU available on the host. If no supported GPU is detected a vireo::Exception is raised when creating the Vireo object.

The vireo::PhysicalDevice::getDescription who returns a description of the selected GPU adapter :

const auto& adapterDesc = vireo->getPhysicalDevice()->getDescription();
std::wcout << adapterDesc.name << L" " << std::to_wstring(adapterDesc.dedicatedVideoMemory / 1024 / 1024) << L"Mb" << std::endl;

Driver memory usage

vireo::Device::getMemoryUsage returns an optional snapshot of the current process's device-local memory usage, in bytes, independently of Vireo allocation tracking.

if (const auto usage = vireo->getDevice()->getMemoryUsage()) {
std::cout << usage->usedBytes << " / " << usage->budgetBytes << " bytes\n";
}