mirror of
https://github.com/patchzyy/wiicompiled
synced 2026-09-12 09:45:04 -04:00
32 lines
836 B
C++
32 lines
836 B
C++
#pragma once
|
|
|
|
#include "common.hpp"
|
|
|
|
#include <webgpu/webgpu_cpp.h>
|
|
|
|
namespace aurora::gfx::clear {
|
|
struct DrawData {
|
|
PipelineRef pipeline;
|
|
Range uniformRange;
|
|
wgpu::Color color;
|
|
float depth = 0.f;
|
|
bool useScissor = false;
|
|
ClipRect scissor{};
|
|
};
|
|
|
|
constexpr uint32_t ClearPipelineConfigVersion = 3;
|
|
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,
|
|
PipelineRef& currentPipeline);
|
|
} // namespace aurora::gfx::clear
|