Typed custom GPU passes on Pulp's shared Dawn device. More...
#include <pulp/render/gpu_capabilities.hpp>#include <pulp/render/gpu_surface.hpp>#include <pulp/render/wgsl_diagnostics.hpp>#include <pulp/runtime/result.hpp>#include <array>#include <chrono>#include <cstddef>#include <cstdint>#include <memory>#include <optional>#include <string>#include <string_view>#include <vector>Go to the source code of this file.
Namespaces | |
| namespace | pulp |
| namespace | pulp::canvas |
| namespace | pulp::render |
| namespace | pulp::render::detail |
Typedefs | |
| template<typename T> | |
| using | pulp::render::GpuResult = runtime::Result<T, GpuError> |
| using | pulp::render::GpuStatus = runtime::Result<void, GpuError> |
| Success is a default-constructed value. | |
Functions | |
| std::string_view | pulp::render::gpu_error_kind_name (GpuError::Kind kind) |
| constexpr GpuTextureUsage | pulp::render::operator| (GpuTextureUsage a, GpuTextureUsage b) |
| constexpr bool | pulp::render::has_usage (GpuTextureUsage set, GpuTextureUsage bit) |
| constexpr GpuBufferUsage | pulp::render::operator| (GpuBufferUsage a, GpuBufferUsage b) |
| constexpr bool | pulp::render::has_usage (GpuBufferUsage set, GpuBufferUsage bit) |
| GpuStatus | pulp::render::draw_gpu_texture (canvas::Canvas &canvas, const GpuTexture &texture, float x, float y, float w, float h) |
| Draw texture into the canvas rectangle (x, y, w, h). | |
Typed custom GPU passes on Pulp's shared Dawn device.
A View that needs its own WGSL draws records render or compute passes on the same wgpu::Device Skia Graphite draws the UI with, then composites the result through the canvas:
auto device = GpuDevice::from_surface(*host.gpu_surface()); // once auto shader = device->create_shader_module(kMyWgsl, "glow"); // once auto pipeline = device->create_render_pipeline({...}); // once auto target = device->create_target({.width = w, .height = h});
// per frame, inside View::paint(): { GpuFrame frame(*device, "glow"); auto pass = frame.render_pass(GpuRenderPassDesc::for_target(*target, {0, 0, 0, 1})); pass.set_pipeline(*pipeline); pass.draw(3); pass.end(); frame.submit(); } draw_gpu_texture(canvas, target->color(), 0, 0, w, h);
The header names no Dawn type. Every object is a reference-counted handle to state that lives in the implementation; copies share it.
Ownership and ordering rules (all load-bearing):