mirror of
https://github.com/encounter/aurora.git
synced 2026-07-09 18:19:33 -07:00
33ec54347d
* Add offscreen rendering support & GXSetTexCopyDst * Try to fix alignment for MSVC
28 lines
723 B
C++
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
|