namespace vk
{
-static bool isPhysicalDeviceFeatures2Supported (const deUint32 version, const std::vector<std::string>& instanceExtensions)
-{
- return isInstanceExtensionSupported(version, instanceExtensions, "VK_KHR_get_physical_device_properties2");
-}
-
DeviceFeatures::DeviceFeatures (const InstanceInterface& vki,
const deUint32 apiVersion,
const VkPhysicalDevice physicalDevice,
deMemset(&m_coreFeatures2, 0, sizeof(m_coreFeatures2));
m_coreFeatures2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
- if (isPhysicalDeviceFeatures2Supported(apiVersion, instanceExtensions))
+ if (isInstanceExtensionSupported(apiVersion, instanceExtensions, "VK_KHR_get_physical_device_properties2"))
{
const std::vector<VkExtensionProperties> deviceExtensionProperties = enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
void** nextPtr = &m_coreFeatures2.pNext;
*/
bool checkMandatoryFeatures(const vkt::Context& context)
{
- if ( !vk::isInstanceExtensionSupported(context.getUsedApiVersion(), context.getInstanceExtensions(), "VK_KHR_get_physical_device_properties2") )
+ if ( !context.isInstanceFunctionalitySupported("VK_KHR_get_physical_device_properties2") )
TCU_THROW(NotSupportedError, "Extension VK_KHR_get_physical_device_properties2 is not present");
VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
return true;
}
-bool isInstanceExtensionSupported (const deUint32 instanceVersion, const std::vector<std::string>& extensions, const std::string& required)
-{
- if (isCoreInstanceExtension(instanceVersion, required))
- return true;
- else
- return de::contains(extensions.begin(), extensions.end(), required);
-}
-
-bool isDeviceExtensionSupported (const deUint32 deviceVersion, const std::vector<std::string>& extensions, const std::string& required)
-{
- if (isCoreDeviceExtension(deviceVersion, required))
- return true;
- else
- return de::contains(extensions.begin(), extensions.end(), required);
-}
-
-bool isInstanceExtensionSupported (const deUint32 instanceVersion, const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required)
-{
- if (isCoreInstanceExtension(instanceVersion, required.name))
- return true;
- else
- return isExtensionSupported(extensions.begin(), extensions.end(), required);
-}
-
-bool isDeviceExtensionSupported (const deUint32 deviceVersion, const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required)
-{
- if (isCoreDeviceExtension(deviceVersion, required.name))
- return true;
- else
- return isExtensionSupported(extensions.begin(), extensions.end(), required);
-}
-
bool isExtensionSupported (const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required)
{
return isExtensionSupported(extensions.begin(), extensions.end(), required);
return de::contains(extensionStrings.begin(), extensionStrings.end(), extensionName);
}
+bool isInstanceExtensionSupported(const deUint32 instanceVersion, const std::vector<std::string>& extensions, const std::string& required)
+{
+ // NOTE: this function is only needed in few cases during creation of context,
+ // dont use it, call Context::isInstanceFunctionalitySupported instead
+ if (isCoreInstanceExtension(instanceVersion, required))
+ return true;
+ return de::contains(extensions.begin(), extensions.end(), required);
+}
+
bool isLayerSupported (const std::vector<VkLayerProperties>& layers, const RequiredLayer& required)
{
return isLayerSupported(layers.begin(), layers.end(), required);
template<typename ExtensionIterator>
bool isExtensionSupported (ExtensionIterator begin, ExtensionIterator end, const RequiredExtension& required);
bool isExtensionSupported (const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required);
-bool isDeviceExtensionSupported (const deUint32 deviceVersion, const std::vector<std::string>& extensions, const std::string& required);
+
bool isInstanceExtensionSupported (const deUint32 instanceVersion, const std::vector<std::string>& extensions, const std::string& required);
-bool isDeviceExtensionSupported (const deUint32 deviceVersion, const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required);
-bool isInstanceExtensionSupported (const deUint32 instanceVersion, const std::vector<VkExtensionProperties>& extensions, const RequiredExtension& required);
template<typename LayerIterator>
bool isLayerSupported (LayerIterator begin, LayerIterator end, const RequiredLayer& required);
de::MovePtr<Allocation>& memory) const
{
DE_UNREF(allocator);
- const std::vector<std::string>& extensions = context.getDeviceExtensions();
- const deBool isSupported = isDeviceExtensionSupported(context.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation");
- if (!isSupported)
- {
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
TCU_THROW(NotSupportedError, "Not supported");
- }
const InstanceInterface& vkInstance = context.getInstanceInterface();
const VkDevice vkDevice = context.getDevice();
VkImageTiling tiling) const
{
DE_UNREF(allocator);
- const std::vector<std::string>& extensions = context.getDeviceExtensions();
- const deBool isSupported = isDeviceExtensionSupported(context.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation");
- if (!isSupported)
- {
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
TCU_THROW(NotSupportedError, "Not supported");
- }
const InstanceInterface& vkInstance = context.getInstanceInterface();
const VkDevice vkDevice = context.getDevice();
virtual void checkSupport (Context& ctx) const
{
- const std::vector<std::string>& extensions = ctx.getDeviceExtensions();
- const deBool isSupported = isDeviceExtensionSupported(ctx.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation");
- if (!isSupported)
- {
+ if (!ctx.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
TCU_THROW(NotSupportedError, "Not supported");
- }
}
private:
BufferCaseParameters m_testCase;
TCU_THROW(NotSupportedError, "Format not supported");
if (m_testCase.bufferAllocationKind == ALLOCATION_KIND_DEDICATED)
{
- const std::vector<std::string>& extensions = ctx.getDeviceExtensions();
- const deBool isSupported = isDeviceExtensionSupported(ctx.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation");
- if (!isSupported)
+ if (!ctx.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
TCU_THROW(NotSupportedError, "Dedicated allocation not supported");
}
}
tcu::TestStatus trimCommandPoolTest (Context& context, const VkCommandBufferLevel cmdBufferLevel)
{
- if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1"))
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_maintenance1"))
TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance1 not supported");
const VkDevice vkDevice = context.getDevice();
{
if (m_params.allocationKind == ALLOCATION_KIND_DEDICATED)
{
- if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation"))
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
TCU_THROW(NotSupportedError, "VK_KHR_dedicated_allocation is not supported");
}
if ((m_params.dst.image.imageType == VK_IMAGE_TYPE_3D && m_params.src.image.imageType == VK_IMAGE_TYPE_2D) ||
(m_params.dst.image.imageType == VK_IMAGE_TYPE_2D && m_params.src.image.imageType == VK_IMAGE_TYPE_3D))
{
- if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1"))
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_maintenance1"))
TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance1 not supported");
}
{
const DeviceInterface& vkd = context.getDeviceInterface();
const VkDevice device = context.getDevice();
- const bool expectOutOfPoolMemoryError = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1");
+ const bool expectOutOfPoolMemoryError = context.isDeviceFunctionalitySupported("VK_KHR_maintenance1");
deUint32 numErrorsReturned = 0;
const struct FailureCase
const VkDevice device = context.getDevice();
if (descriptorSetLayoutCreateFlags == VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR)
- if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_push_descriptor"))
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_push_descriptor"))
TCU_THROW(NotSupportedError, "VK_KHR_push_descriptor extension not supported");
const VkDescriptorSetLayoutCreateInfo descriptorSetLayoutCreateInfo =
void checkSupport (Context& context, const TestType config)
{
DE_UNREF(config);
- context.requireDeviceExtension("VK_KHR_driver_properties");
+ context.requireDeviceFunctionality("VK_KHR_driver_properties");
}
void testDriverMatch (const VkPhysicalDeviceDriverPropertiesKHR& deviceDriverProperties)
TestLog& log = context.getTestContext().getLog();
deUint8 buffer[sizeof(VkPhysicalDeviceMemoryBudgetPropertiesEXT) + GUARD_SIZE];
- if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_memory_budget"))
+ if (!context.isDeviceFunctionalitySupported("VK_EXT_memory_budget"))
TCU_THROW(NotSupportedError, "VK_EXT_memory_budget is not supported");
VkPhysicalDeviceMemoryBudgetPropertiesEXT *budgetProps = reinterpret_cast<VkPhysicalDeviceMemoryBudgetPropertiesEXT *>(buffer);
if (!vk::isCoreDeviceExtension(context.getUsedApiVersion(), "VK_KHR_sampler_ycbcr_conversion"))
{
- if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_sampler_ycbcr_conversion"))
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_sampler_ycbcr_conversion"))
TCU_THROW(NotSupportedError, "VK_KHR_sampler_ycbcr_conversion is not supported");
// Hard dependency for ycbcr
const VkPhysicalDeviceFeatures& deviceFeatures = context.getDeviceFeatures();
const VkPhysicalDeviceLimits& deviceLimits = context.getDeviceProperties().limits;
const VkFormatProperties formatProperties = getPhysicalDeviceFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(), format);
- const bool hasKhrMaintenance1 = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1");
+ const bool hasKhrMaintenance1 = context.isDeviceFunctionalitySupported("VK_KHR_maintenance1");
const VkFormatFeatureFlags supportedFeatures = tiling == VK_IMAGE_TILING_LINEAR ? formatProperties.linearTilingFeatures : formatProperties.optimalTilingFeatures;
const VkImageUsageFlags usageFlagSet = getValidImageUsageFlags(supportedFeatures, hasKhrMaintenance1);
// Instance extensions
{
- static const char* mandatoryExtensions[] =
+ static const string mandatoryExtensions[] =
{
"VK_KHR_get_physical_device_properties2",
};
const vector<VkExtensionProperties> extensions = enumerateInstanceExtensionProperties(context.getPlatformInterface(), DE_NULL);
- for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(mandatoryExtensions); ++ndx)
+ for (const auto ext : mandatoryExtensions)
{
- if (!isInstanceExtensionSupported(context.getUsedApiVersion(), extensions, RequiredExtension(mandatoryExtensions[ndx])))
- results.fail(string(mandatoryExtensions[ndx]) + " is not supported");
+ if (!context.isDeviceFunctionalitySupported(ext))
+ results.fail(ext + " is not supported");
}
}
// Device extensions
{
- static const char* mandatoryExtensions[] =
+ static const string mandatoryExtensions[] =
{
"VK_KHR_maintenance1",
};
const vector<VkExtensionProperties> extensions = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), DE_NULL);
- for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(mandatoryExtensions); ++ndx)
+ for (const auto ext : mandatoryExtensions)
{
- if (!isDeviceExtensionSupported(context.getUsedApiVersion(), extensions, RequiredExtension(mandatoryExtensions[ndx])))
- results.fail(string(mandatoryExtensions[ndx]) + " is not supported");
+ if (!context.isDeviceFunctionalitySupported(ext))
+ results.fail(ext + " is not supported");
}
}
, m_frameBuffer (m_isAttachmentFormat ? createFrameBuffer(*m_imageView, *m_renderPass, params.imageExtent.width, params.imageExtent.height, params.imageViewLayerRange.layerCount) : vk::Move<vk::VkFramebuffer>())
{
if (m_params.allocationKind == ALLOCATION_KIND_DEDICATED)
- context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+ context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
}
ImageClearingTestInstance::ViewType ImageClearingTestInstance::getViewType (deUint32 imageLayerCount) const
{}
virtual void checkSupport (Context& ctx) const
{
- ctx.requireDeviceExtension("VK_KHR_maintenance3");
+ ctx.requireDeviceFunctionality("VK_KHR_maintenance3");
}
virtual TestInstance* createInstance (Context& ctx) const
{
const auto& device = m_context.getDevice();
auto& log = m_context.getTestContext().getLog();
bool iubSupported = false;
- bool iubExtSupported = isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_EXT_inline_uniform_block");
- if (iubExtSupported)
+ if (m_context.isDeviceFunctionalitySupported("VK_EXT_inline_uniform_block"))
{
DevIubFeat iubFeatures =
{
{}
virtual void checkSupport (Context& ctx) const
{
- ctx.requireDeviceExtension("VK_KHR_maintenance3");
+ ctx.requireDeviceFunctionality("VK_KHR_maintenance3");
}
virtual TestInstance* createInstance (Context& ctx) const
{
size_t refSizes[testCycles];
unsigned int order[testCycles];
bool success = true;
- const std::vector<std::string>& extensions = m_context.getDeviceExtensions();
const deBool isDedicatedAllocationSupported =
- isDeviceExtensionSupported(m_context.getUsedApiVersion(), extensions, "VK_KHR_dedicated_allocation");
+ m_context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation");
const deBool isYcbcrSupported =
- isDeviceExtensionSupported(m_context.getUsedApiVersion(), extensions, "VK_KHR_sampler_ycbcr_conversion");
+ m_context.isDeviceFunctionalitySupported("VK_KHR_sampler_ycbcr_conversion");
std::vector<int> optimalFormats;
std::vector<int> linearFormats;
std::vector<int> memoryTypes;
inline bool hasDeviceExtension (Context& context, const string name)
{
- return isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), name);
+ return context.isDeviceFunctionalitySupported(name);
}
VkDeviceSize getPageTableSize (const PlatformMemoryLimits& limits, VkDeviceSize allocationSize)
{
vector<const char*> extensionNamePtrs;
const vector<VkExtensionProperties> instanceExts = enumerateInstanceExtensionProperties(env.vkp, DE_NULL);
- for (size_t extensionID = 0; extensionID < params.instanceExtensions.size(); extensionID++)
+ for (const auto& extName : params.instanceExtensions)
{
- if (!isInstanceExtensionSupported(env.apiVersion, instanceExts, RequiredExtension(params.instanceExtensions[extensionID])))
- TCU_THROW(NotSupportedError, (params.instanceExtensions[extensionID] + " is not supported").c_str());
+ bool extNotInCore = !isCoreInstanceExtension(env.apiVersion, extName);
+ if (extNotInCore && !isExtensionSupported(instanceExts.begin(), instanceExts.end(), RequiredExtension(extName)))
+ TCU_THROW(NotSupportedError, (extName + " is not supported").c_str());
- if (!isCoreInstanceExtension(env.apiVersion, params.instanceExtensions[extensionID]))
- extensionNamePtrs.push_back(params.instanceExtensions[extensionID].c_str());
+ if (extNotInCore)
+ extensionNamePtrs.push_back(extName.c_str());
}
const VkApplicationInfo appInfo =
#if ENABLE_RAYTRACING
if (m_data.stage == STAGE_RAYGEN &&
- !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_NV_ray_tracing"))
+ !context.isDeviceFunctionalitySupported("VK_NV_ray_tracing"))
{
TCU_THROW(NotSupportedError, "Ray tracing not supported");
}
deMemset(&rayTracingProperties, 0, sizeof(rayTracingProperties));
rayTracingProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV;
- if (isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_NV_ray_tracing"))
+ if (m_context.isDeviceFunctionalitySupported("VK_NV_ray_tracing"))
{
properties.pNext = &rayTracingProperties;
}
VkFlags allPipelineStages;
};
+static void getNeededFeatures(const Context& context,
+ VkPhysicalDeviceFeatures2& features,
+ VkPhysicalDeviceInlineUniformBlockFeaturesEXT& inlineUniformFeatures,
+ VkPhysicalDeviceDescriptorIndexingFeaturesEXT& indexingFeatures)
+{
+ deMemset(&inlineUniformFeatures, 0, sizeof(inlineUniformFeatures));
+ inlineUniformFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT;
+
+ deMemset(&indexingFeatures, 0, sizeof(indexingFeatures));
+ indexingFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT;
+
+ deMemset(&features, 0, sizeof(features));
+ features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
+
+ bool descriptorIndexing = context.isDeviceFunctionalitySupported("VK_EXT_descriptor_indexing");
+ bool uniformBlock = context.isDeviceFunctionalitySupported("VK_EXT_inline_uniform_block");
+ if (descriptorIndexing && uniformBlock)
+ {
+ indexingFeatures.pNext = &inlineUniformFeatures;
+ features.pNext = &indexingFeatures;
+ }
+ else if (descriptorIndexing)
+ {
+ features.pNext = &indexingFeatures;
+ }
+ else if (uniformBlock)
+ {
+ features.pNext = &inlineUniformFeatures;
+ }
+
+ context.getInstanceInterface().getPhysicalDeviceFeatures2(context.getPhysicalDevice(), &features);
+}
class RandomLayout
{
properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
void ** pNextTail = &properties.pNext;
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_inline_uniform_block"))
+ if (context.isDeviceFunctionalitySupported("VK_EXT_inline_uniform_block"))
{
*pNextTail = &inlineUniformProperties;
pNextTail = &inlineUniformProperties.pNext;
}
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_NV_ray_tracing"))
+ if (context.isDeviceFunctionalitySupported("VK_NV_ray_tracing"))
{
*pNextTail = &rayTracingProperties;
pNextTail = &rayTracingProperties.pNext;
context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
- VkPhysicalDeviceInlineUniformBlockFeaturesEXT inlineUniformFeatures;
- deMemset(&inlineUniformFeatures, 0, sizeof(inlineUniformFeatures));
- inlineUniformFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT;
-
- VkPhysicalDeviceDescriptorIndexingFeaturesEXT indexingFeatures;
- deMemset(&indexingFeatures, 0, sizeof(indexingFeatures));
- indexingFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT;
-
VkPhysicalDeviceFeatures2 features;
- deMemset(&features, 0, sizeof(features));
- features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
-
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") &&
- isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_inline_uniform_block"))
- {
- indexingFeatures.pNext = &inlineUniformFeatures;
- features.pNext = &indexingFeatures;
- }
- else if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing"))
- {
- features.pNext = &indexingFeatures;
- }
- else if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_inline_uniform_block"))
- {
- features.pNext = &inlineUniformFeatures;
- }
+ VkPhysicalDeviceDescriptorIndexingFeaturesEXT indexingFeatures;
+ VkPhysicalDeviceInlineUniformBlockFeaturesEXT inlineUniformFeatures;
+ getNeededFeatures(context, features, inlineUniformFeatures, indexingFeatures);
- context.getInstanceInterface().getPhysicalDeviceFeatures2(context.getPhysicalDevice(), &features);
if (m_data.stage == STAGE_VERTEX && !features.features.vertexPipelineStoresAndAtomics)
{
return TCU_THROW(NotSupportedError, "Vertex pipeline stores and atomics not supported");
}
else if (m_data.stage == STAGE_RAYGEN &&
- !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_NV_ray_tracing"))
+ !context.isDeviceFunctionalitySupported("VK_NV_ray_tracing"))
{
return TCU_THROW(NotSupportedError, "Ray tracing is not supported");
}
deMemset(&rayTracingProperties, 0, sizeof(rayTracingProperties));
rayTracingProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV;
- if (isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_NV_ray_tracing"))
+ if (m_context.isDeviceFunctionalitySupported("VK_NV_ray_tracing"))
{
properties.pNext = &rayTracingProperties;
}
m_context.getInstanceInterface().getPhysicalDeviceProperties2(m_context.getPhysicalDevice(), &properties);
+ VkPhysicalDeviceFeatures2 features;
VkPhysicalDeviceInlineUniformBlockFeaturesEXT inlineUniformFeatures;
- deMemset(&inlineUniformFeatures, 0, sizeof(inlineUniformFeatures));
- inlineUniformFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT;
-
VkPhysicalDeviceDescriptorIndexingFeaturesEXT indexingFeatures;
- deMemset(&indexingFeatures, 0, sizeof(indexingFeatures));
- indexingFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT;
-
- VkPhysicalDeviceFeatures2 features;
- deMemset(&features, 0, sizeof(features));
- features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
-
- if (isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_EXT_descriptor_indexing") &&
- isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_EXT_inline_uniform_block"))
- {
- indexingFeatures.pNext = &inlineUniformFeatures;
- features.pNext = &indexingFeatures;
- }
- else if (isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_EXT_descriptor_indexing"))
- {
- features.pNext = &indexingFeatures;
- }
- else if (isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_EXT_inline_uniform_block"))
- {
- features.pNext = &inlineUniformFeatures;
- }
+ getNeededFeatures(m_context, features, inlineUniformFeatures, indexingFeatures);
m_context.getInstanceInterface().getPhysicalDeviceFeatures2(m_context.getPhysicalDevice(), &features);
bool pointClippingOutside = true;
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2"))
+ if (context.isDeviceFunctionalitySupported("VK_KHR_maintenance2"))
{
VkPointClippingBehavior clippingBehavior = getClippingBehavior(context.getInstanceInterface(), context.getPhysicalDevice());
void checkSupport (Context& context)
{
- context.requireDeviceExtension("VK_EXT_conditional_rendering");
+ context.requireDeviceFunctionality("VK_EXT_conditional_rendering");
}
} // unnamed namespace
void checkConditionalRenderingCapabilities (vkt::Context& context, const ConditionalData& data)
{
- if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_conditional_rendering"))
+ if (!context.isDeviceFunctionalitySupported("VK_EXT_conditional_rendering"))
TCU_THROW(NotSupportedError, "Missing extension: VK_EXT_conditional_rendering");
if (data.conditionInherited)
virtual void checkSupport (vkt::Context& context) const
{
- context.requireDeviceExtension("VK_EXT_descriptor_indexing");
+ context.requireDeviceFunctionality("VK_EXT_descriptor_indexing");
const vk::VkPhysicalDeviceDescriptorIndexingFeaturesEXT& feats = context.getDescriptorIndexingFeatures();
void DeviceGroupTestInstance::init (void)
{
- if (!isInstanceExtensionSupported(m_context.getUsedApiVersion(), m_context.getInstanceExtensions(), "VK_KHR_device_group_creation"))
+ if (!m_context.isInstanceFunctionalitySupported("VK_KHR_device_group_creation"))
TCU_THROW(NotSupportedError, "Device Group tests are not supported, no device group extension present.");
const InstanceInterface& instanceInterface = m_context.getInstanceInterface();
vector<string> deviceExtensions;
vector<string> enabledLayers;
- if (!isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_KHR_device_group"))
+ if (!m_context.isDeviceFunctionalitySupported("VK_KHR_device_group"))
TCU_THROW(NotSupportedError, "Missing extension: VK_KHR_device_group");
if (!isCoreDeviceExtension(m_context.getUsedApiVersion(), "VK_KHR_device_group"))
if(m_useDedicated)
{
- if (!isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_KHR_dedicated_allocation"))
+ if (!m_context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
TCU_THROW(NotSupportedError, "Missing extension: VK_KHR_dedicated_allocation");
if (!isCoreDeviceExtension(m_context.getUsedApiVersion(), "VK_KHR_dedicated_allocation"))
void DiscardRectanglesTestCase::checkSupport (Context& context) const
{
- context.requireDeviceExtension("VK_EXT_discard_rectangles");
+ context.requireDeviceFunctionality("VK_EXT_discard_rectangles");
}
TestInstance* DiscardRectanglesTestCase::createInstance (Context& context) const
void checkIndirectCountExt (Context& context)
{
- context.requireDeviceExtension("VK_KHR_draw_indirect_count");
+ context.requireDeviceFunctionality("VK_KHR_draw_indirect_count");
}
} // anonymous
{
if (m_params.testAttribDivisor)
{
- context.requireDeviceExtension("VK_EXT_vertex_attribute_divisor");
+ context.requireDeviceFunctionality("VK_EXT_vertex_attribute_divisor");
const vk::VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT& vertexAttributeDivisorFeatures = context.getVertexAttributeDivisorFeatures();
if (m_params.testMultiview)
{
- context.requireDeviceExtension("VK_KHR_multiview");
+ context.requireDeviceFunctionality("VK_KHR_multiview");
const vk::VkPhysicalDeviceMultiviewFeatures& multiviewFeatures = context.getMultiviewFeatures();
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_DEPTH_CLAMP);
if (m_params.minDepth > 1.0f || m_params.minDepth < 0.0f || m_params.maxDepth > 1.0f || m_params.maxDepth < 0.0f)
- context.requireDeviceExtension("VK_EXT_depth_range_unrestricted");
+ context.requireDeviceFunctionality("VK_EXT_depth_range_unrestricted");
}
virtual TestInstance* createInstance (Context& context) const
virtual void checkSupport (Context& context) const
{
- context.requireDeviceExtension("VK_KHR_maintenance1");
+ context.requireDeviceFunctionality("VK_KHR_maintenance1");
}
virtual TestInstance* createInstance (Context& context) const
void checkSupport (Context& context, TestFlags flags)
{
- context.requireDeviceExtension("VK_KHR_shader_draw_parameters");
+ context.requireDeviceFunctionality("VK_KHR_shader_draw_parameters");
// Shader draw parameters is part of Vulkan 1.1 but is optional
if (context.contextSupports(vk::ApiVersion(1, 1, 0)) )
void checkRequirements (Context& context, const int)
{
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_MULTI_VIEWPORT);
- context.requireDeviceExtension("VK_EXT_shader_viewport_index_layer");
+ context.requireDeviceFunctionality("VK_EXT_shader_viewport_index_layer");
const VkPhysicalDeviceLimits limits = context.getDeviceProperties().limits;
void checkSupportVertex (Context& context, const int)
{
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_MULTI_VIEWPORT);
- context.requireDeviceExtension("VK_EXT_shader_viewport_index_layer");
+ context.requireDeviceFunctionality("VK_EXT_shader_viewport_index_layer");
if (context.getDeviceProperties().limits.maxViewports < MIN_MAX_VIEWPORTS)
TCU_FAIL("multiViewport supported but maxViewports is less than the minimum required");
void FSITestCase::checkSupport(Context& context) const
{
- context.requireDeviceExtension("VK_EXT_fragment_shader_interlock");
+ context.requireDeviceFunctionality("VK_EXT_fragment_shader_interlock");
if ((m_data.interlock == INT_SAMPLE_ORDERED || m_data.interlock == INT_SAMPLE_UNORDERED) &&
!context.getFragmentShaderInterlockFeatures().fragmentShaderSampleInterlock)
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_GEOMETRY_SHADER);
if (params.image.viewType == VK_IMAGE_VIEW_TYPE_3D)
- context.requireDeviceExtension("VK_KHR_maintenance1");
+ context.requireDeviceFunctionality("VK_KHR_maintenance1");
if (params.testType == TEST_TYPE_SECONDARY_CMD_BUFFER)
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_FRAGMENT_STORES_AND_ATOMICS);
const VkPhysicalDevice physicalDevice = context.getPhysicalDevice();
const InstanceInterface& vk = context.getInstanceInterface();
- context.requireDeviceExtension("VK_KHR_maintenance2");
+ context.requireDeviceFunctionality("VK_KHR_maintenance2");
{
VkImageFormatProperties imageFormatProperties;
context.getPhysicalDevice(),
m_format));
- if (!context.requireDeviceExtension("VK_KHR_spirv_1_4"))
+ if (!context.requireDeviceFunctionality("VK_KHR_spirv_1_4"))
TCU_THROW(NotSupportedError, "VK_KHR_spirv_1_4 not supported");
if ((m_texture.type() != IMAGE_TYPE_BUFFER) && !(formatProperties.optimalTilingFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT))
public:
UploadDownloadExecutor(Context& context, VkDevice device, VkQueue queue, deUint32 queueFamilyIndex, const CaseDef& caseSpec) :
m_caseDef(caseSpec),
- m_haveMaintenance2(isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2")),
+ m_haveMaintenance2(context.isDeviceFunctionalitySupported("VK_KHR_maintenance2")),
m_vk(context.getDeviceInterface()),
m_device(device),
m_queue(queue),
// If this is a VK_KHR_image_format_list test, check that the extension is supported
if (caseDef.isFormatListTest)
- context.requireDeviceExtension("VK_KHR_image_format_list");
+ context.requireDeviceFunctionality("VK_KHR_image_format_list");
// Check required features on the format for the required upload/download methods
VkFormatProperties imageFormatProps, viewFormatProps;
if ((viewFormatProps.optimalTilingFeatures & viewFormatFeatureFlags) != viewFormatFeatureFlags)
TCU_THROW(NotSupportedError, "View format doesn't support upload/download method");
- const bool haveMaintenance2 = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2");
+ const bool haveMaintenance2 = context.isDeviceFunctionalitySupported("VK_KHR_maintenance2");
// We don't use the base image for anything other than transfer
// operations so there are no features to check. However, The Vulkan
void ImageTranscodingCase::checkSupport (Context& context) const
{
- context.requireDeviceExtension("VK_KHR_maintenance2");
+ context.requireDeviceFunctionality("VK_KHR_maintenance2");
if (!isFormatUsageFlagSupported(context, m_parameters.featuredFormat, m_parameters.testedImageUsageFeature))
TCU_THROW(NotSupportedError, "Test skipped due to feature is not supported by the format");
ColorImagelessTestInstance::ColorImagelessTestInstance (Context& context, const TestParameters& parameters)
: TestInstance (context)
- , m_extensions (context.requireDeviceExtension("VK_KHR_imageless_framebuffer"))
+ , m_extensions (context.requireDeviceFunctionality("VK_KHR_imageless_framebuffer"))
, m_imageExtent2D (makeExtent2D(32u, 32u))
, m_parameters (parameters)
, m_colorImageUsage (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT)
DepthResolveImagelessTestInstance::DepthResolveImagelessTestInstance (Context& context, const TestParameters& parameters)
: DepthImagelessTestInstance (context, parameters)
{
- context.requireDeviceExtension("VK_KHR_depth_stencil_resolve");
+ context.requireDeviceFunctionality("VK_KHR_depth_stencil_resolve");
const InstanceInterface& vki = m_context.getInstanceInterface();
const VkPhysicalDevice physDevice = m_context.getPhysicalDevice();
virtual void checkSupport (Context& ctx) const
{
- ctx.requireDeviceExtension("VK_KHR_bind_memory2");
+ ctx.requireDeviceFunctionality("VK_KHR_bind_memory2");
if (m_params.usePriority && !ctx.getMemoryPriorityFeatures().memoryPriority)
TCU_THROW(NotSupportedError, "VK_EXT_memory_priority Not supported");
void checkSupport (Context& context)
{
- context.requireDeviceExtension("VK_EXT_external_memory_host");
+ context.requireDeviceFunctionality("VK_EXT_external_memory_host");
}
} // unnamed namespace
if (config.allocationKind == ALLOCATION_KIND_DEDICATED_IMAGE
|| config.allocationKind == ALLOCATION_KIND_DEDICATED_BUFFER)
{
- context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+ context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
}
}
{
checkSupportBufferMemoryRequirementsOriginal(context, flags);
- context.requireDeviceExtension("VK_KHR_get_memory_requirements2");
+ context.requireDeviceFunctionality("VK_KHR_get_memory_requirements2");
}
void BufferMemoryRequirementsExtended::addFunctionTestCase (tcu::TestCaseGroup* group,
{
checkSupportBufferMemoryRequirementsExtended(context, flags);
- context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+ context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
}
void BufferMemoryRequirementsDedicatedAllocation::addFunctionTestCase (tcu::TestCaseGroup* group,
const VkPhysicalDeviceMemoryProperties& deviceMemoryProperties);
private:
- virtual bool isImageSupported (const deUint32 apiVersion,
+ virtual bool isImageSupported (const Context& context,
const InstanceInterface& vki,
const VkPhysicalDevice physDevice,
- const std::vector<std::string>& deviceExtensions,
const VkImageCreateInfo& info);
virtual bool isFormatMatchingAspect (const VkFormat format,
}
//! This catches both invalid as well as legal but unsupported combinations of image parameters
-bool ImageMemoryRequirementsOriginal::isImageSupported (const deUint32 apiVersion, const InstanceInterface& vki, const VkPhysicalDevice physDevice, const std::vector<std::string>& deviceExtensions, const VkImageCreateInfo& info)
+bool ImageMemoryRequirementsOriginal::isImageSupported (const Context& context, const InstanceInterface& vki, const VkPhysicalDevice physDevice, const VkImageCreateInfo& info)
{
DE_ASSERT(info.extent.width >= 1u && info.extent.height >= 1u && info.extent.depth >= 1u);
|| info.mipLevels != 1
|| info.arrayLayers != 1
|| info.samples != VK_SAMPLE_COUNT_1_BIT))
- || !isDeviceExtensionSupported(apiVersion, deviceExtensions, "VK_KHR_sampler_ycbcr_conversion"))
+ || !context.isDeviceFunctionalitySupported("VK_KHR_sampler_ycbcr_conversion"))
{
return false;
}
m_currentTestImageInfo = imageInfo;
- if (!isImageSupported(context.getUsedApiVersion(), vki, physDevice, context.getDeviceExtensions(), m_currentTestImageInfo))
+ if (!isImageSupported(context, vki, physDevice, m_currentTestImageInfo))
continue;
log << tcu::TestLog::Message << "- " << getImageInfoString(m_currentTestImageInfo) << tcu::TestLog::EndMessage;
{
checkSupportImageMemoryRequirementsOriginal(context, params);
- context.requireDeviceExtension("VK_KHR_get_memory_requirements2");
+ context.requireDeviceFunctionality("VK_KHR_get_memory_requirements2");
}
void ImageMemoryRequirementsExtended::addFunctionTestCase (tcu::TestCaseGroup* group,
{
checkSupportImageMemoryRequirementsExtended(context, params);
- context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+ context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
}
void ImageMemoryRequirementsDedicatedAllocation::addFunctionTestCase (tcu::TestCaseGroup* group,
{
checkSupportImageMemoryRequirementsOriginal(context, params);
- context.requireDeviceExtension("VK_KHR_get_memory_requirements2");
- context.requireDeviceExtension("VK_KHR_sampler_ycbcr_conversion");
+ context.requireDeviceFunctionality("VK_KHR_get_memory_requirements2");
+ context.requireDeviceFunctionality("VK_KHR_sampler_ycbcr_conversion");
}
void populateMultiplaneTestGroup (tcu::TestCaseGroup* group)
MultiViewRenderTestInstance::MultiViewRenderTestInstance (Context& context, const TestParameters& parameters)
: TestInstance (context)
- , m_extensionSupported ((parameters.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+ , m_extensionSupported ((parameters.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
, m_parameters (fillMissingParameters(parameters))
, m_seed (context.getTestContext().getCommandLine().getBaseSeed())
, m_squareCount (4u)
virtual void checkSupport (Context& context) const
{
- context.requireDeviceExtension("VK_KHR_multiview");
+ context.requireDeviceFunctionality("VK_KHR_multiview");
}
void initPrograms (SourceCollections& programCollection) const
const CacheTestParam* param)
: TestInstance (context)
, m_param (param)
- , m_extensions (m_context.requireDeviceExtension("VK_EXT_pipeline_creation_feedback"))
+ , m_extensions (m_context.requireDeviceFunctionality("VK_EXT_pipeline_creation_feedback"))
{
const DeviceInterface& vk = m_context.getDeviceInterface();
const VkDevice vkDevice = m_context.getDevice();
const DepthRangeUnrestrictedParam param)
: TestInstance (context)
, m_param (param)
- , m_extensions (m_context.requireDeviceExtension("VK_EXT_depth_range_unrestricted"))
+ , m_extensions (m_context.requireDeviceFunctionality("VK_EXT_depth_range_unrestricted"))
, m_renderSize (tcu::UVec2(32,32))
, m_colorFormat (VK_FORMAT_R8G8B8A8_UNORM)
, m_shaderStageCount (0)
const ExecutablePropertiesTestParam* param)
: TestInstance (context)
, m_param (param)
- , m_extensions (m_context.requireDeviceExtension("VK_KHR_pipeline_executable_properties"))
+ , m_extensions (m_context.requireDeviceFunctionality("VK_KHR_pipeline_executable_properties"))
{
const DeviceInterface& vk = m_context.getDeviceInterface();
const VkDevice vkDevice = m_context.getDevice();
if (params.separateStencilUsage)
{
- context.requireDeviceExtension("VK_EXT_separate_stencil_usage");
- context.requireInstanceExtension("VK_KHR_get_physical_device_properties2");
+ context.requireDeviceFunctionality("VK_EXT_separate_stencil_usage");
+ context.requireInstanceFunctionality("VK_KHR_get_physical_device_properties2");
const VkImageStencilUsageCreateInfoEXT stencilUsage =
{
if (nextType == VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT)
{
- context.requireDeviceExtension("VK_EXT_sampler_filter_minmax");
+ context.requireDeviceFunctionality("VK_EXT_sampler_filter_minmax");
if (!isMinMaxFilteringSupported(context.getInstanceInterface(), context.getPhysicalDevice(), params.imageFormat, VK_IMAGE_TILING_OPTIMAL))
throw tcu::NotSupportedError(std::string("Unsupported format for min/max filtering: ") + getFormatName(params.imageFormat));
params.samplerParams.addressModeV == VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE ||
params.samplerParams.addressModeW == VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE)
{
- context.requireDeviceExtension("VK_KHR_sampler_mirror_clamp_to_edge");
+ context.requireDeviceFunctionality("VK_KHR_sampler_mirror_clamp_to_edge");
}
if ((isCompressedFormat(params.imageFormat) || isDepthStencilFormat(params.imageFormat)) && params.imageViewType == VK_IMAGE_VIEW_TYPE_3D)
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_IMAGE_CUBE_ARRAY);
if (params.allocationKind == ALLOCATION_KIND_DEDICATED)
- context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+ context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
}
ImageSamplingInstance::ImageSamplingInstance (Context& context,
void InputAssemblyTest::checkSupport (Context& context) const
{
if (m_indexType == VK_INDEX_TYPE_UINT8_EXT)
- context.requireDeviceExtension("VK_EXT_index_type_uint8");
+ context.requireDeviceFunctionality("VK_EXT_index_type_uint8");
switch (m_primitiveTopology)
{
void checkSupportSampleLocations (Context& context)
{
- context.requireDeviceExtension("VK_EXT_sample_locations");
+ context.requireDeviceFunctionality("VK_EXT_sample_locations");
}
std::string getString (const VkSampleCountFlagBits sampleCount)
if (!context.getDeviceProperties().limits.standardSampleLocations)
TCU_THROW(NotSupportedError, "standardSampleLocations required");
- context.requireDeviceExtension("VK_EXT_post_depth_coverage");
+ context.requireDeviceFunctionality("VK_EXT_post_depth_coverage");
}
void SampleMaskWithDepthTestTest::initPrograms (SourceCollections& programCollection) const
void checkImageViewTypeRequirements (Context& context, const VkImageViewType viewType)
{
if (viewType == VK_IMAGE_VIEW_TYPE_3D)
- context.requireDeviceExtension("VK_KHR_maintenance1");
+ context.requireDeviceFunctionality("VK_KHR_maintenance1");
if (viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY)
context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_IMAGE_CUBE_ARRAY);
checkImageViewTypeRequirements(context, caseDef.viewType);
if (caseDef.allocationKind == ALLOCATION_KIND_DEDICATED)
- context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+ context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
if (caseDef.depthStencilFormat != VK_FORMAT_UNDEFINED && !isDepthStencilFormatSupported(context.getInstanceInterface(), context.getPhysicalDevice(), caseDef.depthStencilFormat))
TCU_THROW(NotSupportedError, "Unsupported depth/stencil format");
checkImageViewTypeRequirements(context, caseDef.viewType);
if (caseDef.allocationKind == ALLOCATION_KIND_DEDICATED)
- context.requireDeviceExtension("VK_KHR_dedicated_allocation");
+ context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
if (caseDef.depthStencilFormat != VK_FORMAT_UNDEFINED && !isDepthStencilFormatSupported(context.getInstanceInterface(), context.getPhysicalDevice(), caseDef.depthStencilFormat))
TCU_THROW(NotSupportedError, "Unsupported depth/stencil format");
void checkSupport (Context& context)
{
- context.requireDeviceExtension("VK_EXT_shader_stencil_export");
+ context.requireDeviceFunctionality("VK_EXT_shader_stencil_export");
const VkFormat stencilFormat = VK_FORMAT_S8_UINT;
if (!isSupportedDepthStencilFormat(context.getInstanceInterface(), context.getPhysicalDevice(), stencilFormat))
if (m_hostQueryReset)
{
// Check VK_EXT_host_query_reset is supported
- context.requireDeviceExtension("VK_EXT_host_query_reset");
+ context.requireDeviceFunctionality("VK_EXT_host_query_reset");
if(context.getHostQueryResetFeatures().hostQueryReset == VK_FALSE)
throw tcu::NotSupportedError("Implementation doesn't support resetting queries from the host");
template <class T>
void CalibratedTimestampTest<T>::checkSupport (Context& context) const
{
- context.requireDeviceExtension("VK_EXT_calibrated_timestamps");
+ context.requireDeviceFunctionality("VK_EXT_calibrated_timestamps");
}
CalibratedTimestampTestInstance::CalibratedTimestampTestInstance (Context& context)
const Extensions supportedExtensions(vk::enumerateInstanceExtensionProperties(vkp, DE_NULL));
std::vector<std::string> requiredExtensions = extraExtensions;
- if (!isCoreInstanceExtension(context.getUsedApiVersion(), "VK_KHR_get_physical_device_properties2"))
+ deUint32 apiVersion = context.getUsedApiVersion();
+ if (!isCoreInstanceExtension(apiVersion, "VK_KHR_get_physical_device_properties2"))
requiredExtensions.push_back("VK_KHR_get_physical_device_properties2");
+ // extract extension names
+ std::vector<std::string> extensions;
+ for (const auto& e : supportedExtensions)
+ extensions.push_back(e.extensionName);
+
for (const auto& extName : requiredExtensions)
{
- if (!isInstanceExtensionSupported(context.getUsedApiVersion(), supportedExtensions, vk::RequiredExtension(extName)))
+ if (!isInstanceExtensionSupported(apiVersion, extensions, extName))
TCU_THROW(NotSupportedError, (extName + " is not supported").c_str());
}
// Check if the physical device supports the protected memory extension name
for (deUint32 ndx = 0; ndx < extensions.size(); ++ndx)
{
- if (!isDeviceExtensionSupported(apiVersion, supportedExtensions, vk::RequiredExtension(extensions[ndx])))
+ bool notInCore = !isCoreDeviceExtension(apiVersion, extensions[ndx]);
+ if (notInCore && !isExtensionSupported(supportedExtensions.begin(), supportedExtensions.end(), RequiredExtension(extensions[ndx])))
TCU_THROW(NotSupportedError, (extensions[ndx] + " is not supported").c_str());
- if (!isCoreDeviceExtension(apiVersion, extensions[ndx]))
+ if (notInCore)
requiredExtensions.push_back(extensions[ndx]);
}
if (m_testVector.queryResultsMode == RESULTS_MODE_GET_RESET)
{
// Check VK_EXT_host_query_reset is supported
- m_context.requireDeviceExtension("VK_EXT_host_query_reset");
+ m_context.requireDeviceFunctionality("VK_EXT_host_query_reset");
if(m_context.getHostQueryResetFeatures().hostQueryReset == VK_FALSE)
throw tcu::NotSupportedError(std::string("Implementation doesn't support resetting queries from the host").c_str());
}
if (m_testVector.queryResultsMode == RESULTS_MODE_GET_RESET)
{
// Check VK_EXT_host_query_reset is supported
- m_context.requireDeviceExtension("VK_EXT_host_query_reset");
+ m_context.requireDeviceFunctionality("VK_EXT_host_query_reset");
if(m_context.getHostQueryResetFeatures().hostQueryReset == VK_FALSE)
throw tcu::NotSupportedError(std::string("Implementation doesn't support resetting queries from the host").c_str());
}
if (hostResetQueryEnabled == DE_TRUE)
{
// Check VK_EXT_host_query_reset is supported
- m_context.requireDeviceExtension("VK_EXT_host_query_reset");
+ m_context.requireDeviceFunctionality("VK_EXT_host_query_reset");
if(m_context.getHostQueryResetFeatures().hostQueryReset == VK_FALSE)
throw tcu::NotSupportedError(std::string("Implementation doesn't support resetting queries from the host").c_str());
}
{
DE_ASSERT(m_primitiveWideness < PRIMITIVEWIDENESS_LAST);
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_line_rasterization"))
+ if (context.isDeviceFunctionalitySupported("VK_EXT_line_rasterization"))
{
VkPhysicalDeviceLineRasterizationPropertiesEXT lineRasterizationProperties =
{
bool DepthStencilResolveTest::isFeaturesSupported()
{
- m_context.requireDeviceExtension("VK_KHR_depth_stencil_resolve");
+ m_context.requireDeviceFunctionality("VK_KHR_depth_stencil_resolve");
if (m_config.imageLayers > 1)
m_context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_GEOMETRY_SHADER);
MultisampleRenderPassTestBase::MultisampleRenderPassTestBase (Context& context, TestConfig config, deUint32 attachmentsCount)
: TestInstance (context)
, m_featuresSupported (featuresSupported(context, config))
- , m_extensionSupported ((config.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+ , m_extensionSupported ((config.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
, m_renderPassType (config.renderPassType)
, m_format (config.format)
, m_sampleCount (sampleCountBitFromSampleCount(config.sampleCount))
{
if (renderPassType == RENDERPASS_TYPE_RENDERPASS2)
- context.requireDeviceExtension("VK_KHR_create_renderpass2");
+ context.requireDeviceFunctionality("VK_KHR_create_renderpass2");
if (separateStencilUsage)
{
- context.requireDeviceExtension ("VK_EXT_separate_stencil_usage");
- context.requireInstanceExtension("VK_KHR_get_physical_device_properties2");
+ context.requireDeviceFunctionality ("VK_EXT_separate_stencil_usage");
+ context.requireInstanceFunctionality("VK_KHR_get_physical_device_properties2");
}
return true;
SampleReadTestInstance::SampleReadTestInstance (Context& context, TestConfig config)
: TestInstance (context)
, m_extensionSupported (context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING) &&
- ((config.renderPassType != RENDERPASS_TYPE_RENDERPASS2) || context.requireDeviceExtension("VK_KHR_create_renderpass2")))
+ ((config.renderPassType != RENDERPASS_TYPE_RENDERPASS2) || context.requireDeviceFunctionality("VK_KHR_create_renderpass2")))
, m_renderPassType (config.renderPassType)
, m_sampleCount (config.sampleCount)
, m_width (32u)
SparseRenderTargetTestInstance::SparseRenderTargetTestInstance (Context& context, TestConfig testConfig)
: TestInstance (context)
- , m_extensionSupported ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+ , m_extensionSupported ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
, m_renderPassType (testConfig.renderPassType)
, m_width (32u)
, m_height (32u)
ExternalDependencyTestInstance::ExternalDependencyTestInstance (Context& context, ExternalTestConfig testConfig)
: TestInstance (context)
- , m_extensionSupported ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+ , m_extensionSupported ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
, m_renderPassType (testConfig.renderPassType)
, m_width (testConfig.imageSize.x())
, m_height (testConfig.imageSize.y())
SubpassDependencyTestInstance::SubpassDependencyTestInstance (Context& context, SubpassTestConfig testConfig)
: TestInstance (context)
- , m_extensionSupported ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+ , m_extensionSupported ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
, m_renderPassInfo (testConfig.renderPass)
, m_renderPassType (testConfig.renderPassType)
, m_width (testConfig.imageSize.x())
SubpassSelfDependencyBackwardsTestInstance::SubpassSelfDependencyBackwardsTestInstance (Context& context, SubpassSelfDependencyBackwardsTestConfig testConfig)
: TestInstance (context)
- , m_extensionSupported ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+ , m_extensionSupported ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
, m_featuresSupported (context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_GEOMETRY_SHADER))
, m_renderPassType (testConfig.renderPassType)
, m_width (testConfig.imageSize.x())
SeparateChannelsTestInstance::SeparateChannelsTestInstance (Context& context, SeparateChannelsTestConfig testConfig)
: TestInstance (context)
- , m_extensionSupported ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceExtension("VK_KHR_create_renderpass2"))
+ , m_extensionSupported ((testConfig.renderPassType == RENDERPASS_TYPE_RENDERPASS2) && context.requireDeviceFunctionality("VK_KHR_create_renderpass2"))
, m_renderPassType (testConfig.renderPassType)
, m_width (256u)
, m_height (256u)
vector<SubpassRenderInfo> subpassRenderInfo;
if (config.renderPassType == RENDERPASS_TYPE_RENDERPASS2)
- context.requireDeviceExtension("VK_KHR_create_renderpass2");
+ context.requireDeviceFunctionality("VK_KHR_create_renderpass2");
if (config.allocationKind == ALLOCATION_KIND_DEDICATED)
{
- if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation"))
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
TCU_THROW(NotSupportedError, "VK_KHR_dedicated_allocation is not supported");
}
if (!renderPassInfo.getInputAspects().empty())
{
- if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2"))
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_maintenance2"))
TCU_THROW(NotSupportedError, "Extension VK_KHR_maintenance2 not supported.");
}
}
}
- if (requireDepthStencilLayout && !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2"))
+ if (requireDepthStencilLayout && !context.isDeviceFunctionalitySupported("VK_KHR_maintenance2"))
TCU_THROW(NotSupportedError, "VK_KHR_maintenance2 is not supported");
}
// Check for renderpass2 extension if used
if (testParams.renderPassType == RENDERPASS_TYPE_RENDERPASS2)
- context.requireDeviceExtension("VK_KHR_create_renderpass2");
+ context.requireDeviceFunctionality("VK_KHR_create_renderpass2");
// Create color image
{
{
// Check for renderpass2 extension if used
if (m_testParams.renderPassType == RENDERPASS_TYPE_RENDERPASS2)
- context.requireDeviceExtension("VK_KHR_create_renderpass2");
+ context.requireDeviceFunctionality("VK_KHR_create_renderpass2");
// Check support for the needed color, depth and stencil formats.
if (!m_testParams.colorUsed.empty())
{
// A function for getting information on variable pointer features supported through physical device
-vk::VkPhysicalDeviceVariablePointersFeatures querySupportedVariablePointersFeatures (const deUint32 apiVersion,
- const InstanceInterface& vki,
- VkPhysicalDevice device,
- const std::vector<std::string>& instanceExtensions)
+vk::VkPhysicalDeviceVariablePointersFeatures querySupportedVariablePointersFeatures (const Context& context)
{
VkPhysicalDeviceVariablePointersFeatures extensionFeatures =
{
features.pNext = &extensionFeatures;
// Call the getter only if supported. Otherwise above "zero" defaults are used
- if (isInstanceExtensionSupported(apiVersion, instanceExtensions, "VK_KHR_get_physical_device_properties2"))
+ if (context.isInstanceFunctionalitySupported("VK_KHR_get_physical_device_properties2"))
{
- vki.getPhysicalDeviceFeatures2(device, &features);
+ context.getInstanceInterface().getPhysicalDeviceFeatures2(context.getPhysicalDevice(), &features);
}
return extensionFeatures;
TestInstance* RobustReadTest::createInstance (Context& context) const
{
- VkPhysicalDeviceVariablePointersFeatures pointerFeatures = querySupportedVariablePointersFeatures(context.getUsedApiVersion(), context.getInstanceInterface(), context.getPhysicalDevice(), context.getInstanceExtensions());
+ VkPhysicalDeviceVariablePointersFeatures pointerFeatures = querySupportedVariablePointersFeatures(context);
if (pointerFeatures.variablePointersStorageBuffer != DE_TRUE)
return new NotSupportedInstance(context, std::string("VariablePointersStorageBuffer support is required for this test."));
TestInstance* RobustWriteTest::createInstance (Context& context) const
{
- VkPhysicalDeviceVariablePointersFeatures pointerFeatures = querySupportedVariablePointersFeatures(context.getUsedApiVersion(), context.getInstanceInterface(), context.getPhysicalDevice(), context.getInstanceExtensions());
+ VkPhysicalDeviceVariablePointersFeatures pointerFeatures = querySupportedVariablePointersFeatures(context);
if (pointerFeatures.variablePointersStorageBuffer != DE_TRUE)
return new NotSupportedInstance(context, std::string("VariablePointersStorageBuffer support is required for this test."));
{
if ((m_dataType == DATA_TYPE_INT64) || (m_dataType == DATA_TYPE_UINT64))
{
- if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_shader_atomic_int64"))
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_shader_atomic_int64"))
TCU_THROW(NotSupportedError, "Missing extension: VK_KHR_shader_atomic_int64");
VkPhysicalDeviceShaderAtomicInt64FeaturesKHR shaderAtomicInt64Features;
if ((m_flags & FLAG_USE_STORAGE_BUFFER) != 0)
{
- if (!isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_KHR_storage_buffer_storage_class"))
+ if (!m_context.isDeviceFunctionalitySupported("VK_KHR_storage_buffer_storage_class"))
TCU_THROW(NotSupportedError, "VK_KHR_storage_buffer_storage_class is not supported");
}
private:
void checkSupported(void)
{
- m_context.requireDeviceExtension("VK_KHR_shader_clock");
+ m_context.requireDeviceFunctionality("VK_KHR_shader_clock");
VkPhysicalDeviceShaderClockFeaturesKHR shaderClockFeatures;
shaderClockFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR;
// features are set to the same value when specific independence settings are used.
tcu::TestStatus verifyIndependenceSettings(Context& context)
{
- const std::vector<std::string>& deviceExtensions = context.getDeviceExtensions();
- if (!isDeviceExtensionSupported(context.getUsedApiVersion(), deviceExtensions, "VK_KHR_shader_float_controls"))
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_shader_float_controls"))
TCU_THROW(NotSupportedError, "VK_KHR_shader_float_controls not supported");
vk::VkPhysicalDeviceFloatControlsPropertiesKHR fcProperties;
return true;
// return false when float control features are requested and proper extension is not supported
- const std::vector<std::string>& deviceExtensions = context.getDeviceExtensions();
- if (!isDeviceExtensionSupported(context.getUsedApiVersion(), deviceExtensions, "VK_KHR_shader_float_controls"))
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_shader_float_controls"))
return false;
// perform query to get supported float control properties
TestInstance* SSBOLayoutCase::createInstance (Context& context) const
{
- if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_relaxed_block_layout") && usesRelaxedLayout(m_interface))
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_relaxed_block_layout") && usesRelaxedLayout(m_interface))
TCU_THROW(NotSupportedError, "VK_KHR_relaxed_block_layout not supported");
if (!context.get16BitStorageFeatures().storageBuffer16BitAccess && uses16BitStorage(m_interface))
TCU_THROW(NotSupportedError, "storageBuffer16BitAccess not supported");
if (!subgroups::isFormatSupportedForDevice(context, caseDef.format))
TCU_THROW(NotSupportedError, "Device does not support the specified format in subgroup operations");
- if (caseDef.extShaderSubGroupBallotTests && !context.requireDeviceExtension("VK_EXT_shader_subgroup_ballot"))
+ if (caseDef.extShaderSubGroupBallotTests && !context.requireDeviceFunctionality("VK_EXT_shader_subgroup_ballot"))
{
TCU_THROW(NotSupportedError, "Device does not support VK_EXT_shader_subgroup_ballot extension");
}
if (!subgroups::isSubgroupSupported(context))
TCU_THROW(NotSupportedError, "Subgroup operations are not supported");
- if (!context.requireDeviceExtension("VK_EXT_shader_subgroup_ballot"))
+ if (!context.requireDeviceFunctionality("VK_EXT_shader_subgroup_ballot"))
{
TCU_THROW(NotSupportedError, "Device does not support VK_EXT_shader_subgroup_ballot extension");
}
TCU_THROW(NotSupportedError, "Device does not support subgroup ballot operations");
}
- if (caseDef.extShaderSubGroupBallotTests && !context.requireDeviceExtension("VK_EXT_shader_subgroup_ballot"))
+ if (caseDef.extShaderSubGroupBallotTests && !context.requireDeviceFunctionality("VK_EXT_shader_subgroup_ballot"))
{
TCU_THROW(NotSupportedError, "Device does not support VK_EXT_shader_subgroup_ballot extension");
}
features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
features2.pNext = DE_NULL;
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_shader_subgroup_extended_types") &&
- isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_shader_float16_int8"))
+ if (context.isDeviceFunctionalitySupported("VK_KHR_shader_subgroup_extended_types") &&
+ context.isDeviceFunctionalitySupported("VK_KHR_shader_float16_int8"))
{
features2.pNext = &subgroupExtendedTypesFeatures;
subgroupExtendedTypesFeatures.pNext = &float16Int8Features;
if (caseDef.opType > OPTYPE_LAST_NON_ARB)
{
- context.requireDeviceExtension("VK_EXT_shader_subgroup_vote");
+ context.requireDeviceFunctionality("VK_EXT_shader_subgroup_vote");
}
*caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
if (caseDef.opType > OPTYPE_LAST_NON_ARB)
{
- context.requireDeviceExtension("VK_EXT_shader_subgroup_vote");
+ context.requireDeviceFunctionality("VK_EXT_shader_subgroup_vote");
}
subgroups::SSBOData inputData;
std::vector<deUint32> queueFamilyIndices (queueFamilyProperties.size(), 0xFFFFFFFFu);
std::vector<const char*> extensions;
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_dedicated_allocation"))
+ if (context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"))
extensions.push_back("VK_KHR_dedicated_allocation");
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_get_memory_requirements2"))
+ if (context.isDeviceFunctionalitySupported("VK_KHR_get_memory_requirements2"))
extensions.push_back("VK_KHR_get_memory_requirements2");
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_external_semaphore"))
+ if (context.isDeviceFunctionalitySupported("VK_KHR_external_semaphore"))
extensions.push_back("VK_KHR_external_semaphore");
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_external_memory"))
+ if (context.isDeviceFunctionalitySupported("VK_KHR_external_memory"))
extensions.push_back("VK_KHR_external_memory");
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_external_semaphore_fd"))
+ if (context.isDeviceFunctionalitySupported("VK_KHR_external_semaphore_fd"))
extensions.push_back("VK_KHR_external_semaphore_fd");
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_external_memory_fd"))
+ if (context.isDeviceFunctionalitySupported("VK_KHR_external_memory_fd"))
extensions.push_back("VK_KHR_external_memory_fd");
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_external_semaphore_win32"))
+ if (context.isDeviceFunctionalitySupported("VK_KHR_external_semaphore_win32"))
extensions.push_back("VK_KHR_external_semaphore_win32");
- if (isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_external_memory_win32"))
+ if (context.isDeviceFunctionalitySupported("VK_KHR_external_memory_win32"))
extensions.push_back("VK_KHR_external_memory_win32");
if (timelineSemaphores)
, m_supportWriteOp (makeOperationSupport(config.writeOp, config.resource))
, m_supportReadOp (makeOperationSupport(config.readOp, config.resource))
, m_notSupportedChecker (context, m_config, *m_supportWriteOp, *m_supportReadOp)
- , m_getMemReq2Supported (vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_get_memory_requirements2"))
+ , m_getMemReq2Supported (context.isDeviceFunctionalitySupported("VK_KHR_get_memory_requirements2"))
, m_instanceAndDeviceA (context, config)
, m_instanceA (m_instanceAndDeviceA.getInstance())
const vk::Unique<vk::VkCommandBuffer> commandBufferA (createCommandBuffer(m_vkdA, *m_deviceA, *commandPoolA));
vk::SimpleAllocator allocatorA (m_vkdA, *m_deviceA, vk::getPhysicalDeviceMemoryProperties(m_vkiA, m_physicalDeviceA));
const std::vector<std::string> deviceExtensionsA;
- OperationContext operationContextA (m_context.getUsedApiVersion(), m_vkiA, m_vkdA, m_physicalDeviceA, *m_deviceA, allocatorA, deviceExtensionsA, m_context.getBinaryCollection(), m_pipelineCacheData);
+ OperationContext operationContextA (m_context, m_vkiA, m_vkdA, m_physicalDeviceA, *m_deviceA, allocatorA, deviceExtensionsA, m_context.getBinaryCollection(), m_pipelineCacheData);
if (!checkQueueFlags(m_queueFamiliesA[m_queueANdx].queueFlags , m_supportWriteOp->getQueueFlags(operationContextA)))
TCU_THROW(NotSupportedError, "Operation not supported by the source queue");
const vk::Unique<vk::VkCommandBuffer> commandBufferB (createCommandBuffer(m_vkdB, *m_deviceB, *commandPoolB));
vk::SimpleAllocator allocatorB (m_vkdB, *m_deviceB, vk::getPhysicalDeviceMemoryProperties(m_vkiB, m_physicalDeviceB));
const std::vector<std::string> deviceExtensionsB;
- OperationContext operationContextB (m_context.getUsedApiVersion(), m_vkiB, m_vkdB, m_physicalDeviceB, *m_deviceB, allocatorB, deviceExtensionsB, m_context.getBinaryCollection(), m_pipelineCacheData);
+ OperationContext operationContextB (m_context, m_vkiB, m_vkdB, m_physicalDeviceB, *m_deviceB, allocatorB, deviceExtensionsB, m_context.getBinaryCollection(), m_pipelineCacheData);
if (!checkQueueFlags(m_queueFamiliesB[m_queueBNdx].queueFlags , m_supportReadOp->getQueueFlags(operationContextB)))
TCU_THROW(NotSupportedError, "Operation not supported by the destination queue");
VkQueueFlags getQueueFlags (const OperationContext& context) const
{
- if (m_bufferOp == BUFFER_OP_FILL &&
- !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance1"))
+ if (m_bufferOp == BUFFER_OP_FILL && !context.isDeviceFunctionalitySupported("VK_KHR_maintenance1"))
{
return VK_QUEUE_COMPUTE_BIT | VK_QUEUE_GRAPHICS_BIT;
}
} // anonymous ns
OperationContext::OperationContext (Context& context, PipelineCacheData& pipelineCacheData)
- : m_vki (context.getInstanceInterface())
+ : m_context (context)
+ , m_vki (context.getInstanceInterface())
, m_vk (context.getDeviceInterface())
, m_physicalDevice (context.getPhysicalDevice())
, m_device (context.getDevice())
}
OperationContext::OperationContext (Context& context, PipelineCacheData& pipelineCacheData, const DeviceInterface& vk, const VkDevice device, vk::Allocator& allocator)
- : m_vki (context.getInstanceInterface())
+ : m_context (context)
+ , m_vki (context.getInstanceInterface())
, m_vk (vk)
, m_physicalDevice (context.getPhysicalDevice())
, m_device (device)
{
}
-OperationContext::OperationContext (const deUint32 apiVersion,
+OperationContext::OperationContext (Context& context,
const vk::InstanceInterface& vki,
const vk::DeviceInterface& vkd,
vk::VkPhysicalDevice physicalDevice,
const std::vector<std::string>& deviceExtensions,
vk::BinaryCollection& programCollection,
PipelineCacheData& pipelineCacheData)
- : m_vki (vki)
+ : m_context (context)
+ , m_vki (vki)
, m_vk (vkd)
, m_physicalDevice (physicalDevice)
, m_device (device)
, m_progCollection (programCollection)
, m_pipelineCacheData (pipelineCacheData)
, m_deviceExtensions (deviceExtensions)
- , m_usedApiVersion (apiVersion)
+ , m_usedApiVersion (context.getUsedApiVersion())
{
}
const vk::VkDevice device,
vk::Allocator& allocator);
- OperationContext (const deUint32 apiVersion,
+ OperationContext (Context& context,
const vk::InstanceInterface& vki,
const vk::DeviceInterface& vkd,
vk::VkPhysicalDevice physicalDevice,
const std::vector<std::string>& getDeviceExtensions (void) const { return m_deviceExtensions;}
deUint32 getUsedApiVersion (void) const { return m_usedApiVersion; }
+ bool isDeviceFunctionalitySupported(const std::string& extension) const
+ {
+ return m_context.isDeviceFunctionalitySupported(extension);
+ }
private:
+ const vkt::Context& m_context;
const vk::InstanceInterface& m_vki;
const vk::DeviceInterface& m_vk;
const vk::VkPhysicalDevice m_physicalDevice;
const vk::Unique<vk::VkCommandBuffer> commandBufferRead (allocateCommandBuffer(m_vkd, *m_device, *commandPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
vk::SimpleAllocator allocator (m_vkd, *m_device, vk::getPhysicalDeviceMemoryProperties(m_vki, m_physicalDevice));
const std::vector<std::string> deviceExtensions;
- OperationContext operationContext (m_context.getUsedApiVersion(), m_vki, m_vkd, m_physicalDevice, *m_device, allocator, deviceExtensions, m_context.getBinaryCollection(), m_pipelineCacheData);
+ OperationContext operationContext (m_context, m_vki, m_vkd, m_physicalDevice, *m_device, allocator, deviceExtensions, m_context.getBinaryCollection(), m_pipelineCacheData);
if (!checkQueueFlags(m_queueFamilies[m_queueNdx].queueFlags, vk::VK_QUEUE_GRAPHICS_BIT))
TCU_THROW(NotSupportedError, "Operation not supported by the source queue");
void WindingTestInstance::requireExtension (const char* name) const
{
- if(!isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), name))
+ if(!m_context.isDeviceFunctionalitySupported(name))
TCU_THROW(NotSupportedError, (std::string(name) + " is not supported").c_str());
}
TransformFeedbackTestInstance::TransformFeedbackTestInstance (Context& context, const TestParameters& parameters)
: TestInstance (context)
- , m_extensions (context.requireDeviceExtension("VK_EXT_transform_feedback"))
+ , m_extensions (context.requireDeviceFunctionality("VK_EXT_transform_feedback"))
, m_imageExtent2D (makeExtent2D(IMAGE_SIZE, IMAGE_SIZE))
, m_parameters (parameters)
, m_rnd (0)
if (m_parameters.testType == TEST_TYPE_QUERY_RESET)
{
// Check VK_EXT_host_query_reset is supported
- m_context.requireDeviceExtension("VK_EXT_host_query_reset");
+ m_context.requireDeviceFunctionality("VK_EXT_host_query_reset");
if(m_context.getHostQueryResetFeatures().hostQueryReset == VK_FALSE)
throw tcu::NotSupportedError(std::string("Implementation doesn't support resetting queries from the host").c_str());
}
for (const auto& ext : extensions)
{
- if (!vk::isInstanceExtensionSupported(apiVersion, availableExtensions, vk::RequiredExtension(ext)))
+ if (!context.isInstanceFunctionalitySupported(ext))
TCU_THROW(NotSupportedError, ext + " is not supported");
if (!vk::isCoreInstanceExtension(apiVersion, ext))
const vk::VkPhysicalDeviceFeatures& Context::getDeviceFeatures (void) const { return m_device->getDeviceFeatures(); }
const vk::VkPhysicalDeviceFeatures2& Context::getDeviceFeatures2 (void) const { return m_device->getDeviceFeatures2(); }
+bool Context::isDeviceFunctionalitySupported (const std::string& extension) const
+{
+ // check if extension was promoted to core
+ if (isCoreDeviceExtension(getUsedApiVersion(), extension))
+ return true;
+
+ // check if extension is on the lits of extensions for current device
+ const auto& extensions = getDeviceExtensions();
+ return de::contains(extensions.begin(), extensions.end(), extension);
+}
+
+bool Context::isInstanceFunctionalitySupported(const std::string& extension) const
+{
+ // NOTE: current implementation uses isInstanceExtensionSupported but
+ // this will change when some instance extensions will be promoted to the
+ // core; don't use isInstanceExtensionSupported directly, use this method instead
+ return isInstanceExtensionSupported(getUsedApiVersion(), getInstanceExtensions(), extension);
+}
+
#include "vkDeviceFeaturesForContextDefs.inl"
const vk::VkPhysicalDeviceProperties& Context::getDeviceProperties (void) const { return m_device->getDeviceProperties(); }
bool Context::contextSupports (const deUint32 requiredApiVersionBits) const
{ return m_device->getUsedApiVersion() >= requiredApiVersionBits; }
-bool Context::requireDeviceExtension (const std::string& required)
+bool Context::requireDeviceFunctionality (const std::string& required)
{
- if (!isDeviceExtensionSupported(getUsedApiVersion(), getDeviceExtensions(), required))
+ if (!isDeviceFunctionalitySupported(required))
TCU_THROW(NotSupportedError, required + " is not supported");
return true;
}
-bool Context::requireInstanceExtension (const std::string& required)
+bool Context::requireInstanceFunctionality (const std::string& required)
{
- if (!isInstanceExtensionSupported(getUsedApiVersion(), getInstanceExtensions(), required))
+ if (!isInstanceFunctionalitySupported(required))
TCU_THROW(NotSupportedError, required + " is not supported");
return true;
const vk::VkPhysicalDeviceFeatures& getDeviceFeatures (void) const;
const vk::VkPhysicalDeviceFeatures2& getDeviceFeatures2 (void) const;
+ bool isInstanceFunctionalitySupported (const std::string& extension) const;
+ bool isDeviceFunctionalitySupported (const std::string& extension) const;
+
#include "vkDeviceFeaturesForContextDecl.inl"
const vk::VkPhysicalDeviceProperties& getDeviceProperties (void) const;
bool contextSupports (const deUint32 majorNum, const deUint32 minorNum, const deUint32 patchNum) const;
bool contextSupports (const vk::ApiVersion version) const;
bool contextSupports (const deUint32 requiredApiVersionBits) const;
- bool requireDeviceExtension (const std::string& required);
- bool requireInstanceExtension (const std::string& required);
+ bool requireDeviceFunctionality (const std::string& required);
+ bool requireInstanceFunctionality (const std::string& required);
bool requireDeviceCoreFeature (const DeviceCoreFeature requiredDeviceCoreFeature);
void* getInstanceProcAddr ();
return true;
if (spirvVersion <= vk::SPIRV_VERSION_1_4)
- return vk::isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_KHR_spirv_1_4");
+ return m_context.isDeviceFunctionalitySupported("VK_KHR_spirv_1_4");
return false;
}
typedef vector<VkExtensionProperties> Extensions;
CustomInstance createInstanceWithWsi (Context& context,
- const Extensions& supportedExtensions,
Type wsiType,
const vector<string> extraExtensions,
const VkAllocationCallbacks* pAllocator = DE_NULL)
extensionName != extensions.end();
++extensionName)
{
- if (!isInstanceExtensionSupported(version, supportedExtensions, RequiredExtension(*extensionName)))
+ if (!context.isInstanceFunctionalitySupported(*extensionName))
TCU_THROW(NotSupportedError, (*extensionName + " is not supported").c_str());
if (!isCoreInstanceExtension(version, *extensionName))
: supportedExtensions (enumerateInstanceExtensionProperties(context.getPlatformInterface(),
DE_NULL))
, instance (createInstanceWithWsi(context,
- supportedExtensions,
wsiType,
vector<string>(),
pAllocator))
: supportedExtensions (enumerateInstanceExtensionProperties(context.getPlatformInterface(),
DE_NULL))
, instance (createInstanceWithWsi(context,
- supportedExtensions,
wsiType,
extensions,
pAllocator))
DE_UNREF(deviceMask); // needed for compatibility with acquireNextImage2KHR
}
- bool featureAvailable(const deUint32 deviceVersion, const Extensions& supportedExtensions)
+ bool featureAvailable(Context&)
{
- DE_UNREF(deviceVersion);
- DE_UNREF(supportedExtensions);
return true; // needed for compatibility with acquireNextImage2KHR
}
m_info.deviceMask = deviceMask;
}
- bool featureAvailable(const deUint32 deviceVersion, const Extensions& supportedExtensions)
+ bool featureAvailable(Context& context)
{
- return isDeviceExtensionSupported(deviceVersion, supportedExtensions, RequiredExtension("VK_KHR_device_group"));
+ return context.isDeviceFunctionalitySupported("VK_KHR_device_group");
}
VkResult call(VkSemaphore semaphore, VkFence fence, deUint32* imageIndex)
const vector<VkImage> swapchainImages = getSwapchainImages(vkd, device, *swapchain);
AcquireWrapperType acquireImageWrapper(vkd, device, 1u, *swapchain, std::numeric_limits<deUint64>::max());
- if (!acquireImageWrapper.featureAvailable(context.getUsedApiVersion(), instHelper.supportedExtensions))
+ if (!acquireImageWrapper.featureAvailable(context))
TCU_THROW(NotSupportedError, "Required extension is not supported");
const TriangleRenderer renderer (vkd,
void checkSupport (Context& context, const TestConfig config)
{
#if !defined(FAKE_COLOR_CONVERSION)
- if (!vk::isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_sampler_ycbcr_conversion"))
+ if (!context.isDeviceFunctionalitySupported("VK_KHR_sampler_ycbcr_conversion"))
TCU_THROW(NotSupportedError, "Extension VK_KHR_sampler_ycbcr_conversion not supported");
try
if (params.useArrayLayers)
{
- if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_ycbcr_image_arrays"))
+ if (!context.isDeviceFunctionalitySupported("VK_EXT_ycbcr_image_arrays"))
TCU_THROW(NotSupportedError, "VK_EXT_ycbcr_image_arrays is not supported");
VkImageFormatProperties properties = getPhysicalDeviceImageFormatProperties(context.getInstanceInterface(), context.getPhysicalDevice(),
reqExts.push_back("VK_KHR_get_memory_requirements2");
}
- for (vector<string>::const_iterator extIter = reqExts.begin(); extIter != reqExts.end(); ++extIter)
+ for (const string& ext : reqExts)
{
- if (!isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), *extIter))
- TCU_THROW(NotSupportedError, (*extIter + " is not supported").c_str());
+ if (!context.isDeviceFunctionalitySupported(ext))
+ TCU_THROW(NotSupportedError, (ext + " is not supported").c_str());
}
if (features.samplerYcbcrConversion == VK_FALSE)
dictStructs[m[0]].append(allRequirements[0])
stream.extend(['bool checkMandatoryFeatures(const vkt::Context& context)\n{',
- '\tif ( !vk::isInstanceExtensionSupported(context.getUsedApiVersion(), context.getInstanceExtensions(), "VK_KHR_get_physical_device_properties2") )',
+ '\tif ( !context.isInstanceFunctionalitySupported("VK_KHR_get_physical_device_properties2") )',
'\t\tTCU_THROW(NotSupportedError, "Extension VK_KHR_get_physical_device_properties2 is not present");',
'',
'\tVkPhysicalDevice\t\t\t\t\tphysicalDevice\t\t= context.getPhysicalDevice();',