Roll external/abseil_cpp/ 8f739d18b..917bfee46 (2 commits) (#5887)
[KhronosGroup/SPIRV-Tools.git] / source / fuzz / force_render_red.h
blob5b8eab1b6396d0fab11a05215cd7204ee60b1a7a
1 // Copyright (c) 2019 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 #ifndef SOURCE_FORCE_RENDER_RED_H_
16 #define SOURCE_FORCE_RENDER_RED_H_
18 #include <vector>
20 #include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
21 #include "spirv-tools/libspirv.hpp"
23 namespace spvtools {
24 namespace fuzz {
26 // Requires |binary_in| to be a valid SPIR-V module with Shader capability,
27 // containing an entry point with the Fragment execution model, and a single
28 // output variable of type vec4.
30 // Turns the body of this entry point into effectively:
32 // output_variable = vec4(1.0, 0.0, 0.0, 1.0);
33 // if (false) {
34 // original_body
35 // }
37 // If suitable facts about values of uniforms are available, the 'false' will
38 // instead become: 'u > v', where 'u' and 'v' are pieces of uniform data for
39 // which it is known that 'u < v' holds.
40 bool ForceRenderRed(
41 const spv_target_env& target_env, spv_validator_options validator_options,
42 const std::vector<uint32_t>& binary_in,
43 const spvtools::fuzz::protobufs::FactSequence& initial_facts,
44 const MessageConsumer& message_consumer, std::vector<uint32_t>* binary_out);
46 } // namespace fuzz
47 } // namespace spvtools
49 #endif // SOURCE_FORCE_RENDER_RED_H_