Commit 5add6b5d by Nicolas Capens Committed by Nicolas Capens

Disable SPIR-V validation during pipeline compilation

Validation is costly and it's the applications' responsibility to send valid SPIR-V to the ICD, so we shouldn't do it in Release builds. Note that while in Debug builds we already perform validation during creation of the shader module (to catch issues even sooner), we should validate again during pipeline compilation to ensure we (or the tooling we use) didn't alter the SPIR-V to become invalid. Bug: b/158228522 Change-Id: I5b8153f0397c609d139e37909868b5836d57d40e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51168Reviewed-by: 's avatarSean Risser <srisser@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 6178ad2a
......@@ -75,7 +75,12 @@ std::vector<uint32_t> preprocessSpirv(
}
std::vector<uint32_t> optimized;
opt.Run(code.data(), code.size(), &optimized);
spvtools::OptimizerOptions options;
#if defined(NDEBUG)
options.set_run_validator(false);
#endif
opt.Run(code.data(), code.size(), &optimized, options);
if(false)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment