Skip to content

Commit 20f5909

Browse files
PaulDemeulenaereGitHub Enterprise
authored andcommitted
[Switch] Fix OOB in Initialize compute (#261)
* Fix OOB See original experiment dfe52ee * *Update changelog.md * Minor refactor of dichotomy code - Address this issue : Fix https://github.cds.internal.unity3d.com/unity/vfx-graphics/pull/261#discussion_r159944 - I checked the generated code from ilassembly : http://shader-playground.timjones.io/52be834b8d455f3240051c5f7eebee5d - Run locally URP graphicTest in playmode :green: (TODO : verify on switch)
1 parent 027782f commit 20f5909

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

com.unity.visualeffectgraph/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7373
- Fix IsFrontFace shader graph node for VFX.
7474
- Fix crash when loading SDF Baker settings holding a mesh prefab [Case 1343898](https://issuetracker.unity3d.com/product/unity/issues/guid/1343898/)
7575
- Exception using gizmo on exposed properties [Case 1340818](https://issuetracker.unity3d.com/product/unity/issues/guid/1340818/)
76+
- GPU hang on some initialize dispatch during dichotomy (platform specific)
7677

7778
## [11.0.0] - 2020-10-21
7879
### Added

com.unity.visualeffectgraph/Shaders/VFXInit.template

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,16 @@ void CSMain(uint3 groupId : SV_GroupID,
108108
while (left <= right)
109109
{
110110
sourceIndex = (int)((left + right) / 2);
111-
if (id < prefixSumSpawnCount[sourceIndex] && (sourceIndex == 0 || id >= prefixSumSpawnCount[sourceIndex-1]))
112-
break;
113-
114-
if (id < prefixSumSpawnCount[sourceIndex])
111+
if (id.x < prefixSumSpawnCount[sourceIndex])
112+
{
113+
if (sourceIndex == 0 || id.x >= prefixSumSpawnCount[max(sourceIndex - 1, 0)])
114+
break;
115115
right = sourceIndex - 1;
116+
}
116117
else
118+
{
117119
left = sourceIndex + 1;
120+
}
118121
}
119122
#endif
120123
#endif

0 commit comments

Comments
 (0)