1 // Copyright 2017 The Dawn 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 DAWNNATIVE_VULKAN_COMMANDBUFFERVK_H_
16 #define DAWNNATIVE_VULKAN_COMMANDBUFFERVK_H_
17 
18 #include "dawn_native/CommandBuffer.h"
19 #include "dawn_native/Error.h"
20 
21 #include "common/vulkan_platform.h"
22 
23 namespace dawn_native {
24     struct BeginRenderPassCmd;
25     struct TextureCopy;
26 }  // namespace dawn_native
27 
28 namespace dawn_native { namespace vulkan {
29 
30     struct CommandRecordingContext;
31     class Device;
32 
33     class CommandBuffer final : public CommandBufferBase {
34       public:
35         static CommandBuffer* Create(CommandEncoder* encoder,
36                                      const CommandBufferDescriptor* descriptor);
37 
38         MaybeError RecordCommands(CommandRecordingContext* recordingContext);
39 
40       private:
41         CommandBuffer(CommandEncoder* encoder, const CommandBufferDescriptor* descriptor);
42 
43         MaybeError RecordComputePass(CommandRecordingContext* recordingContext);
44         MaybeError RecordRenderPass(CommandRecordingContext* recordingContext,
45                                     BeginRenderPassCmd* renderPass);
46         void RecordCopyImageWithTemporaryBuffer(CommandRecordingContext* recordingContext,
47                                                 const TextureCopy& srcCopy,
48                                                 const TextureCopy& dstCopy,
49                                                 const Extent3D& copySize);
50     };
51 
52 }}  // namespace dawn_native::vulkan
53 
54 #endif  // DAWNNATIVE_VULKAN_COMMANDBUFFERVK_H_
55