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

Uniform and Vertex buffer pool refactor

This commit is contained in:
Jack Andersen
2016-12-09 16:33:54 -10:00
parent 474ef07953
commit a9322292f5
33 changed files with 614 additions and 205 deletions

View File

@@ -33,8 +33,8 @@ Toolbar::Toolbar(ViewResources& res, View& parentView, Position tbPos, unsigned
commitResources(res, [&](boo::IGraphicsDataFactory::Context& ctx) -> bool
{
buildResources(ctx, res);
m_tbBlockBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(ViewBlock), 1);
m_vertsBinding.initTex(ctx, res, 10, m_tbBlockBuf, res.m_toolbarRes.m_shadingTex);
m_tbBlockBuf.emplace(res.m_viewRes.m_bufPool.allocateBlock(res.m_factory));
m_vertsBinding.init(ctx, res, 10, *m_tbBlockBuf, res.m_toolbarRes.m_shadingTex);
return true;
});
setBackground(res.themeData().toolbarBackground());
@@ -138,9 +138,9 @@ void Toolbar::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub)
{
View::resized(root, sub);
setHorizontalVerts(sub.size[0]);
m_vertsBinding.load(m_tbVerts, sizeof(m_tbVerts));
m_vertsBinding.load<decltype(m_tbVerts)>(m_tbVerts);
m_tbBlock.setViewRect(root, sub);
m_tbBlockBuf->load(&m_tbBlock, sizeof(ViewBlock));
m_tbBlockBuf->access() = m_tbBlock;
float gaugeUnit = rootView().viewRes().pixelFactor() * SPECTER_TOOLBAR_GAUGE;
float yOff = 0.0;