VkCV Framework
0.0.1
CV Vulkan framework
|
Public Member Functions | |
~Core () noexcept | |
Core (const Core &other)=delete | |
Core (Core &&other)=delete | |
Core & | operator= (const Core &other)=delete |
Core & | operator= (Core &&other)=delete |
const Context & | getContext () const |
const Swapchain & | getSwapchain () const |
PipelineHandle | createGraphicsPipeline (const PipelineConfig &config) |
PipelineHandle | createComputePipeline (const ShaderProgram &shaderProgram, const std::vector< vk::DescriptorSetLayout > &descriptorSetLayouts) |
PassHandle | createPass (const PassConfig &config) |
template<typename T > | |
Buffer< T > | createBuffer (vkcv::BufferType type, size_t count, BufferMemoryType memoryType=BufferMemoryType::DEVICE_LOCAL, bool supportIndirect=false) |
SamplerHandle | createSampler (SamplerFilterType magFilter, SamplerFilterType minFilter, SamplerMipmapMode mipmapMode, SamplerAddressMode addressMode, float mipLodBias=0.0f) |
Image | createImage (vk::Format format, uint32_t width, uint32_t height, uint32_t depth=1, bool createMipChain=false, bool supportStorage=false, bool supportColorAttachment=false, Multisampling multisampling=Multisampling::None) |
uint32_t | getImageWidth (const ImageHandle &image) |
uint32_t | getImageHeight (const ImageHandle &image) |
vk::Format | getImageFormat (const ImageHandle &image) |
DescriptorSetLayoutHandle | createDescriptorSetLayout (const std::unordered_map< uint32_t, DescriptorBinding > &bindingsMap) |
DescriptorSetLayout | getDescriptorSetLayout (const DescriptorSetLayoutHandle handle) const |
DescriptorSetHandle | createDescriptorSet (const DescriptorSetLayoutHandle &layoutHandle) |
void | writeDescriptorSet (DescriptorSetHandle handle, const DescriptorWrites &writes) |
DescriptorSet | getDescriptorSet (const DescriptorSetHandle handle) const |
bool | beginFrame (uint32_t &width, uint32_t &height) |
start recording command buffers and increment frame index | |
void | recordDrawcallsToCmdStream (const CommandStreamHandle &cmdStreamHandle, const PassHandle &renderpassHandle, const PipelineHandle pipelineHandle, const PushConstants &pushConstants, const std::vector< DrawcallInfo > &drawcalls, const std::vector< ImageHandle > &renderTargets) |
void | recordMeshShaderDrawcalls (const CommandStreamHandle &cmdStreamHandle, const PassHandle &renderpassHandle, const PipelineHandle pipelineHandle, const PushConstants &pushConstantData, const std::vector< MeshShaderDrawcall > &drawcalls, const std::vector< ImageHandle > &renderTargets) |
void | recordComputeDispatchToCmdStream (CommandStreamHandle cmdStream, PipelineHandle computePipeline, const uint32_t dispatchCount[3], const std::vector< DescriptorSetUsage > &descriptorSetUsages, const PushConstants &pushConstants) |
void | recordBeginDebugLabel (const CommandStreamHandle &cmdStream, const std::string &label, const std::array< float, 4 > &color) |
void | recordEndDebugLabel (const CommandStreamHandle &cmdStream) |
void | recordComputeIndirectDispatchToCmdStream (const CommandStreamHandle cmdStream, const PipelineHandle computePipeline, const vkcv::BufferHandle buffer, const size_t bufferArgOffset, const std::vector< DescriptorSetUsage > &descriptorSetUsages, const PushConstants &pushConstants) |
void | endFrame () |
end recording and present image | |
void | recordAndSubmitCommandsImmediate (const SubmitInfo &submitInfo, const RecordCommandFunction &record, const FinishCommandFunction &finish) |
CommandStreamHandle | createCommandStream (QueueType queueType) |
void | recordCommandsToStream (const CommandStreamHandle cmdStreamHandle, const RecordCommandFunction &record, const FinishCommandFunction &finish) |
void | submitCommandStream (const CommandStreamHandle &handle) |
void | prepareSwapchainImageForPresent (const CommandStreamHandle &handle) |
void | prepareImageForSampling (const CommandStreamHandle &cmdStream, const ImageHandle &image) |
void | prepareImageForStorage (const CommandStreamHandle &cmdStream, const ImageHandle &image) |
void | recordImageMemoryBarrier (const CommandStreamHandle &cmdStream, const ImageHandle &image) |
void | recordBufferMemoryBarrier (const CommandStreamHandle &cmdStream, const BufferHandle &buffer) |
void | resolveMSAAImage (const CommandStreamHandle &cmdStream, const ImageHandle &src, const ImageHandle &dst) |
vk::ImageView | getSwapchainImageView () const |
void | recordMemoryBarrier (const CommandStreamHandle &cmdStream) |
void | recordBlitImage (const CommandStreamHandle &cmdStream, const ImageHandle &src, const ImageHandle &dst, SamplerFilterType filterType) |
void | setDebugLabel (const BufferHandle &handle, const std::string &label) |
void | setDebugLabel (const PassHandle &handle, const std::string &label) |
void | setDebugLabel (const PipelineHandle &handle, const std::string &label) |
void | setDebugLabel (const DescriptorSetHandle &handle, const std::string &label) |
void | setDebugLabel (const SamplerHandle &handle, const std::string &label) |
void | setDebugLabel (const ImageHandle &handle, const std::string &label) |
void | setDebugLabel (const CommandStreamHandle &handle, const std::string &label) |
Static Public Member Functions | |
static Core | create (Window &window, const char *applicationName, uint32_t applicationVersion, const std::vector< vk::QueueFlagBits > &queueFlags={}, const Features &features={}, const std::vector< const char * > &instanceExtensions={}) |
Private Member Functions | |
Core (Context &&context, Window &window, const Swapchain &swapChain, std::vector< vk::ImageView > imageViews, const CommandResources &commandResources, const SyncResources &syncResources) noexcept | |
Result | acquireSwapchainImage () |
Private Attributes | |
Context | m_Context |
Swapchain | m_swapchain |
Window & | m_window |
std::unique_ptr< PassManager > | m_PassManager |
std::unique_ptr< PipelineManager > | m_PipelineManager |
std::unique_ptr< DescriptorManager > | m_DescriptorManager |
std::unique_ptr< BufferManager > | m_BufferManager |
std::unique_ptr< SamplerManager > | m_SamplerManager |
std::unique_ptr< ImageManager > | m_ImageManager |
std::unique_ptr< CommandStreamManager > | m_CommandStreamManager |
CommandResources | m_CommandResources |
SyncResources | m_SyncResources |
uint32_t | m_currentSwapchainImageIndex |
event_handle< int, int > | e_resizeHandle |
|
privatenoexcept |
Constructor of Core requires an context
.
context | encapsulates various Vulkan objects |
|
noexcept |
Destructor of Core destroys the Vulkan objects contained in the core's context.
References vkcv::Swapchain::getSurface(), vkcv::Swapchain::getSwapchain(), and vkcv::event< T >::remove().
|
delete |
Copy-constructor of Core is deleted!
other | Other instance of #Context |
|
delete |
Move-constructor of Core uses default behavior!
other | Other instance of #Context |
|
static |
Creates a Core with given applicationName
and applicationVersion
for your application.
It is also possible to require a specific amount of queues, ask for specific queue-flags or extensions. This function will take care of the required arguments as best as possible.
To pass a valid version for your application, you should use #VK_MAKE_VERSION().
[in] | applicationName | Name of the application |
[in] | applicationVersion | Version of the application |
[in] | queueFlags | (optional) Requested flags of queues |
[in] | instanceExtensions | (optional) Requested instance extensions |
[in] | deviceExtensions | (optional) Requested device extensions |
References vkcv::Swapchain::create(), and vkcv::Swapchain::getSwapchain().
|
inline |
Creates a #Buffer with data-type T and bufferType
type | Type of Buffer created |
count | Count of elements of type T |
memoryType | Type of Buffers memory return Buffer-Object |
PipelineHandle vkcv::Core::createComputePipeline | ( | const ShaderProgram & | shaderProgram, |
const std::vector< vk::DescriptorSetLayout > & | descriptorSetLayouts | ||
) |
Creates a basic vulkan compute pipeline using shader
program and returns it using the handle
. Fixed Functions for pipeline are set with standard values.
shader | program that hold the compiles compute shader |
handle | a handle to return the created vulkan handle |
DescriptorSetHandle vkcv::Core::createDescriptorSet | ( | const DescriptorSetLayoutHandle & | layoutHandle | ) |
TODO:
setDescriptions |
DescriptorSetLayoutHandle vkcv::Core::createDescriptorSetLayout | ( | const std::unordered_map< uint32_t, DescriptorBinding > & | bindingsMap | ) |
TODO:
bindings |
PipelineHandle vkcv::Core::createGraphicsPipeline | ( | const PipelineConfig & | config | ) |
Creates a basic vulkan graphics pipeline using config
from the pipeline config class and returns it using the handle
. Fixed Functions for pipeline are set with standard values.
config | a pipeline config object from the pipeline config class |
handle | a handle to return the created vulkan handle |
Image vkcv::Core::createImage | ( | vk::Format | format, |
uint32_t | width, | ||
uint32_t | height, | ||
uint32_t | depth = 1 , |
||
bool | createMipChain = false , |
||
bool | supportStorage = false , |
||
bool | supportColorAttachment = false , |
||
Multisampling | multisampling = Multisampling::None |
||
) |
PassHandle vkcv::Core::createPass | ( | const PassConfig & | config | ) |
Creates a basic vulkan render pass using config
from the render pass config class and returns it using the handle
. Fixed Functions for pipeline are set with standard values.
config | a render pass config object from the render pass config class |
handle | a handle to return the created vulkan handle |
SamplerHandle vkcv::Core::createSampler | ( | SamplerFilterType | magFilter, |
SamplerFilterType | minFilter, | ||
SamplerMipmapMode | mipmapMode, | ||
SamplerAddressMode | addressMode, | ||
float | mipLodBias = 0.0f |
||
) |
Creates a Sampler with given attributes.
magFilter | Magnifying filter |
minFilter | Minimizing filter |
mipmapMode | Mipmapping filter |
addressMode | Address mode |
mipLodBias | Mip level of detail bias |
Copy assignment operator of Core is deleted!
other | Other instance of #Context |
Move assignment operator of Core uses default behavior!
other | Other instance of #Context |
void vkcv::Core::recordAndSubmitCommandsImmediate | ( | const SubmitInfo & | submitInfo, |
const RecordCommandFunction & | record, | ||
const FinishCommandFunction & | finish | ||
) |
Submit a command buffer to any queue of selected type. The recording can be customized by a custom record-command-function. If the command submission has finished, an optional finish-function will be called.
submitInfo | Submit information |
record | Record-command-function |
finish | Finish-command-function or nullptr |