Package org.lwjgl.vulkan
Class KHRDeviceGroupCreation
java.lang.Object
org.lwjgl.vulkan.KHRDeviceGroupCreation
This extension provides instance-level commands to enumerate groups of physical devices, and to create a logical device from a subset of one of those groups. Such a logical device can then be used with new features in the
VK_KHR_device_group extension.
Promotion to Vulkan 1.1
All functionality in this extension is included in core Vulkan 1.1, with the KHR suffix omitted. The original type, enum, and command names are still available as aliases of the core functionality.
Examples
VkDeviceCreateInfo devCreateInfo = { VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO };
// (not shown) fill out devCreateInfo as usual.
uint32_t deviceGroupCount = 0;
VkPhysicalDeviceGroupPropertiesKHR *props = NULL;
// Query the number of device groups
vkEnumeratePhysicalDeviceGroupsKHR(g_vkInstance, &deviceGroupCount, NULL);
// Allocate and initialize structures to query the device groups
props = (VkPhysicalDeviceGroupPropertiesKHR *)malloc(deviceGroupCount*sizeof(VkPhysicalDeviceGroupPropertiesKHR));
for (i = 0; i < deviceGroupCount; ++i) {
props[i].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR;
props[i].pNext = NULL;
}
vkEnumeratePhysicalDeviceGroupsKHR(g_vkInstance, &deviceGroupCount, props);
// If the first device group has more than one physical device. create
// a logical device using all of the physical devices.
VkDeviceGroupDeviceCreateInfoKHR deviceGroupInfo = { VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR };
if (props[0].physicalDeviceCount > 1) {
deviceGroupInfo.physicalDeviceCount = props[0].physicalDeviceCount;
deviceGroupInfo.pPhysicalDevices = props[0].physicalDevices;
devCreateInfo.pNext = &deviceGroupInfo;
}
vkCreateDevice(props[0].physicalDevices[0], &devCreateInfo, NULL, &g_vkDevice);
free(props);
- Name String
VK_KHR_device_group_creation- Extension Type
- Instance extension
- Registered Extension Number
- 71
- Revision
- 1
- Deprecation State
- Promoted to Vulkan 1.1
- Contact
- Jeff Bolz jeffbolznv
Other Extension Metadata
- Last Modified Date
- 2016-10-19
- IP Status
- No known IP claims.
- Contributors
- Jeff Bolz, NVIDIA
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version.static final intVK_MAX_DEVICE_GROUP_SIZE_KHRstatic final intExtendsVkMemoryHeapFlagBits.static final intExtendsVkStructureType.static final intExtendsVkStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnvkEnumeratePhysicalDeviceGroupsKHR(org.lwjgl.vulkan.VkInstance instance, long pPhysicalDeviceGroupCount, long pPhysicalDeviceGroupProperties) Unsafe version of:EnumeratePhysicalDeviceGroupsKHRstatic intvkEnumeratePhysicalDeviceGroupsKHR(org.lwjgl.vulkan.VkInstance instance, int[] pPhysicalDeviceGroupCount, @Nullable VkPhysicalDeviceGroupProperties.Buffer pPhysicalDeviceGroupProperties) Array version of:EnumeratePhysicalDeviceGroupsKHRstatic intvkEnumeratePhysicalDeviceGroupsKHR(org.lwjgl.vulkan.VkInstance instance, IntBuffer pPhysicalDeviceGroupCount, @Nullable VkPhysicalDeviceGroupProperties.Buffer pPhysicalDeviceGroupProperties)
-
Field Details
-
VK_KHR_DEVICE_GROUP_CREATION_SPEC_VERSION
public static final int VK_KHR_DEVICE_GROUP_CREATION_SPEC_VERSIONThe extension specification version.- See Also:
-
VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME
The extension name.- See Also:
-
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHRExtendsVkStructureType.Enum values:
- See Also:
-
VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR
public static final int VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHRExtendsVkStructureType.Enum values:
- See Also:
-
VK_MAX_DEVICE_GROUP_SIZE_KHR
public static final int VK_MAX_DEVICE_GROUP_SIZE_KHRVK_MAX_DEVICE_GROUP_SIZE_KHR- See Also:
-
VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR
public static final int VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHRExtendsVkMemoryHeapFlagBits.- See Also:
-
-
Method Details
-
nvkEnumeratePhysicalDeviceGroupsKHR
public static int nvkEnumeratePhysicalDeviceGroupsKHR(org.lwjgl.vulkan.VkInstance instance, long pPhysicalDeviceGroupCount, long pPhysicalDeviceGroupProperties) Unsafe version of:EnumeratePhysicalDeviceGroupsKHR- Parameters:
pPhysicalDeviceGroupCount- a pointer to an integer related to the number of device groups available or queried, as described below.
-
vkEnumeratePhysicalDeviceGroupsKHR
public static int vkEnumeratePhysicalDeviceGroupsKHR(org.lwjgl.vulkan.VkInstance instance, IntBuffer pPhysicalDeviceGroupCount, @Nullable VkPhysicalDeviceGroupProperties.Buffer pPhysicalDeviceGroupProperties) - Parameters:
instance- a handle to a Vulkan instance previously created withCreateInstance.pPhysicalDeviceGroupCount- a pointer to an integer related to the number of device groups available or queried, as described below.pPhysicalDeviceGroupProperties- eitherNULLor a pointer to an array ofVkPhysicalDeviceGroupPropertiesstructures.
-
vkEnumeratePhysicalDeviceGroupsKHR
public static int vkEnumeratePhysicalDeviceGroupsKHR(org.lwjgl.vulkan.VkInstance instance, int[] pPhysicalDeviceGroupCount, @Nullable VkPhysicalDeviceGroupProperties.Buffer pPhysicalDeviceGroupProperties) Array version of:EnumeratePhysicalDeviceGroupsKHR
-