summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/Util.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2016-11-27 11:56:22 +0100
committerLéo Lam <leo@innovatetechnologi.es>2016-12-06 20:33:53 +0100
commit31ccfffd386cdf7bfafdccda240a179431ecc98c (patch)
tree820bdb640091e5726e4c52d42f819956f82bfd28 /Source/Core/VideoBackends/Vulkan/Util.cpp
parent7192789c1162e2deb5923151d05158f459448ab9 (diff)
Common: Add alignment header
Gets rid of duplicated alignment code.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/Util.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/Util.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/Util.cpp b/Source/Core/VideoBackends/Vulkan/Util.cpp
index f85321bac5..f49ca90580 100644
--- a/Source/Core/VideoBackends/Vulkan/Util.cpp
+++ b/Source/Core/VideoBackends/Vulkan/Util.cpp
@@ -4,6 +4,7 @@
#include "VideoBackends/Vulkan/Util.h"
+#include "Common/Align.h"
#include "Common/Assert.h"
#include "Common/CommonFuncs.h"
#include "Common/MathUtil.h"
@@ -20,22 +21,13 @@ namespace Vulkan
{
namespace Util
{
-size_t AlignValue(size_t value, size_t alignment)
-{
- // Have to use mod rather than masking bits in case alignment is not a power of two.
- size_t offset = value % alignment;
- if (offset != 0)
- value += (alignment - offset);
- return value;
-}
-
size_t AlignBufferOffset(size_t offset, size_t alignment)
{
// Assume an offset of zero is already aligned to a value larger than alignment.
if (offset == 0)
return 0;
- return AlignValue(offset, alignment);
+ return Common::AlignUp(offset, alignment);
}
u32 MakeRGBA8Color(float r, float g, float b, float a)