metaforce/aurora/lib/gfx/model/shader.hpp

39 lines
899 B
C++
Raw Normal View History

#pragma once
#include "../common.hpp"
#include "../gx.hpp"
2022-03-07 23:53:42 +00:00
#include <unordered_map>
namespace aurora::gfx::model {
struct DrawData {
PipelineRef pipeline;
Range vertRange;
2022-03-08 05:28:31 +00:00
Range idxRange;
Range sVtxRange;
Range sNrmRange;
Range sTcRange;
Range sPackedTcRange;
Range uniformRange;
2022-03-08 05:28:31 +00:00
uint32_t indexCount;
gx::GXBindGroups bindGroups;
};
2022-03-07 23:53:42 +00:00
struct PipelineConfig : gx::PipelineConfig {
2022-03-08 05:28:31 +00:00
};
struct CachedBindGroup {
wgpu::BindGroupLayout layout;
wgpu::BindGroup bindGroup;
CachedBindGroup(wgpu::BindGroupLayout layout, wgpu::BindGroup&& group)
: layout(std::move(layout)), bindGroup(std::move(group)) {}
};
struct State {
};
State construct_state();
wgpu::RenderPipeline create_pipeline(const State& state, [[maybe_unused]] PipelineConfig config);
void render(const State& state, const DrawData& data, const wgpu::RenderPassEncoder& pass);
} // namespace aurora::gfx::model