Skip to content

Commit ca98d81

Browse files
committed
Remove MaxEnum members from enums
Because the MaxEnum member got removed, some enum members had their trimming adjusted as a side effect. Case 1: Matches Silk 2: - SamplerYcbcrRange - SemaphoreImportFlags - DeviceDiagnosticsConfigFlagsNV - FenceImportFlags - VideoDecodeCapabilityFlagsKHR - VideoEncodeFeedbackFlagsKHR - ClusterAccelerationStructureAddressResolutionFlagsNV (Doesn't exist in Silk 2) Case 2: Unintended changes (need to fix): - IndirectStateFlagsNV - SemaphoreImportFlags - SemaphoreWaitFlags - SurfaceCounterFlagsEXT
1 parent 86e998d commit ca98d81

File tree

257 files changed

+40
-1877
lines changed

Some content is hidden

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

257 files changed

+40
-1877
lines changed

.silktouch/ac001027d53000e0.stout

0 Bytes
Binary file not shown.

sources/SilkTouch/SilkTouch/Mods/MixKhronosData.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,7 @@ private class EnumRewriterPhase1(JobData job, ILogger logger) : CSharpSyntaxRewr
19201920
/// Finishes renaming FlagBits enums to Flags.
19211921
/// Marks bitmask enums with the [Flags] attribute.
19221922
/// Replaces uint/ulong with the actual enum type for FlagBits/Flags types.
1923+
/// Removes MaxEnum member from enums.
19231924
/// </summary>
19241925
private class EnumRewriterPhase2(JobData job, EnumRewriterPhase1 phase1) : CSharpSyntaxRewriter(true)
19251926
{
@@ -1928,6 +1929,7 @@ private class EnumRewriterPhase2(JobData job, EnumRewriterPhase1 phase1) : CShar
19281929
public override SyntaxNode? VisitEnumDeclaration(EnumDeclarationSyntax node)
19291930
{
19301931
var identifier = node.Identifier.ToString();
1932+
19311933
if (job.Groups.TryGetValue(identifier, out var group) && group.KnownBitmask)
19321934
{
19331935
// Add [Flags] attribute
@@ -1938,6 +1940,14 @@ private class EnumRewriterPhase2(JobData job, EnumRewriterPhase1 phase1) : CShar
19381940
node = node.WithAttributeLists(node.AttributeLists.Add(flagsAttribute));
19391941
}
19401942

1943+
if (job.Groups.ContainsKey(identifier))
1944+
{
1945+
// Remove MaxEnum member
1946+
node = node.WithMembers([
1947+
..node.Members.Where(member => !member.Identifier.ToString().Contains("MAX_ENUM"))
1948+
]);
1949+
}
1950+
19411951
return base.VisitEnumDeclaration(node);
19421952
}
19431953

sources/Vulkan/Vulkan/Vulkan/AccelerationStructureBuildTypeKHR.gen.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,4 @@ public enum AccelerationStructureBuildTypeKHR : uint
4242
]
4343
)]
4444
HostOrDeviceKHR = 2,
45-
46-
[SupportedApiProfile(
47-
"vulkan",
48-
["VK_KHR_acceleration_structure"],
49-
ImpliesSets = [
50-
"VK_KHR_deferred_host_operations+VK_VERSION_1_1+VK_EXT_descriptor_indexing+VK_KHR_buffer_device_address",
51-
"VK_KHR_deferred_host_operations+VK_VERSION_1_2",
52-
]
53-
)]
54-
MaxEnumKHR = 0x7FFFFFFF,
5545
}

sources/Vulkan/Vulkan/Vulkan/AccelerationStructureCompatibilityKHR.gen.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,4 @@ public enum AccelerationStructureCompatibilityKHR : uint
3232
]
3333
)]
3434
IncompatibleKHR = 1,
35-
36-
[SupportedApiProfile(
37-
"vulkan",
38-
["VK_KHR_acceleration_structure"],
39-
ImpliesSets = [
40-
"VK_KHR_deferred_host_operations+VK_VERSION_1_1+VK_EXT_descriptor_indexing+VK_KHR_buffer_device_address",
41-
"VK_KHR_deferred_host_operations+VK_VERSION_1_2",
42-
]
43-
)]
44-
MaxEnumKHR = 0x7FFFFFFF,
4535
}

sources/Vulkan/Vulkan/Vulkan/AccelerationStructureMemoryRequirementsTypeNV.gen.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,4 @@ public enum AccelerationStructureMemoryRequirementsTypeNV : uint
4242
]
4343
)]
4444
UpdateScratchNV = 2,
45-
46-
[SupportedApiProfile(
47-
"vulkan",
48-
["VK_NV_ray_tracing"],
49-
ImpliesSets = [
50-
"VK_KHR_get_physical_device_properties2+VK_KHR_get_memory_requirements2",
51-
"VK_VERSION_1_1",
52-
]
53-
)]
54-
MaxEnumNV = 0x7FFFFFFF,
5545
}

sources/Vulkan/Vulkan/Vulkan/AccelerationStructureMotionInstanceTypeNV.gen.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,4 @@ public enum AccelerationStructureMotionInstanceTypeNV : uint
3333
ImpliesSets = ["VK_KHR_ray_tracing_pipeline"]
3434
)]
3535
SrtMotionNV = 2,
36-
37-
[SupportedApiProfile(
38-
"vulkan",
39-
["VK_NV_ray_tracing_motion_blur"],
40-
ImpliesSets = ["VK_KHR_ray_tracing_pipeline"]
41-
)]
42-
MaxEnumNV = 0x7FFFFFFF,
4336
}

sources/Vulkan/Vulkan/Vulkan/AccelerationStructureTypeKHR.gen.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,4 @@ public enum AccelerationStructureTypeKHR : uint
6262
]
6363
)]
6464
BottomLevelNV = BottomLevelKHR,
65-
66-
[SupportedApiProfile(
67-
"vulkan",
68-
["VK_KHR_acceleration_structure"],
69-
ImpliesSets = [
70-
"VK_KHR_deferred_host_operations+VK_VERSION_1_1+VK_EXT_descriptor_indexing+VK_KHR_buffer_device_address",
71-
"VK_KHR_deferred_host_operations+VK_VERSION_1_2",
72-
]
73-
)]
74-
MaxEnumKHR = 0x7FFFFFFF,
7565
}

sources/Vulkan/Vulkan/Vulkan/AntiLagModeAMD.gen.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,4 @@ public enum AntiLagModeAMD : uint
2121

2222
[SupportedApiProfile("vulkan", ["VK_AMD_anti_lag"])]
2323
OffAMD = 2,
24-
25-
[SupportedApiProfile("vulkan", ["VK_AMD_anti_lag"])]
26-
MaxEnumAMD = 0x7FFFFFFF,
2724
}

sources/Vulkan/Vulkan/Vulkan/AntiLagStageAMD.gen.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,4 @@ public enum AntiLagStageAMD : uint
1818

1919
[SupportedApiProfile("vulkan", ["VK_AMD_anti_lag"])]
2020
PresentAMD = 1,
21-
22-
[SupportedApiProfile("vulkan", ["VK_AMD_anti_lag"])]
23-
MaxEnumAMD = 0x7FFFFFFF,
2421
}

sources/Vulkan/Vulkan/Vulkan/AttachmentDescriptionFlagBits.gen.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,4 @@ public enum AttachmentDescriptionFlags : uint
2222
MinVersion = "1.0"
2323
)]
2424
MayAliasBit = 0x00000001,
25-
26-
[SupportedApiProfile(
27-
"vulkan",
28-
["VK_VERSION_1_0", "VK_VERSION_1_1", "VK_VERSION_1_2", "VK_VERSION_1_3", "VK_VERSION_1_4"],
29-
MinVersion = "1.0"
30-
)]
31-
FlagBitsMaxEnum = 0x7FFFFFFF,
3225
}

0 commit comments

Comments
 (0)