1 // Copyright (c) 2019 Google LLC
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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_FUZZ_DATA_DESCRIPTOR_H_
16 #define SOURCE_FUZZ_DATA_DESCRIPTOR_H_
21 #include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
26 // Factory method to create a data descriptor message from an object id and a
28 protobufs::DataDescriptor
MakeDataDescriptor(
29 uint32_t object
, const std::vector
<uint32_t>& indices
);
31 // Hash function for data descriptors.
32 struct DataDescriptorHash
{
33 size_t operator()(const protobufs::DataDescriptor
* data_descriptor
) const;
36 // Equality function for data descriptors.
37 struct DataDescriptorEquals
{
38 bool operator()(const protobufs::DataDescriptor
* first
,
39 const protobufs::DataDescriptor
* second
) const;
42 std::ostream
& operator<<(std::ostream
& out
,
43 const protobufs::DataDescriptor
& data_descriptor
);
46 } // namespace spvtools
48 #endif // SOURCE_FUZZ_DATA_DESCRIPTOR_H_