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

@@ -23,19 +23,20 @@ static const char* FS =
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 CFogVolumePlaneShaderD3DDataBindingFactory : TShader<CFogVolumePlaneShader>::IDataBindingFactory
{
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CFogVolumePlaneShader& filter)
boo::ObjToken<boo::IShaderDataBinding>
BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CFogVolumePlaneShader& filter)
{
boo::ID3DDataFactory::Context& cctx = static_cast<boo::ID3DDataFactory::Context&>(ctx);
for (int i=0 ; i<4 ; ++i)
filter.m_dataBinds[i] = cctx.newShaderDataBinding(s_Pipelines[i], s_VtxFmt,
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];
}
@@ -64,4 +65,14 @@ CFogVolumePlaneShader::Initialize(boo::ID3DDataFactory::Context& ctx)
return new CFogVolumePlaneShaderD3DDataBindingFactory;
}
template <>
void CFogVolumePlaneShader::Shutdown<boo::ID3DDataFactory>()
{
s_VtxFmt.reset();
s_Pipelines[0].reset();
s_Pipelines[1].reset();
s_Pipelines[2].reset();
s_Pipelines[3].reset();
}
}