Avoid SIMD functions if they're not defined.

This commit is contained in:
Pavel Krajcevski 2012-09-13 16:57:10 -04:00
parent a850cf0103
commit 47fbfa1615

View file

@ -34,12 +34,16 @@ static CompressionFunc ChooseFuncFromSettings(const SCompressionSettings &s) {
case eCompressionFormat_BPTC:
{
BC7C::SetQualityLevel(s.iQuality);
#ifdef HAS_SSE_41
if(s.bUseSIMD) {
return BC7C::CompressImageBC7SIMD;
}
else {
#endif
return BC7C::CompressImageBC7;
#ifdef HAS_SSE_41
}
#endif
}
break;
}
@ -54,7 +58,16 @@ CompressedImage * CompressImage(
const ImageFile &img,
const SCompressionSettings &settings
) {
// Make sure that platform supports SSE if they chose this
// option...
#ifndef HAS_SSE_41
if(settings.bUseSIMD) {
ReportError("Platform does not support SIMD!\n");
return NULL;
}
#endif
const unsigned int dataSz = img.GetWidth() * img.GetHeight() * 4;
// Allocate data based on the compression method