We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 310bfa6 commit e746feeCopy full SHA for e746fee
hxsl/Ast.hx
@@ -350,6 +350,9 @@ typedef ShaderData = {
350
class Tools {
351
352
static var UID = 0;
353
+ #if heaps_mt_hxsl_cache
354
+ static var uidMutex = new sys.thread.Mutex();
355
+ #end
356
357
public static var SWIZ = Component.createAll();
358
public static var MAX_CHANNELS_BITS = 3;
@@ -361,7 +364,14 @@ class Tools {
361
364
#if macro
362
365
return --UID;
363
366
#else
- return ++UID;
367
368
+ uidMutex.acquire();
369
370
+ var id = ++UID;
371
372
+ uidMutex.release();
373
374
+ return id;
375
#end
376
}
377
0 commit comments