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 |
Typed handle to the device a GpuSurface owns. Copies share it.
|
default |
| const GpuDeviceCapabilities & pulp::render::GpuDevice::capabilities | ( | ) | const |
| GpuResult< GpuBindGroup > pulp::render::GpuDevice::create_bind_group | ( | const GpuComputePipeline & | pipeline, |
| std::uint32_t | group, | ||
| const std::vector< GpuBinding > & | bindings ) const |
| 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.
| GpuResult< GpuBuffer > pulp::render::GpuDevice::create_buffer | ( | const GpuBufferDesc & | desc | ) | const |
| GpuResult< GpuComputePipeline > pulp::render::GpuDevice::create_compute_pipeline | ( | const GpuComputePipelineDesc & | desc | ) | const |
| GpuResult< GpuRenderPipeline > pulp::render::GpuDevice::create_render_pipeline | ( | const GpuRenderPipelineDesc & | desc | ) | const |
| GpuResult< GpuSampler > pulp::render::GpuDevice::create_sampler | ( | const GpuSamplerDesc & | desc = {} | ) | const |
| 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.
| GpuResult< GpuTarget > pulp::render::GpuDevice::create_target | ( | const GpuTargetDesc & | desc | ) | const |
| GpuResult< GpuTexture > pulp::render::GpuDevice::create_texture | ( | const GpuTextureDesc & | desc | ) | const |
|
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.
| bool pulp::render::GpuDevice::is_lost | ( | ) | const |
True once Dawn reports the device lost. Non-blocking.
| void pulp::render::GpuDevice::process_events | ( | ) | const |
Run pending Dawn callbacks once (submission status, readback).
|
noexcept |
| 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.
|
friend |