Files
Luke Street 33ec54347d Add offscreen rendering support & GXSetTexCopyDst (#89)
* Add offscreen rendering support & GXSetTexCopyDst

* Try to fix alignment for MSVC
2026-04-02 23:01:14 -06:00

28 lines
723 B
C++

#pragma once
#include "common.hpp"
#include <webgpu/webgpu_cpp.h>
namespace aurora::gfx::clear {
struct DrawData {
PipelineRef pipeline;
wgpu::Color color;
float depth = 0.f;
};
constexpr uint32_t ClearPipelineConfigVersion = 2;
struct PipelineConfig {
uint32_t version = ClearPipelineConfigVersion;
uint32_t msaaSamples = 1;
bool clearColor = true;
bool clearAlpha = true;
bool clearDepth = true;
uint8_t _pad = 0;
};
static_assert(std::has_unique_object_representations_v<PipelineConfig>);
wgpu::RenderPipeline create_pipeline(const PipelineConfig& config);
void render(const DrawData& data, const wgpu::RenderPassEncoder& pass, const wgpu::Extent3D& targetSize);
} // namespace aurora::gfx::clear