layers: Added check and test for scalar block layout
Added code to use scalar block layout validation in spirv-val when
VK_EXT_scalar_block_layout is enabled.
Added positive test for this, mirroring the relaxed block layout
extension test.
diff --git a/layers/shader_validation.cpp b/layers/shader_validation.cpp
index b6e78dc..ef6cbe1 100644
--- a/layers/shader_validation.cpp
+++ b/layers/shader_validation.cpp
@@ -1434,6 +1434,8 @@
: IsEnabled([=](const DeviceFeatures &features) { return features.transform_feedback_features.*ptr; }) {}
FeaturePointer(VkBool32 VkPhysicalDeviceFloat16Int8FeaturesKHR::*ptr)
: IsEnabled([=](const DeviceFeatures &features) { return features.float16_int8.*ptr; }) {}
+ FeaturePointer(VkBool32 VkPhysicalDeviceScalarBlockLayoutFeaturesEXT::*ptr)
+ : IsEnabled([=](const DeviceFeatures &features) { return features.scalar_block_layout_features.*ptr; }) {}
};
struct CapabilityInfo {
@@ -2295,6 +2297,10 @@
if (GetDeviceExtensions(dev_data)->vk_khr_relaxed_block_layout) {
spvValidatorOptionsSetRelaxBlockLayout(options, true);
}
+ if (GetDeviceExtensions(dev_data)->vk_ext_scalar_block_layout &&
+ GetEnabledFeatures(dev_data)->scalar_block_layout_features.scalarBlockLayout == VK_TRUE) {
+ spvValidatorOptionsSetScalarBlockLayout(options, true);
+ }
spv_valid = spvValidateWithOptions(ctx, options, &binary, &diag);
if (spv_valid != SPV_SUCCESS) {
if (!have_glsl_shader || (pCreateInfo->pCode[0] == spv::MagicNumber)) {