aboutsummaryrefslogtreecommitdiff
path: root/source/validate.h
diff options
context:
space:
mode:
authorEhsan Nasiri <ehsann@google.com>2017-01-11 15:03:53 -0500
committerDavid Neto <dneto@google.com>2017-01-13 16:07:03 -0500
commit68e36ec7e9da5300b5d183be543162928aee5776 (patch)
tree959af2d9eeca4178c9877aacc61590530234bf79 /source/validate.h
parentd5e4f06eecfd36059117142bbb1d73ba3ac517c1 (diff)
downloadspirv-tools-68e36ec7e9da5300b5d183be543162928aee5776.tar.gz
Introducing a new flow for running the Validator.
We are adding a new API which can be called to run the SPIR-V validator, and retrieve the ValidationState_t object. This is very useful for unit testing. I have also added basic unit tests that demonstrate usage of this flow and ease of use to verify correctness.
Diffstat (limited to 'source/validate.h')
-rw-r--r--source/validate.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/validate.h b/source/validate.h
index 258b0ebb..3237e6cc 100644
--- a/source/validate.h
+++ b/source/validate.h
@@ -190,4 +190,15 @@ spv_result_t spvValidateIDs(const spv_instruction_t* pInstructions,
spv_position position,
const spvtools::MessageConsumer& consumer);
+namespace spvtools {
+// Performs validation for the SPIRV-V module binary.
+// The main difference between this API and spvValidateBinary is that the
+// "Validation State" is not destroyed upon function return; it lives on and is
+// pointed to by the vstate unique_ptr.
+spv_result_t ValidateBinaryAndKeepValidationState(
+ const spv_const_context context, const uint32_t* words,
+ const size_t num_words, spv_diagnostic* pDiagnostic,
+ std::unique_ptr<libspirv::ValidationState_t>* vstate);
+} // namespace spvtools
+
#endif // LIBSPIRV_VALIDATE_H_