forked from KhronosGroup/SPIRV-Cross
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix control flow bug where we missed continue;
Case which caused failure: if (cond) { continue; } break; Only allow tracing from inner selections if the outer header never merges execution.
- Loading branch information
1 parent
50b4d53
commit 46e4b5a
Showing
3 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
reference/shaders-no-opt/comp/loop-break-merge-after-inner-continue.comp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#version 450 | ||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; | ||
|
||
layout(binding = 0, std430) buffer STO | ||
{ | ||
uint data[]; | ||
} ssbo; | ||
|
||
void main() | ||
{ | ||
while (true) | ||
{ | ||
ssbo.data[0]++; | ||
if (ssbo.data[2] != 0u) | ||
{ | ||
ssbo.data[5]++; | ||
continue; | ||
} | ||
break; | ||
} | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
shaders-no-opt/comp/loop-break-merge-after-inner-continue.comp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#version 450 | ||
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; | ||
|
||
layout (binding = 0) buffer STO | ||
{ | ||
uint data[]; | ||
} ssbo; | ||
|
||
void main() | ||
{ | ||
while(true) | ||
{ | ||
ssbo.data[0] += 1; | ||
if (bool(ssbo.data[2])) | ||
{ | ||
ssbo.data[5] += 1; | ||
continue; | ||
} | ||
break; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters