Vulkan backend fixes

This commit is contained in:
Jack Andersen 2018-05-20 12:38:56 -10:00
parent f4bd59bb2f
commit 536f943858
8 changed files with 71 additions and 12 deletions

View File

@ -117,7 +117,7 @@ struct CTweakGui final : ITweakGui
Value<float> x1f4_;
Value<float> x1f8_;
Value<float> x1fc_;
float x200_;
zeus::CColor x200_;
float x204_xrayBlurScaleLinear = 0.0014f;
float x208_xrayBlurScaleQuadratic = 0.0000525f;
Value<float> x20c_;
@ -314,9 +314,7 @@ struct CTweakGui final : ITweakGui
xd8_ = zeus::degToRad(xd8_);
xdc_ = zeus::degToRad(xdc_);
x200_ = x1f4_ * 0.25f;
x204_xrayBlurScaleLinear = x1f8_ * 0.25f;
x208_xrayBlurScaleQuadratic = x1fc_ * 0.25f;
x200_ = zeus::CColor(x1f4_ * 0.25f, x1f8_ * 0.25f, x1fc_ * 0.25f, 1.f);
x210_scanSidesAngle = zeus::degToRad(x210_scanSidesAngle);
x228_scanSidesEndTime = x220_scanSidesDuration + x224_scanSidesStartTime;

View File

@ -183,6 +183,36 @@ void CFluidPlaneShader::PrepareBinding(const boo::ObjToken<boo::IShaderPipeline>
});
}
void CFluidPlaneShader::Shutdown()
{
_cache.Clear();
switch (CGraphics::g_BooFactory->platform())
{
#if BOO_HAS_GL
case boo::IGraphicsDataFactory::Platform::OpenGL:
CFluidPlaneShader::_Shutdown<boo::GLDataFactory>();
break;
#endif
#if _WIN32
case boo::IGraphicsDataFactory::Platform::D3D11:
case boo::IGraphicsDataFactory::Platform::D3D12:
CFluidPlaneShader::_Shutdown<boo::ID3DDataFactory>();
break;
#endif
#if BOO_HAS_METAL
case boo::IGraphicsDataFactory::Platform::Metal:
CFluidPlaneShader::_Shutdown<boo::MetalDataFactory>();
break;
#endif
#if BOO_HAS_VULKAN
case boo::IGraphicsDataFactory::Platform::Vulkan:
CFluidPlaneShader::_Shutdown<boo::VulkanDataFactory>();
break;
#endif
default: break;
}
}
CFluidPlaneShader::CFluidPlaneShader(CFluidPlane::EFluidType type,
const std::experimental::optional<TLockedToken<CTexture>>& patternTex1,
const std::experimental::optional<TLockedToken<CTexture>>& patternTex2,

View File

@ -151,6 +151,8 @@ private:
const boo::ObjToken<boo::IShaderPipeline>& pipeline, bool door);
#endif
template <class F> static void _Shutdown();
void PrepareBinding(const boo::ObjToken<boo::IShaderPipeline>& pipeline, u32 maxVertCount, bool door);
public:
CFluidPlaneShader(CFluidPlane::EFluidType type,
@ -169,7 +171,7 @@ public:
void prepareDraw(const RenderSetupInfo& info);
void loadVerts(const std::vector<Vertex>& verts);
static void Shutdown() { _cache.Clear(); }
static void Shutdown();
};
}

View File

@ -578,6 +578,9 @@ CFluidPlaneShader::BuildShader(boo::GLDataFactory::Context& ctx, const SFluidPla
boo::CullMode::None);
}
template <>
void CFluidPlaneShader::_Shutdown<boo::GLDataFactory>() {}
#if BOO_HAS_VULKAN
static boo::ObjToken<boo::IVertexFormat> s_vtxFmt;
@ -633,6 +636,13 @@ CFluidPlaneShader::BuildShader(boo::VulkanDataFactory::Context& ctx, const SFlui
boo::Primitive::TriStrips, boo::ZTest::LEqual, false, true, false,
boo::CullMode::None);
}
template <>
void CFluidPlaneShader::_Shutdown<boo::VulkanDataFactory>()
{
s_vtxFmt.reset();
}
#endif
boo::ObjToken<boo::IShaderDataBinding>

View File

@ -558,6 +558,12 @@ CFluidPlaneShader::BuildShader(boo::ID3DDataFactory::Context& ctx, const SFluidP
return ret;
}
template <>
void CFluidPlaneShader::_Shutdown<boo::ID3DDataFactory>()
{
s_vtxFmt.reset();
}
boo::ObjToken<boo::IShaderDataBinding>
CFluidPlaneShader::BuildBinding(boo::ID3DDataFactory::Context& ctx,
const boo::ObjToken<boo::IShaderPipeline>& pipeline, bool door)

View File

@ -586,6 +586,12 @@ CFluidPlaneShader::BuildShader(boo::MetalDataFactory::Context& ctx, const SFluid
return ret;
}
template <>
void CFluidPlaneShader::_Shutdown<boo::MetalDataFactory>()
{
s_vtxFmt.reset();
}
boo::ObjToken<boo::IShaderDataBinding> CFluidPlaneShader::BuildBinding(boo::MetalDataFactory::Context& ctx,
const boo::ObjToken<boo::IShaderPipeline>& pipeline, bool door)
{

View File

@ -171,7 +171,8 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
if (msg == EScriptObjectMessage::Action)
{
mgr.MapWorldInfo()->SetMapStationUsed(true);
const_cast<CMapWorld&>(*mgr.WorldNC()->GetMapWorld()).RecalculateWorldSphere(*mgr.MapWorldInfo(), *mgr.GetWorld());
const_cast<CMapWorld&>(*mgr.WorldNC()->GetMapWorld()).RecalculateWorldSphere
(*mgr.MapWorldInfo(), *mgr.GetWorld());
}
break;
}
@ -180,7 +181,8 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
if (msg == EScriptObjectMessage::Action)
{
CPlayerState& pState = *mgr.GetPlayerState().get();
pState.ResetAndIncrPickUp(CPlayerState::EItemType::Missiles, pState.GetItemCapacity(CPlayerState::EItemType::Missiles));
pState.ResetAndIncrPickUp(CPlayerState::EItemType::Missiles,
pState.GetItemCapacity(CPlayerState::EItemType::Missiles));
}
break;
}
@ -189,7 +191,8 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
if (msg == EScriptObjectMessage::Action)
{
CPlayerState& pState = *mgr.GetPlayerState().get();
pState.ResetAndIncrPickUp(CPlayerState::EItemType::PowerBombs, pState.GetItemCapacity(CPlayerState::EItemType::PowerBombs));
pState.ResetAndIncrPickUp(CPlayerState::EItemType::PowerBombs,
pState.GetItemCapacity(CPlayerState::EItemType::PowerBombs));
}
break;
}
@ -278,7 +281,8 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
{
CDamageInfo dInfo = x11c_damageInfo;
dInfo.SetRadius(xfc_);
mgr.ApplyDamageToWorld(GetUniqueId(), *this, GetTranslation(), dInfo, CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {0ull}));
mgr.ApplyDamageToWorld(GetUniqueId(), *this, GetTranslation(), dInfo,
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {0ull}));
}
break;
}
@ -329,6 +333,8 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
{
break;
}
default:
break;
}
}
}
@ -465,7 +471,8 @@ void CScriptSpecialFunction::DeleteEmitter(const CSfxHandle& handle)
u32 CScriptSpecialFunction::GetSpecialEnding(const CStateManager& mgr) const
{
const u32 rate = (mgr.GetPlayerState()->CalculateItemCollectionRate() * 100) / mgr.GetPlayerState()->GetPickupTotal();
const u32 rate = (mgr.GetPlayerState()->CalculateItemCollectionRate() * 100) /
mgr.GetPlayerState()->GetPickupTotal();
if (rate < 75)
return 0;
else if (rate < 100)

2
hecl

@ -1 +1 @@
Subproject commit c8f9d4cc050dc5dc0e4ae78beee80814b352bd8c
Subproject commit edaa2d0360409a3f02087ac3d4265c35f4ddee81