Consider GL_EXT_scalar_block_layout when validating SPIR-V

If GL_EXT_scalar_block_layout is requested by the shader, set the
option to allow scalar blocks in the SPIR-V validator.

Fix the existing tests using scalar layout to not expect "Validation
failed".

Fixes #2400.
This commit is contained in:
Caio Marcelo de Oliveira Filho
2021-01-27 00:30:59 -08:00
parent f7c43377f0
commit a38df83d3e
4 changed files with 9 additions and 2 deletions

View File

@@ -153,6 +153,7 @@ void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<
spv_validator_options options = spvValidatorOptionsCreate();
spvValidatorOptionsSetRelaxBlockLayout(options, intermediate.usingHlslOffsets());
spvValidatorOptionsSetBeforeHlslLegalization(options, prelegalization);
spvValidatorOptionsSetScalarBlockLayout(options, intermediate.usingScalarBlockLayout());
spvValidateWithOptions(context, options, &binary, &diagnostic);
// report