forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vulkan_command_buffer.h
55 lines (40 loc) · 1.56 KB
/
vulkan_command_buffer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_VULKAN_VULKAN_COMMAND_BUFFER_H_
#define FLUTTER_VULKAN_VULKAN_COMMAND_BUFFER_H_
#include "flutter/fml/compiler_specific.h"
#include "flutter/fml/macros.h"
#include "vulkan_handle.h"
namespace vulkan {
class VulkanProcTable;
class VulkanCommandBuffer {
public:
VulkanCommandBuffer(const VulkanProcTable& vk,
const VulkanHandle<VkDevice>& device,
const VulkanHandle<VkCommandPool>& pool);
~VulkanCommandBuffer();
bool IsValid() const;
VkCommandBuffer Handle() const;
[[nodiscard]] bool Begin() const;
[[nodiscard]] bool End() const;
[[nodiscard]] bool InsertPipelineBarrier(
VkPipelineStageFlagBits src_stage_flags,
VkPipelineStageFlagBits dest_stage_flags,
uint32_t /* mask of VkDependencyFlagBits */ dependency_flags,
uint32_t memory_barrier_count,
const VkMemoryBarrier* memory_barriers,
uint32_t buffer_memory_barrier_count,
const VkBufferMemoryBarrier* buffer_memory_barriers,
uint32_t image_memory_barrier_count,
const VkImageMemoryBarrier* image_memory_barriers) const;
private:
const VulkanProcTable& vk;
const VulkanHandle<VkDevice>& device_;
const VulkanHandle<VkCommandPool>& pool_;
VulkanHandle<VkCommandBuffer> handle_;
bool valid_;
FML_DISALLOW_COPY_AND_ASSIGN(VulkanCommandBuffer);
};
} // namespace vulkan
#endif // FLUTTER_VULKAN_VULKAN_COMMAND_BUFFER_H_