2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-21 22:19:12 +00:00

Changes to support boo object tracker API

This commit is contained in:
Jack Andersen
2017-11-04 20:17:12 -10:00
parent d301491bd6
commit 3894749675
138 changed files with 1679 additions and 1243 deletions

View File

@@ -50,34 +50,34 @@ BOO_GLSL_BINDING_HEAD
URDE_DECL_SPECIALIZE_SHADER(CRadarPaintShader)
static boo::IVertexFormat* s_VtxFmt = nullptr;
static boo::IShaderPipeline* s_Pipeline = nullptr;
static boo::ObjToken<boo::IVertexFormat> s_VtxFmt;
static boo::ObjToken<boo::IShaderPipeline> s_Pipeline;
struct CRadarPaintShaderGLDataBindingFactory : TShader<CRadarPaintShader>::IDataBindingFactory
{
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CRadarPaintShader& filter)
boo::ObjToken<boo::IShaderDataBinding> BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CRadarPaintShader& filter)
{
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
const boo::VertexElementDescriptor VtxVmt[] =
{
{filter.m_vbo, nullptr, boo::VertexSemantic::Position4, 0},
{filter.m_vbo, nullptr, boo::VertexSemantic::Position4, 1},
{filter.m_vbo, nullptr, boo::VertexSemantic::Position4, 2},
{filter.m_vbo, nullptr, boo::VertexSemantic::Position4, 3},
{filter.m_vbo, nullptr, boo::VertexSemantic::UV4, 0},
{filter.m_vbo, nullptr, boo::VertexSemantic::UV4, 1},
{filter.m_vbo, nullptr, boo::VertexSemantic::UV4, 2},
{filter.m_vbo, nullptr, boo::VertexSemantic::UV4, 3},
{filter.m_vbo, nullptr, boo::VertexSemantic::Color}
{filter.m_vbo.get(), nullptr, boo::VertexSemantic::Position4, 0},
{filter.m_vbo.get(), nullptr, boo::VertexSemantic::Position4, 1},
{filter.m_vbo.get(), nullptr, boo::VertexSemantic::Position4, 2},
{filter.m_vbo.get(), nullptr, boo::VertexSemantic::Position4, 3},
{filter.m_vbo.get(), nullptr, boo::VertexSemantic::UV4, 0},
{filter.m_vbo.get(), nullptr, boo::VertexSemantic::UV4, 1},
{filter.m_vbo.get(), nullptr, boo::VertexSemantic::UV4, 2},
{filter.m_vbo.get(), nullptr, boo::VertexSemantic::UV4, 3},
{filter.m_vbo.get(), nullptr, boo::VertexSemantic::Color}
};
boo::IVertexFormat* vtxFmt = ctx.newVertexFormat(9, VtxVmt);
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
boo::ObjToken<boo::IVertexFormat> vtxFmt = ctx.newVertexFormat(9, VtxVmt);
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {filter.m_uniBuf.get()};
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
boo::ITexture* texs[] = {filter.m_tex->GetBooTexture()};
boo::ObjToken<boo::ITexture> texs[] = {filter.m_tex->GetBooTexture()};
return cctx.newShaderDataBinding(s_Pipeline,
vtxFmt, nullptr, filter.m_vbo, nullptr,
vtxFmt, nullptr, filter.m_vbo.get(), nullptr,
1, bufs, stages, nullptr, nullptr, 1, texs, nullptr, nullptr);
}
};
@@ -110,6 +110,12 @@ CRadarPaintShader::Initialize(boo::GLDataFactory::Context& ctx)
return new CRadarPaintShaderGLDataBindingFactory;
}
template <>
void CRadarPaintShader::Shutdown<boo::GLDataFactory>()
{
s_Pipeline.reset();
}
#if BOO_HAS_VULKAN
TShader<CRadarPaintShader>::IDataBindingFactory*
CRadarPaintShader::Initialize(boo::VulkanDataFactory::Context& ctx)