2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-21 14: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

@@ -43,29 +43,29 @@ BOO_GLSL_BINDING_HEAD
URDE_DECL_SPECIALIZE_SHADER(CWorldShadowShader)
static boo::IVertexFormat* s_VtxFmt = nullptr;
static boo::IShaderPipeline* s_Pipeline = nullptr;
static boo::IShaderPipeline* s_ZPipeline = nullptr;
static boo::ObjToken<boo::IVertexFormat> s_VtxFmt;
static boo::ObjToken<boo::IShaderPipeline> s_Pipeline;
static boo::ObjToken<boo::IShaderPipeline> s_ZPipeline;
struct CWorldShadowShaderGLDataBindingFactory : TShader<CWorldShadowShader>::IDataBindingFactory
{
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CWorldShadowShader& filter)
boo::ObjToken<boo::IShaderDataBinding> BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CWorldShadowShader& filter)
{
boo::GLDataFactory::Context& cctx = static_cast<boo::GLDataFactory::Context&>(ctx);
const boo::VertexElementDescriptor VtxVmt[] =
{
{filter.m_vbo, nullptr, boo::VertexSemantic::Position4}
{filter.m_vbo.get(), nullptr, boo::VertexSemantic::Position4}
};
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {filter.m_uniBuf.get()};
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
boo::IVertexFormat* vtxFmt = ctx.newVertexFormat(1, VtxVmt);
boo::ObjToken<boo::IVertexFormat> vtxFmt = ctx.newVertexFormat(1, VtxVmt);
filter.m_dataBind = cctx.newShaderDataBinding(s_Pipeline,
vtxFmt, filter.m_vbo, nullptr, nullptr,
vtxFmt, filter.m_vbo.get(), nullptr, nullptr,
1, bufs, stages, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
filter.m_zDataBind = cctx.newShaderDataBinding(s_ZPipeline,
vtxFmt, filter.m_vbo, nullptr, nullptr,
vtxFmt, filter.m_vbo.get(), nullptr, nullptr,
1, bufs, stages, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
return nullptr;
}
@@ -104,6 +104,13 @@ CWorldShadowShader::Initialize(boo::GLDataFactory::Context& ctx)
return new CWorldShadowShaderGLDataBindingFactory;
}
template <>
void CWorldShadowShader::Shutdown<boo::GLDataFactory>()
{
s_Pipeline.reset();
s_ZPipeline.reset();
}
#if BOO_HAS_VULKAN
TShader<CWorldShadowShader>::IDataBindingFactory*
CWorldShadowShader::Initialize(boo::VulkanDataFactory::Context& ctx)