mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2024-11-28 00:44:20 +01:00
Add Yield function to global namespace
In order to develop a threadsafe texture compression function, we will need to preempt threads in order to not kill performance while we initialzie everything...
This commit is contained in:
parent
2deb71eec9
commit
8ebdc30394
@ -121,4 +121,8 @@ typedef void (* CompressionFuncWithStats)(
|
|||||||
// compressed image and a raw image.
|
// compressed image and a raw image.
|
||||||
extern double ComputePSNR(const CompressedImage &ci, const ImageFile &file);
|
extern double ComputePSNR(const CompressedImage &ci, const ImageFile &file);
|
||||||
|
|
||||||
|
// This is a multi-platform yield function that preempts the current thread
|
||||||
|
// based on the threading library that we're using.
|
||||||
|
extern void YieldThread();
|
||||||
|
|
||||||
#endif //_TEX_COMP_H_
|
#endif //_TEX_COMP_H_
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "BC7Compressor.h"
|
#include "BC7Compressor.h"
|
||||||
|
#include "Thread.h"
|
||||||
#include "WorkerQueue.h"
|
#include "WorkerQueue.h"
|
||||||
#include "ThreadGroup.h"
|
#include "ThreadGroup.h"
|
||||||
|
|
||||||
@ -322,3 +323,7 @@ bool CompressImageData(
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void YieldThread() {
|
||||||
|
TCThread::Yield();
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user