Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
vulkan::VulkanCommandBuffer Class Reference

#include <vulkan_command_buffer.h>

Public Member Functions

 VulkanCommandBuffer (const VulkanProcTable &vk, const VulkanHandle< VkDevice > &device, const VulkanHandle< VkCommandPool > &pool)
 
 ~VulkanCommandBuffer ()
 
bool IsValid () const
 
VkCommandBuffer Handle () const
 
bool Begin () const
 
bool End () const
 
bool InsertPipelineBarrier (VkPipelineStageFlagBits src_stage_flags, VkPipelineStageFlagBits dest_stage_flags, uint32_t 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
 

Detailed Description

Definition at line 16 of file vulkan_command_buffer.h.

Constructor & Destructor Documentation

◆ VulkanCommandBuffer()

vulkan::VulkanCommandBuffer::VulkanCommandBuffer ( const VulkanProcTable vk,
const VulkanHandle< VkDevice > &  device,
const VulkanHandle< VkCommandPool > &  pool 
)

Definition at line 11 of file vulkan_command_buffer.cc.

15 : vk_(p_vk), device_(device), pool_(pool), valid_(false) {
16 const VkCommandBufferAllocateInfo allocate_info = {
18 .pNext = nullptr,
19 .commandPool = pool_,
21 .commandBufferCount = 1,
22 };
23
24 VkCommandBuffer buffer = VK_NULL_HANDLE;
25
26 if (VK_CALL_LOG_ERROR(vk_.AllocateCommandBuffers(device_, &allocate_info,
27 &buffer)) != VK_SUCCESS) {
28 FML_DLOG(INFO) << "Could not allocate command buffers.";
29 return;
30 }
31
32 auto buffer_collect = [this](VkCommandBuffer buffer) {
33 vk_.FreeCommandBuffers(device_, pool_, 1, &buffer);
34 };
35
36 handle_ = VulkanHandle<VkCommandBuffer>{buffer, buffer_collect};
37
38 valid_ = true;
39}
AutoreleasePool pool
VkDevice device
Definition: main.cc:53
#define FML_DLOG(severity)
Definition: logging.h:102
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
@ VK_COMMAND_BUFFER_LEVEL_PRIMARY
Definition: vulkan_core.h:2178
@ VK_SUCCESS
Definition: vulkan_core.h:141
#define VK_NULL_HANDLE
Definition: vulkan_core.h:46
@ VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Definition: vulkan_core.h:242
#define VK_CALL_LOG_ERROR(expression)

◆ ~VulkanCommandBuffer()

vulkan::VulkanCommandBuffer::~VulkanCommandBuffer ( )
default

Member Function Documentation

◆ Begin()

bool vulkan::VulkanCommandBuffer::Begin ( ) const

Definition at line 51 of file vulkan_command_buffer.cc.

51 {
54 .pNext = nullptr,
55 .flags = 0,
56 .pInheritanceInfo = nullptr,
57 };
58
59 return VK_CALL_LOG_ERROR(vk_.BeginCommandBuffer(handle_, &info)) ==
61}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
@ VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
Definition: vulkan_core.h:244

◆ End()

bool vulkan::VulkanCommandBuffer::End ( ) const

Definition at line 63 of file vulkan_command_buffer.cc.

63 {
64 return VK_CALL_LOG_ERROR(vk_.EndCommandBuffer(handle_)) == VK_SUCCESS;
65}

◆ Handle()

VkCommandBuffer vulkan::VulkanCommandBuffer::Handle ( ) const

Definition at line 47 of file vulkan_command_buffer.cc.

47 {
48 return handle_;
49}

◆ InsertPipelineBarrier()

bool vulkan::VulkanCommandBuffer::InsertPipelineBarrier ( VkPipelineStageFlagBits  src_stage_flags,
VkPipelineStageFlagBits  dest_stage_flags,
uint32_t  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

Definition at line 67 of file vulkan_command_buffer.cc.

76 {
77 vk_.CmdPipelineBarrier(handle_, src_stage_flags, dest_stage_flags,
78 dependency_flags, memory_barrier_count,
79 memory_barriers, buffer_memory_barrier_count,
80 buffer_memory_barriers, image_memory_barrier_count,
81 image_memory_barriers);
82 return true;
83}

◆ IsValid()

bool vulkan::VulkanCommandBuffer::IsValid ( ) const

Definition at line 43 of file vulkan_command_buffer.cc.

43 {
44 return valid_;
45}

The documentation for this class was generated from the following files: