VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT = 1000244000,
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT = 1000244001,
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT = 1000244002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR = 1000253000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV = 1000249000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV = 1000249002,
VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV = 1000249001,
#define VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION 2
#define VK_NV_COOPERATIVE_MATRIX_SPEC_VERSION 1
#define VK_EXT_HOST_QUERY_RESET_SPEC_VERSION 1
+#define VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_SPEC_VERSION 1
return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT;
}
+template<> VkStructureType getStructureType<VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR;
+}
+
{
FLAG_USE_STORAGE_BUFFER_STORAGE_CLASS = (1u<<0),
FLAG_ALLOW_RELAXED_OFFSETS = (1u<<1), // allow block offsets to follow VK_KHR_relaxed_block_layout
- FLAG_ALLOW_SCALAR_OFFSETS = (1u<<2) // allow block offsets to follow VK_EXT_scalar_block_layout
+ FLAG_ALLOW_SCALAR_OFFSETS = (1u<<2), // allow block offsets to follow VK_EXT_scalar_block_layout
+ FLAG_ALLOW_STD430_UBOS = (1u<<3) // allow block offsets to follow VK_EXT_uniform_buffer_standard_layout
};
deUint32 vulkanVersion;
{
rules = SpirvValidatorOptions::kScalarBlockLayout;
}
+ else if (flags & FLAG_ALLOW_STD430_UBOS)
+ {
+ rules = SpirvValidatorOptions::kUniformStandardLayout;
+ }
else if (flags & FLAG_ALLOW_RELAXED_OFFSETS)
{
rules = SpirvValidatorOptions::kRelaxedBlockLayout;
case SpirvValidatorOptions::kRelaxedBlockLayout:
spvValidatorOptionsSetRelaxBlockLayout(options, true);
break;
+ case SpirvValidatorOptions::kUniformStandardLayout:
+ spvValidatorOptionsSetUniformBufferStandardLayout(options, true);
+ break;
case SpirvValidatorOptions::kScalarBlockLayout:
spvValidatorOptionsSetScalarBlockLayout(options, true);
break;
std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceCooperativeMatrixPropertiesNV& value);
std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceCooperativeMatrixFeaturesNV& value);
std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceHostQueryResetFeaturesEXT& value);
+std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR& value);
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT";
case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT: return "VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT";
case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: return "VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR";
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV";
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV";
case VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV: return "VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV";
s << '}';
return s;
}
+
+std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR& value)
+{
+ s << "VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tuniformBufferStandardLayout = " << value.uniformBufferStandardLayout << '\n';
+ s << '}';
+ return s;
+}
VkBool32 hostQueryReset;
};
+struct VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR
+{
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 uniformBufferStandardLayout;
+};
+
kNoneBlockLayout,
// VK_KHR_relaxed_block_layout
kRelaxedBlockLayout,
+ // VK_EXT_uniform_buffer_standard_layout
+ kUniformStandardLayout,
// VK_EXT_scalar_block_layout
kScalarBlockLayout
};
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT = 1000244000,
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT = 1000244001,
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT = 1000244002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR = 1000253000,
VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV = 1000249000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV = 1000249002,
deUint32 queryCount);
#endif
+#define VK_KHR_uniform_buffer_standard_layout 1
+#define VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_SPEC_VERSION 1
+#define VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME "VK_KHR_uniform_buffer_standard_layout"
+
+typedef struct VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 uniformBufferStandardLayout;
+} VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR;
+
+
+
#ifdef __cplusplus
}
#endif
"VK_KHR_shader_atomic_int64",
"VK_KHR_vulkan_memory_model",
"VK_KHR_swapchain_mutable_format",
+ "VK_KHR_uniform_buffer_standard_layout",
};
checkKhrExtensions(results, extensions, DE_LENGTH_OF_ARRAY(s_allowedDeviceKhrExtensions), s_allowedDeviceKhrExtensions);
}
}
-bool uses16BitStorage (const ShaderInterface& interface)
-{
- // If any of blocks has LAYOUT_16BIT_STORAGE flag
- for (int ndx = 0; ndx < interface.getNumUniformBlocks(); ++ndx)
- {
- if (interface.getUniformBlock(ndx).getFlags() & LAYOUT_16BIT_STORAGE)
- return true;
- }
- return false;
-}
-
-bool uses8BitStorage (const ShaderInterface& interface)
-{
- // If any of blocks has LAYOUT_8BIT_STORAGE flag
- for (int ndx = 0; ndx < interface.getNumUniformBlocks(); ++ndx)
- {
- if (interface.getUniformBlock(ndx).getFlags() & LAYOUT_8BIT_STORAGE)
- return true;
- }
- return false;
-}
-
-bool usesScalarOrStd430Layout (const ShaderInterface& interface)
-{
- // If any of blocks has LAYOUT_SCALAR or LAYOUT_STD430 flags
- for (int ndx = 0; ndx < interface.getNumUniformBlocks(); ++ndx)
- {
- if (interface.getUniformBlock(ndx).getFlags() & (LAYOUT_SCALAR | LAYOUT_STD430))
- return true;
- }
- return false;
-}
-
struct Indent
{
int level;
vk::ShaderBuildOptions::Flags flags = vk::ShaderBuildOptions::Flags(0);
// TODO(dneto): If these tests ever use LAYOUT_RELAXED, then add support
// here as well.
- if (usesBlockLayout(UniformFlags(LAYOUT_SCALAR | LAYOUT_STD430)))
- {
+ if (usesBlockLayout(LAYOUT_SCALAR))
flags = vk::ShaderBuildOptions::FLAG_ALLOW_SCALAR_OFFSETS;
- }
+ else if (usesBlockLayout(LAYOUT_STD430))
+ flags = vk::ShaderBuildOptions::FLAG_ALLOW_STD430_UBOS;
programCollection.glslSources.add("vert") << glu::VertexSource(m_vertShaderSource)
<< vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::getBaselineSpirvVersion(programCollection.usedVulkanVersion), flags);
TestInstance* UniformBlockCase::createInstance (Context& context) const
{
- if (!context.get16BitStorageFeatures().uniformAndStorageBuffer16BitAccess && uses16BitStorage(m_interface))
+ if (!context.get16BitStorageFeatures().uniformAndStorageBuffer16BitAccess && usesBlockLayout(LAYOUT_16BIT_STORAGE))
TCU_THROW(NotSupportedError, "uniformAndStorageBuffer16BitAccess not supported");
- if (!context.get8BitStorageFeatures().uniformAndStorageBuffer8BitAccess && uses8BitStorage(m_interface))
+ if (!context.get8BitStorageFeatures().uniformAndStorageBuffer8BitAccess && usesBlockLayout(LAYOUT_8BIT_STORAGE))
TCU_THROW(NotSupportedError, "uniformAndStorageBuffer8BitAccess not supported");
- if (!context.getScalarBlockLayoutFeatures().scalarBlockLayout && usesScalarOrStd430Layout(m_interface))
+ if (!context.getScalarBlockLayoutFeatures().scalarBlockLayout && !context.getUniformBufferStandardLayoutFeatures().uniformBufferStandardLayout && usesBlockLayout(LAYOUT_STD430))
+ TCU_THROW(NotSupportedError, "std430 not supported");
+ if (!context.getScalarBlockLayoutFeatures().scalarBlockLayout && usesBlockLayout(LAYOUT_SCALAR))
TCU_THROW(NotSupportedError, "scalarBlockLayout not supported");
return new UniformBlockCaseInstance(context, m_bufferMode, m_uniformLayout, m_blockPointers);
VkPhysicalDeviceBufferAddressFeaturesEXT bufferDeviceAddressFeatures;
VkPhysicalDeviceCooperativeMatrixFeaturesNV cooperativeMatrixFeatures;
VkPhysicalDeviceHostQueryResetFeaturesEXT hostQueryResetFeatures;
+ VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR uniformBufferStandardLayoutFeatures;
DeviceFeatures (const InstanceInterface& vki,
const deUint32 apiVersion,
deMemset(&bufferDeviceAddressFeatures, 0, sizeof(bufferDeviceAddressFeatures));
deMemset(&cooperativeMatrixFeatures, 0, sizeof(cooperativeMatrixFeatures));
deMemset(&hostQueryResetFeatures, 0, sizeof(hostQueryResetFeatures));
+ deMemset(&uniformBufferStandardLayoutFeatures, 0, sizeof(uniformBufferStandardLayoutFeatures));
coreFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
samplerYCbCrConversionFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES;
bufferDeviceAddressFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT;
cooperativeMatrixFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV;
hostQueryResetFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT;
+ uniformBufferStandardLayoutFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR;
vector<VkExtensionProperties> deviceExtensionProperties =
enumerateDeviceExtensionProperties(vki, physicalDevice, DE_NULL);
*nextPtr = &hostQueryResetFeatures;
nextPtr = &hostQueryResetFeatures.pNext;
}
+ if (de::contains(deviceExtensions.begin(), deviceExtensions.end(), "VK_KHR_uniform_buffer_standard_layout"))
+ {
+ *nextPtr = &uniformBufferStandardLayoutFeatures;
+ nextPtr = &uniformBufferStandardLayoutFeatures.pNext;
+ }
vki.getPhysicalDeviceFeatures2(physicalDevice, &coreFeatures);
}
const VkPhysicalDeviceShaderAtomicInt64FeaturesKHR& getShaderAtomicInt64Features (void) const { return m_deviceFeatures.shaderAtomicInt64Features; }
const VkPhysicalDeviceConditionalRenderingFeaturesEXT& getConditionalRenderingFeatures (void) const { return m_deviceFeatures.conditionalRenderingFeatures; }
const VkPhysicalDeviceScalarBlockLayoutFeaturesEXT& getScalarBlockLayoutFeatures (void) const { return m_deviceFeatures.scalarBlockLayoutFeatures; }
+ const VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR& getUniformBufferStandardLayoutFeatures (void) const { return m_deviceFeatures.uniformBufferStandardLayoutFeatures; }
const VkPhysicalDeviceFloat16Int8FeaturesKHR& getFloat16Int8Features (void) const { return m_deviceFeatures.float16Int8Features; }
const VkPhysicalDeviceDepthClipEnableFeaturesEXT& getDepthClipEnableFeatures (void) const { return m_deviceFeatures.depthClipEnableFeatures; }
const VkPhysicalDeviceBufferAddressFeaturesEXT& getBufferDeviceAddressFeatures (void) const { return m_deviceFeatures.bufferDeviceAddressFeatures; }
Context::getConditionalRenderingFeatures(void) const { return m_device->getConditionalRenderingFeatures(); }
const vk::VkPhysicalDeviceScalarBlockLayoutFeaturesEXT&
Context::getScalarBlockLayoutFeatures (void) const { return m_device->getScalarBlockLayoutFeatures(); }
+const vk::VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR&
+ Context::getUniformBufferStandardLayoutFeatures (void) const { return m_device->getUniformBufferStandardLayoutFeatures(); }
const vk::VkPhysicalDeviceFloat16Int8FeaturesKHR&
Context::getFloat16Int8Features (void) const { return m_device->getFloat16Int8Features(); }
const vk::VkPhysicalDeviceDepthClipEnableFeaturesEXT&
getConditionalRenderingFeatures (void) const;
const vk::VkPhysicalDeviceScalarBlockLayoutFeaturesEXT&
getScalarBlockLayoutFeatures (void) const;
+ const vk::VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR&
+ getUniformBufferStandardLayoutFeatures(void) const;
const vk::VkPhysicalDeviceFloat16Int8FeaturesKHR&
getFloat16Int8Features (void) const;
const vk::VkPhysicalDeviceDepthClipEnableFeaturesEXT&
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT = 1000244000,
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT = 1000244001,
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT = 1000244002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR = 1000253000,
VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV = 1000249000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV = 1000249002,
uint32_t queryCount);
#endif
+#define VK_KHR_uniform_buffer_standard_layout 1
+#define VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_SPEC_VERSION 1
+#define VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME "VK_KHR_uniform_buffer_standard_layout"
+
+typedef struct VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 uniformBufferStandardLayout;
+} VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR;
+
+
+
#ifdef __cplusplus
}
#endif