Update astc.cpp

This commit is contained in:
halx99 2021-07-02 00:38:02 +08:00 committed by GitHub
parent 26027020ba
commit 36870f7aaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -93,13 +93,14 @@ public:
task->_context->manage_decompress.wait(); task->_context->manage_decompress.wait();
_taskQueueMtx.lock(); _taskQueueMtx.lock();
if (!_taskQueue.empty()) { assert(!_taskQueue.empty());
auto t = _taskQueue.front();
assert(t == task); auto t = _taskQueue.front();
_taskQueue.pop_front(); assert(t == task);
t->release(); _taskQueue.pop_front();
}
_taskQueueMtx.unlock(); _taskQueueMtx.unlock();
task->release();
} }
public: public:
@ -207,7 +208,7 @@ int astc_decompress_job_manager::s_thread_count = 1;
uint8_t astc_decompress_image(const uint8_t* in, uint32_t inlen, uint8_t* out, uint32_t dim_x, uint32_t dim_y, uint8_t astc_decompress_image(const uint8_t* in, uint32_t inlen, uint8_t* out, uint32_t dim_x, uint32_t dim_y,
uint32_t block_x, uint32_t block_y) { uint32_t block_x, uint32_t block_y) {
auto start = yasio::highp_clock(); // auto start = yasio::highp_clock();
#if defined(ASTC_ENABLE_PARALLEL_DECOMPRESS) #if defined(ASTC_ENABLE_PARALLEL_DECOMPRESS)
astc_decompress_job_manager::get_instance()->decompress_parallel_sync(in, out, dim_x, dim_y, block_x, block_y); astc_decompress_job_manager::get_instance()->decompress_parallel_sync(in, out, dim_x, dim_y, block_x, block_y);