2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-22 00:19:13 +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

@@ -52,23 +52,24 @@ static const char* FS =
URDE_DECL_SPECIALIZE_SHADER(CEnergyBarShader)
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 CEnergyBarShaderD3DDataBindingFactory : TShader<CEnergyBarShader>::IDataBindingFactory
{
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CEnergyBarShader& filter)
boo::ObjToken<boo::IShaderDataBinding>
BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CEnergyBarShader& filter)
{
boo::ID3DDataFactory::Context& cctx = static_cast<boo::ID3DDataFactory::Context&>(ctx);
boo::IGraphicsBuffer* bufs[1];
boo::ITexture* texs[] = {filter.m_tex->GetBooTexture()};
boo::ObjToken<boo::IGraphicsBuffer> bufs[1];
boo::ObjToken<boo::ITexture> texs[] = {filter.m_tex->GetBooTexture()};
for (int i=0 ; i<3 ; ++i)
{
bufs[0] = filter.m_uniBuf[i];
bufs[0] = filter.m_uniBuf[i].get();
filter.m_dataBind[i] = cctx.newShaderDataBinding(s_Pipeline, s_VtxFmt,
filter.m_vbo, nullptr, nullptr, 1, bufs,
filter.m_vbo.get(), nullptr, nullptr, 1, bufs,
nullptr, nullptr, nullptr, 1, texs, nullptr, nullptr);
}
return filter.m_dataBind[0];
@@ -90,4 +91,11 @@ CEnergyBarShader::Initialize(boo::ID3DDataFactory::Context& ctx)
boo::ZTest::LEqual, false, true, false, boo::CullMode::None);
return new CEnergyBarShaderD3DDataBindingFactory;
}
template <>
void CEnergyBarShader::Shutdown<boo::ID3DDataFactory>()
{
s_VtxFmt.reset();
s_Pipeline.reset();
}
}