Files
aurora/lib/gx/pipeline.hpp
T
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

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