From c8101b46f7738a37657bceeaf3137527d21ae556 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Mon, 14 Oct 2013 20:58:11 -0400 Subject: [PATCH] Make sure not to break compilation if we don't have any atomics. --- Core/src/TexComp.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Core/src/TexComp.cpp b/Core/src/TexComp.cpp index f69a22a..5b36d50 100644 --- a/Core/src/TexComp.cpp +++ b/Core/src/TexComp.cpp @@ -186,6 +186,7 @@ static double CompressImageInSerial( return cmpTime; } +#ifdef HAS_ATOMICS class AtomicThreadUnit : public TCCallable { CompressionJobList &m_CompressionJobList; TCBarrier *m_Barrier; @@ -269,6 +270,16 @@ static double CompressImageWithAtomics( double cmpTimeTotal = sw.TimeInMilliseconds(); return cmpTimeTotal / double(settings.iNumCompressions); } +#else // HAS_ATOMICS +static double CompressImageWithAtomics( + const unsigned char *imgData, + const unsigned int width, const unsigned int height, + const SCompressionSettings &settings, + unsigned char *outBuf +) { + fprintf(stderr, "Compiler does not support atomic operations!"); +} +#endif static double CompressThreadGroup(ThreadGroup &tgrp, const SCompressionSettings &settings) { if(!(tgrp.PrepareThreads())) { @@ -419,6 +430,13 @@ bool CompressImageData( } #endif + #ifndef HAS_ATOMICS + if(settings.bUseAtomics) { + ReportError("Compiler's atomic operations are not supported!\n"); + return false; + } + #endif + if(dataSz <= 0) { ReportError("No data sent to compress!"); return false;