• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_VULKAN_COMPUTE_PIPELINE_H_
16 #define SRC_VULKAN_COMPUTE_PIPELINE_H_
17 
18 #include <vector>
19 
20 #include "amber/result.h"
21 #include "amber/vulkan_header.h"
22 #include "src/vulkan/pipeline.h"
23 
24 namespace amber {
25 namespace vulkan {
26 
27 /// Pipepline to handle compute commands.
28 class ComputePipeline : public Pipeline {
29  public:
30   ComputePipeline(
31       Device* device,
32       uint32_t fence_timeout_ms,
33       const std::vector<VkPipelineShaderStageCreateInfo>& shader_stage_info);
34   ~ComputePipeline() override;
35 
36   Result Initialize(CommandPool* pool);
37 
38   Result Compute(uint32_t x, uint32_t y, uint32_t z);
39 
40  private:
41   Result CreateVkComputePipeline(const VkPipelineLayout& pipeline_layout,
42                                  VkPipeline* pipeline);
43 };
44 
45 }  // namespace vulkan
46 }  // namespace amber
47 
48 #endif  // SRC_VULKAN_COMPUTE_PIPELINE_H_
49