Closed M2-TE closed 2 months ago
so as background, this logic is all done in SPIRV-Tools
(via spirv-val
) and the validations layers call
if (enabled_features.scalarBlockLayout == VK_TRUE) {
// --scalar-block-layout
options.SetScalarBlockLayout(true);
}
so the --scalar-block-layout
is passed into spirv-val
depending if scalarBlockLayout
feature was enabled or not
So if I take this glsl example and run spirv-val --target-env vulkan1.0 out.spv
I get the same error
but if I run with
spirv-val --target-env vulkan1.0 out.spv --scalar-block-layout
I don't get the error anymore
awwww, I think I know the issue now, I was able to reproduce this behaviour because of we do shader caching, so if you go
export VK_LAYER_DISABLES=VK_VALIDATION_FEATURE_DISABLE_SHADER_VALIDATION_CACHE_EXT
it will work as expected... so we need to hashing depending on the settings such as scalarBlockLayout
Environment:
Describe the Issue
Enabling GL_EXT_scalar_block_layout without enabling VK_EXT_scalar_block_layout feature in vulkan 1.2 does not consistently warn about the latter when using scalar layout for a struct in combination with GL_EXT_buffer_reference and using members with non-power-of-two alignment (mat3x3, vec3). VK_KHR_dynamic_rendering is used to construct the graphics pipeline.
Expected behavior
Upon construction of a graphics pipeline using VK_KHR_dynamic_rendering and shaders containing buffer references with scalar layout structs without power-of-two alignment in members (not total struct size), validation layers should consistently report the lack of VK_EXT_scalar_block_layout should it not be enabled for the current device.
Valid Usage ID No other validation errors
Additional context Device buffer reference used to (sometimes) trigger the validation error upon pipeline construction when VK_EXT_scalar_block_layout feature/extension is not enabled:
Shader compiled using:
Validation Error that would sometimes appear: