Skip to content

KDGpu::Device

Module: Public API

Device is our main entry point to create Graphics Resources. More...

#include <KDGpu/device.h>

Public Functions

Name
Device()
~Device()
Device(Device && other)
Device & operator=(Device && other)
Device(const Device & ) =delete
Device & operator=(const Device & ) =delete
Handle< Device_t > handle() const
Returns the handle used to retrieve the underlying API specific Device.
bool isValid() const
Convenience function to check whether the Device is actually referencing a valid API specific resource.
operator Handle< Device_t >() const
std::span< Queue > queues()
Returns the queues available on the device.
void waitUntilIdle()
Forces a CPU side blocking wait until the underlying device has completed execution of all its pending commands.
const Adapter * adapter() const
Swapchain createSwapchain(const SwapchainOptions & options)
Texture createTexture(const TextureOptions & options)
Buffer createBuffer(const BufferOptions & options, const void * initialData =nullptr)
ShaderModule createShaderModule(const std::vector< uint32_t > & code)
RenderPass createRenderPass(const RenderPassOptions & options)
PipelineLayout createPipelineLayout(const PipelineLayoutOptions & options =PipelineLayoutOptions())
GraphicsPipeline createGraphicsPipeline(const GraphicsPipelineOptions & options)
ComputePipeline createComputePipeline(const ComputePipelineOptions & options)
RayTracingPipeline createRayTracingPipeline(const RayTracingPipelineOptions & options)
CommandRecorder createCommandRecorder(const CommandRecorderOptions & options =CommandRecorderOptions())
GpuSemaphore createGpuSemaphore(const GpuSemaphoreOptions & options =GpuSemaphoreOptions())
BindGroupLayout createBindGroupLayout(const BindGroupLayoutOptions & options)
BindGroup createBindGroup(const BindGroupOptions & options)
Sampler createSampler(const SamplerOptions & options =SamplerOptions())
Fence createFence(const FenceOptions & options =FenceOptions())
AccelerationStructure createAccelerationStructure(const AccelerationStructureOptions & options =AccelerationStructureOptions())
GraphicsApi * graphicsApi() const

Friends

Name
class Adapter
class VulkanGraphicsApi

Detailed Description

1
class KDGpu::Device;

Device is our main entry point to create Graphics Resources.

See: Adapter::createDevice

1
2
3
4
using namespace KDGpu;

Adapter *selectedAdapter = instance.selectAdapter(AdapterDeviceType::Default);
Device device = selectedAdapter->createDevice();

Public Functions Documentation

function Device

1
Device()

function ~Device

1
~Device()

function Device

1
2
3
Device(
    Device && other
)

function operator=

1
2
3
Device & operator=(
    Device && other
)

function Device

1
2
3
Device(
    const Device & 
) =delete

function operator=

1
2
3
Device & operator=(
    const Device & 
) =delete

function handle

1
inline Handle< Device_t > handle() const

Returns the handle used to retrieve the underlying API specific Device.

See: ResourceManager

function isValid

1
inline bool isValid() const

Convenience function to check whether the Device is actually referencing a valid API specific resource.

function operator Handle< Device_t >

1
inline operator Handle< Device_t >() const

function queues

1
inline std::span< Queue > queues()

Returns the queues available on the device.

function waitUntilIdle

1
void waitUntilIdle()

Forces a CPU side blocking wait until the underlying device has completed execution of all its pending commands.

function adapter

1
const Adapter * adapter() const

function createSwapchain

1
2
3
Swapchain createSwapchain(
    const SwapchainOptions & options
)

function createTexture

1
2
3
Texture createTexture(
    const TextureOptions & options
)

function createBuffer

1
2
3
4
Buffer createBuffer(
    const BufferOptions & options,
    const void * initialData =nullptr
)

function createShaderModule

1
2
3
ShaderModule createShaderModule(
    const std::vector< uint32_t > & code
)

function createRenderPass

1
2
3
RenderPass createRenderPass(
    const RenderPassOptions & options
)

function createPipelineLayout

1
2
3
PipelineLayout createPipelineLayout(
    const PipelineLayoutOptions & options =PipelineLayoutOptions()
)

function createGraphicsPipeline

1
2
3
GraphicsPipeline createGraphicsPipeline(
    const GraphicsPipelineOptions & options
)

function createComputePipeline

1
2
3
ComputePipeline createComputePipeline(
    const ComputePipelineOptions & options
)

function createRayTracingPipeline

1
2
3
RayTracingPipeline createRayTracingPipeline(
    const RayTracingPipelineOptions & options
)

function createCommandRecorder

1
2
3
CommandRecorder createCommandRecorder(
    const CommandRecorderOptions & options =CommandRecorderOptions()
)

function createGpuSemaphore

1
2
3
GpuSemaphore createGpuSemaphore(
    const GpuSemaphoreOptions & options =GpuSemaphoreOptions()
)

function createBindGroupLayout

1
2
3
BindGroupLayout createBindGroupLayout(
    const BindGroupLayoutOptions & options
)

function createBindGroup

1
2
3
BindGroup createBindGroup(
    const BindGroupOptions & options
)

function createSampler

1
2
3
Sampler createSampler(
    const SamplerOptions & options =SamplerOptions()
)

function createFence

1
2
3
Fence createFence(
    const FenceOptions & options =FenceOptions()
)

function createAccelerationStructure

1
2
3
AccelerationStructure createAccelerationStructure(
    const AccelerationStructureOptions & options =AccelerationStructureOptions()
)

function graphicsApi

1
GraphicsApi * graphicsApi() const

Friends

friend Adapter

1
2
3
friend class Adapter(
    Adapter 
);

friend VulkanGraphicsApi

1
2
3
friend class VulkanGraphicsApi(
    VulkanGraphicsApi 
);

Updated on 2024-12-29 at 00:12:08 +0000