Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::render::GpuDevice Class Reference

Typed handle to the device a GpuSurface owns. Copies share it. More...

#include <gpu_pass.hpp>

Public Member Functions

 GpuDevice ()=default
bool valid () const noexcept
bool is_lost () const
 True once Dawn reports the device lost. Non-blocking.
const GpuDeviceCapabilities & capabilities () const
GpuResult< GpuTexture > create_texture (const GpuTextureDesc &desc) const
GpuResult< GpuBuffer > create_buffer (const GpuBufferDesc &desc) const
GpuResult< GpuSampler > create_sampler (const GpuSamplerDesc &desc={}) const
GpuResult< GpuShaderModule > create_shader_module (std::string_view wgsl, std::string_view label={}) const
 Compile WGSL.
GpuResult< GpuRenderPipeline > create_render_pipeline (const GpuRenderPipelineDesc &desc) const
GpuResult< GpuComputePipeline > create_compute_pipeline (const GpuComputePipelineDesc &desc) const
GpuResult< GpuBindGroup > create_bind_group (const GpuRenderPipeline &pipeline, std::uint32_t group, const std::vector< GpuBinding > &bindings) const
 Bind group group of a pipeline's automatic layout.
GpuResult< GpuBindGroup > create_bind_group (const GpuComputePipeline &pipeline, std::uint32_t group, const std::vector< GpuBinding > &bindings) const
GpuResult< GpuTarget > create_target (const GpuTargetDesc &desc) const
GpuStatus write_buffer (const GpuBuffer &buffer, std::uint64_t offset, const void *data, std::size_t size) const
 Queue a buffer write.
void process_events () const
 Run pending Dawn callbacks once (submission status, readback).

Static Public Member Functions

static GpuResult< GpuDevice > from_surface (GpuSurface &surface)
 Wrap the surface's device, queue and instance.

Friends

struct detail::GpuAccess

Detailed Description

Typed handle to the device a GpuSurface owns. Copies share it.

Constructor & Destructor Documentation

◆ GpuDevice()

pulp::render::GpuDevice::GpuDevice ( )
default

Member Function Documentation

◆ capabilities()

const GpuDeviceCapabilities & pulp::render::GpuDevice::capabilities ( ) const

◆ create_bind_group() [1/2]

GpuResult< GpuBindGroup > pulp::render::GpuDevice::create_bind_group ( const GpuComputePipeline & pipeline,
std::uint32_t group,
const std::vector< GpuBinding > & bindings ) const

◆ create_bind_group() [2/2]

GpuResult< GpuBindGroup > pulp::render::GpuDevice::create_bind_group ( const GpuRenderPipeline & pipeline,
std::uint32_t group,
const std::vector< GpuBinding > & bindings ) const

Bind group group of a pipeline's automatic layout.

◆ create_buffer()

GpuResult< GpuBuffer > pulp::render::GpuDevice::create_buffer ( const GpuBufferDesc & desc) const

◆ create_compute_pipeline()

GpuResult< GpuComputePipeline > pulp::render::GpuDevice::create_compute_pipeline ( const GpuComputePipelineDesc & desc) const

◆ create_render_pipeline()

GpuResult< GpuRenderPipeline > pulp::render::GpuDevice::create_render_pipeline ( const GpuRenderPipelineDesc & desc) const

◆ create_sampler()

GpuResult< GpuSampler > pulp::render::GpuDevice::create_sampler ( const GpuSamplerDesc & desc = {}) const

◆ create_shader_module()

GpuResult< GpuShaderModule > pulp::render::GpuDevice::create_shader_module ( std::string_view wgsl,
std::string_view label = {} ) const

Compile WGSL.

A compile error fails with shader_compilation and the compiler's line/column diagnostics; label names the source in them.

◆ create_target()

GpuResult< GpuTarget > pulp::render::GpuDevice::create_target ( const GpuTargetDesc & desc) const

◆ create_texture()

GpuResult< GpuTexture > pulp::render::GpuDevice::create_texture ( const GpuTextureDesc & desc) const

◆ from_surface()

GpuResult< GpuDevice > pulp::render::GpuDevice::from_surface ( GpuSurface & surface)
static

Wrap the surface's device, queue and instance.

Fails with unavailable before the surface is initialized, or in a build without Dawn. The surface must outlive the returned device and every object created from it.

◆ is_lost()

bool pulp::render::GpuDevice::is_lost ( ) const

True once Dawn reports the device lost. Non-blocking.

◆ process_events()

void pulp::render::GpuDevice::process_events ( ) const

Run pending Dawn callbacks once (submission status, readback).

◆ valid()

bool pulp::render::GpuDevice::valid ( ) const
noexcept

◆ write_buffer()

GpuStatus pulp::render::GpuDevice::write_buffer ( const GpuBuffer & buffer,
std::uint64_t offset,
const void * data,
std::size_t size ) const

Queue a buffer write.

It executes before any later submission, so write uniforms first and then submit the frame that reads them.

◆ detail::GpuAccess

friend struct detail::GpuAccess
friend

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/render/include/pulp/render/gpu_pass.hpp