Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
31 lines (26 sloc)
428 Bytes
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
| uint func(uint3 dispatch) | |
| { | |
| [loop] | |
| for (int i = 0; i < 10; i++) | |
| { | |
| [loop] | |
| for (int j = 0; j < 20; j++) | |
| { | |
| [branch] | |
| if (dispatch.y < 10) | |
| return 50; | |
| [branch] | |
| if (dispatch.z < 10) | |
| return 70; | |
| dispatch.y++; | |
| } | |
| dispatch.x++; | |
| } | |
| return 80; | |
| } | |
| RWStructuredBuffer<uint> buf : register(u0); | |
| [numthreads(1, 1, 1)] | |
| void main(uint3 dispatch : SV_DispatchThreadID) | |
| { | |
| buf[dispatch.x] = func(dispatch); | |
| } |