gpu/shaders: ensure dynamically uniform barriers when malloc fails

GPU APIs require that barrier() calls are dynamically uniform, that is
for every barrier in the code, every shader invocation in a workgroup
must all call it, or all not call it.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-04-11 16:34:33 +02:00
parent f930e3f3d7
commit ee519351f7
9 changed files with 564 additions and 580 deletions
+1 -5
View File
@@ -28,10 +28,6 @@ shared uint sh_tile_count[TILE_ALLOC_WG];
shared MallocResult sh_tile_alloc;
void main() {
if (mem_error != NO_ERROR) {
return;
}
uint th_ix = gl_LocalInvocationID.x;
uint element_ix = gl_GlobalInvocationID.x;
PathRef path_ref = PathRef(conf.tile_alloc.offset + element_ix * Path_size);
@@ -86,7 +82,7 @@ void main() {
}
barrier();
MallocResult alloc_start = sh_tile_alloc;
if (alloc_start.failed) {
if (alloc_start.failed || mem_error != NO_ERROR) {
return;
}