1 // Copyright 2018 The Amber Authors. 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. 14 15 #ifndef SRC_VERIFIER_H_ 16 #define SRC_VERIFIER_H_ 17 18 #include <vector> 19 20 #include "amber/result.h" 21 #include "src/command.h" 22 #include "src/format.h" 23 24 namespace amber { 25 26 /// The verifier is used to validate if a probe command is successful or not. 27 class Verifier { 28 public: 29 /// Create a verifier. 30 Verifier(); 31 ~Verifier(); 32 33 /// Check |command| against |buf|. The result will be success if the probe 34 /// passes correctly. 35 Result Probe(const ProbeCommand* command, 36 const Format* texel_format, 37 uint32_t texel_stride, 38 uint32_t row_stride, 39 uint32_t frame_width, 40 uint32_t frame_height, 41 const void* buf); 42 43 /// Check |command| against |cpu_memory|. The result will be success if the 44 /// probe passes correctly. 45 Result ProbeSSBO(const ProbeSSBOCommand* command, 46 uint32_t buffer_element_count, 47 const void* buffer); 48 }; 49 50 } // namespace amber 51 52 #endif // SRC_VERIFIER_H_ 53