diff --git a/piet-gpu/shader/elements.comp b/piet-gpu/shader/elements.comp index e4bbfec..873fc41 100644 --- a/piet-gpu/shader/elements.comp +++ b/piet-gpu/shader/elements.comp @@ -248,9 +248,10 @@ void main() { // The flag load is done only in the last thread. However, because the // translation of memoryBarrierBuffer to Metal requires uniform control // flow, we broadcast it to all threads. - barrier(); memoryBarrierBuffer(); + barrier(); uint flag = sh_flag; + barrier(); if (flag == FLAG_PREFIX_READY) { if (gl_LocalInvocationID.x == WG_SIZE - 1) { @@ -293,6 +294,7 @@ void main() { } barrier(); flag = sh_flag; + barrier(); if (flag == FLAG_PREFIX_READY) { break; } diff --git a/piet-gpu/shader/elements.spv b/piet-gpu/shader/elements.spv index 60517b0..37cc051 100644 Binary files a/piet-gpu/shader/elements.spv and b/piet-gpu/shader/elements.spv differ diff --git a/piet-gpu/shader/kernel4.spv b/piet-gpu/shader/kernel4.spv index 2e8f752..322a047 100644 Binary files a/piet-gpu/shader/kernel4.spv and b/piet-gpu/shader/kernel4.spv differ