From cebc37237a74a130dffaefad0a10da17abc42981 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 18 Feb 2014 09:59:17 +0200 Subject: [PATCH] Fix build when SSE2 is not available. Although SSE2 support is detected at runtime it still may not be available at build time, so we have to ensure it only uses SSE2 when it is available at build time too. Change-Id: I86c45a6466ab4cec79aa0f62b0d5230a78ad825a --- src/3rdparty/angle/src/libGLESv2/mathutil.h | 2 ++ src/3rdparty/angle/src/libGLESv2/renderer/d3d9/Image9.cpp | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/angle/src/libGLESv2/mathutil.h b/src/3rdparty/angle/src/libGLESv2/mathutil.h index f902131..6474b66 100644 --- a/src/3rdparty/angle/src/libGLESv2/mathutil.h +++ b/src/3rdparty/angle/src/libGLESv2/mathutil.h @@ -92,6 +92,7 @@ inline bool supportsSSE2() return supports; } +#if defined(_M_IX86) || defined(_M_AMD64) // ARM doesn't provide __cpuid() int info[4]; __cpuid(info, 0); @@ -101,6 +102,7 @@ inline bool supportsSSE2() supports = (info[3] >> 26) & 1; } +#endif checked = true; diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d9/Image9.cpp b/src/3rdparty/angle/src/libGLESv2/renderer/d3d9/Image9.cpp index 8511946..cd12d8c 100644 --- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d9/Image9.cpp +++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d9/Image9.cpp @@ -373,11 +373,13 @@ void Image9::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heigh switch (mInternalFormat) { case GL_ALPHA8_EXT: +#if defined(__SSE2__) if (gl::supportsSSE2()) { loadAlphaDataToBGRASSE2(width, height, inputPitch, input, locked.Pitch, locked.pBits); } else +#endif { loadAlphaDataToBGRA(width, height, inputPitch, input, locked.Pitch, locked.pBits); } @@ -413,11 +415,13 @@ void Image9::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heigh loadRGB565DataToBGRA(width, height, inputPitch, input, locked.Pitch, locked.pBits); break; case GL_RGBA8_OES: +#if defined(__SSE2__) if (gl::supportsSSE2()) { loadRGBAUByteDataToBGRASSE2(width, height, inputPitch, input, locked.Pitch, locked.pBits); } else +#endif { loadRGBAUByteDataToBGRA(width, height, inputPitch, input, locked.Pitch, locked.pBits); } @@ -729,4 +733,4 @@ void Image9::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, mDirty = true; } -} \ No newline at end of file +} -- 1.8.4.msysgit.0