2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-20 13:39:12 +00:00

Vulkan and HLSL object tracker support

This commit is contained in:
Jack Andersen
2017-11-05 20:58:04 -10:00
parent 3894749675
commit 62c1dc467f
47 changed files with 801 additions and 347 deletions

View File

@@ -44,20 +44,21 @@ static const char* FS =
URDE_DECL_SPECIALIZE_SHADER(CAABoxShader)
static boo::IVertexFormat* s_VtxFmt = nullptr;
static boo::IShaderPipeline* s_Pipeline = nullptr;
static boo::IShaderPipeline* s_zOnlyPipeline = nullptr;
static boo::ObjToken<boo::IVertexFormat> s_VtxFmt;
static boo::ObjToken<boo::IShaderPipeline> s_Pipeline;
static boo::ObjToken<boo::IShaderPipeline> s_zOnlyPipeline;
struct CAABoxShaderD3DDataBindingFactory : TShader<CAABoxShader>::IDataBindingFactory
{
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CAABoxShader& filter)
boo::ObjToken<boo::IShaderDataBinding>
BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CAABoxShader& filter)
{
boo::ID3DDataFactory::Context& cctx = static_cast<boo::ID3DDataFactory::Context&>(ctx);
boo::IGraphicsBuffer* bufs[] = {filter.m_uniBuf};
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {filter.m_uniBuf.get()};
return cctx.newShaderDataBinding(filter.m_zOnly ? s_zOnlyPipeline : s_Pipeline, s_VtxFmt,
filter.m_vbo, nullptr, nullptr, 1, bufs,
filter.m_vbo.get(), nullptr, nullptr, 1, bufs,
nullptr, nullptr, nullptr, 0, nullptr, nullptr, nullptr);
}
};
@@ -78,4 +79,12 @@ TShader<CAABoxShader>::IDataBindingFactory* CAABoxShader::Initialize(boo::ID3DDa
return new CAABoxShaderD3DDataBindingFactory;
}
template <>
void CAABoxShader::Shutdown<boo::ID3DDataFactory>()
{
s_VtxFmt.reset();
s_Pipeline.reset();
s_zOnlyPipeline.reset();
}
}