metaforce/Runtime/Graphics/Shaders/CMapSurfaceShader.cpp

41 lines
1.5 KiB
C++
Raw Permalink Normal View History

#include "Runtime/Graphics/Shaders/CMapSurfaceShader.hpp"
#include <array>
#include "Runtime/Graphics/CGraphics.hpp"
2022-02-01 00:06:54 +00:00
//#include <hecl/Pipeline.hpp>
2017-04-22 06:42:32 +00:00
2021-04-10 08:42:06 +00:00
namespace metaforce {
2017-04-22 06:42:32 +00:00
2022-02-01 00:06:54 +00:00
//static boo::ObjToken<boo::IShaderPipeline> s_Pipeline;
2018-10-07 02:59:17 +00:00
2022-02-01 00:06:54 +00:00
void CMapSurfaceShader::Initialize() {
// s_Pipeline = hecl::conv->convert(Shader_CMapSurfaceShader{});
}
2018-10-07 02:59:17 +00:00
2022-02-01 00:06:54 +00:00
void CMapSurfaceShader::Shutdown() {
// s_Pipeline.reset();
}
2018-10-07 02:59:17 +00:00
2022-02-01 00:06:54 +00:00
CMapSurfaceShader::CMapSurfaceShader(aurora::ArrayRef<zeus::CVector3f> vbo,
aurora::ArrayRef<uint16_t> ibo)
//: m_vbo(vbo), m_ibo(ibo)
{
// m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
// const std::array<boo::ObjToken<boo::IGraphicsBuffer>, 1> bufs{m_uniBuf.get()};
// constexpr std::array<boo::PipelineStage, 1> stages{boo::PipelineStage::Vertex};
// m_dataBind = ctx.newShaderDataBinding(s_Pipeline, m_vbo.get(), nullptr, m_ibo.get(), bufs.size(), bufs.data(),
// stages.data(), nullptr, nullptr, 0, nullptr, nullptr, nullptr);
2017-04-22 06:42:32 +00:00
}
2018-12-08 05:30:43 +00:00
void CMapSurfaceShader::draw(const zeus::CColor& color, u32 start, u32 count) {
2019-07-21 08:42:52 +00:00
SCOPED_GRAPHICS_DEBUG_GROUP("CMapSurfaceShader::draw", zeus::skMagenta);
Uniform uniform = {CGraphics::GetPerspectiveProjectionMatrix(/*true*/) * CGraphics::g_GXModelView.toMatrix4f(), color};
2022-02-01 00:06:54 +00:00
// m_uniBuf->load(&uniform, sizeof(Uniform));
// CGraphics::SetShaderDataBinding(m_dataBind);
// CGraphics::DrawArrayIndexed(start, count);
2017-04-22 06:42:32 +00:00
}
2021-04-10 08:42:06 +00:00
} // namespace metaforce