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

@@ -150,18 +150,19 @@ void CParticleSwooshShaders::Shutdown<boo::GLDataFactory>()
#if BOO_HAS_VULKAN
struct VulkanParticleSwooshDataBindingFactory : TShader<CParticleSwooshShaders>::IDataBindingFactory
{
boo::IShaderDataBinding* BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CParticleSwooshShaders& shaders)
boo::ObjToken<boo::IShaderDataBinding>
BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CParticleSwooshShaders& shaders)
{
CParticleSwoosh& gen = shaders.m_gen;
CSwooshDescription* desc = gen.GetDesc();
CUVElement* texr = desc->x3c_TEXR.get();
boo::ITexture* textures[] = {texr ? texr->GetValueTexture(0).GetObj()->GetBooTexture() : nullptr};
boo::ObjToken<boo::ITexture> textures[] = {texr ? texr->GetValueTexture(0).GetObj()->GetBooTexture() : nullptr};
boo::IGraphicsBuffer* uniforms[] = {gen.m_uniformBuf};
boo::ObjToken<boo::IGraphicsBuffer> uniforms[] = {gen.m_uniformBuf.get()};
gen.m_dataBind = ctx.newShaderDataBinding(shaders.m_pipeline, CParticleSwooshShaders::m_vtxFormat,
gen.m_vertBuf, nullptr, nullptr, 1, uniforms,
gen.m_vertBuf.get(), nullptr, nullptr, 1, uniforms,
nullptr, texr ? 1 : 0, textures, nullptr, nullptr);
return nullptr;
}
@@ -213,6 +214,22 @@ TShader<CParticleSwooshShaders>::IDataBindingFactory* CParticleSwooshShaders::In
return new struct VulkanParticleSwooshDataBindingFactory;
}
template <>
void CParticleSwooshShaders::Shutdown<boo::VulkanDataFactory>()
{
m_vtxFormat.reset();
m_texZWrite.reset();
m_texNoZWrite.reset();
m_texAdditiveZWrite.reset();
m_texAdditiveNoZWrite.reset();
m_noTexZWrite.reset();
m_noTexNoZWrite.reset();
m_noTexAdditiveZWrite.reset();
m_noTexAdditiveNoZWrite.reset();
}
#endif
}