Skip to content

Commit cfdb477

Browse files
committed
Change Vulkan _T suffix trimming to be more specific
This is to avoid trimming things like GL_T from OpenGL
1 parent 8e1e2ad commit cfdb477

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

sources/SilkTouch/SilkTouch/Mods/MixKhronosData.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,15 +1386,19 @@ container is not null
13861386
}
13871387

13881388
// Trim _T from the end of names
1389-
foreach (var (original, (current, previous)) in names)
1389+
// This is targeted towards Vulkan handle type names, which end in _T
1390+
if (container is null)
13901391
{
1391-
if (current.EndsWith("_T"))
1392+
foreach (var (original, (current, previous)) in names)
13921393
{
1393-
var newPrim = current.Substring(0, current.Length - 2);
1394-
var newPrev = previous ?? [];
1395-
newPrev.Add(current);
1394+
if (current.EndsWith("_T"))
1395+
{
1396+
var newPrim = current.Substring(0, current.Length - 2);
1397+
var newPrev = previous ?? [];
1398+
newPrev.Add(current);
13961399

1397-
names[original] = (newPrim, newPrev);
1400+
names[original] = (newPrim, newPrev);
1401+
}
13981402
}
13991403
}
14001404
}

0 commit comments

Comments
 (0)