Skip to content

Commit b228927

Browse files
committed
Fix PointerDimensionReducer accidentally overwriting its own changes
1 parent 776a9ad commit b228927

58 files changed

Lines changed: 12215 additions & 29296 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.silktouch/a8a82533527277ff.stout

0 Bytes
Binary file not shown.

sources/SilkTouch/SilkTouch/Mods/TransformHandles.cs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,11 @@ public async Task ReducePointerDimensionAsync(List<INamedTypeSymbol> symbols)
616616
}
617617

618618
// Reduce the pointer dimension of all reference locations
619-
foreach (var location in locations)
619+
// Also, do modifications in groups to prevent overwriting changes
620+
var locationsBySourcetree = locations.GroupBy(l => l.SourceTree);
621+
foreach (var group in locationsBySourcetree)
620622
{
621-
var syntaxTree = location.SourceTree;
623+
var syntaxTree = group.Key;
622624
if (syntaxTree == null)
623625
{
624626
continue;
@@ -631,18 +633,24 @@ public async Task ReducePointerDimensionAsync(List<INamedTypeSymbol> symbols)
631633
}
632634

633635
var syntaxRoot = await syntaxTree.GetRootAsync(ct);
634-
var syntaxNode = syntaxRoot.FindNode(location.SourceSpan);
635636

636-
var nodeToModify = GetNodeToModify(syntaxNode);
637-
if (nodeToModify == null)
637+
// Modify each location
638+
foreach (var location in group.OrderByDescending(l => l.SourceSpan.Start))
638639
{
639-
continue;
640-
}
640+
var syntaxNode = syntaxRoot.FindNode(location.SourceSpan);
641641

642-
var newNode = Visit(nodeToModify);
643-
var newRoot = syntaxRoot.ReplaceNode(nodeToModify, newNode);
644-
var newDocument = document.WithSyntaxRoot(newRoot);
642+
var nodeToModify = GetNodeToModify(syntaxNode);
643+
if (nodeToModify == null)
644+
{
645+
continue;
646+
}
647+
648+
var newNode = Visit(nodeToModify);
649+
syntaxRoot = syntaxRoot.ReplaceNode(nodeToModify, newNode);
650+
}
645651

652+
// Commit the changes to the project
653+
var newDocument = document.WithSyntaxRoot(syntaxRoot);
646654
project = newDocument.Project;
647655
}
648656

sources/Vulkan/Vulkan/IVulkan/IVulkan.gen.cs

Lines changed: 3722 additions & 8506 deletions
Large diffs are not rendered by default.

sources/Vulkan/Vulkan/Vulkan/AccelerationStructureBuildGeometryInfoKHR.gen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public unsafe partial struct AccelerationStructureBuildGeometryInfoKHR
9292
"VK_KHR_deferred_host_operations+VK_VERSION_1_2",
9393
]
9494
)]
95-
public AccelerationStructureKHRHandle* DstAccelerationStructure;
95+
public AccelerationStructureKHRHandle DstAccelerationStructure;
9696

9797
[NativeTypeName("uint32_t")]
9898
[SupportedApiProfile(

sources/Vulkan/Vulkan/Vulkan/AccelerationStructureCaptureDescriptorDataInfoEXT.gen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ public unsafe partial struct AccelerationStructureCaptureDescriptorDataInfoEXT
7777
"VK_VERSION_1_3",
7878
]
7979
)]
80-
public AccelerationStructureNVHandle* AccelerationStructureNV;
80+
public AccelerationStructureNVHandle AccelerationStructureNV;
8181
}

sources/Vulkan/Vulkan/Vulkan/AcquireNextImageInfoKHR.gen.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public unsafe partial struct AcquireNextImageInfoKHR
4545
ImpliesSets = ["VK_KHR_surface"],
4646
RequireAll = true
4747
)]
48-
public SwapchainKHRHandle* Swapchain;
48+
public SwapchainKHRHandle Swapchain;
4949

5050
[NativeTypeName("uint64_t")]
5151
[SupportedApiProfile(
@@ -72,7 +72,7 @@ public unsafe partial struct AcquireNextImageInfoKHR
7272
ImpliesSets = ["VK_KHR_surface"],
7373
RequireAll = true
7474
)]
75-
public FenceHandle* Fence;
75+
public FenceHandle Fence;
7676

7777
[NativeTypeName("uint32_t")]
7878
[SupportedApiProfile(

sources/Vulkan/Vulkan/Vulkan/BindAccelerationStructureMemoryInfoNV.gen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public unsafe partial struct BindAccelerationStructureMemoryInfoNV
5151
"VK_KHR_deferred_host_operations+VK_VERSION_1_2",
5252
]
5353
)]
54-
public AccelerationStructureNVHandle* AccelerationStructure;
54+
public AccelerationStructureNVHandle AccelerationStructure;
5555

5656
[NativeTypeName("VkDeviceMemory")]
5757
[SupportedApiProfile(

sources/Vulkan/Vulkan/Vulkan/BindBufferMemoryInfo.gen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public unsafe partial struct BindBufferMemoryInfo
5050
["VK_VERSION_1_1", "VK_VERSION_1_2", "VK_VERSION_1_3", "VK_VERSION_1_4"],
5151
MinVersion = "1.1"
5252
)]
53-
public DeviceMemoryHandle* Memory;
53+
public DeviceMemoryHandle Memory;
5454

5555
[NativeTypeName("VkDeviceSize")]
5656
[SupportedApiProfile(

sources/Vulkan/Vulkan/Vulkan/BindDescriptorSetsInfo.gen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public unsafe partial struct BindDescriptorSetsInfo
4646

4747
[NativeTypeName("const VkDescriptorSet *")]
4848
[SupportedApiProfile("vulkan", ["VK_VERSION_1_4"], MinVersion = "1.4")]
49-
public DescriptorSetHandle** PDescriptorSets;
49+
public DescriptorSetHandle* PDescriptorSets;
5050

5151
[NativeTypeName("uint32_t")]
5252
[SupportedApiProfile("vulkan", ["VK_VERSION_1_4"], MinVersion = "1.4")]

sources/Vulkan/Vulkan/Vulkan/BindImageMemoryInfo.gen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public unsafe partial struct BindImageMemoryInfo
4242
["VK_VERSION_1_1", "VK_VERSION_1_2", "VK_VERSION_1_3", "VK_VERSION_1_4"],
4343
MinVersion = "1.1"
4444
)]
45-
public ImageHandle* Image;
45+
public ImageHandle Image;
4646

4747
[NativeTypeName("VkDeviceMemory")]
4848
[SupportedApiProfile(

0 commit comments

Comments
 (0)