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

@@ -26,24 +26,24 @@ BOO_GLSL_BINDING_HEAD
URDE_DECL_SPECIALIZE_SHADER(CFogVolumePlaneShader)
static boo::IVertexFormat* s_VtxFmt = nullptr;
static boo::IShaderPipeline* s_Pipelines[4] = {};
static boo::ObjToken<boo::IVertexFormat> s_VtxFmt;
static boo::ObjToken<boo::IShaderPipeline> s_Pipelines[4];
struct CFogVolumePlaneShaderGLDataBindingFactory : TShader<CFogVolumePlaneShader>::IDataBindingFactory
{
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CFogVolumePlaneShader& filter)
boo::ObjToken<boo::IShaderDataBinding> BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CFogVolumePlaneShader& 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::IVertexFormat* VtxVmtObj = cctx.newVertexFormat(1, VtxVmt);
boo::ObjToken<boo::IVertexFormat> VtxVmtObj = cctx.newVertexFormat(1, VtxVmt);
for (int i=0 ; i<4 ; ++i)
filter.m_dataBinds[i] = cctx.newShaderDataBinding(s_Pipelines[i], VtxVmtObj,
filter.m_vbo, nullptr, nullptr, 0, nullptr,
filter.m_vbo.get(), nullptr, nullptr, 0, nullptr,
nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
return filter.m_dataBinds[0];
}
@@ -84,6 +84,15 @@ CFogVolumePlaneShader::Initialize(boo::GLDataFactory::Context& ctx)
return new CFogVolumePlaneShaderGLDataBindingFactory;
}
template <>
void CFogVolumePlaneShader::Shutdown<boo::GLDataFactory>()
{
s_Pipelines[0].reset();
s_Pipelines[1].reset();
s_Pipelines[2].reset();
s_Pipelines[3].reset();
}
#if BOO_HAS_VULKAN
TShader<CFogVolumePlaneShader>::IDataBindingFactory*
CFogVolumePlaneShader::Initialize(boo::VulkanDataFactory::Context& ctx)