KDGpu::Adapter
Module: Public API
Adapter is a representation of a physical hardware device. More...
#include <KDGpu/adapter.h>
Public Functions
Protected Functions
Protected Attributes
Friends
Detailed Description
Adapter is a representation of a physical hardware device.
See:
Adapter instances are provided by the Instance. The Adapter is used to query what the underlying physical hardware supports. In turn, a logical Device can be created from the Adapter.
1
2
3
4
5
6
7
8
9
10
11
12
13 | using namespace KDGpu;
Adapter *selectedAdapter = instance.selectAdapter(AdapterDeviceType::Default);
if (!selectedAdapter)
return;
auto queueTypes = selectedAdapter->queueTypes();
const bool hasGraphicsAndCompute = queueTypes[0].supportsFeature(QueueFlags(QueueFlagBits::GraphicsBit) | QueueFlags(QueueFlagBits::ComputeBit));
const bool supportsPresentation = selectedAdapter->supportsPresentation(surface, 0);
if (!supportsPresentation || !hasGraphicsAndCompute)
return;
...
|
Public Functions Documentation
function Adapter
function ~Adapter
function Adapter
| Adapter(
Adapter && other
)
|
function operator=
| Adapter & operator=(
Adapter && other
)
|
function Adapter
| Adapter(
const Adapter &
) =delete
|
function operator=
| Adapter & operator=(
const Adapter &
) =delete
|
function handle
| inline Handle< Adapter_t > handle() const
|
Returns the handle used to retrieve the underlying API specific Adapter.
See: ResourceManager
function isValid
| inline bool isValid() const
|
Convenience function to check whether the Adapter is actually referencing a valid API specific resource.
function operator Handle< Adapter_t >
| inline operator Handle< Adapter_t >() const
|
function extensions
| std::vector< Extension > extensions() const
|
function properties
| const AdapterProperties & properties() const
|
Returns the AdapterFeatures supported by the Adapter.
function features
| const AdapterFeatures & features() const
|
Returns the AdapterFeatures supported by the Adapter.
function queueTypes
| std::span< AdapterQueueType > queueTypes() const
|
Returns the AdapterQueueType supported by the Adapter.
function swapchainProperties
| AdapterSwapchainProperties swapchainProperties(
const Handle< Surface_t > & surface
) const
|
Returns the AdapterSwapchainProperties supported for Surfacesurface.
function supportsPresentation
| bool supportsPresentation(
const Handle< Surface_t > & surface,
uint32_t queueTypeIndex
) const
|
Returns whether presentation is supported for surface and queueTypeIndex.
| FormatProperties formatProperties(
Format format
) const
|
Returns the FormatProperties for Format @format supported by the Adapter.
function supportsBlitting
| bool supportsBlitting(
Format srcFormat,
TextureTiling srcTiling,
Format dstFormat,
TextureTiling dstTiling
) const
|
function supportsBlitting
| bool supportsBlitting(
Format format,
TextureTiling tiling
) const
|
| std::vector< DrmFormatModifierProperties > drmFormatModifierProperties(
Format format
) const
|
function createDevice
| Device createDevice(
const DeviceOptions & options =DeviceOptions()
)
|
Create a Device object.
Parameters:
Return: Device
Protected Functions Documentation
function Adapter
| explicit Adapter(
GraphicsApi * api,
const Handle< Adapter_t > & adapter
)
|
Protected Attributes Documentation
variable m_api
| GraphicsApi * m_api { nullptr };
|
variable m_adapter
| Handle< Adapter_t > m_adapter;
|
variable m_properties
| AdapterProperties m_properties;
|
variable m_features
| AdapterFeatures m_features;
|
variable m_queueTypes
| std::vector< AdapterQueueType > m_queueTypes;
|
Friends
friend Instance
| friend class Instance(
Instance
);
|
friend VulkanGraphicsApi
| friend class VulkanGraphicsApi(
VulkanGraphicsApi
);
|
Updated on 2026-01-20 at 00:03:57 +0000