diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2016-11-27 11:56:22 +0100 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2016-12-06 20:33:53 +0100 |
| commit | 31ccfffd386cdf7bfafdccda240a179431ecc98c (patch) | |
| tree | 820bdb640091e5726e4c52d42f819956f82bfd28 /Source/Core/VideoBackends/OGL/StreamBuffer.cpp | |
| parent | 7192789c1162e2deb5923151d05158f459448ab9 (diff) | |
Common: Add alignment header
Gets rid of duplicated alignment code.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/StreamBuffer.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/StreamBuffer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/OGL/StreamBuffer.cpp b/Source/Core/VideoBackends/OGL/StreamBuffer.cpp index a81d96b0ff..97a25a5bc7 100644 --- a/Source/Core/VideoBackends/OGL/StreamBuffer.cpp +++ b/Source/Core/VideoBackends/OGL/StreamBuffer.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Common/Align.h" #include "Common/GL/GLUtil.h" #include "Common/MemoryUtil.h" @@ -261,11 +262,11 @@ public: PinnedMemory(u32 type, u32 size) : StreamBuffer(type, size) { CreateFences(); - m_pointer = static_cast<u8*>( - Common::AllocateAlignedMemory(ROUND_UP(m_size, ALIGN_PINNED_MEMORY), ALIGN_PINNED_MEMORY)); + m_pointer = static_cast<u8*>(Common::AllocateAlignedMemory( + Common::AlignUp(m_size, ALIGN_PINNED_MEMORY), ALIGN_PINNED_MEMORY)); glBindBuffer(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, m_buffer); - glBufferData(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, ROUND_UP(m_size, ALIGN_PINNED_MEMORY), - m_pointer, GL_STREAM_COPY); + glBufferData(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, + Common::AlignUp(m_size, ALIGN_PINNED_MEMORY), m_pointer, GL_STREAM_COPY); glBindBuffer(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, 0); glBindBuffer(m_buffertype, m_buffer); } |
