tcu::TestStatus deviceFeatures2 (Context& context)
{
- const PlatformInterface& vkp = context.getPlatformInterface();
- const VkInstance instance (context.getInstance());
- const InstanceDriver vki (vkp, instance);
- const vector<VkPhysicalDevice> devices = enumeratePhysicalDevices(vki, instance);
- TestLog& log = context.getTestContext().getLog();
-
- for (size_t deviceNdx = 0; deviceNdx < devices.size(); ++deviceNdx)
- {
- VkPhysicalDeviceFeatures coreFeatures;
- VkPhysicalDeviceFeatures2 extFeatures;
+ const PlatformInterface& vkp = context.getPlatformInterface();
+ const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
+ const VkInstance instance (context.getInstance());
+ const InstanceDriver vki (vkp, instance);
+ TestLog& log = context.getTestContext().getLog();
+ VkPhysicalDeviceFeatures coreFeatures;
+ VkPhysicalDeviceFeatures2 extFeatures;
- deMemset(&coreFeatures, 0xcd, sizeof(coreFeatures));
- deMemset(&extFeatures.features, 0xcd, sizeof(extFeatures.features));
- std::vector<std::string> instExtensions = context.getInstanceExtensions();
+ deMemset(&coreFeatures, 0xcd, sizeof(coreFeatures));
+ deMemset(&extFeatures.features, 0xcd, sizeof(extFeatures.features));
+ std::vector<std::string> instExtensions = context.getInstanceExtensions();
- extFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
- extFeatures.pNext = DE_NULL;
+ extFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
+ extFeatures.pNext = DE_NULL;
- vki.getPhysicalDeviceFeatures(devices[deviceNdx], &coreFeatures);
- vki.getPhysicalDeviceFeatures2(devices[deviceNdx], &extFeatures);
+ vki.getPhysicalDeviceFeatures(physicalDevice, &coreFeatures);
+ vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
- TCU_CHECK(extFeatures.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2);
- TCU_CHECK(extFeatures.pNext == DE_NULL);
+ TCU_CHECK(extFeatures.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2);
+ TCU_CHECK(extFeatures.pNext == DE_NULL);
- if (deMemCmp(&coreFeatures, &extFeatures.features, sizeof(VkPhysicalDeviceFeatures)) != 0)
- TCU_FAIL("Mismatch between features reported by vkGetPhysicalDeviceFeatures and vkGetPhysicalDeviceFeatures2");
+ if (deMemCmp(&coreFeatures, &extFeatures.features, sizeof(VkPhysicalDeviceFeatures)) != 0)
+ TCU_FAIL("Mismatch between features reported by vkGetPhysicalDeviceFeatures and vkGetPhysicalDeviceFeatures2");
- log << TestLog::Message << "device = " << deviceNdx << TestLog::EndMessage
- << TestLog::Message << extFeatures << TestLog::EndMessage;
+ log << TestLog::Message << extFeatures << TestLog::EndMessage;
- bool khr_16bit_storage = true;
- bool khr_multiview = true;
- bool deviceProtectedMemory = true;
- bool sampler_ycbcr_conversion = true;
- bool variable_pointers = true;
- if (getPhysicalDeviceProperties(vki, devices[deviceNdx]).apiVersion < VK_API_VERSION_1_1)
- {
- vector<VkExtensionProperties> properties = enumerateDeviceExtensionProperties(vki, devices[deviceNdx], DE_NULL);
- khr_16bit_storage = checkExtension(properties,"VK_KHR_16bit_storage");
- khr_multiview = checkExtension(properties,"VK_KHR_multiview");
- deviceProtectedMemory = false;
- sampler_ycbcr_conversion = checkExtension(properties,"VK_KHR_sampler_ycbcr_conversion");
- variable_pointers = checkExtension(properties,"VK_KHR_variable_pointers");
- }
+ bool khr_16bit_storage = true;
+ bool khr_multiview = true;
+ bool deviceProtectedMemory = true;
+ bool sampler_ycbcr_conversion = true;
+ bool variable_pointers = true;
+ if (getPhysicalDeviceProperties(vki, physicalDevice).apiVersion < VK_API_VERSION_1_1)
+ {
+ vector<VkExtensionProperties> properties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
+ khr_16bit_storage = checkExtension(properties,"VK_KHR_16bit_storage");
+ khr_multiview = checkExtension(properties,"VK_KHR_multiview");
+ deviceProtectedMemory = false;
+ sampler_ycbcr_conversion = checkExtension(properties,"VK_KHR_sampler_ycbcr_conversion");
+ variable_pointers = checkExtension(properties,"VK_KHR_variable_pointers");
+ }
- const int count = 2u;
- VkPhysicalDevice16BitStorageFeatures device16BitStorageFeatures[count];
- VkPhysicalDeviceMultiviewFeatures deviceMultiviewFeatures[count];
- VkPhysicalDeviceProtectedMemoryFeatures protectedMemoryFeatures[count];
- VkPhysicalDeviceSamplerYcbcrConversionFeatures samplerYcbcrConversionFeatures[count];
- VkPhysicalDeviceVariablePointerFeatures variablePointerFeatures[count];
+ const int count = 2u;
+ VkPhysicalDevice16BitStorageFeatures device16BitStorageFeatures[count];
+ VkPhysicalDeviceMultiviewFeatures deviceMultiviewFeatures[count];
+ VkPhysicalDeviceProtectedMemoryFeatures protectedMemoryFeatures[count];
+ VkPhysicalDeviceSamplerYcbcrConversionFeatures samplerYcbcrConversionFeatures[count];
+ VkPhysicalDeviceVariablePointerFeatures variablePointerFeatures[count];
- for (int ndx = 0; ndx < count; ++ndx)
- {
- deMemset(&device16BitStorageFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDevice16BitStorageFeatures));
- deMemset(&deviceMultiviewFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceMultiviewFeatures));
- deMemset(&protectedMemoryFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceProtectedMemoryFeatures));
- deMemset(&samplerYcbcrConversionFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceSamplerYcbcrConversionFeatures));
- deMemset(&variablePointerFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceVariablePointerFeatures));
+ for (int ndx = 0; ndx < count; ++ndx)
+ {
+ deMemset(&device16BitStorageFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDevice16BitStorageFeatures));
+ deMemset(&deviceMultiviewFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceMultiviewFeatures));
+ deMemset(&protectedMemoryFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceProtectedMemoryFeatures));
+ deMemset(&samplerYcbcrConversionFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceSamplerYcbcrConversionFeatures));
+ deMemset(&variablePointerFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceVariablePointerFeatures));
- device16BitStorageFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES;
- device16BitStorageFeatures[ndx].pNext = &deviceMultiviewFeatures[ndx];
+ device16BitStorageFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES;
+ device16BitStorageFeatures[ndx].pNext = &deviceMultiviewFeatures[ndx];
- deviceMultiviewFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES;
- deviceMultiviewFeatures[ndx].pNext = &protectedMemoryFeatures[ndx];
+ deviceMultiviewFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES;
+ deviceMultiviewFeatures[ndx].pNext = &protectedMemoryFeatures[ndx];
- protectedMemoryFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES;
- protectedMemoryFeatures[ndx].pNext = &samplerYcbcrConversionFeatures[ndx];
+ protectedMemoryFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES;
+ protectedMemoryFeatures[ndx].pNext = &samplerYcbcrConversionFeatures[ndx];
- samplerYcbcrConversionFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES;
- samplerYcbcrConversionFeatures[ndx].pNext = &variablePointerFeatures[ndx].sType;
+ samplerYcbcrConversionFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES;
+ samplerYcbcrConversionFeatures[ndx].pNext = &variablePointerFeatures[ndx].sType;
- variablePointerFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES;
- variablePointerFeatures[ndx].pNext = DE_NULL;
+ variablePointerFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES;
+ variablePointerFeatures[ndx].pNext = DE_NULL;
- deMemset(&extFeatures.features, 0xcd, sizeof(extFeatures.features));
- extFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
- extFeatures.pNext = &device16BitStorageFeatures[ndx];
+ deMemset(&extFeatures.features, 0xcd, sizeof(extFeatures.features));
+ extFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
+ extFeatures.pNext = &device16BitStorageFeatures[ndx];
- vki.getPhysicalDeviceFeatures2(devices[deviceNdx], &extFeatures);
- }
+ vki.getPhysicalDeviceFeatures2(physicalDevice, &extFeatures);
+ }
- if ( khr_16bit_storage &&
- (device16BitStorageFeatures[0].storageBuffer16BitAccess != device16BitStorageFeatures[1].storageBuffer16BitAccess ||
- device16BitStorageFeatures[0].uniformAndStorageBuffer16BitAccess != device16BitStorageFeatures[1].uniformAndStorageBuffer16BitAccess ||
- device16BitStorageFeatures[0].storagePushConstant16 != device16BitStorageFeatures[1].storagePushConstant16 ||
- device16BitStorageFeatures[0].storageInputOutput16 != device16BitStorageFeatures[1].storageInputOutput16)
- )
- {
- TCU_FAIL("Mismatch between VkPhysicalDevice16BitStorageFeatures");
- }
+ if ( khr_16bit_storage &&
+ (device16BitStorageFeatures[0].storageBuffer16BitAccess != device16BitStorageFeatures[1].storageBuffer16BitAccess ||
+ device16BitStorageFeatures[0].uniformAndStorageBuffer16BitAccess != device16BitStorageFeatures[1].uniformAndStorageBuffer16BitAccess ||
+ device16BitStorageFeatures[0].storagePushConstant16 != device16BitStorageFeatures[1].storagePushConstant16 ||
+ device16BitStorageFeatures[0].storageInputOutput16 != device16BitStorageFeatures[1].storageInputOutput16)
+ )
+ {
+ TCU_FAIL("Mismatch between VkPhysicalDevice16BitStorageFeatures");
+ }
- if (khr_multiview &&
- (deviceMultiviewFeatures[0].multiview != deviceMultiviewFeatures[1].multiview ||
- deviceMultiviewFeatures[0].multiviewGeometryShader != deviceMultiviewFeatures[1].multiviewGeometryShader ||
- deviceMultiviewFeatures[0].multiviewTessellationShader != deviceMultiviewFeatures[1].multiviewTessellationShader)
- )
- {
- TCU_FAIL("Mismatch between VkPhysicalDeviceMultiviewFeatures");
- }
+ if (khr_multiview &&
+ (deviceMultiviewFeatures[0].multiview != deviceMultiviewFeatures[1].multiview ||
+ deviceMultiviewFeatures[0].multiviewGeometryShader != deviceMultiviewFeatures[1].multiviewGeometryShader ||
+ deviceMultiviewFeatures[0].multiviewTessellationShader != deviceMultiviewFeatures[1].multiviewTessellationShader)
+ )
+ {
+ TCU_FAIL("Mismatch between VkPhysicalDeviceMultiviewFeatures");
+ }
- if (deviceProtectedMemory && protectedMemoryFeatures[0].protectedMemory != protectedMemoryFeatures[1].protectedMemory)
- {
- TCU_FAIL("Mismatch between VkPhysicalDeviceProtectedMemoryFeatures");
- }
+ if (deviceProtectedMemory && protectedMemoryFeatures[0].protectedMemory != protectedMemoryFeatures[1].protectedMemory)
+ {
+ TCU_FAIL("Mismatch between VkPhysicalDeviceProtectedMemoryFeatures");
+ }
- if (sampler_ycbcr_conversion && samplerYcbcrConversionFeatures[0].samplerYcbcrConversion != samplerYcbcrConversionFeatures[1].samplerYcbcrConversion)
- {
- TCU_FAIL("Mismatch between VkPhysicalDeviceSamplerYcbcrConversionFeatures");
- }
+ if (sampler_ycbcr_conversion && samplerYcbcrConversionFeatures[0].samplerYcbcrConversion != samplerYcbcrConversionFeatures[1].samplerYcbcrConversion)
+ {
+ TCU_FAIL("Mismatch between VkPhysicalDeviceSamplerYcbcrConversionFeatures");
+ }
- if (variable_pointers &&
- (variablePointerFeatures[0].variablePointersStorageBuffer != variablePointerFeatures[1].variablePointersStorageBuffer ||
- variablePointerFeatures[0].variablePointers != variablePointerFeatures[1].variablePointers)
- )
- {
- TCU_FAIL("Mismatch between VkPhysicalDeviceVariablePointerFeatures");
- }
- if (khr_16bit_storage)
- log << TestLog::Message << toString(device16BitStorageFeatures[0]) << TestLog::EndMessage;
- if (khr_multiview)
- log << TestLog::Message << toString(deviceMultiviewFeatures[0]) << TestLog::EndMessage;
- if (deviceProtectedMemory)
- log << TestLog::Message << toString(protectedMemoryFeatures[0]) << TestLog::EndMessage;
- if (sampler_ycbcr_conversion)
- log << TestLog::Message << toString(samplerYcbcrConversionFeatures[0]) << TestLog::EndMessage;
- if(variable_pointers)
- log << TestLog::Message << toString(variablePointerFeatures[0]) << TestLog::EndMessage;
+ if (variable_pointers &&
+ (variablePointerFeatures[0].variablePointersStorageBuffer != variablePointerFeatures[1].variablePointersStorageBuffer ||
+ variablePointerFeatures[0].variablePointers != variablePointerFeatures[1].variablePointers)
+ )
+ {
+ TCU_FAIL("Mismatch between VkPhysicalDeviceVariablePointerFeatures");
}
+ if (khr_16bit_storage)
+ log << TestLog::Message << toString(device16BitStorageFeatures[0]) << TestLog::EndMessage;
+ if (khr_multiview)
+ log << TestLog::Message << toString(deviceMultiviewFeatures[0]) << TestLog::EndMessage;
+ if (deviceProtectedMemory)
+ log << TestLog::Message << toString(protectedMemoryFeatures[0]) << TestLog::EndMessage;
+ if (sampler_ycbcr_conversion)
+ log << TestLog::Message << toString(samplerYcbcrConversionFeatures[0]) << TestLog::EndMessage;
+ if(variable_pointers)
+ log << TestLog::Message << toString(variablePointerFeatures[0]) << TestLog::EndMessage;
+
return tcu::TestStatus::pass("Querying device features succeeded");
}
tcu::TestStatus deviceProperties2 (Context& context)
{
- const PlatformInterface& vkp = context.getPlatformInterface();
- const Unique<VkInstance> instance (createInstanceWithExtension(vkp, "VK_KHR_get_physical_device_properties2", context));
- const InstanceDriver vki (vkp, *instance);
- const vector<VkPhysicalDevice> devices = enumeratePhysicalDevices(vki, *instance);
- TestLog& log = context.getTestContext().getLog();
+ const PlatformInterface& vkp = context.getPlatformInterface();
+ const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
+ const Unique<VkInstance> instance (createInstanceWithExtension(vkp, "VK_KHR_get_physical_device_properties2", context));
+ const InstanceDriver vki (vkp, *instance);
+ TestLog& log = context.getTestContext().getLog();
+ VkPhysicalDeviceProperties coreProperties;
+ VkPhysicalDeviceProperties2 extProperties;
- for (size_t deviceNdx = 0; deviceNdx < devices.size(); ++deviceNdx)
- {
- VkPhysicalDeviceProperties coreProperties;
- VkPhysicalDeviceProperties2 extProperties;
+ extProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+ extProperties.pNext = DE_NULL;
- extProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
- extProperties.pNext = DE_NULL;
+ vki.getPhysicalDeviceProperties(physicalDevice, &coreProperties);
+ vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
- vki.getPhysicalDeviceProperties(devices[deviceNdx], &coreProperties);
- vki.getPhysicalDeviceProperties2(devices[deviceNdx], &extProperties);
+ TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2);
+ TCU_CHECK(extProperties.pNext == DE_NULL);
- TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2);
- TCU_CHECK(extProperties.pNext == DE_NULL);
+ // We can't use memcmp() here because the structs may contain padding bytes that drivers may or may not
+ // have written while writing the data and memcmp will compare them anyway, so we iterate through the
+ // valid bytes for each field in the struct and compare only the valid bytes for each one.
+ for (int propNdx = 0; propNdx < DE_LENGTH_OF_ARRAY(s_physicalDevicePropertiesOffsetTable); propNdx++)
+ {
+ const size_t offset = s_physicalDevicePropertiesOffsetTable[propNdx].offset;
+ const size_t size = s_physicalDevicePropertiesOffsetTable[propNdx].size;
- // We can't use memcmp() here because the structs may contain padding bytes that drivers may or may not
- // have written while writing the data and memcmp will compare them anyway, so we iterate through the
- // valid bytes for each field in the struct and compare only the valid bytes for each one.
- for (int propNdx = 0; propNdx < DE_LENGTH_OF_ARRAY(s_physicalDevicePropertiesOffsetTable); propNdx++)
- {
- const size_t offset = s_physicalDevicePropertiesOffsetTable[propNdx].offset;
- const size_t size = s_physicalDevicePropertiesOffsetTable[propNdx].size;
+ const deUint8* corePropertyBytes = reinterpret_cast<deUint8*>(&coreProperties) + offset;
+ const deUint8* extPropertyBytes = reinterpret_cast<deUint8*>(&extProperties.properties) + offset;
- const deUint8* corePropertyBytes = reinterpret_cast<deUint8*>(&coreProperties) + offset;
- const deUint8* extPropertyBytes = reinterpret_cast<deUint8*>(&extProperties.properties) + offset;
+ if (deMemCmp(corePropertyBytes, extPropertyBytes, size) != 0)
+ TCU_FAIL("Mismatch between properties reported by vkGetPhysicalDeviceProperties and vkGetPhysicalDeviceProperties2");
+ }
- if (deMemCmp(corePropertyBytes, extPropertyBytes, size) != 0)
- TCU_FAIL("Mismatch between properties reported by vkGetPhysicalDeviceProperties and vkGetPhysicalDeviceProperties2");
- }
+ log << TestLog::Message << extProperties.properties << TestLog::EndMessage;
- log << TestLog::Message << "device " << deviceNdx << TestLog::EndMessage
- << TestLog::Message << extProperties.properties << TestLog::EndMessage;
+ if (getPhysicalDeviceProperties(vki, physicalDevice).apiVersion >= VK_API_VERSION_1_1)
+ {
+ const int count = 2u;
+ VkPhysicalDeviceIDProperties IDProperties[count];
+ VkPhysicalDeviceMaintenance3Properties maintenance3Properties[count];
+ VkPhysicalDeviceMultiviewProperties multiviewProperties[count];
+ VkPhysicalDevicePointClippingProperties pointClippingProperties[count];
+ VkPhysicalDeviceProtectedMemoryProperties protectedMemoryPropertiesKHR[count];
+ VkPhysicalDeviceSubgroupProperties subgroupProperties[count];
- if (getPhysicalDeviceProperties(vki, devices[deviceNdx]).apiVersion >= VK_API_VERSION_1_1)
+ for (int ndx = 0; ndx < count; ++ndx)
{
- const int count = 2u;
- VkPhysicalDeviceIDProperties IDProperties[count];
- VkPhysicalDeviceMaintenance3Properties maintenance3Properties[count];
- VkPhysicalDeviceMultiviewProperties multiviewProperties[count];
- VkPhysicalDevicePointClippingProperties pointClippingProperties[count];
- VkPhysicalDeviceProtectedMemoryProperties protectedMemoryPropertiesKHR[count];
- VkPhysicalDeviceSubgroupProperties subgroupProperties[count];
-
- for (int ndx = 0; ndx < count; ++ndx)
- {
- deMemset(&IDProperties[ndx], 0xFF, sizeof(VkPhysicalDeviceIDProperties ));
- deMemset(&maintenance3Properties[ndx], 0xFF, sizeof(VkPhysicalDeviceMaintenance3Properties ));
- deMemset(&multiviewProperties[ndx], 0xFF, sizeof(VkPhysicalDeviceMultiviewProperties ));
- deMemset(&pointClippingProperties[ndx], 0xFF, sizeof(VkPhysicalDevicePointClippingProperties ));
- deMemset(&protectedMemoryPropertiesKHR[ndx], 0xFF, sizeof(VkPhysicalDeviceProtectedMemoryProperties ));
- deMemset(&subgroupProperties[ndx], 0xFF, sizeof(VkPhysicalDeviceSubgroupProperties ));
+ deMemset(&IDProperties[ndx], 0xFF, sizeof(VkPhysicalDeviceIDProperties ));
+ deMemset(&maintenance3Properties[ndx], 0xFF, sizeof(VkPhysicalDeviceMaintenance3Properties ));
+ deMemset(&multiviewProperties[ndx], 0xFF, sizeof(VkPhysicalDeviceMultiviewProperties ));
+ deMemset(&pointClippingProperties[ndx], 0xFF, sizeof(VkPhysicalDevicePointClippingProperties ));
+ deMemset(&protectedMemoryPropertiesKHR[ndx], 0xFF, sizeof(VkPhysicalDeviceProtectedMemoryProperties ));
+ deMemset(&subgroupProperties[ndx], 0xFF, sizeof(VkPhysicalDeviceSubgroupProperties ));
- IDProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES;
- IDProperties[ndx].pNext = &maintenance3Properties[ndx];
+ IDProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES;
+ IDProperties[ndx].pNext = &maintenance3Properties[ndx];
- maintenance3Properties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES;
- maintenance3Properties[ndx].pNext = &multiviewProperties[ndx];
+ maintenance3Properties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES;
+ maintenance3Properties[ndx].pNext = &multiviewProperties[ndx];
- multiviewProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES;
- multiviewProperties[ndx].pNext = &pointClippingProperties[ndx];
+ multiviewProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES;
+ multiviewProperties[ndx].pNext = &pointClippingProperties[ndx];
- pointClippingProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES;
- pointClippingProperties[ndx].pNext = &protectedMemoryPropertiesKHR[ndx];
+ pointClippingProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES;
+ pointClippingProperties[ndx].pNext = &protectedMemoryPropertiesKHR[ndx];
- protectedMemoryPropertiesKHR[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES;
- protectedMemoryPropertiesKHR[ndx].pNext = &subgroupProperties[ndx];
+ protectedMemoryPropertiesKHR[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES;
+ protectedMemoryPropertiesKHR[ndx].pNext = &subgroupProperties[ndx];
- subgroupProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;
- subgroupProperties[ndx].pNext = DE_NULL;
+ subgroupProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;
+ subgroupProperties[ndx].pNext = DE_NULL;
- extProperties.pNext = &IDProperties[ndx];
+ extProperties.pNext = &IDProperties[ndx];
- vki.getPhysicalDeviceProperties2(devices[deviceNdx], &extProperties);
+ vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
+ IDProperties[ndx].pNext = DE_NULL;
+ maintenance3Properties[ndx].pNext = DE_NULL;
+ multiviewProperties[ndx].pNext = DE_NULL;
+ pointClippingProperties[ndx].pNext = DE_NULL;
+ protectedMemoryPropertiesKHR[ndx].pNext = DE_NULL;
+ subgroupProperties[ndx].pNext = DE_NULL;
+ }
- IDProperties[ndx].pNext = DE_NULL;
- maintenance3Properties[ndx].pNext = DE_NULL;
- multiviewProperties[ndx].pNext = DE_NULL;
- pointClippingProperties[ndx].pNext = DE_NULL;
- protectedMemoryPropertiesKHR[ndx].pNext = DE_NULL;
- subgroupProperties[ndx].pNext = DE_NULL;
- }
-
- if (
- deMemCmp(&IDProperties[0], &IDProperties[1], sizeof(VkPhysicalDeviceIDProperties )) != 0 ||
- deMemCmp(&maintenance3Properties[0], &maintenance3Properties[1], sizeof(VkPhysicalDeviceMaintenance3Properties)) != 0 ||
- deMemCmp(&multiviewProperties[0], &multiviewProperties[1], sizeof(VkPhysicalDeviceMultiviewProperties)) != 0 ||
- deMemCmp(&pointClippingProperties[0], &pointClippingProperties[1], sizeof(VkPhysicalDevicePointClippingProperties)) != 0 ||
- deMemCmp(&protectedMemoryPropertiesKHR[0], &protectedMemoryPropertiesKHR[1], sizeof(VkPhysicalDeviceProtectedMemoryProperties)) != 0 ||
- deMemCmp(&subgroupProperties[0], &subgroupProperties[1], sizeof(VkPhysicalDeviceSubgroupProperties)) != 0
- )
- {
- TCU_FAIL("Mismatch in vkGetPhysicalDeviceProperties2");
- }
-
- log << TestLog::Message << toString(IDProperties[0]) << TestLog::EndMessage
- << TestLog::Message << toString(maintenance3Properties[0]) << TestLog::EndMessage
- << TestLog::Message << toString(multiviewProperties[0]) << TestLog::EndMessage
- << TestLog::Message << toString(pointClippingProperties[0]) << TestLog::EndMessage
- << TestLog::Message << toString(protectedMemoryPropertiesKHR[0]) << TestLog::EndMessage
- << TestLog::Message << toString(subgroupProperties[0]) << TestLog::EndMessage;
+ if (
+ deMemCmp(&IDProperties[0], &IDProperties[1], sizeof(VkPhysicalDeviceIDProperties )) != 0 ||
+ deMemCmp(&maintenance3Properties[0], &maintenance3Properties[1], sizeof(VkPhysicalDeviceMaintenance3Properties)) != 0 ||
+ deMemCmp(&multiviewProperties[0], &multiviewProperties[1], sizeof(VkPhysicalDeviceMultiviewProperties)) != 0 ||
+ deMemCmp(&pointClippingProperties[0], &pointClippingProperties[1], sizeof(VkPhysicalDevicePointClippingProperties)) != 0 ||
+ deMemCmp(&protectedMemoryPropertiesKHR[0], &protectedMemoryPropertiesKHR[1], sizeof(VkPhysicalDeviceProtectedMemoryProperties)) != 0 ||
+ deMemCmp(&subgroupProperties[0], &subgroupProperties[1], sizeof(VkPhysicalDeviceSubgroupProperties)) != 0
+ )
+ {
+ TCU_FAIL("Mismatch in vkGetPhysicalDeviceProperties2");
}
+
+ log << TestLog::Message << toString(IDProperties[0]) << TestLog::EndMessage
+ << TestLog::Message << toString(maintenance3Properties[0]) << TestLog::EndMessage
+ << TestLog::Message << toString(multiviewProperties[0]) << TestLog::EndMessage
+ << TestLog::Message << toString(pointClippingProperties[0]) << TestLog::EndMessage
+ << TestLog::Message << toString(protectedMemoryPropertiesKHR[0]) << TestLog::EndMessage
+ << TestLog::Message << toString(subgroupProperties[0]) << TestLog::EndMessage;
}
return tcu::TestStatus::pass("Querying device properties succeeded");
tcu::TestStatus deviceFormatProperties2 (Context& context)
{
- const PlatformInterface& vkp = context.getPlatformInterface();
- const Unique<VkInstance> instance (createInstanceWithExtension(vkp, "VK_KHR_get_physical_device_properties2", context));
- const InstanceDriver vki (vkp, *instance);
- const vector<VkPhysicalDevice> devices = enumeratePhysicalDevices(vki, *instance);
- TestLog& log = context.getTestContext().getLog();
+ const PlatformInterface& vkp = context.getPlatformInterface();
+ const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
+ const Unique<VkInstance> instance (createInstanceWithExtension(vkp, "VK_KHR_get_physical_device_properties2", context));
+ const InstanceDriver vki (vkp, *instance);
+ TestLog& log = context.getTestContext().getLog();
- for (size_t deviceNdx = 0; deviceNdx < devices.size(); ++deviceNdx)
+ for (int formatNdx = 0; formatNdx < VK_CORE_FORMAT_LAST; ++formatNdx)
{
- const VkPhysicalDevice physicalDevice = devices[deviceNdx];
-
- for (int formatNdx = 0; formatNdx < VK_CORE_FORMAT_LAST; ++formatNdx)
- {
- const VkFormat format = (VkFormat)formatNdx;
- VkFormatProperties coreProperties;
- VkFormatProperties2 extProperties;
+ const VkFormat format = (VkFormat)formatNdx;
+ VkFormatProperties coreProperties;
+ VkFormatProperties2 extProperties;
- deMemset(&coreProperties, 0xcd, sizeof(VkFormatProperties));
- deMemset(&extProperties, 0xcd, sizeof(VkFormatProperties2));
+ deMemset(&coreProperties, 0xcd, sizeof(VkFormatProperties));
+ deMemset(&extProperties, 0xcd, sizeof(VkFormatProperties2));
- extProperties.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2;
- extProperties.pNext = DE_NULL;
+ extProperties.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2;
+ extProperties.pNext = DE_NULL;
- vki.getPhysicalDeviceFormatProperties(physicalDevice, format, &coreProperties);
- vki.getPhysicalDeviceFormatProperties2(physicalDevice, format, &extProperties);
+ vki.getPhysicalDeviceFormatProperties(physicalDevice, format, &coreProperties);
+ vki.getPhysicalDeviceFormatProperties2(physicalDevice, format, &extProperties);
- TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2);
- TCU_CHECK(extProperties.pNext == DE_NULL);
+ TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2);
+ TCU_CHECK(extProperties.pNext == DE_NULL);
- if (deMemCmp(&coreProperties, &extProperties.formatProperties, sizeof(VkFormatProperties)) != 0)
- TCU_FAIL("Mismatch between format properties reported by vkGetPhysicalDeviceFormatProperties and vkGetPhysicalDeviceFormatProperties2");
+ if (deMemCmp(&coreProperties, &extProperties.formatProperties, sizeof(VkFormatProperties)) != 0)
+ TCU_FAIL("Mismatch between format properties reported by vkGetPhysicalDeviceFormatProperties and vkGetPhysicalDeviceFormatProperties2");
- log << TestLog::Message << "device = " << deviceNdx << " VkFormat = " << format << TestLog::EndMessage
- << TestLog::Message << toString (extProperties) << TestLog::EndMessage;
- }
+ log << TestLog::Message << toString (extProperties) << TestLog::EndMessage;
}
return tcu::TestStatus::pass("Querying device format properties succeeded");
tcu::TestStatus deviceQueueFamilyProperties2 (Context& context)
{
- const PlatformInterface& vkp = context.getPlatformInterface();
- const Unique<VkInstance> instance (createInstanceWithExtension(vkp, "VK_KHR_get_physical_device_properties2", context));
- const InstanceDriver vki (vkp, *instance);
- const vector<VkPhysicalDevice> devices = enumeratePhysicalDevices(vki, *instance);
- TestLog& log = context.getTestContext().getLog();
+ const PlatformInterface& vkp = context.getPlatformInterface();
+ const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
+ const Unique<VkInstance> instance (createInstanceWithExtension(vkp, "VK_KHR_get_physical_device_properties2", context));
+ const InstanceDriver vki (vkp, *instance);
+ TestLog& log = context.getTestContext().getLog();
+ deUint32 numCoreQueueFamilies = ~0u;
+ deUint32 numExtQueueFamilies = ~0u;
- for (size_t deviceNdx = 0; deviceNdx < devices.size(); ++deviceNdx)
- {
- const VkPhysicalDevice physicalDevice = devices[deviceNdx];
- deUint32 numCoreQueueFamilies = ~0u;
- deUint32 numExtQueueFamilies = ~0u;
+ vki.getPhysicalDeviceQueueFamilyProperties(physicalDevice, &numCoreQueueFamilies, DE_NULL);
+ vki.getPhysicalDeviceQueueFamilyProperties2(physicalDevice, &numExtQueueFamilies, DE_NULL);
- vki.getPhysicalDeviceQueueFamilyProperties(physicalDevice, &numCoreQueueFamilies, DE_NULL);
- vki.getPhysicalDeviceQueueFamilyProperties2(physicalDevice, &numExtQueueFamilies, DE_NULL);
+ TCU_CHECK_MSG(numCoreQueueFamilies == numExtQueueFamilies, "Different number of queue family properties reported");
+ TCU_CHECK(numCoreQueueFamilies > 0);
- TCU_CHECK_MSG(numCoreQueueFamilies == numExtQueueFamilies, "Different number of queue family properties reported");
- TCU_CHECK(numCoreQueueFamilies > 0);
-
- {
- std::vector<VkQueueFamilyProperties> coreProperties (numCoreQueueFamilies);
- std::vector<VkQueueFamilyProperties2> extProperties (numExtQueueFamilies);
+ {
+ std::vector<VkQueueFamilyProperties> coreProperties (numCoreQueueFamilies);
+ std::vector<VkQueueFamilyProperties2> extProperties (numExtQueueFamilies);
- deMemset(&coreProperties[0], 0xcd, sizeof(VkQueueFamilyProperties)*numCoreQueueFamilies);
- deMemset(&extProperties[0], 0xcd, sizeof(VkQueueFamilyProperties2)*numExtQueueFamilies);
+ deMemset(&coreProperties[0], 0xcd, sizeof(VkQueueFamilyProperties)*numCoreQueueFamilies);
+ deMemset(&extProperties[0], 0xcd, sizeof(VkQueueFamilyProperties2)*numExtQueueFamilies);
- for (size_t ndx = 0; ndx < extProperties.size(); ++ndx)
- {
- extProperties[ndx].sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2;
- extProperties[ndx].pNext = DE_NULL;
- }
+ for (size_t ndx = 0; ndx < extProperties.size(); ++ndx)
+ {
+ extProperties[ndx].sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2;
+ extProperties[ndx].pNext = DE_NULL;
+ }
- vki.getPhysicalDeviceQueueFamilyProperties(physicalDevice, &numCoreQueueFamilies, &coreProperties[0]);
- vki.getPhysicalDeviceQueueFamilyProperties2(physicalDevice, &numExtQueueFamilies, &extProperties[0]);
+ vki.getPhysicalDeviceQueueFamilyProperties(physicalDevice, &numCoreQueueFamilies, &coreProperties[0]);
+ vki.getPhysicalDeviceQueueFamilyProperties2(physicalDevice, &numExtQueueFamilies, &extProperties[0]);
- TCU_CHECK((size_t)numCoreQueueFamilies == coreProperties.size());
- TCU_CHECK((size_t)numExtQueueFamilies == extProperties.size());
- DE_ASSERT(numCoreQueueFamilies == numExtQueueFamilies);
+ TCU_CHECK((size_t)numCoreQueueFamilies == coreProperties.size());
+ TCU_CHECK((size_t)numExtQueueFamilies == extProperties.size());
+ DE_ASSERT(numCoreQueueFamilies == numExtQueueFamilies);
- for (size_t ndx = 0; ndx < extProperties.size(); ++ndx)
- {
- TCU_CHECK(extProperties[ndx].sType == VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2);
- TCU_CHECK(extProperties[ndx].pNext == DE_NULL);
+ for (size_t ndx = 0; ndx < extProperties.size(); ++ndx)
+ {
+ TCU_CHECK(extProperties[ndx].sType == VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2);
+ TCU_CHECK(extProperties[ndx].pNext == DE_NULL);
- if (deMemCmp(&coreProperties[ndx], &extProperties[ndx].queueFamilyProperties, sizeof(VkQueueFamilyProperties)) != 0)
- TCU_FAIL("Mismatch between format properties reported by vkGetPhysicalDeviceQueueFamilyProperties and vkGetPhysicalDeviceQueueFamilyProperties2");
+ if (deMemCmp(&coreProperties[ndx], &extProperties[ndx].queueFamilyProperties, sizeof(VkQueueFamilyProperties)) != 0)
+ TCU_FAIL("Mismatch between format properties reported by vkGetPhysicalDeviceQueueFamilyProperties and vkGetPhysicalDeviceQueueFamilyProperties2");
- log << TestLog::Message << "device = " << deviceNdx << " queueFamilyNdx = " << ndx <<TestLog::EndMessage
- << TestLog::Message << toString(extProperties[ndx]) << TestLog::EndMessage;
- }
+ log << TestLog::Message << " queueFamilyNdx = " << ndx <<TestLog::EndMessage
+ << TestLog::Message << toString(extProperties[ndx]) << TestLog::EndMessage;
}
}
tcu::TestStatus deviceMemoryProperties2 (Context& context)
{
- const PlatformInterface& vkp = context.getPlatformInterface();
- const Unique<VkInstance> instance (createInstanceWithExtension(vkp, "VK_KHR_get_physical_device_properties2", context));
- const InstanceDriver vki (vkp, *instance);
- const vector<VkPhysicalDevice> devices = enumeratePhysicalDevices(vki, *instance);
- TestLog& log = context.getTestContext().getLog();
+ const PlatformInterface& vkp = context.getPlatformInterface();
+ const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
+ const Unique<VkInstance> instance (createInstanceWithExtension(vkp, "VK_KHR_get_physical_device_properties2", context));
+ const InstanceDriver vki (vkp, *instance);
+ TestLog& log = context.getTestContext().getLog();
+ VkPhysicalDeviceMemoryProperties coreProperties;
+ VkPhysicalDeviceMemoryProperties2 extProperties;
- for (size_t deviceNdx = 0; deviceNdx < devices.size(); ++deviceNdx)
- {
- VkPhysicalDeviceMemoryProperties coreProperties;
- VkPhysicalDeviceMemoryProperties2 extProperties;
+ deMemset(&coreProperties, 0xcd, sizeof(VkPhysicalDeviceMemoryProperties));
+ deMemset(&extProperties, 0xcd, sizeof(VkPhysicalDeviceMemoryProperties2));
- deMemset(&coreProperties, 0xcd, sizeof(VkPhysicalDeviceMemoryProperties));
- deMemset(&extProperties, 0xcd, sizeof(VkPhysicalDeviceMemoryProperties2));
+ extProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
+ extProperties.pNext = DE_NULL;
- extProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
- extProperties.pNext = DE_NULL;
-
- vki.getPhysicalDeviceMemoryProperties(devices[deviceNdx], &coreProperties);
- vki.getPhysicalDeviceMemoryProperties2(devices[deviceNdx], &extProperties);
+ vki.getPhysicalDeviceMemoryProperties(physicalDevice, &coreProperties);
+ vki.getPhysicalDeviceMemoryProperties2(physicalDevice, &extProperties);
- TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2);
- TCU_CHECK(extProperties.pNext == DE_NULL);
+ TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2);
+ TCU_CHECK(extProperties.pNext == DE_NULL);
- if (deMemCmp(&coreProperties, &extProperties.memoryProperties, sizeof(VkPhysicalDeviceMemoryProperties)) != 0)
- TCU_FAIL("Mismatch between properties reported by vkGetPhysicalDeviceMemoryProperties and vkGetPhysicalDeviceMemoryProperties2");
+ if (deMemCmp(&coreProperties, &extProperties.memoryProperties, sizeof(VkPhysicalDeviceMemoryProperties)) != 0)
+ TCU_FAIL("Mismatch between properties reported by vkGetPhysicalDeviceMemoryProperties and vkGetPhysicalDeviceMemoryProperties2");
- log << TestLog::Message << "device = " << deviceNdx << TestLog::EndMessage
- << TestLog::Message << extProperties << TestLog::EndMessage;
- }
+ log << TestLog::Message << extProperties << TestLog::EndMessage;
return tcu::TestStatus::pass("Querying device memory properties succeeded");
}
TestLog& log = context.getTestContext().getLog();
const PlatformInterface& vkp = context.getPlatformInterface();
+ const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
const Unique<VkInstance> instance (createInstanceWithExtension(vkp, "VK_KHR_get_physical_device_properties2", context));
const InstanceDriver vki (vkp, *instance);
- const vector<VkPhysicalDevice> devices = enumeratePhysicalDevices(vki, *instance);
const VkImageUsageFlags allUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT
| VK_IMAGE_USAGE_TRANSFER_DST_BIT
| VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
| VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
- for (size_t deviceNdx = 0; deviceNdx < devices.size(); ++deviceNdx)
+ for (VkImageUsageFlags curUsageFlags = (VkImageUsageFlags)1; curUsageFlags <= allUsageFlags; curUsageFlags++)
{
- const VkPhysicalDevice physicalDevice = devices[deviceNdx];
-
- for (VkImageUsageFlags curUsageFlags = (VkImageUsageFlags)1; curUsageFlags <= allUsageFlags; curUsageFlags++)
+ for (VkImageCreateFlags curCreateFlags = 0; curCreateFlags <= allCreateFlags; curCreateFlags++)
{
- for (VkImageCreateFlags curCreateFlags = 0; curCreateFlags <= allCreateFlags; curCreateFlags++)
+ const VkPhysicalDeviceImageFormatInfo2 imageFormatInfo =
{
- const VkPhysicalDeviceImageFormatInfo2 imageFormatInfo =
- {
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2,
- DE_NULL,
- format,
- imageType,
- tiling,
- curUsageFlags,
- curCreateFlags
- };
-
- VkImageFormatProperties coreProperties;
- VkImageFormatProperties2 extProperties;
- VkResult coreResult;
- VkResult extResult;
-
- deMemset(&coreProperties, 0xcd, sizeof(VkImageFormatProperties));
- deMemset(&extProperties, 0xcd, sizeof(VkImageFormatProperties2));
-
- extProperties.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2;
- extProperties.pNext = DE_NULL;
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2,
+ DE_NULL,
+ format,
+ imageType,
+ tiling,
+ curUsageFlags,
+ curCreateFlags
+ };
+
+ VkImageFormatProperties coreProperties;
+ VkImageFormatProperties2 extProperties;
+ VkResult coreResult;
+ VkResult extResult;
+
+ deMemset(&coreProperties, 0xcd, sizeof(VkImageFormatProperties));
+ deMemset(&extProperties, 0xcd, sizeof(VkImageFormatProperties2));
+
+ extProperties.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2;
+ extProperties.pNext = DE_NULL;
- coreResult = vki.getPhysicalDeviceImageFormatProperties(physicalDevice, imageFormatInfo.format, imageFormatInfo.type, imageFormatInfo.tiling, imageFormatInfo.usage, imageFormatInfo.flags, &coreProperties);
- extResult = vki.getPhysicalDeviceImageFormatProperties2(physicalDevice, &imageFormatInfo, &extProperties);
+ coreResult = vki.getPhysicalDeviceImageFormatProperties(physicalDevice, imageFormatInfo.format, imageFormatInfo.type, imageFormatInfo.tiling, imageFormatInfo.usage, imageFormatInfo.flags, &coreProperties);
+ extResult = vki.getPhysicalDeviceImageFormatProperties2(physicalDevice, &imageFormatInfo, &extProperties);
- TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2);
- TCU_CHECK(extProperties.pNext == DE_NULL);
+ TCU_CHECK(extProperties.sType == VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2);
+ TCU_CHECK(extProperties.pNext == DE_NULL);
- if ((coreResult != extResult) ||
- (deMemCmp(&coreProperties, &extProperties.imageFormatProperties, sizeof(VkImageFormatProperties)) != 0))
- {
- log << TestLog::Message << "ERROR: device " << deviceNdx << ": mismatch with query " << imageFormatInfo << TestLog::EndMessage
- << TestLog::Message << "vkGetPhysicalDeviceImageFormatProperties() returned " << coreResult << ", " << coreProperties << TestLog::EndMessage
- << TestLog::Message << "vkGetPhysicalDeviceImageFormatProperties2() returned " << extResult << ", " << extProperties << TestLog::EndMessage;
- TCU_FAIL("Mismatch between image format properties reported by vkGetPhysicalDeviceImageFormatProperties and vkGetPhysicalDeviceImageFormatProperties2");
- }
+ if ((coreResult != extResult) ||
+ (deMemCmp(&coreProperties, &extProperties.imageFormatProperties, sizeof(VkImageFormatProperties)) != 0))
+ {
+ log << TestLog::Message << "ERROR: device mismatch with query " << imageFormatInfo << TestLog::EndMessage
+ << TestLog::Message << "vkGetPhysicalDeviceImageFormatProperties() returned " << coreResult << ", " << coreProperties << TestLog::EndMessage
+ << TestLog::Message << "vkGetPhysicalDeviceImageFormatProperties2() returned " << extResult << ", " << extProperties << TestLog::EndMessage;
+ TCU_FAIL("Mismatch between image format properties reported by vkGetPhysicalDeviceImageFormatProperties and vkGetPhysicalDeviceImageFormatProperties2");
}
}
}
TestLog& log = context.getTestContext().getLog();
const PlatformInterface& vkp = context.getPlatformInterface();
+ const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
const Unique<VkInstance> instance (createInstanceWithExtension(vkp, "VK_KHR_get_physical_device_properties2", context));
const InstanceDriver vki (vkp, *instance);
- const vector<VkPhysicalDevice> devices = enumeratePhysicalDevices(vki, *instance);
const VkImageUsageFlags allUsageFlags = VK_IMAGE_USAGE_TRANSFER_SRC_BIT
| VK_IMAGE_USAGE_TRANSFER_DST_BIT
| VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT
| VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
- for (size_t deviceNdx = 0; deviceNdx < devices.size(); ++deviceNdx)
+ for (deUint32 sampleCountBit = VK_SAMPLE_COUNT_1_BIT; sampleCountBit <= VK_SAMPLE_COUNT_64_BIT; sampleCountBit = (sampleCountBit << 1u))
{
- const VkPhysicalDevice physicalDevice = devices[deviceNdx];
-
- for (deUint32 sampleCountBit = VK_SAMPLE_COUNT_1_BIT; sampleCountBit <= VK_SAMPLE_COUNT_64_BIT; sampleCountBit = (sampleCountBit << 1u))
+ for (VkImageUsageFlags curUsageFlags = (VkImageUsageFlags)1; curUsageFlags <= allUsageFlags; curUsageFlags++)
{
- for (VkImageUsageFlags curUsageFlags = (VkImageUsageFlags)1; curUsageFlags <= allUsageFlags; curUsageFlags++)
+ const VkPhysicalDeviceSparseImageFormatInfo2 imageFormatInfo =
{
- const VkPhysicalDeviceSparseImageFormatInfo2 imageFormatInfo =
- {
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2,
- DE_NULL,
- format,
- imageType,
- (VkSampleCountFlagBits)sampleCountBit,
- curUsageFlags,
- tiling,
- };
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2,
+ DE_NULL,
+ format,
+ imageType,
+ (VkSampleCountFlagBits)sampleCountBit,
+ curUsageFlags,
+ tiling,
+ };
+
+ deUint32 numCoreProperties = ~0u;
+ deUint32 numExtProperties = ~0u;
+
+ // Query count
+ vki.getPhysicalDeviceSparseImageFormatProperties(physicalDevice, imageFormatInfo.format, imageFormatInfo.type, imageFormatInfo.samples, imageFormatInfo.usage, imageFormatInfo.tiling, &numCoreProperties, DE_NULL);
+ vki.getPhysicalDeviceSparseImageFormatProperties2(physicalDevice, &imageFormatInfo, &numExtProperties, DE_NULL);
+
+ if (numCoreProperties != numExtProperties)
+ {
+ log << TestLog::Message << "ERROR: different number of properties reported for " << imageFormatInfo << TestLog::EndMessage;
+ TCU_FAIL("Mismatch in reported property count");
+ }
- deUint32 numCoreProperties = ~0u;
- deUint32 numExtProperties = ~0u;
+ if (numCoreProperties > 0)
+ {
+ std::vector<VkSparseImageFormatProperties> coreProperties (numCoreProperties);
+ std::vector<VkSparseImageFormatProperties2> extProperties (numExtProperties);
- // Query count
- vki.getPhysicalDeviceSparseImageFormatProperties(physicalDevice, imageFormatInfo.format, imageFormatInfo.type, imageFormatInfo.samples, imageFormatInfo.usage, imageFormatInfo.tiling, &numCoreProperties, DE_NULL);
- vki.getPhysicalDeviceSparseImageFormatProperties2(physicalDevice, &imageFormatInfo, &numExtProperties, DE_NULL);
+ deMemset(&coreProperties[0], 0xcd, sizeof(VkSparseImageFormatProperties)*numCoreProperties);
+ deMemset(&extProperties[0], 0xcd, sizeof(VkSparseImageFormatProperties2)*numExtProperties);
- if (numCoreProperties != numExtProperties)
+ for (deUint32 ndx = 0; ndx < numExtProperties; ++ndx)
{
- log << TestLog::Message << "ERROR: device " << deviceNdx << ": different number of properties reported for " << imageFormatInfo << TestLog::EndMessage;
- TCU_FAIL("Mismatch in reported property count");
+ extProperties[ndx].sType = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2;
+ extProperties[ndx].pNext = DE_NULL;
}
- if (numCoreProperties > 0)
- {
- std::vector<VkSparseImageFormatProperties> coreProperties (numCoreProperties);
- std::vector<VkSparseImageFormatProperties2> extProperties (numExtProperties);
+ vki.getPhysicalDeviceSparseImageFormatProperties(physicalDevice, imageFormatInfo.format, imageFormatInfo.type, imageFormatInfo.samples, imageFormatInfo.usage, imageFormatInfo.tiling, &numCoreProperties, &coreProperties[0]);
+ vki.getPhysicalDeviceSparseImageFormatProperties2(physicalDevice, &imageFormatInfo, &numExtProperties, &extProperties[0]);
- deMemset(&coreProperties[0], 0xcd, sizeof(VkSparseImageFormatProperties)*numCoreProperties);
- deMemset(&extProperties[0], 0xcd, sizeof(VkSparseImageFormatProperties2)*numExtProperties);
+ TCU_CHECK((size_t)numCoreProperties == coreProperties.size());
+ TCU_CHECK((size_t)numExtProperties == extProperties.size());
- for (deUint32 ndx = 0; ndx < numExtProperties; ++ndx)
- {
- extProperties[ndx].sType = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2;
- extProperties[ndx].pNext = DE_NULL;
- }
-
- vki.getPhysicalDeviceSparseImageFormatProperties(physicalDevice, imageFormatInfo.format, imageFormatInfo.type, imageFormatInfo.samples, imageFormatInfo.usage, imageFormatInfo.tiling, &numCoreProperties, &coreProperties[0]);
- vki.getPhysicalDeviceSparseImageFormatProperties2(physicalDevice, &imageFormatInfo, &numExtProperties, &extProperties[0]);
-
- TCU_CHECK((size_t)numCoreProperties == coreProperties.size());
- TCU_CHECK((size_t)numExtProperties == extProperties.size());
+ for (deUint32 ndx = 0; ndx < numCoreProperties; ++ndx)
+ {
+ TCU_CHECK(extProperties[ndx].sType == VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2);
+ TCU_CHECK(extProperties[ndx].pNext == DE_NULL);
- for (deUint32 ndx = 0; ndx < numCoreProperties; ++ndx)
+ if ((deMemCmp(&coreProperties[ndx], &extProperties[ndx].properties, sizeof(VkSparseImageFormatProperties)) != 0))
{
- TCU_CHECK(extProperties[ndx].sType == VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2);
- TCU_CHECK(extProperties[ndx].pNext == DE_NULL);
-
- if ((deMemCmp(&coreProperties[ndx], &extProperties[ndx].properties, sizeof(VkSparseImageFormatProperties)) != 0))
- {
- log << TestLog::Message << "ERROR: device " << deviceNdx << ": mismatch with query " << imageFormatInfo << " property " << ndx << TestLog::EndMessage
- << TestLog::Message << "vkGetPhysicalDeviceSparseImageFormatProperties() returned " << coreProperties[ndx] << TestLog::EndMessage
- << TestLog::Message << "vkGetPhysicalDeviceSparseImageFormatProperties2() returned " << extProperties[ndx] << TestLog::EndMessage;
- TCU_FAIL("Mismatch between image format properties reported by vkGetPhysicalDeviceSparseImageFormatProperties and vkGetPhysicalDeviceSparseImageFormatProperties2");
- }
+ log << TestLog::Message << "ERROR: device mismatch with query " << imageFormatInfo << " property " << ndx << TestLog::EndMessage
+ << TestLog::Message << "vkGetPhysicalDeviceSparseImageFormatProperties() returned " << coreProperties[ndx] << TestLog::EndMessage
+ << TestLog::Message << "vkGetPhysicalDeviceSparseImageFormatProperties2() returned " << extProperties[ndx] << TestLog::EndMessage;
+ TCU_FAIL("Mismatch between image format properties reported by vkGetPhysicalDeviceSparseImageFormatProperties and vkGetPhysicalDeviceSparseImageFormatProperties2");
}
}
}