Skip to content

Commit 008aec0

Browse files
alsepkowCopilot
andcommitted
[VK] Fix EnabledDeviceExtensions redefinition and silent extension drop
Two local variables both named `EnabledDeviceExtensions` were declared in the same enclosing scope of `VulkanDevice::create`: one added by #1177 (mesh shader) and one added inside `#ifdef VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME` by #1195 (InterlockedOr). Any platform whose Vulkan SDK defines that macro rejects the file. CI surfaced it first on the macOS runner (Vulkan 1.4.335 + clang) because that job ran ahead of the Windows jobs and short-circuited the matrix, but Windows is equally affected: Windows VK CI uses Vulkan SDK 1.4.350.0, and a local Windows + MSVC + Vulkan SDK 1.4.341.1 build reproduces the failure as `error C2371: 'EnabledDeviceExtensions': redefinition`. Beyond the build break, the inner block also overwrote `DeviceInfo.enabledExtensionCount` and `ppEnabledExtensionNames` that the mesh-shader block had populated, silently dropping `VK_EXT_mesh_shader` whenever both extensions were available. Neither bug existed in either PR in isolation; both are post-merge artifacts. Append the AtomicInt64 extension to the single `EnabledDeviceExtensions` vector and assign the `DeviceInfo` extension fields once, after both blocks. Assisted-by: Claude Opus 4.7 (claude-opus-4.7-high) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a2e657a commit 008aec0

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

lib/API/VK/Device.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,22 +1315,19 @@ class VulkanDevice : public offloadtest::Device {
13151315
Features.pNext = &MeshFeatures;
13161316
}
13171317

1318-
DeviceInfo.enabledExtensionCount =
1319-
static_cast<uint32_t>(EnabledDeviceExtensions.size());
1320-
DeviceInfo.ppEnabledExtensionNames = EnabledDeviceExtensions.data();
1321-
DeviceInfo.pEnabledFeatures = &Features.features;
1322-
DeviceInfo.pNext = Features.pNext;
1323-
13241318
#ifdef VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME
1325-
llvm::SmallVector<const char *, 1> EnabledDeviceExtensions;
13261319
if (HasShaderImageAtomicInt64Ext &&
13271320
FeaturesImageAtomicInt64.shaderImageInt64Atomics)
13281321
EnabledDeviceExtensions.push_back(
13291322
VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME);
1330-
DeviceInfo.enabledExtensionCount = EnabledDeviceExtensions.size();
1331-
DeviceInfo.ppEnabledExtensionNames = EnabledDeviceExtensions.data();
13321323
#endif
13331324

1325+
DeviceInfo.enabledExtensionCount =
1326+
static_cast<uint32_t>(EnabledDeviceExtensions.size());
1327+
DeviceInfo.ppEnabledExtensionNames = EnabledDeviceExtensions.data();
1328+
DeviceInfo.pEnabledFeatures = &Features.features;
1329+
DeviceInfo.pNext = Features.pNext;
1330+
13341331
VkDevice Device = VK_NULL_HANDLE;
13351332
if (auto Err = VK::toError(
13361333
vkCreateDevice(PhysicalDevice, &DeviceInfo, nullptr, &Device),

0 commit comments

Comments
 (0)