TCU_THROW(NotSupportedError, "Requested 16bit float or 8bit int feature not supported");
}
+ // Vulkan Memory Model features
+ {
+ if (!isVulkanMemoryModelFeaturesSupported(m_context, m_shaderSpec.requestedVulkanFeatures.extVulkanMemoryModel))
+ TCU_THROW(NotSupportedError, "Requested Vulkan Memory Model feature not supported");
+ }
+
// FloatControls features
if (!isFloatControlsFeaturesSupported(m_context, m_shaderSpec.requestedVulkanFeatures.floatControlsProperties))
TCU_THROW(NotSupportedError, "Requested Float Controls features not supported");
return true;
}
+bool isVulkanMemoryModelFeaturesSupported (const Context& context, ExtensionVulkanMemoryModelFeatures toCheck)
+{
+ const VkPhysicalDeviceVulkanMemoryModelFeaturesKHR& extensionFeatures = context.getVulkanMemoryModelFeatures();
+
+ if ((toCheck & EXTVULKANMEMORYMODELFEATURES_ENABLE) != 0 && extensionFeatures.vulkanMemoryModel == VK_FALSE)
+ return false;
+
+ if ((toCheck & EXTVULKANMEMORYMODELFEATURES_DEVICESCOPE) != 0 && extensionFeatures.vulkanMemoryModelDeviceScope == VK_FALSE)
+ return false;
+
+ if ((toCheck & EXTVULKANMEMORYMODELFEATURES_AVAILABILITYVISIBILITYCHAINS) != 0 && extensionFeatures.vulkanMemoryModelAvailabilityVisibilityChains == VK_FALSE)
+ return false;
+
+ return true;
+}
+
bool isFloatControlsFeaturesSupported (const Context& context, const ExtensionFloatControlsFeatures& toCheck)
{
// if all flags are set to false then no float control features are actualy requested by the test
typedef deUint32 ExtensionFloat16Int8Features;
typedef vk::VkPhysicalDeviceFloatControlsPropertiesKHR ExtensionFloatControlsFeatures;
+enum ExtensionVulkanMemoryModelFeaturesBits
+{
+ EXTVULKANMEMORYMODELFEATURES_ENABLE = (1u << 1),
+ EXTVULKANMEMORYMODELFEATURES_DEVICESCOPE = (1u << 2),
+ EXTVULKANMEMORYMODELFEATURES_AVAILABILITYVISIBILITYCHAINS = (1u << 3),
+};
+typedef deUint32 ExtensionVulkanMemoryModelFeatures;
+
struct VulkanFeatures
{
vk::VkPhysicalDeviceFeatures coreFeatures;
Extension8BitStorageFeatures ext8BitStorage;
Extension16BitStorageFeatures ext16BitStorage;
ExtensionVariablePointersFeatures extVariablePointers;
+ ExtensionVulkanMemoryModelFeatures extVulkanMemoryModel;
ExtensionFloatControlsFeatures floatControlsProperties;
+
VulkanFeatures (void)
: extFloat16Int8 (0)
, ext8BitStorage (0)
, ext16BitStorage (0)
, extVariablePointers (0)
+ , extVulkanMemoryModel (0)
{
deMemset(&coreFeatures, 0, sizeof(coreFeatures));
deMemset(&floatControlsProperties, 0, sizeof(ExtensionFloatControlsFeatures));
bool isFloat16Int8FeaturesSupported (const Context& context,
ExtensionFloat16Int8Features toCheck);
+// Returns true if the given Vulkan Memory Model extension features in `toCheck` are all supported.
+bool isVulkanMemoryModelFeaturesSupported (const Context& context,
+ ExtensionVulkanMemoryModelFeatures toCheck);
+
// Returns true if the given float controls features in `toCheck` are all supported.
bool isFloatControlsFeaturesSupported (const Context& context,
const ExtensionFloatControlsFeatures& toCheck);