Skip to content

Commit eb9e330

Browse files
authored
[VK] Fix EnabledDeviceExtensions redefinition and drop on macOS build (#1251)
Fixes a redefinition of `EnabledDeviceExtensions` in `VulkanDevice::create` introduced by the parallel merge of #1177 and #1195, plus a related silent drop of `VK_EXT_mesh_shader` when both extensions are enabled. Assisted by Claude Opus 4.7.
1 parent 8d8ad56 commit eb9e330

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)