mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 11:48:09 +02:00
Update nvtt to only use a single thread
This commit is contained in:
parent
a59103aad5
commit
8e73eae341
1 changed files with 11 additions and 0 deletions
|
@ -447,7 +447,18 @@ void generateMips(gpu::Texture* texture, QImage& image, int face = -1) {
|
||||||
MyErrorHandler errorHandler;
|
MyErrorHandler errorHandler;
|
||||||
outputOptions.setErrorHandler(&errorHandler);
|
outputOptions.setErrorHandler(&errorHandler);
|
||||||
|
|
||||||
|
class SequentialTaskDispatcher : public nvtt::TaskDispatcher {
|
||||||
|
public:
|
||||||
|
virtual void dispatch(nvtt::Task* task, void* context, int count) {
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
|
task(context, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
SequentialTaskDispatcher dispatcher;
|
||||||
nvtt::Compressor compressor;
|
nvtt::Compressor compressor;
|
||||||
|
compressor.setTaskDispatcher(&dispatcher);
|
||||||
compressor.process(inputOptions, compressionOptions, outputOptions);
|
compressor.process(inputOptions, compressionOptions, outputOptions);
|
||||||
#else
|
#else
|
||||||
texture->autoGenerateMips(-1);
|
texture->autoGenerateMips(-1);
|
||||||
|
|
Loading…
Reference in a new issue