mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-01-24 13:41:00 +00:00
Make sure not to break compilation if we don't have any atomics.
This commit is contained in:
parent
0ecd678a58
commit
c8101b46f7
|
@ -186,6 +186,7 @@ static double CompressImageInSerial(
|
||||||
return cmpTime;
|
return cmpTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAS_ATOMICS
|
||||||
class AtomicThreadUnit : public TCCallable {
|
class AtomicThreadUnit : public TCCallable {
|
||||||
CompressionJobList &m_CompressionJobList;
|
CompressionJobList &m_CompressionJobList;
|
||||||
TCBarrier *m_Barrier;
|
TCBarrier *m_Barrier;
|
||||||
|
@ -269,6 +270,16 @@ static double CompressImageWithAtomics(
|
||||||
double cmpTimeTotal = sw.TimeInMilliseconds();
|
double cmpTimeTotal = sw.TimeInMilliseconds();
|
||||||
return cmpTimeTotal / double(settings.iNumCompressions);
|
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) {
|
static double CompressThreadGroup(ThreadGroup &tgrp, const SCompressionSettings &settings) {
|
||||||
if(!(tgrp.PrepareThreads())) {
|
if(!(tgrp.PrepareThreads())) {
|
||||||
|
@ -419,6 +430,13 @@ bool CompressImageData(
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAS_ATOMICS
|
||||||
|
if(settings.bUseAtomics) {
|
||||||
|
ReportError("Compiler's atomic operations are not supported!\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(dataSz <= 0) {
|
if(dataSz <= 0) {
|
||||||
ReportError("No data sent to compress!");
|
ReportError("No data sent to compress!");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue