* @brief Runner callback function for a decompression worker thread. * * @param thread_count The number of threads in the worker pool. * @param thread_id The index of this thread in the worker pool. * @param payload The parameters for this thread. */
| 274 | * @param payload The parameters for this thread. |
| 275 | */ |
| 276 | static void decompression_workload_runner( |
| 277 | int thread_count, |
| 278 | int thread_id, |
| 279 | void* payload |
| 280 | ) { |
| 281 | (void)thread_count; |
| 282 | |
| 283 | char name[16] { 0 }; |
| 284 | std::snprintf(name, 16, "astc workd %d", thread_id); |
| 285 | set_thread_name(name); |
| 286 | |
| 287 | decompression_workload* work = static_cast<decompression_workload*>(payload); |
| 288 | astcenc_error error = astcenc_decompress_image( |
| 289 | work->context, work->data, work->data_len, |
| 290 | work->image_out, &work->swizzle, thread_id); |
| 291 | |
| 292 | // This is a racy update, so which error gets returned is a random, but it |
| 293 | // will reliably report an error if an error occurs |
| 294 | if (error != ASTCENC_SUCCESS) |
| 295 | { |
| 296 | work->error = error; |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | /** |
| 301 | * @brief Utility to generate a slice file name from a pattern. |
nothing calls this directly
no test coverage detected