-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy path003-angle-src-fixes.patch
72 lines (67 loc) · 3.13 KB
/
003-angle-src-fixes.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
diff --git a/src/common/mathutil.h b/src/common/mathutil.h
index d142b35de..46b9eac13 100644
--- a/src/common/mathutil.h
+++ b/src/common/mathutil.h
@@ -1032,8 +1032,8 @@ inline uint32_t BitfieldReverse(uint32_t value)
}
// Count the 1 bits.
-#if defined(_MSC_VER) && !defined(__clang__)
-# if defined(_M_IX86) || defined(_M_X64)
+#if defined(ANGLE_PLATFORM_WINDOWS) && !defined(__clang__)
+# if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__x86_64__)
namespace priv
{
// Check POPCNT instruction support and cache the result.
@@ -1076,7 +1076,7 @@ inline int BitCount(uint64_t bits)
{
if (priv::kHasPopcnt)
{
-# if defined(_M_X64)
+# if defined(_M_X64) || defined(__x86_64__)
return static_cast<int>(__popcnt64(bits));
# else // x86
return static_cast<int>(__popcnt(static_cast<uint32_t>(bits >> 32)) +
@@ -1109,7 +1109,7 @@ inline int BitCount(uint64_t bits)
return static_cast<int>(vget_lane_u64(vpaddl_u32(vpaddl_u16(vpaddl_u8(vsum))), 0));
}
# endif // defined(_M_IX86) || defined(_M_X64)
-#endif // defined(_MSC_VER) && !defined(__clang__)
+#endif // defined(ANGLE_PLATFORM_WINDOWS) && !defined(__clang__)
#if defined(ANGLE_PLATFORM_POSIX) || defined(__clang__)
inline int BitCount(uint32_t bits)
diff --git a/src/common/serializer/JsonSerializer.cpp b/src/common/serializer/JsonSerializer.cpp
index 0028331d9..e675c406b 100644
--- a/src/common/serializer/JsonSerializer.cpp
+++ b/src/common/serializer/JsonSerializer.cpp
@@ -173,7 +173,7 @@ void JsonSerializer::addValue(const std::string &name, rapidjson::Value &&value)
}
else
{
- rapidjson::Value nameValue(name, mAllocator);
+ rapidjson::Value nameValue;
mDoc.AddMember(nameValue, std::move(value), mAllocator);
}
}
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index 485b4bd38..cbe275733 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -1213,7 +1213,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
bool TCompiler::resizeClipAndCullDistanceBuiltins(TIntermBlock *root)
{
- auto resizeVariable = [=](const ImmutableString &name, uint32_t size, uint32_t maxSize) {
+ auto resizeVariable = [=, this](const ImmutableString &name, uint32_t size, uint32_t maxSize) {
// Skip if the variable is not used or implicitly has the maximum size
if (size == 0 || size == maxSize)
return true;
diff --git a/util/capture/frame_capture_test_utils.cpp b/util/capture/frame_capture_test_utils.cpp
index 427844c5d..8c549d1b3 100644
--- a/util/capture/frame_capture_test_utils.cpp
+++ b/util/capture/frame_capture_test_utils.cpp
@@ -84,7 +84,7 @@ bool LoadTraceInfoFromJSON(const std::string &traceName,
return false;
}
- const rapidjson::Document::Object &meta = doc["TraceMetadata"].GetObj();
+ const rapidjson::Document::Object &meta = doc["TraceMetadata"].GetObject();
strncpy(traceInfoOut->name, traceName.c_str(), kTraceInfoMaxNameLen);
traceInfoOut->contextClientMajorVersion = meta["ContextClientMajorVersion"].GetInt();