Skip to content

Commit a380bb1

Browse files
Merge pull request #906 from Devsh-Graphics-Programming/fix_spv_opt_to_skip_validation
Skip validation for spirv optimizer
2 parents c7bea5a + f2fc2fb commit a380bb1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/nbl/asset/utils/ISPIRVOptimizer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ nbl::core::smart_refctd_ptr<ICPUBuffer> ISPIRVOptimizer::optimize(const uint32_t
9797
opt.SetMessageConsumer(msgConsumer);
9898

9999
std::vector<uint32_t> optimized;
100-
opt.Run(_spirv, _dwordCount, &optimized);
100+
spvtools::ValidatorOptions validatorOptions;
101+
// Nabla use Scalar block layout, we skip this validation to work around this and to save time. No need to set it since we skip validation. We set it here just in case we change our mind in the future
102+
validatorOptions.SetSkipBlockLayout(true);
103+
opt.Run(_spirv, _dwordCount, &optimized, validatorOptions, true);
101104

102105
const uint32_t resultBytesize = optimized.size() * sizeof(uint32_t);
103106
if (!resultBytesize)

0 commit comments

Comments
 (0)