Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2017-08-21 21:22:47 +0300
committerKacper Michajłow <kasper93@gmail.com>2017-08-28 00:14:47 +0300
commit90c2393a8a59fba67f36f6f802a3ca2fbfce6be5 (patch)
tree75c62ac1a4adccabc46e3d8abfc146591047ae07
parent53b8c0638aae24f857f018c78de03f507a17cbf6 (diff)
Check if OS supports AVX.
-rw-r--r--src/Subtitles/Rasterizer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Subtitles/Rasterizer.cpp b/src/Subtitles/Rasterizer.cpp
index 050dd8c31..e4346681a 100644
--- a/src/Subtitles/Rasterizer.cpp
+++ b/src/Subtitles/Rasterizer.cpp
@@ -38,6 +38,7 @@ Rasterizer::Rasterizer()
, mpPathTypes(nullptr)
, mpPathPoints(nullptr)
, mPathPoints(0)
+ , m_bUseAVX2(false)
, mpEdgeBuffer(nullptr)
, mEdgeHeapSize(0)
, mEdgeNext(0)
@@ -49,7 +50,7 @@ Rasterizer::Rasterizer()
return;
}
__cpuidex(cpuInfo, 7, 0);
- m_bUseAVX2 = !!(cpuInfo[1] & (1 << 5));
+ m_bUseAVX2 = !!(cpuInfo[1] & (1 << 5)) && (_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6) == 0x6;
}
Rasterizer::~Rasterizer()