Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
gpu_capabilities.hpp File Reference

What the shared Dawn device can render, as plain data. More...

#include <cstdint>
#include <string_view>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::render::GpuDeviceFeatures
 Optional device features that change what a format can do. More...
struct  pulp::render::GpuFormatSupport
 What one format supports on a device. More...
struct  pulp::render::GpuDeviceFacts
 The facts pick_tier() reads. A test can build one by hand. More...
struct  pulp::render::GpuDeviceCapabilities
 Rendering capabilities of the shared device. More...

Namespaces

namespace  pulp
namespace  pulp::render

Enumerations

enum class  pulp::render::GpuFormat : std::uint8_t {
  pulp::render::undefined , pulp::render::r8_unorm , pulp::render::rg8_unorm , pulp::render::rgba8_unorm ,
  pulp::render::rgba8_unorm_srgb , pulp::render::bgra8_unorm , pulp::render::bgra8_unorm_srgb , pulp::render::rgb10a2_unorm ,
  pulp::render::rg11b10_ufloat , pulp::render::r16_float , pulp::render::rg16_float , pulp::render::rgba16_float ,
  pulp::render::r32_float , pulp::render::rg32_float , pulp::render::rgba32_float , pulp::render::r32_uint ,
  pulp::render::rgba8_uint , pulp::render::depth16_unorm , pulp::render::depth24_plus , pulp::render::depth24_plus_stencil8 ,
  pulp::render::depth32_float
}
 Texture formats the typed GPU API accepts. More...
enum class  pulp::render::GpuAdapterKind : std::uint8_t { pulp::render::unknown , pulp::render::integrated , pulp::render::discrete , pulp::render::cpu }
 Adapter class as Dawn reports it. More...
enum class  pulp::render::GpuRenderTier : std::uint8_t { pulp::render::none , pulp::render::basic , pulp::render::standard , pulp::render::high }
 Coarse rendering tier for choosing a visual path. More...

Functions

const std::vector< GpuFormat > & pulp::render::all_gpu_formats ()
 Every format above except undefined, in declaration order.
std::string_view pulp::render::gpu_format_name (GpuFormat format)
 WebGPU spelling of a format ("rgba8unorm"), or "undefined".
std::uint32_t pulp::render::gpu_format_bytes_per_pixel (GpuFormat format)
 Bytes per texel for color formats, 0 for depth/stencil and undefined (depth texels have no defined CPU layout and cannot be read back).
bool pulp::render::gpu_format_is_depth (GpuFormat format)
 True for depth and depth/stencil formats.
GpuFormatSupport pulp::render::gpu_format_support (GpuFormat format, const GpuDeviceFeatures &features)
 The WebGPU format table for format, adjusted for features. Pure.
void pulp::render::fill_format_table (GpuDeviceCapabilities &caps)
 Fill the format table of caps from caps.facts.features. Pure.
std::string_view pulp::render::gpu_render_tier_name (GpuRenderTier tier)
GpuRenderTier pulp::render::pick_tier (const GpuDeviceFacts &facts)
 Pure: the same facts always give the same tier.

Detailed Description

What the shared Dawn device can render, as plain data.

GpuDeviceCapabilities is filled from the device's wgpu::Limits, its enabled features and the WebGPU format tables. pick_tier() reduces the facts to a coarse rendering tier. Everything here is pure data and pure functions: it names no Dawn type and needs no GPU, so a View can choose a rendering path, and a test can cover that choice, without a device.