Also fix write-after-read in elements.com

On further testing, this resolves a hard lockup on Intel 630 on the
mmark stress test, so is worth getting into the repo.
This commit is contained in:
Raph Levien 2021-11-14 08:22:34 -08:00
parent 69b6632085
commit 8015eb25a1
3 changed files with 3 additions and 1 deletions

View file

@ -248,9 +248,10 @@ void main() {
// The flag load is done only in the last thread. However, because the // The flag load is done only in the last thread. However, because the
// translation of memoryBarrierBuffer to Metal requires uniform control // translation of memoryBarrierBuffer to Metal requires uniform control
// flow, we broadcast it to all threads. // flow, we broadcast it to all threads.
barrier();
memoryBarrierBuffer(); memoryBarrierBuffer();
barrier();
uint flag = sh_flag; uint flag = sh_flag;
barrier();
if (flag == FLAG_PREFIX_READY) { if (flag == FLAG_PREFIX_READY) {
if (gl_LocalInvocationID.x == WG_SIZE - 1) { if (gl_LocalInvocationID.x == WG_SIZE - 1) {
@ -293,6 +294,7 @@ void main() {
} }
barrier(); barrier();
flag = sh_flag; flag = sh_flag;
barrier();
if (flag == FLAG_PREFIX_READY) { if (flag == FLAG_PREFIX_READY) {
break; break;
} }

Binary file not shown.

Binary file not shown.