Skip to content

Commit 297cd57

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [6000.3] [VFX] Fix Sort.compute crash caused by OOB buffer access
1 parent 42b673f commit 297cd57

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Packages/com.unity.visualeffectgraph/Shaders/Sort.compute

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ void LoadFromMemory(uint3 groupId, uint ldsIndex)
112112
uint memIndex = DST_INDEX(groupId, ldsIndex);
113113

114114
KVP kvp = { REJECTED_VALUE, 0xFFFFFFFF };
115+
116+
UNITY_BRANCH
115117
if (instanceDstIndex < GetElementCount(groupId.z))
116118
kvp = inputSequence[totalInstanceCount + memIndex];
117119

@@ -245,6 +247,7 @@ void MERGE_PASS(uint3 groupId : SV_GroupID,
245247
const int arrayStart = arraySize * (id / arraySize);
246248

247249
// If the current array considered is less than one half filled (due to element count), we can copy it directly as it is already sorted
250+
UNITY_BRANCH
248251
if (GetElementCount(groupId.z) - (uint)arrayStart <= subArraySize)
249252
{
250253
#if FINAL_PASS

0 commit comments

Comments
 (0)