MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / compression_workload_runner

Function compression_workload_runner

Source/astcenccli_toplevel.cpp:245–267  ·  view source on GitHub ↗

* @brief Runner callback function for a compression 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. */

Source from the content-addressed store, hash-verified

243 * @param payload The parameters for this thread.
244 */
245static void compression_workload_runner(
246 int thread_count,
247 int thread_id,
248 void* payload
249) {
250 (void)thread_count;
251
252 char name[16] { 0 };
253 std::snprintf(name, 16, "astc workc %d", thread_id);
254 set_thread_name(name);
255
256 compression_workload* work = static_cast<compression_workload*>(payload);
257 astcenc_error error = astcenc_compress_image(
258 work->context, work->image, &work->swizzle,
259 work->data_out, work->data_len, thread_id);
260
261 // This is a racy update, so which error gets returned is a random, but it
262 // will reliably report an error if an error occurs
263 if (error != ASTCENC_SUCCESS)
264 {
265 work->error = error;
266 }
267}
268
269/**
270 * @brief Runner callback function for a decompression worker thread.

Callers

nothing calls this directly

Calls 2

set_thread_nameFunction · 0.85
astcenc_compress_imageFunction · 0.85

Tested by

no test coverage detected