Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlastair Donaldson <afdx@google.com>2020-09-25 11:58:10 +0300
committerGitHub <noreply@github.com>2020-09-25 11:58:10 +0300
commit9e17b9d07a2536dc0a717ba0ed7c419659400078 (patch)
tree8a31251b2088b756669add6eaae9c4ca697dab7c /tools
parente12087d6c38a492ab5a0373793fe073920a1f2b5 (diff)
spirv-fuzz: Return IR and transformation context after replay (#3846)
Before this change, the replayer would return a SPIR-V binary. This did not allow further transforming the resulting module: it would need to be re-parsed, and the transformation context arising from the replayed transformations was not available. This change makes it so that after replay an IR context and transformation context are returned instead; the IR context can subsequently be turned into a binary if desired. This change paves the way for an upcoming PR to integrate spirv-reduce with the spirv-fuzz shrinker.
Diffstat (limited to 'tools')
-rw-r--r--tools/fuzz/fuzz.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/fuzz/fuzz.cpp b/tools/fuzz/fuzz.cpp
index 80ac9f514..d19904b42 100644
--- a/tools/fuzz/fuzz.cpp
+++ b/tools/fuzz/fuzz.cpp
@@ -480,8 +480,7 @@ bool Replay(const spv_target_env& target_env,
initial_facts, transformation_sequence, num_transformations_to_apply,
0, fuzzer_options->replay_validation_enabled, validator_options)
.Run();
-
- *binary_out = std::move(replay_result.transformed_binary);
+ replay_result.transformed_module->module()->ToBinary(binary_out, false);
*transformations_applied = std::move(replay_result.applied_transformations);
return replay_result.status ==
spvtools::fuzz::Replayer::ReplayerResultStatus::kComplete;