Po-Hsien Wang | 00777b2 | 2019-04-24 16:37:09 -0700 | [diff] [blame] | 1 | // Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef VKBENCH_SUBMITTEST_H |
| 6 | #define VKBENCH_SUBMITTEST_H |
| 7 | |
| 8 | #include "testBase.h" |
| 9 | |
| 10 | namespace vkbench { |
| 11 | class SubmitTest : public testBase { |
| 12 | public: |
| 13 | SubmitTest(uint64_t submitCnt){ |
| 14 | sprintf(name_, "SubmitTest@%lu", submitCnt); |
| 15 | sprintf(desp_, "Times the time used when submitting %lu empty calls.", |
| 16 | submitCnt); |
| 17 | smt_infos_.resize(submitCnt); |
| 18 | } |
| 19 | const char* Name() const override { return name_; } |
| 20 | const char* Desp() const override { return desp_; } |
| 21 | ~SubmitTest() override = default; |
| 22 | const char* Unit() const override { return "us"; } |
| 23 | |
| 24 | protected: |
| 25 | void TestInitialization() override; |
| 26 | bool TestRun() override; |
| 27 | void TestCleanup() override; |
| 28 | void TestDestroy() override; |
| 29 | |
| 30 | private: |
| 31 | char name_[100]; |
| 32 | char desp_[1024]; |
| 33 | std::vector<vk::Fence> fences_; |
| 34 | std::vector<vk::SubmitInfo> smt_infos_; |
| 35 | std::vector<vk::CommandBuffer> cmd_buffers_; |
| 36 | DISALLOW_COPY_AND_ASSIGN(SubmitTest); |
| 37 | }; |
| 38 | } // namespace vkbench |
| 39 | #endif // VKBENCH_SUBMITTEST_H |