blob: 9fd2b529fd2a18e946cf11cc6092aa6d8c4f535b [file] [log] [blame]
Po-Hsien Wang00777b22019-04-24 16:37:09 -07001// 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
10namespace vkbench {
11class SubmitTest : public testBase {
12 public:
Po-Hsien Wang42e116c2020-06-09 16:10:27 -070013 SubmitTest(uint64_t submitCnt, vkBase* base) {
14 vk = base;
Po-Hsien Wang00777b22019-04-24 16:37:09 -070015 sprintf(name_, "SubmitTest@%lu", submitCnt);
16 sprintf(desp_, "Times the time used when submitting %lu empty calls.",
17 submitCnt);
18 smt_infos_.resize(submitCnt);
19 }
Po-Hsien Wang42e116c2020-06-09 16:10:27 -070020 ~SubmitTest() override = default;
21
Po-Hsien Wang00777b22019-04-24 16:37:09 -070022 const char* Name() const override { return name_; }
23 const char* Desp() const override { return desp_; }
Po-Hsien Wang00777b22019-04-24 16:37:09 -070024 const char* Unit() const override { return "us"; }
25
26 protected:
Po-Hsien Wang42e116c2020-06-09 16:10:27 -070027 void Initialize() override;
28 void Run() override;
29 void Cleanup() override;
30 void Destroy() override;
Po-Hsien Wang00777b22019-04-24 16:37:09 -070031
32 private:
33 char name_[100];
34 char desp_[1024];
35 std::vector<vk::Fence> fences_;
36 std::vector<vk::SubmitInfo> smt_infos_;
37 std::vector<vk::CommandBuffer> cmd_buffers_;
38 DISALLOW_COPY_AND_ASSIGN(SubmitTest);
39};
40} // namespace vkbench
41#endif // VKBENCH_SUBMITTEST_H