metaforce/NESEmulator/CNESShader.cpp

25 lines
1.1 KiB
C++
Raw Normal View History

2018-02-01 23:19:34 +00:00
#include "CNESShader.hpp"
#include "Graphics/CGraphics.hpp"
2018-10-07 02:59:17 +00:00
#include "hecl/Pipeline.hpp"
2018-02-01 23:19:34 +00:00
2021-04-10 08:42:06 +00:00
namespace metaforce::MP1 {
2018-02-01 23:19:34 +00:00
boo::ObjToken<boo::IShaderPipeline> CNESShader::g_Pipeline;
2018-12-08 05:30:43 +00:00
void CNESShader::Initialize() { g_Pipeline = hecl::conv->convert(Shader_CNESShader{}); }
2018-02-01 23:19:34 +00:00
2018-10-07 02:59:17 +00:00
boo::ObjToken<boo::IShaderDataBinding> CNESShader::BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
2018-02-01 23:19:34 +00:00
boo::ObjToken<boo::IGraphicsBufferS> vbo,
boo::ObjToken<boo::IGraphicsBufferD> uniBuf,
2018-12-08 05:30:43 +00:00
boo::ObjToken<boo::ITextureD> tex) {
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {uniBuf.get()};
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
boo::ObjToken<boo::ITexture> texs[] = {tex.get()};
return ctx.newShaderDataBinding(g_Pipeline, vbo.get(), nullptr, nullptr, 1, bufs, stages, nullptr, nullptr, 1, texs,
nullptr, nullptr);
2018-02-01 23:19:34 +00:00
}
2018-12-08 05:30:43 +00:00
void CNESShader::Shutdown() { g_Pipeline.reset(); }
2018-02-01 23:19:34 +00:00
2021-04-10 08:42:06 +00:00
} // namespace metaforce::MP1