From 8469ee8fac5b16e5891715a6bb103a070d9e054a Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 31 Jan 2017 21:19:15 -1000 Subject: [PATCH] Update athena, minor buffer pool changes --- hecl/extern/athena | 2 +- hecl/include/hecl/UniformBufferPool.hpp | 11 +++++++++-- hecl/include/hecl/VertexBufferPool.hpp | 11 +++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/hecl/extern/athena b/hecl/extern/athena index fd8480876..cecbcffd9 160000 --- a/hecl/extern/athena +++ b/hecl/extern/athena @@ -1 +1 @@ -Subproject commit fd84808762fcae588d50d9522e50a43c90da41d2 +Subproject commit cecbcffd96b615dfe7d8cf97827151cd82d92e58 diff --git a/hecl/include/hecl/UniformBufferPool.hpp b/hecl/include/hecl/UniformBufferPool.hpp index 863aa66c6..634dacd6e 100644 --- a/hecl/include/hecl/UniformBufferPool.hpp +++ b/hecl/include/hecl/UniformBufferPool.hpp @@ -67,9 +67,11 @@ class UniformBufferPool void updateBuffer() { - if (buffer) + if (cpuBuffer) + { buffer->unmap(); - cpuBuffer = nullptr; + cpuBuffer = nullptr; + } dirty = false; } @@ -84,6 +86,11 @@ class UniformBufferPool { if (useCount.fetch_sub(1) == 1) { + if (cpuBuffer) + { + buffer->unmap(); + cpuBuffer = nullptr; + } pool.m_token.deletePoolBuffer(buffer); buffer = nullptr; } diff --git a/hecl/include/hecl/VertexBufferPool.hpp b/hecl/include/hecl/VertexBufferPool.hpp index 7e8cf0d0f..556586c1b 100644 --- a/hecl/include/hecl/VertexBufferPool.hpp +++ b/hecl/include/hecl/VertexBufferPool.hpp @@ -67,9 +67,11 @@ class VertexBufferPool void updateBuffer() { - if (buffer) + if (cpuBuffer) + { buffer->unmap(); - cpuBuffer = nullptr; + cpuBuffer = nullptr; + } dirty = false; } @@ -84,6 +86,11 @@ class VertexBufferPool { if (useCount.fetch_sub(1) == 1) { + if (cpuBuffer) + { + buffer->unmap(); + cpuBuffer = nullptr; + } pool.m_token.deletePoolBuffer(buffer); buffer = nullptr; }