|
1
|
+From 1e1853aea10c43232c64d8cd572ff1d4b98a7688 Mon Sep 17 00:00:00 2001
|
|
2
|
+From: Michael Skorokhodov <mykhailo.skorokhodov@globallogic.com>
|
|
3
|
+Date: Wed, 11 Aug 2021 12:44:35 +0300
|
|
4
|
+Subject: [PATCH] Fix compiling with gcc11
|
|
5
|
+
|
|
6
|
+---
|
|
7
|
+ framework/encode/trace_manager.cpp | 8 +++++---
|
|
8
|
+ framework/encode/vulkan_handle_wrapper_util.h | 3 ++-
|
|
9
|
+ 2 files changed, 7 insertions(+), 4 deletions(-)
|
|
10
|
+
|
|
11
|
+diff --git a/framework/encode/trace_manager.cpp b/framework/encode/trace_manager.cpp
|
|
12
|
+index 2542b96b..687084ca 100644
|
|
13
|
+--- a/framework/encode/trace_manager.cpp
|
|
14
|
++++ b/framework/encode/trace_manager.cpp
|
|
15
|
+@@ -37,6 +37,8 @@
|
|
16
|
+ #include "util/page_guard_manager.h"
|
|
17
|
+ #include "util/platform.h"
|
|
18
|
+
|
|
19
|
++#include <algorithm>
|
|
20
|
++#include <iterator>
|
|
21
|
+ #include <cassert>
|
|
22
|
+ #include <unordered_set>
|
|
23
|
+
|
|
24
|
+@@ -920,9 +922,9 @@ void TraceManager::WriteSetDeviceMemoryPropertiesCommand(format::HandleId
|
|
25
|
+ // populate thread_data's scratch_buffer_ then write to file.
|
|
26
|
+ auto& scratch_buffer = thread_data->GetScratchBuffer();
|
|
27
|
+ scratch_buffer.clear();
|
|
28
|
+- scratch_buffer.insert(scratch_buffer.end(),
|
|
29
|
+- reinterpret_cast<uint8_t*>(&memory_properties_cmd),
|
|
30
|
+- reinterpret_cast<uint8_t*>(&memory_properties_cmd) + sizeof(memory_properties_cmd));
|
|
31
|
++ std::copy(reinterpret_cast<uint8_t*>(&memory_properties_cmd),
|
|
32
|
++ reinterpret_cast<uint8_t*>(&memory_properties_cmd) + sizeof(memory_properties_cmd),
|
|
33
|
++ std::back_inserter(scratch_buffer));
|
|
34
|
+
|
|
35
|
+ format::DeviceMemoryType type;
|
|
36
|
+ for (uint32_t i = 0; i < memory_properties.memoryTypeCount; ++i)
|
|
37
|
+diff --git a/framework/encode/vulkan_handle_wrapper_util.h b/framework/encode/vulkan_handle_wrapper_util.h
|
|
38
|
+index f94ca3f3..e3e04b35 100644
|
|
39
|
+--- a/framework/encode/vulkan_handle_wrapper_util.h
|
|
40
|
++++ b/framework/encode/vulkan_handle_wrapper_util.h
|
|
41
|
+@@ -30,6 +30,7 @@
|
|
42
|
+ #include "util/defines.h"
|
|
43
|
+
|
|
44
|
+ #include <algorithm>
|
|
45
|
++#include <iterator>
|
|
46
|
+ #include <cassert>
|
|
47
|
+ #include <vector>
|
|
48
|
+
|
|
49
|
+@@ -77,7 +78,7 @@ class HandleUnwrapMemory
|
|
50
|
+ {
|
|
51
|
+ next_buffer = &buffers_[next_index];
|
|
52
|
+ next_buffer->clear();
|
|
53
|
+- next_buffer->insert(next_buffer->end(), data, data + len);
|
|
54
|
++ std::copy(data, data + len, std::back_inserter(*next_buffer));
|
|
55
|
+ }
|
|
56
|
+ else
|
|
57
|
+ {
|