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
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "../gfx/common.hpp"
|
|
#include "gx.hpp"
|
|
|
|
namespace aurora::gx {
|
|
struct DrawData {
|
|
gfx::PipelineRef pipeline;
|
|
gfx::Range vertRange;
|
|
gfx::Range idxRange;
|
|
BindGroupRanges dataRanges;
|
|
gfx::Range uniformRange;
|
|
uint32_t vtxCount;
|
|
uint32_t indexCount;
|
|
uint32_t instanceCount;
|
|
GXBindGroups bindGroups;
|
|
uint32_t dstAlpha;
|
|
};
|
|
|
|
constexpr uint32_t GXPipelineConfigVersion = 11;
|
|
struct PipelineConfig {
|
|
uint32_t version = GXPipelineConfigVersion;
|
|
uint32_t msaaSamples = 1;
|
|
ShaderConfig shaderConfig;
|
|
GXCompare depthFunc;
|
|
GXCullMode cullMode;
|
|
GXBlendMode blendMode;
|
|
GXBlendFactor blendFacSrc, blendFacDst;
|
|
GXLogicOp blendOp;
|
|
uint32_t dstAlpha;
|
|
bool depthCompare, depthUpdate, alphaUpdate, colorUpdate;
|
|
};
|
|
static_assert(std::has_unique_object_representations_v<PipelineConfig>);
|
|
|
|
wgpu::RenderPipeline create_pipeline([[maybe_unused]] const PipelineConfig& config);
|
|
void render(const DrawData& data, const wgpu::RenderPassEncoder& pass);
|
|
|
|
void queue_surface(const u8* dlStart, uint32_t dlSize, bool bigEndian) noexcept;
|
|
} // namespace aurora::gx
|