Hi, I started looking into implementing comp shaders for Windows and hit a few errors with the shaders that I'm not sure how to solve.
error X3663: thread sync operation found in varying flow control, consider reformulating your algorithm so all threads will hit the sync simultaneously:
backdrop.comp (and few others):
void main() {
if (mem_error != NO_ERROR) { // <---
return;
}
...
barrier(); // <---
error X3000: syntax error: unexpected token 'vector':
struct TileSeg {
vec2 origin;
vec2 vector; // <--- it looks like "vector" is a reserved word.
float y_edge;
TileSegRef next;
generate: Z:\Temp\shader-convert292189591\kernel4.comp(1000,17-25): error X3708: continue cannot be used in a switch
case Cmd_Jump:
cmd_ref = CmdRef(Cmd_Jump_read(cmd_alloc, cmd_ref).new_ref);
cmd_alloc.offset = cmd_ref.offset;
continue; // <---
error X4026: thread sync operation must be in non-varying flow control, due to a potential race condition this sync is illegal, consider adding a sync after reading any values controlling shader execution at this point
MallocResult alloc_clip_buf(uint link) {
if (gl_LocalInvocationID.x == 0 && gl_LocalInvocationID.y == 0) {
MallocResult m = malloc(CLIP_BUF_SIZE * 4);
if (!m.failed) {
write_mem(m.alloc, (m.alloc.offset >> 2) + CLIP_LINK_OFFSET, link);
}
sh_clip_alloc = m;
}
barrier(); // <---
return sh_clip_alloc;
}