From 288cce9de5a790247d270b3236125d6c52efc5a1 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 28 Nov 2016 17:45:57 +0100 Subject: [PATCH] Add utility integer alignment function --- qrenderdoc/Code/QRDUtils.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qrenderdoc/Code/QRDUtils.h b/qrenderdoc/Code/QRDUtils.h index 063d60c7d..874651165 100644 --- a/qrenderdoc/Code/QRDUtils.h +++ b/qrenderdoc/Code/QRDUtils.h @@ -31,6 +31,12 @@ #include #include "renderdoc_replay.h" +template +inline T AlignUp(T x, T a) +{ + return (x + (a - 1)) & (~(a - 1)); +} + #ifndef ARRAY_COUNT #define ARRAY_COUNT(arr) (sizeof(arr) / sizeof(arr[0])) #endif