Nebula
Loading...
Searching...
No Matches
vkdeferredcommand.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
8//------------------------------------------------------------------------------
9#include "util/fixedarray.h"
10#include "coregraphics/config.h"
12#include <vulkan/vulkan.h>
13namespace Vulkan
14{
16{
21
23 {
28 __RunAfterFence, // don't use this flag, but all delegates prior to this flag requires a frame to be complete before it can occur
29
30 BindDescriptorSets, // this can actually be done outside of a frame (views, custom code, etc)
31
34
36
41 };
42
43 struct Delegate
44 {
47 VkFence fence;
48 union
49 {
50 struct // FreeCmdBuffers
51 {
52 VkCommandBuffer buffers[64];
53 VkCommandPool pool;
54 uint32_t numBuffers;
56
57 struct // FreeMemory
58 {
59 void* data;
61
62 struct // FreeBuffer
63 {
64 VkBuffer buf;
65 VkDeviceMemory mem;
67
68 struct // FreeImage
69 {
70 VkImage img;
71 VkDeviceMemory mem;
73
74 struct // UpdateBuffer
75 {
76 VkBuffer buf;
77 VkDeviceSize offset;
78 VkDeviceSize size;
79 uint32_t* data;
81
82 struct // UpdateImage
83 {
84 VkImage img;
85 VkImageCreateInfo info;
86 uint32_t mip;
87 uint32_t face;
88 VkDeviceSize size;
89 uint32_t* data;
91
92 struct // DestroyPipeline
93 {
94 VkPipeline pipeline;
96
97 struct // ImageLayoutTransition
98 {
99 VkPipelineStageFlags left;
100 VkPipelineStageFlags right;
101 VkImageMemoryBarrier barrier;
103
104 struct // ClearColorImage
105 {
106 VkImage img;
107 VkImageLayout layout;
108 VkClearColorValue clearValue;
109 VkImageSubresourceRange region;
111
112 struct // ClearDepthStencilImage
113 {
114 VkImage img;
115 VkImageLayout layout;
116 VkClearDepthStencilValue clearValue;
117 VkImageSubresourceRange region;
119
120 struct // ImageOwnershipChange
121 {
122 VkPipelineStageFlags left;
123 VkPipelineStageFlags right;
124 VkImageMemoryBarrier barrier;
126
127 struct // BindDescriptorSets
128 {
129 VkPipelineBindPoint type;
130 uint32_t baseSet;
131 uint32_t numSets;
132 const VkDescriptorSet* sets;
133 uint32_t numOffsets;
134 const uint32_t* offsets;
136 };
138
139 VkDevice dev;
140
142 void RunDelegate();
143};
144
145
146} // namespace Vulkan
QueueType
Definition config.h:40
Vulkan implementation of GPU acceleration structure.
Definition vkaccelerationstructure.cc:15
Compile time configuration options for the CoreGraphics subsystem.
Definition vkdeferredcommand.h:44
struct Vulkan::VkDeferredCommand::Delegate::@129::@133 buffer
VkDeviceMemory mem
Definition vkdeferredcommand.h:65
struct Vulkan::VkDeferredCommand::Delegate::@129::@139 imgColorClear
uint32_t numOffsets
Definition vkdeferredcommand.h:133
struct Vulkan::VkDeferredCommand::Delegate::@129::@131 cmdbufferfree
VkPipelineStageFlags right
Definition vkdeferredcommand.h:100
struct Vulkan::VkDeferredCommand::Delegate::@129::@136 imageUpd
uint32_t mip
Definition vkdeferredcommand.h:86
uint32_t baseSet
Definition vkdeferredcommand.h:130
VkImageLayout layout
Definition vkdeferredcommand.h:107
struct Vulkan::VkDeferredCommand::Delegate::@129::@137 pipelineDestroy
VkCommandBuffer buffers[64]
Definition vkdeferredcommand.h:52
struct Vulkan::VkDeferredCommand::Delegate::@129::@142 descSetBind
struct Vulkan::VkDeferredCommand::Delegate::@129::@135 bufferUpd
VkPipelineStageFlags left
Definition vkdeferredcommand.h:99
uint32_t numBuffers
Definition vkdeferredcommand.h:54
struct Vulkan::VkDeferredCommand::Delegate::@129::@140 imgDepthStencilClear
struct Vulkan::VkDeferredCommand::Delegate::@129::@138 imgBarrier
uint32_t numSets
Definition vkdeferredcommand.h:131
VkImageSubresourceRange region
Definition vkdeferredcommand.h:109
CoreGraphics::QueueType queue
Definition vkdeferredcommand.h:46
VkPipeline pipeline
Definition vkdeferredcommand.h:94
uint32_t face
Definition vkdeferredcommand.h:87
VkImageCreateInfo info
Definition vkdeferredcommand.h:85
VkDeviceSize size
Definition vkdeferredcommand.h:78
const uint32_t * offsets
Definition vkdeferredcommand.h:134
uint32_t * data
Definition vkdeferredcommand.h:79
VkDeviceSize offset
Definition vkdeferredcommand.h:77
VkFence fence
Definition vkdeferredcommand.h:47
void * data
Definition vkdeferredcommand.h:59
struct Vulkan::VkDeferredCommand::Delegate::@129::@141 imgOwnerChange
VkClearDepthStencilValue clearValue
Definition vkdeferredcommand.h:116
struct Vulkan::VkDeferredCommand::Delegate::@129::@134 image
DelegateType type
Definition vkdeferredcommand.h:45
VkPipelineBindPoint type
Definition vkdeferredcommand.h:129
const VkDescriptorSet * sets
Definition vkdeferredcommand.h:132
VkImage img
Definition vkdeferredcommand.h:70
VkBuffer buf
Definition vkdeferredcommand.h:64
VkCommandPool pool
Definition vkdeferredcommand.h:53
VkClearColorValue clearValue
Definition vkdeferredcommand.h:108
VkImageMemoryBarrier barrier
Definition vkdeferredcommand.h:101
struct Vulkan::VkDeferredCommand::Delegate::@129::@132 memory
Definition vkdeferredcommand.h:16
void RunDelegate()
run delegate action
Definition vkdeferredcommand.cc:34
~VkDeferredCommand()
destructor
Definition vkdeferredcommand.cc:25
VkDeferredCommand()
constructor
Definition vkdeferredcommand.cc:16
DelegateType
Definition vkdeferredcommand.h:23
@ FreeBuffer
Definition vkdeferredcommand.h:26
@ FreeMemory
Definition vkdeferredcommand.h:25
@ UpdateImage
Definition vkdeferredcommand.h:33
@ ClearColorImage
Definition vkdeferredcommand.h:37
@ ClearDepthStencilImage
Definition vkdeferredcommand.h:38
@ ImageOwnershipChange
Definition vkdeferredcommand.h:39
@ ImageLayoutTransition
Definition vkdeferredcommand.h:40
@ BindDescriptorSets
Definition vkdeferredcommand.h:30
@ __RunAfterFence
Definition vkdeferredcommand.h:28
@ FreeImage
Definition vkdeferredcommand.h:27
@ UpdateBuffer
Definition vkdeferredcommand.h:32
@ DestroyPipeline
Definition vkdeferredcommand.h:35
@ FreeCmdBuffers
Definition vkdeferredcommand.h:24
VkDevice dev
Definition vkdeferredcommand.h:139
struct Vulkan::VkDeferredCommand::Delegate del