Volatile atomic tests were not checking vulkan memory model support.
Components: Vulkan
VK-GL-CTS issue: 2125
Affected tests:
dEQP-VK.spirv_assembly.*atomic*
Change-Id: I67557361e2df9fc057ab38a1104f66512a532cf0
TCU_THROW(NotSupportedError, "Requested 16bit float or 8bit int feature not supported");
}
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");
// FloatControls features
if (!isFloatControlsFeaturesSupported(m_context, m_shaderSpec.requestedVulkanFeatures.floatControlsProperties))
TCU_THROW(NotSupportedError, "Requested Float Controls features not supported");
if (volatileAtomic)
{
spec.extensions.push_back("VK_KHR_vulkan_memory_model");
if (volatileAtomic)
{
spec.extensions.push_back("VK_KHR_vulkan_memory_model");
+ spec.requestedVulkanFeatures.extVulkanMemoryModel = EXTVULKANMEMORYMODELFEATURES_ENABLE;
+
// volatile, queuefamily scope
specializations["SEMANTICS"] = "%volbit";
specializations["SCOPE"] = "%five";
// volatile, queuefamily scope
specializations["SEMANTICS"] = "%volbit";
specializations["SCOPE"] = "%five";
+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
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;
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;
struct VulkanFeatures
{
vk::VkPhysicalDeviceFeatures coreFeatures;
Extension8BitStorageFeatures ext8BitStorage;
Extension16BitStorageFeatures ext16BitStorage;
ExtensionVariablePointersFeatures extVariablePointers;
Extension8BitStorageFeatures ext8BitStorage;
Extension16BitStorageFeatures ext16BitStorage;
ExtensionVariablePointersFeatures extVariablePointers;
+ ExtensionVulkanMemoryModelFeatures extVulkanMemoryModel;
ExtensionFloatControlsFeatures floatControlsProperties;
ExtensionFloatControlsFeatures floatControlsProperties;
VulkanFeatures (void)
: extFloat16Int8 (0)
, ext8BitStorage (0)
, ext16BitStorage (0)
, extVariablePointers (0)
VulkanFeatures (void)
: extFloat16Int8 (0)
, ext8BitStorage (0)
, ext16BitStorage (0)
, extVariablePointers (0)
+ , extVulkanMemoryModel (0)
{
deMemset(&coreFeatures, 0, sizeof(coreFeatures));
deMemset(&floatControlsProperties, 0, sizeof(ExtensionFloatControlsFeatures));
{
deMemset(&coreFeatures, 0, sizeof(coreFeatures));
deMemset(&floatControlsProperties, 0, sizeof(ExtensionFloatControlsFeatures));
bool isFloat16Int8FeaturesSupported (const Context& context,
ExtensionFloat16Int8Features toCheck);
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);
// Returns true if the given float controls features in `toCheck` are all supported.
bool isFloatControlsFeaturesSupported (const Context& context,
const ExtensionFloatControlsFeatures& toCheck);