summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-01-28 02:19:59 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2021-01-28 02:28:22 +0100
commit9e88ad8da9c698f38e25e3d9b23feb19b30f68bd (patch)
tree40ad268d89255944d552a044ab692e60b0f622c4 /src/video_core
parentMerge pull request #5778 from ReinUsesLisp/shader-dir (diff)
downloadyuzu-9e88ad8da9c698f38e25e3d9b23feb19b30f68bd.tar
yuzu-9e88ad8da9c698f38e25e3d9b23feb19b30f68bd.tar.gz
yuzu-9e88ad8da9c698f38e25e3d9b23feb19b30f68bd.tar.bz2
yuzu-9e88ad8da9c698f38e25e3d9b23feb19b30f68bd.tar.lz
yuzu-9e88ad8da9c698f38e25e3d9b23feb19b30f68bd.tar.xz
yuzu-9e88ad8da9c698f38e25e3d9b23feb19b30f68bd.tar.zst
yuzu-9e88ad8da9c698f38e25e3d9b23feb19b30f68bd.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_vulkan/vk_scheduler.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h
index 4cd43e425..15f2987eb 100644
--- a/src/video_core/renderer_vulkan/vk_scheduler.h
+++ b/src/video_core/renderer_vulkan/vk_scheduler.h
@@ -6,10 +6,12 @@
#include <atomic>
#include <condition_variable>
+#include <cstddef>
#include <memory>
#include <stack>
#include <thread>
#include <utility>
+#include "common/alignment.h"
#include "common/common_types.h"
#include "common/threadsafe_queue.h"
#include "video_core/vulkan_common/vulkan_wrapper.h"
@@ -130,12 +132,11 @@ private:
using FuncType = TypedCommand<T>;
static_assert(sizeof(FuncType) < sizeof(data), "Lambda is too large");
+ command_offset = Common::AlignUp(command_offset, alignof(FuncType));
if (command_offset > sizeof(data) - sizeof(FuncType)) {
return false;
}
-
- Command* current_last = last;
-
+ Command* const current_last = last;
last = new (data.data() + command_offset) FuncType(std::move(command));
if (current_last) {
@@ -143,7 +144,6 @@ private:
} else {
first = last;
}
-
command_offset += sizeof(FuncType);
return true;
}
@@ -156,8 +156,8 @@ private:
Command* first = nullptr;
Command* last = nullptr;
- std::size_t command_offset = 0;
- std::array<u8, 0x8000> data{};
+ size_t command_offset = 0;
+ alignas(std::max_align_t) std::array<u8, 0x8000> data{};
};
struct State {