KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
KarmaGuiVulkanHandler.h
Go to the documentation of this file.
1
10// Dear ImGui (1.89.2) is Copyright (c) 2014-2023 Omar Cornut.
11
12// Major and heavy modifications of the original Dear ImGUI's take on Vulkan implementation
13// https://github.com/ravimohan1991/imgui/blob/9068fd1afbaba56247aacd452bbadebb286800c7/backends/imgui_impl_vulkan.h
14// Disclaimer:
15// Most of the member variables and function naming in the herein is credited to the author(s) of Dear ImGUI. I take no responsibility
16// of damage caused by short names herein (if any).
17
18#pragma once
19
20#include "KarmaGui.h"
21#include "KarmaGuiInternal.h"
23#include "KarmaTypes.h"
24#include <vulkan/vulkan.h>
25
26namespace Karma
27{
28 class FVulkanSwapChain;
32 class FVulkanFence;
33
40 #define KR_MEMALIGN(_OFF,_ALIGN) (((_OFF) + ((_ALIGN) - 1)) & ~((_ALIGN) - 1))
41
47 #define KR_MAX(A, B) (((A) >= (B)) ? (A) : (B))
48
57 {
63 VkInstance Instance;
64
70 VkPhysicalDevice PhysicalDevice;
71
78 VkDevice Device;
79
87 uint32_t QueueFamily;
88
94 VkQueue Queue;
95
101 VkDescriptorPool DescriptorPool;
102
113 VkRenderPass RenderPass;
114
115 // begin Optional
121 VkPipelineCache PipelineCache;
122
128 uint32_t Subpass;
129 // end Optional
130
138
144 uint32_t ImageCount;
145
166 VkSampleCountFlagBits MSAASamples; // Multi sample anti aliasing samples
167
174 const VkAllocationCallbacks* Allocator;
175 };
176
177 //-------------------------------------------------------------------------
178 // Internal / Miscellaneous Vulkan Helpers
179 // (Used by example's main.cpp. Used by multi-viewport features. PROBABLY NOT used by your own engine/app.)
180 //-------------------------------------------------------------------------
181 // You probably do NOT need to use or care about those functions.
182 // Those functions only exist because:
183 // 1) they facilitate the readability and maintenance of the multiple main.cpp examples files.
184 // 2) the multi-viewport / platform window implementation needs them internally.
185 // Generally we avoid exposing any kind of superfluous high-level helpers in the bindings,
186 // but it is too much code to duplicate everywhere so we exceptionally expose them.
187 //
188 // Your engine/app(lication) will likely _already_ have code to setup all that stuff (swap chain, render pass, frame buffers, etc.).
189 // You may read this code to learn about Vulkan, but it is recommended you use you own custom tailored code to do equivalent work.
190 // (The ImGui_ImplVulkanH_XXX functions do not interact with any of the state used by the regular ImGui_ImplVulkan_XXX functions)
191 //-------------------------------------------------------------------------
192
207 {
219
232
245
251 VkCommandBuffer CommandBuffer;
252 };
253
264 {
271 VkImage Backbuffer;
272
278 VkImageView BackbufferView;
279
288 VkFramebuffer Framebuffer;
289 };
290
315
326 {
334 int Width;
335
344
350 VkSwapchainKHR Swapchain;
351
357 VkCommandPool CommandPool;
358
365 VkSurfaceKHR Surface;
366
372 VkSurfaceFormatKHR SurfaceFormat;
373
379 VkPresentModeKHR PresentMode;
380
395 VkRenderPass RenderPass;
396
403 VkPipeline Pipeline;
404
411
417 VkClearValue ClearValue;
418
425
432
439
446
455
456 // Cowboy's Modification
457
464
472 VkRect2D RenderArea;
473
480
487 {
488 memset((void*)this, 0, sizeof(*this));
489 PresentMode = (VkPresentModeKHR)~0; // Ensure we get an error if user doesn't set this.
490 ClearEnable = true;
491 }
492 };
493
505 {
516 VkDeviceMemory VertexBufferMemory;
517
528 VkDeviceMemory IndexBufferMemory;
529
535 VkDeviceSize VertexBufferSize;
536
542 VkDeviceSize IndexBufferSize;
543
549 VkBuffer VertexBuffer;
550
556 VkBuffer IndexBuffer;
557
558 public:
559
571 };
572
602
655
664 {
671 std::string TextureLable;
672
678 uint32_t width;
679
685 uint32_t height;
686
693 uint32_t channels;
694
705 size_t size;
706
712 VkSampler TextureSampler;
713
719 VkDeviceMemory TextureMemory;
720
727
733 VkImageView TextureView;
734
740 VkDescriptorSet TextureDescriptorSet;
741
747 VkDeviceMemory UploadBufferMemory;
748
754 VkBuffer UploadBuffer;
755
762 {
763 TextureLable = "NO LABLE YET";
764 }
765 };
766
774 {
778 std::shared_ptr<Scene> Scene3D;
779
784
789 KGTextureID KarmaGui_Texture;
790
794 VkImage Image;
795
799 VkDeviceMemory DeviceMemory;
800
804 VkImageView Image_View;
805
809 VkImage DepthImage;
810
814 VkDeviceMemory DepthDeviceMemory;
815
819 VkImageView DepthImage_View;
820
824 VkFramebuffer FrameBuffer;
825 };
826
833 struct KarmaGui_OffScreen_Render_Resources
834 {
844 VkSampler Sampler;
845
855
862
863 VkPipelineLayout OffscreenPipelineLayout;
864 VkPipeline OffscreenGraphicsPipeline;
865
866 KarmaGui_OffScreen_Render_Resources() : bAllocationDoneOnce(false)
867 {}
868 };
869
881 {
888
896 VkRenderPass RenderPass;
897
903 std::vector<KarmaGui_3DScene_To_2DTexture_Data> Elements3DTo2D;
904
909
917
923 VkPipelineCreateFlags PipelineCreateFlags;
924
934 VkDescriptorSetLayout DescriptorSetLayout;
935
942 VkPipelineLayout PipelineLayout;
943
952 VkPipeline Pipeline;
953
959 uint32_t Subpass;
960
966 VkShaderModule ShaderModuleVert;
967
973 VkShaderModule ShaderModuleFrag;
974
975 // Font data
981 VkSampler FontSampler;
982
988 VkDeviceMemory FontMemory;
989
1003 VkImage FontImage;
1004
1010 VkImageView FontView;
1011
1017 VkDescriptorSet FontDescriptorSet;
1018
1024 VkDeviceMemory UploadBufferMemory;
1025
1032
1033 // Image data
1039 std::vector<KarmaGui_ImplVulkan_Image_TextureData*> vulkanMesaDecalDataList;
1040
1041 // Render buffers for main window
1042 //KarmaGui_ImplVulkanH_WindowRenderBuffers MainWindowRenderBuffers;
1043
1044 // heh, not working with initializers in MSVC. Need a blog post!
1045
1046 /*
1047 ImGui_ImplVulkan_Data()
1048 {
1049 memset((void*)this, 0, sizeof(*this));
1050 BufferMemoryAlignment = 256;
1051 }*/
1052 };
1053
1058 {
1059 public:
1060 /*
1061 inline static KarmaGui_ImplVulkan_Data* KarmaGui_ImplVulkan_GetBackendData()
1062 {
1063 return KarmaGui::GetCurrentContext() ? (KarmaGui_ImplVulkan_Data*)KarmaGui::GetIO().BackendRendererUserData : nullptr;
1064 }*/
1065 // GetIO should fetche the configuration settings and whatnot, which in this case is the struct KarmaGui_ImplVulkan_Data
1066
1078 static uint32_t KarmaGui_ImplVulkan_MemoryType(VkMemoryPropertyFlags properties, uint32_t type_bits);
1079
1092 static void CreateOrResizeBuffer(VkBuffer& buffer, VkDeviceMemory& bufferMemory, VkDeviceSize& pBufferSize, size_t newSize, VkBufferUsageFlagBits usage);
1093
1108 static void KarmaGui_ImplVulkan_SetupRenderState(KGDrawData* drawData, VkPipeline pipeline, VkCommandBuffer commandBuffer, KarmaGui_ImplVulkanH_ImageFrameRenderBuffers* remderingBufferData, int width, int height);
1109
1118 static void KarmaGui_ImplVulkan_CreateShaderModules(VkDevice device, const VkAllocationCallbacks* allocator);
1119
1120 static VkShaderModule KarmaGui_ImplVulkan_CreateShaderModule(const std::vector<uint32_t>& code);
1121
1130 static void KarmaGui_ImplVulkan_CreateFontSampler(VkDevice device, const VkAllocationCallbacks* allocator);
1131
1140 static void KarmaGui_ImplVulkan_CreateDescriptorSetLayout(VkDevice device, const VkAllocationCallbacks* allocator);
1141
1150 static void KarmaGui_ImplVulkan_CreatePipelineLayout(VkDevice device, const VkAllocationCallbacks* allocator);
1151
1165 static void KarmaGui_ImplVulkan_CreatePipeline(VkDevice device, const VkAllocationCallbacks* allocator, VkPipelineCache pipelineCache, VkRenderPass renderPass, VkSampleCountFlagBits MSAASamples, VkPipeline* pipeline, uint32_t subpass);
1166
1174
1175 // Overload for destroying KarmaGui window
1183
1193
1203 static void KarmaGui_ImplVulkan_SetWindowSize(KarmaGuiViewport* viewport, KGVec2 size);
1204
1214
1242 static void KarmaGui_ImplVulkan_RenderDrawData(KGDrawData* drawData, VkCommandBuffer commandBuffer, VkPipeline pipeline, uint32_t imageFrameIndex);
1243
1261 static void KarmaGui_ImplVulkan_SwapBuffers(KarmaGuiViewport* viewport, void*);
1262
1269 static void CheckInitialization();
1270
1288 static void FillWindowData(KarmaGui_ImplVulkanH_Window* windowData, bool bCreateSyncronicity);
1289
1299 static void MakeRenderPassInfo(FVulkanSwapChain* SwapChain, struct FVulkanRenderPassInfo& RPInfo);
1300
1306 static void CreateDepthRenderTarget(FVulkanRenderTargetsInfo& RTInfo, FVulkanSwapChain* SwapChain);
1307
1313 static void GatherSwapChainColorRenderTargets(FVulkanRenderTargetsInfo& RTInfo, FVulkanSwapChain* SwapChain, uint32_t SwapChainImageIndex);
1314
1322
1328 static void CreateOffScreenTextureResources();
1329
1337
1344
1352
1353 static void CreateOffScreenTextureGraphicsPipelineResource(VkRenderPass renderPassKG, float windowKGWidth, float windowKGHeight);
1354
1367 static void ClearVulkanWindowData(KarmaGui_ImplVulkanH_Window* vulkanWindowData, bool bDestroySyncronicity = false);
1368
1377
1384 static void DestroyFramesOnFlightData(KarmaGui_Vulkan_Frame_On_Flight* frameSyncronicityData);
1385
1395 static void KarmaGui_ImplVulkan_CreateOrResizeWindow(KarmaGui_ImplVulkanH_Window* windowData, bool bCreateSyncronicity, bool bRecreateSwapChainAndCommandBuffers);
1396
1404 static void KarmaGui_ImplVulkan_DestroyAllViewportsRenderBuffers(VkDevice device, const VkAllocationCallbacks* allocator);
1405
1415 static void KarmaGui_ImplVulkan_ShivaWindowRenderBuffers(VkDevice device, KarmaGui_ImplVulkanH_WindowRenderBuffers* buffers, const VkAllocationCallbacks* allocator);
1416
1428 static void KarmaGui_ImplVulkan_ShivaFrameRenderBuffers(VkDevice device, KarmaGui_ImplVulkanH_ImageFrameRenderBuffers* buffers, const VkAllocationCallbacks* allocator);
1429
1436 static bool KarmaGui_ImplVulkan_CreateFontsTexture(VkCommandBuffer commandBuffer);
1437
1446 static bool KarmaGui_ImplVulkan_CreateTexture(VkCommandBuffer commandBuffer, char const* fileName, const std::string& lable = "");
1447
1459
1469
1487
1497 static void KarmaGui_ImplVulkan_Shutdown();
1498
1505 static void KarmaGui_ImplVulkan_NewFrame();
1506
1507 // Register a texture (VkDescriptorSet == ImTextureID)
1508 // FIXME: This is experimental in the sense that we are unsure how to best design/tackle this problem, please post to https://github.com/ocornut/imgui/pull/914 if you have suggestions.
1517 static VkDescriptorSet KarmaGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView imageView, VkImageLayout imageLayout);
1518
1526
1534 };
1535}
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
This file constains KarmaGui class. The chief class for our UI needs..
This file contains helper routines for UI drawing and relevant data structures.
This file contains the custom types used in Engine's logic.
This file contains the class Scene.
Represents a Vulkan fence used for synchronization between the CPU and GPU.
Definition VulkanSynchronization.h:141
Actual Vulkan framebuffer class.
Definition VulkanFramebuffer.h:72
The actual Vulkan renderpass Engine class.
Definition VulkanRenderPass.h:591
May move to more abstract since any graphic api should use such render targets' information.
Definition VulkanFramebuffer.h:30
Represents a Vulkan swapchain, managing the images used for rendering and presentation.
Definition VulkanSwapChain.h:49
A class for required Vulkan routines for KarmaGui Vulkan backend.
Definition KarmaGuiVulkanHandler.h:1058
static void CreateDepthRenderTarget(FVulkanRenderTargetsInfo &RTInfo, FVulkanSwapChain *SwapChain)
Fills the depth render target information.
Definition KarmaGuiVulkanHandler.cpp:1823
static void KarmaGui_ImplVulkan_SwapBuffers(KarmaGuiViewport *viewport, void *)
Called in KarmaGui_ImplVulkan_InitPlatformInterface for setting the field KarmaGuiPlatformIO::Rendere...
Definition KarmaGuiVulkanHandler.cpp:2298
static void KarmaGui_ImplVulkan_CreateDescriptorSetLayout(VkDevice device, const VkAllocationCallbacks *allocator)
Creates KarmaGui_ImplVulkan_Data.DescriptorSetLayout if not already in KarmaGuiVulkanHandler::KarmaGu...
Definition KarmaGuiVulkanHandler.cpp:805
static void KarmaGui_ImplVulkan_DestroyDeviceObjects()
The following objects are destroyed.
Definition KarmaGuiVulkanHandler.cpp:1041
static void CreateOffScreenTextureRenderpassResource()
Creates renderpass for off screen texture (3D scene to 2D texture).
Definition KarmaGuiVulkanHandler.cpp:1561
static uint32_t KarmaGui_ImplVulkan_MemoryType(VkMemoryPropertyFlags properties, uint32_t type_bits)
Reports memory relevant type information for the specified physical device (the GPU,...
Definition KarmaGuiVulkanHandler.cpp:97
static void ClearVulkanWindowData(KarmaGui_ImplVulkanH_Window *vulkanWindowData, bool bDestroySyncronicity=false)
Clears appropriate buffers which are used for KarmaGui's rendering. They include:
Definition KarmaGuiVulkanHandler.cpp:1975
static bool KarmaGui_ImplVulkan_CreateTexture(VkCommandBuffer commandBuffer, char const *fileName, const std::string &lable="")
Routine to create Image vulkan texture.
Definition KarmaGuiVulkanHandler.cpp:398
static void KarmaGui_ImplVulkan_DestroyAllViewportsRenderBuffers(VkDevice device, const VkAllocationCallbacks *allocator)
Clears the KarmaGui_ImplVulkan_ViewportData::RenderBuffers associated with the single KarmaGui viewpo...
Definition KarmaGuiVulkanHandler.cpp:1137
static void CreateOffScreenTextureFrameBufferResource(KarmaGui_3DScene_To_2DTexture_Data *textureData)
Creates appropriate frame buffer for off screen texture rendering.
Definition KarmaGuiVulkanHandler.cpp:1612
static void KarmaGui_ImplVulkan_RenderDrawData(KGDrawData *drawData, VkCommandBuffer commandBuffer, VkPipeline pipeline, uint32_t imageFrameIndex)
Record KarmaGui primitives into command buffer. Frame rendering relevant buffers and resources are se...
Definition KarmaGuiVulkanHandler.cpp:212
static void KarmaGui_ImplVulkan_SetWindowSize(KarmaGuiViewport *viewport, KGVec2 size)
Set the size of window rendering relevant resources (swapchain, framebuffers, and all that)....
Definition KarmaGuiVulkanHandler.cpp:2207
static void ShivaSwapChainForRebuild(KarmaGui_ImplVulkanH_Window *windowData)
Destroys swapchain and related resources for KarmaGui's Vulkan backend.
Definition KarmaGuiVulkanHandler.cpp:1926
static void KarmaGui_ImplVulkan_ShivaFrameRenderBuffers(VkDevice device, KarmaGui_ImplVulkanH_ImageFrameRenderBuffers *buffers, const VkAllocationCallbacks *allocator)
Destroys and clears the following buffers.
Definition KarmaGuiVulkanHandler.cpp:1166
static void KarmaGui_ImplVulkan_DestroyWindow(KarmaGuiViewport *viewport)
Destroys the KarmaGui window relevant data (KarmaGui_ImplVulkan_ViewportData) and buffers....
Definition KarmaGuiVulkanHandler.cpp:2190
static void KarmaGui_ImplVulkan_Shutdown()
Called in the KarmaGuiRenderer::GracefulVulkanShutDown(). Basically does the following.
Definition KarmaGuiVulkanHandler.cpp:1241
static void KarmaGui_ImplVulkan_NewFrame()
No clue what this does. Legacy?
Definition KarmaGuiVulkanHandler.cpp:1268
static void CheckInitialization()
Checks whether KarmaGui_ImplVulkan_InitInfo has been initialized properly. Crashes if not.
Definition KarmaGuiVulkanHandler.cpp:1696
static void CreateOrResizeBuffer(VkBuffer &buffer, VkDeviceMemory &bufferMemory, VkDeviceSize &pBufferSize, size_t newSize, VkBufferUsageFlagBits usage)
Creates new vulkan buffer and allocates appropriate memory based upon the supplied newSize (appropria...
Definition KarmaGuiVulkanHandler.cpp:118
static VkDescriptorSet KarmaGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView imageView, VkImageLayout imageLayout)
Register a texture by creation of descriptor set from preallocated descriptor pool.
Definition KarmaGuiVulkanHandler.cpp:1279
static void KarmaGui_ImplVulkan_RenderWindow(KarmaGuiViewport *viewport, void *)
A set of instructions for rendering a viewport of KarmaGui window (called each loop for realtime Vulk...
static void DestroyFramesOnFlightData(KarmaGui_Vulkan_Frame_On_Flight *frameSyncronicityData)
Clears all the synchronization primitives (semaphores and fences) associated with the rendering.
Definition KarmaGuiVulkanHandler.cpp:2029
static bool KarmaGui_ImplVulkan_CreateDeviceObjects()
Generates or creates the following objects.
Definition KarmaGuiVulkanHandler.cpp:962
static void GatherSwapChainColorRenderTargets(FVulkanRenderTargetsInfo &RTInfo, FVulkanSwapChain *SwapChain, uint32_t SwapChainImageIndex)
Prepares the RTInfo for framebuffer creation.
Definition KarmaGuiVulkanHandler.cpp:1876
static void DestroyWindowDataFrame(KarmaGui_ImplVulkanH_ImageFrame *frame)
Clears KarmaGui_ImplVulkanH_ImageFrame::BackBuffer and KarmaGui_ImplVulkanH_ImageFrame::Framebuffer a...
Definition KarmaGuiVulkanHandler.cpp:2018
static bool KarmaGui_ImplVulkan_CreateFontsTexture(VkCommandBuffer commandBuffer)
Creates fonts' texture for KarmaGui.
Definition KarmaGuiVulkanHandler.cpp:583
static void CreateOffScreenTextureResources()
Creates framebuffers, renderpass, and vertexarray (for KarmaGui) pipeline for 2D texture creation fro...
Definition KarmaGuiVulkanHandler.cpp:1314
static void KarmaGui_ImplVulkan_CreateFontSampler(VkDevice device, const VkAllocationCallbacks *allocator)
Bilinear sampling object is created for font and stored in KarmaGui_ImplVulkan_Data....
Definition KarmaGuiVulkanHandler.cpp:780
static void KarmaGui_ImplVulkan_CreateWindow(KarmaGuiViewport *viewport)
This is an advanced and optional feature, allowing the backend to create and handle multiple viewport...
Definition KarmaGuiVulkanHandler.cpp:2161
static void MakeRenderPassInfo(FVulkanSwapChain *SwapChain, struct FVulkanRenderPassInfo &RPInfo)
Prepares the renderpass information for KarmaGui's Vulkan backend.
Definition KarmaGuiVulkanHandler.cpp:1884
static void KarmaGui_ImplVulkan_CreatePipelineLayout(VkDevice device, const VkAllocationCallbacks *allocator)
Creates KarmaGui_ImplVulkan_Data.PipelineLayout (if not already in KarmaGuiVulkanHandler::KarmaGui_Im...
Definition KarmaGuiVulkanHandler.cpp:829
static void KarmaGui_ImplVulkan_DestroyFontUploadObjects()
Function to destroy the fonts (created by KarmaGuiVulkanHandler::KarmaGui_ImplVulkan_CreateFontsTextu...
Definition KarmaGuiVulkanHandler.cpp:1025
static void KarmaGui_ImplVulkan_CreateShaderModules(VkDevice device, const VkAllocationCallbacks *allocator)
A routine to create the shader modules (KarmaGui_ImplVulkan_Data.ShaderModuleVert and KarmaGui_ImplVu...
Definition KarmaGuiVulkanHandler.cpp:754
static void KarmaGui_ImplVulkan_SetupRenderState(KGDrawData *drawData, VkPipeline pipeline, VkCommandBuffer commandBuffer, KarmaGui_ImplVulkanH_ImageFrameRenderBuffers *remderingBufferData, int width, int height)
A routine to bind index/vertex buffers, setup a external viewport, and bind pipeline....
Definition KarmaGuiVulkanHandler.cpp:163
static void FillWindowData(KarmaGui_ImplVulkanH_Window *windowData, bool bCreateSyncronicity)
Replacement for ShareVulkanContextResourcesOfMainWindow. Does the following.
Definition KarmaGuiVulkanHandler.cpp:1711
static void CreateOffScreenTextureDepthResource(KarmaGui_3DScene_To_2DTexture_Data *textureData)
Creates depth resource for off screen texture (3D scene to 2D texture).
Definition KarmaGuiVulkanHandler.cpp:1635
static void KarmaGui_ImplVulkan_CreatePipeline(VkDevice device, const VkAllocationCallbacks *allocator, VkPipelineCache pipelineCache, VkRenderPass renderPass, VkSampleCountFlagBits MSAASamples, VkPipeline *pipeline, uint32_t subpass)
Creates KarmaGui_ImplVulkan_Data.Pipeline.
Definition KarmaGuiVulkanHandler.cpp:855
static void KarmaGui_ImplVulkan_InitPlatformInterface()
Called in KarmaGuiRenderer::KarmaGui_ImplVulkan_Init, during the initialization of Vulkan backend for...
Definition KarmaGuiVulkanHandler.cpp:2333
static void KarmaGui_ImplVulkan_CreateOrResizeWindow(KarmaGui_ImplVulkanH_Window *windowData, bool bCreateSyncronicity, bool bRecreateSwapChainAndCommandBuffers)
KarmaGui_ImplVulkan_CreateOrResizeWindow.
Definition KarmaGuiVulkanHandler.cpp:2054
static void KarmaGui_ImplVulkan_ShutdownPlatformInterface()
Calls KarmaGui::DestroyPlatformWindows, which further calls KarmaGuiInternal::DestroyPlatformWindow o...
Definition KarmaGuiVulkanHandler.cpp:2347
static void KarmaGui_ImplVulkan_ShivaWindowRenderBuffers(VkDevice device, KarmaGui_ImplVulkanH_WindowRenderBuffers *buffers, const VkAllocationCallbacks *allocator)
Destroys and clears the frame buffers, KarmaGui_ImplVulkanH_WindowRenderBuffers::FrameRenderBuffers,...
Definition KarmaGuiVulkanHandler.cpp:1152
Karma's std::vector wrapper with additional functionalities.
Definition KarmaTypes.h:243
Definition KarmaGui.h:2707
Definition KarmaGui.h:153
Data structure to hold information about Vulkan renderpass attachments (like color and depth attachme...
Definition VulkanRenderPass.h:433
Data structure for 3D scene to 2D texture rendering element(s) in KarmaGui.
Definition KarmaGuiVulkanHandler.h:774
VkImageView DepthImage_View
Image view for the offscreen rendered 2D texture depth image.
Definition KarmaGuiVulkanHandler.h:819
VkDeviceMemory DeviceMemory
Device memory for the offscreen rendered 2D texture image.
Definition KarmaGuiVulkanHandler.h:799
VkImageView Image_View
Image view for the offscreen rendered 2D texture image.
Definition KarmaGuiVulkanHandler.h:804
KGVec2 Size
Size of the 2D texture to be rendered offscreen from 3D scene.
Definition KarmaGuiVulkanHandler.h:783
VkFramebuffer FrameBuffer
Framebuffer for offscreen rendered 2D texture.
Definition KarmaGuiVulkanHandler.h:824
VkImage Image
Vulkan image for offscreen rendered 2D texture.
Definition KarmaGuiVulkanHandler.h:794
VkImage DepthImage
Depth image for offscreen rendered 2D texture.
Definition KarmaGuiVulkanHandler.h:809
VkDeviceMemory DepthDeviceMemory
Device memory for the offscreen rendered 2D texture depth image.
Definition KarmaGuiVulkanHandler.h:814
KGTextureID KarmaGui_Texture
Texture ID to be used in KarmaGui::Image() and related functions, for display of 2D rendered renderta...
Definition KarmaGuiVulkanHandler.h:789
std::shared_ptr< Scene > Scene3D
3D scene to be rendered offscreen to 2D texture for display in KarmaGui element.
Definition KarmaGuiVulkanHandler.h:778
Backend data containing stuff for Vulkan renderer for KarmaGui.
Definition KarmaGuiVulkanHandler.h:881
KarmaGui_ImplVulkan_InitInfo VulkanInitInfo
KarmaGui's initialization data.
Definition KarmaGuiVulkanHandler.h:887
uint32_t Subpass
This is the index of the subpass in the render pass where this pipeline (KarmaGuiVulkanHandler::Karma...
Definition KarmaGuiVulkanHandler.h:959
VkPipelineLayout PipelineLayout
Opaque handle to a pipeline layout object. Access to descriptor sets from a pipeline is accomplished ...
Definition KarmaGuiVulkanHandler.h:942
VkSampler FontSampler
Opaque handle to a sampler object. The object represents the state of an image sampler which is used ...
Definition KarmaGuiVulkanHandler.h:981
VkImage FontImage
A 2D font image object with following properties.
Definition KarmaGuiVulkanHandler.h:1003
VkDeviceMemory FontMemory
The memory resource allocated for the fonts to be displayed by the backend.
Definition KarmaGuiVulkanHandler.h:988
VkPipelineCreateFlags PipelineCreateFlags
Flags to be set for Vulkan's graphics pipeline.
Definition KarmaGuiVulkanHandler.h:923
VkDeviceMemory UploadBufferMemory
Device allocated memory for font image pixels' buffer.
Definition KarmaGuiVulkanHandler.h:1024
VkImageView FontView
The image view, for 2D font, representing contiguous ranges of the image subresources and containing ...
Definition KarmaGuiVulkanHandler.h:1010
VkBuffer UploadBuffer
Vulkan buffer containing font texture pixels.
Definition KarmaGuiVulkanHandler.h:1031
VkDescriptorSetLayout DescriptorSetLayout
A handle to the descriptorsetlayout created by backend in KarmaGuiVulkanHandler::KarmaGui_ImplVulkan_...
Definition KarmaGuiVulkanHandler.h:934
VkShaderModule ShaderModuleVert
Opaque handle to a vertex shader module object for backend. Shader modules contain shader code and on...
Definition KarmaGuiVulkanHandler.h:966
VkPipeline Pipeline
A huge object in Vulkan that encompasses the configuration of the entire GPU for the draw....
Definition KarmaGuiVulkanHandler.h:952
VkDescriptorSet FontDescriptorSet
Container for uploading image texture relevant data, TextureView for instance, from CPU to GPU.
Definition KarmaGuiVulkanHandler.h:1017
VkShaderModule ShaderModuleFrag
Opaque handle to fragment shader module object for backend. Shader modules contain shader code and on...
Definition KarmaGuiVulkanHandler.h:973
std::vector< KarmaGui_3DScene_To_2DTexture_Data > Elements3DTo2D
3D scene to 2d texture elements on display by KarmaGui
Definition KarmaGuiVulkanHandler.h:903
std::vector< KarmaGui_ImplVulkan_Image_TextureData * > vulkanMesaDecalDataList
List of vulkan images' textures, for instance icons and stuff.
Definition KarmaGuiVulkanHandler.h:1039
KarmaGui_OffScreen_Render_Resources OffScreenRR
Resources (common) required for off screen rendering of Elements3DTo2D.
Definition KarmaGuiVulkanHandler.h:908
VkRenderPass RenderPass
A render pass object represents a collection of attachments, subpasses, and dependencies between the ...
Definition KarmaGuiVulkanHandler.h:896
VkDeviceSize BufferMemoryAlignment
The value for default alignment for index and vertex buffers. The value is set to 256 by DearImgui au...
Definition KarmaGuiVulkanHandler.h:916
VkSampler TextureSampler
This is a sampler handle, and is used in descriptor updates for types VK_DESCRIPTOR_TYPE_SAMPLER and ...
Definition KarmaGuiVulkanHandler.h:712
KarmaGui_ImplVulkan_Image_TextureData()
A constructor.
Definition KarmaGuiVulkanHandler.h:761
VkImage TextureImage
The actual vulkan's image object.
Definition KarmaGuiVulkanHandler.h:726
size_t size
The size, in bytes, of the image texture.
Definition KarmaGuiVulkanHandler.h:705
VkDeviceMemory TextureMemory
A VkDeviceMemory object describing the device memory, relevant to the image, to attach.
Definition KarmaGuiVulkanHandler.h:719
VkDeviceMemory UploadBufferMemory
Device allocated memory for image pixels' buffer.
Definition KarmaGuiVulkanHandler.h:747
VkDescriptorSet TextureDescriptorSet
Container for uploading image texture relevant data, TextureView for instance, from CPU to GPU.
Definition KarmaGuiVulkanHandler.h:740
VkImageView TextureView
The image view representing contiguous ranges of the image subresources and containing additional met...
Definition KarmaGuiVulkanHandler.h:733
uint32_t width
2D width of the texture.
Definition KarmaGuiVulkanHandler.h:678
uint32_t channels
The number of image components in image texture.
Definition KarmaGuiVulkanHandler.h:693
VkBuffer UploadBuffer
Vulkan buffer containing texture pixels.
Definition KarmaGuiVulkanHandler.h:754
std::string TextureLable
The name of the image texture for Mesa.
Definition KarmaGuiVulkanHandler.h:671
uint32_t height
2D height of the texture.
Definition KarmaGuiVulkanHandler.h:685
A data structure for Vulkan's initialization done in KarmaGuiRenderer::KarmaGui_ImplVulkan_Init().
Definition KarmaGuiVulkanHandler.h:57
VkPipelineCache PipelineCache
Usually this cache is set to VK_NULL_HANDLE, indicating that pipeline caching is disabled; or the han...
Definition KarmaGuiVulkanHandler.h:121
VkInstance Instance
The handle to Vulkan's instance object, for use in backend.
Definition KarmaGuiVulkanHandler.h:63
uint32_t QueueFamily
Graphics queue family (valued in unsigned integer) properties used for creating commandpool,...
Definition KarmaGuiVulkanHandler.h:87
VkDescriptorPool DescriptorPool
A fresh descriptor pool created in KarmaGuiRenderer::CreateDescriptorPool() (seperate from VulkanVert...
Definition KarmaGuiVulkanHandler.h:101
VkRenderPass RenderPass
A handle to render pass object which represents a collection of attachments (depth attachment or colo...
Definition KarmaGuiVulkanHandler.h:113
uint32_t MinImageCount
The minimum number of images the specified device supports for a swapchain created for the surface,...
Definition KarmaGuiVulkanHandler.h:137
VkSampleCountFlagBits MSAASamples
Is a VkSampleCountFlagBits value specifying the number of samples used in rasterization....
Definition KarmaGuiVulkanHandler.h:166
VkQueue Queue
Opaque handle to a queue object. For backend submission of queues via vkQueueSubmit.
Definition KarmaGuiVulkanHandler.h:94
VkDevice Device
A logical device handle. Device is an appropriate instance using which swapchains,...
Definition KarmaGuiVulkanHandler.h:78
const VkAllocationCallbacks * Allocator
A pointer to a valid VkAllocationCallbacks structure. Structure containing callback function pointers...
Definition KarmaGuiVulkanHandler.h:174
uint32_t Subpass
Not sure what the use of this Subpass is. Seems vestigial?
Definition KarmaGuiVulkanHandler.h:128
VkPhysicalDevice PhysicalDevice
The handle to the Vulkan's software representaion of GPU, for use in backend.
Definition KarmaGuiVulkanHandler.h:70
uint32_t ImageCount
The number of elements in the pSwapchainImages array, i.e number of presentable swapchain images avai...
Definition KarmaGuiVulkanHandler.h:144
bool WindowOwned
Probabbly for multiview port which we are not supporting in the Current state.
Definition KarmaGuiVulkanHandler.h:618
KarmaGui_ImplVulkan_ViewportData()
A constructor for allocation and 0 initialization.
Definition KarmaGuiVulkanHandler.h:642
~KarmaGui_ImplVulkan_ViewportData()
A destructor.
Definition KarmaGuiVulkanHandler.h:653
KarmaGui_ImplVulkanH_WindowRenderBuffers RenderBuffers
The rendering relevant buffers to be used by viewport.
Definition KarmaGuiVulkanHandler.h:635
KarmaGui_ImplVulkanH_Window Window
Window data to be used by secondary viewports only.
Definition KarmaGuiVulkanHandler.h:626
Helper structure to hold the data needed by one rendering ImageFrame (different from the FRAME_IN_FLI...
Definition KarmaGuiVulkanHandler.h:264
VkImageView BackbufferView
VulkanContext m_swapChainImageViews equivalent. Again, the number is same.
Definition KarmaGuiVulkanHandler.h:278
VkImage Backbuffer
VulkanContext m_swapChainImages equivalent. The number of images (MinImageCount = m_MinImageCount + 1...
Definition KarmaGuiVulkanHandler.h:271
VkFramebuffer Framebuffer
A handle to framebuffer which represents a collection of specific memory attachments that a render pa...
Definition KarmaGuiVulkanHandler.h:288
Reusable buffers used for rendering 1 current in-flight ImageFrame, for KarmaGui_ImplVulkan_RenderDra...
Definition KarmaGuiVulkanHandler.h:505
VkBuffer VertexBuffer
Vulkan buffer to be bound to KarmaGui_Vulkan_Frame_On_Flight::CommandBuffer for vertexbuffer.
Definition KarmaGuiVulkanHandler.h:549
VkDeviceMemory VertexBufferMemory
Device (KarmaGui_ImplVulkan_InitInfo::Device) memory allocated via vkAllocateMemory for containing ve...
Definition KarmaGuiVulkanHandler.h:516
KarmaGui_ImplVulkanH_ImageFrameRenderBuffers()
A constructor for zelo initialization and relevant assignment.
Definition KarmaGuiVulkanHandler.h:565
VkDeviceMemory IndexBufferMemory
Device (KarmaGui_ImplVulkan_InitInfo::Device) memory allocated via vkAllocateMemory for containing in...
Definition KarmaGuiVulkanHandler.h:528
VkDeviceSize VertexBufferSize
The size in bytes of the vertex buffer.
Definition KarmaGuiVulkanHandler.h:535
VkDeviceSize IndexBufferSize
The size in bytes of the index buffer.
Definition KarmaGuiVulkanHandler.h:542
VkBuffer IndexBuffer
Vulkan buffer to be bound to KarmaGui_Vulkan_Frame_On_Flight::CommandBuffer for indexbuffer.
Definition KarmaGuiVulkanHandler.h:556
Structure to hold references to Vulkan RHI resources.
Definition KarmaGuiVulkanHandler.h:297
FVulkanRenderPass * VulkanRenderPass
Primary renderpass for on-screen presentation.
Definition KarmaGuiVulkanHandler.h:306
FVulkanSwapChain * VulkanSwapChain
Primary swapchain created in KarmaGuiVulkanHandler::FillWindowData.
Definition KarmaGuiVulkanHandler.h:301
KarmaVector< FVulkanRenderTargetsInfo * > RenderTargets
Collection of render targets organized in KarmaVector. Meaning each KarmaVector element contains a co...
Definition KarmaGuiVulkanHandler.h:313
Helper structure to hold the data needed by entire KarmaGui primitive rendering including commandpool...
Definition KarmaGuiVulkanHandler.h:326
KarmaGui_ImplVulkanH_Window()
Constructor for zero clearence and relevant stuff.
Definition KarmaGuiVulkanHandler.h:486
uint32_t SemaphoreIndex
Current set of swapchain wait semaphores and command buffers we're using (0 <= SemaphoreIndex < MAX_F...
Definition KarmaGuiVulkanHandler.h:438
KarmaGui_ImplVulkanH_RHIResources * RHIResources
Vulkan RHI resources containing pointers to FVulkanSwpaChain etc.
Definition KarmaGuiVulkanHandler.h:479
VkRenderPass RenderPass
A render pass object represents a collection of attachments, subpasses, and dependencies between the ...
Definition KarmaGuiVulkanHandler.h:395
uint32_t MAX_FRAMES_IN_FLIGHT
Is representative of (linearly proportional to or indicative of) number of commandbuffer recordings o...
Definition KarmaGuiVulkanHandler.h:445
KarmaGui_Vulkan_Frame_On_Flight * FramesOnFlight
Data (fences, semaphores, and commandbuffers (taken from VulkanRendererAPI::GetCommandBuffers())) for...
Definition KarmaGuiVulkanHandler.h:463
VkSwapchainKHR Swapchain
Vulkan does not have the concept of a "default framebuffer", hence it requires an infrastructure that...
Definition KarmaGuiVulkanHandler.h:350
VkRect2D RenderArea
Most likely the glfw window size, set from VulkanHolder::GetVulkanContext()->GetSwapChainExtent()....
Definition KarmaGuiVulkanHandler.h:472
VkSurfaceFormatKHR SurfaceFormat
Structure describing a supported swapchain format-color space pair. Taken from VulkanContext::CreateS...
Definition KarmaGuiVulkanHandler.h:372
VkCommandPool CommandPool
Command pools manage the memory that is used to store the buffers and command buffers are allocated f...
Definition KarmaGuiVulkanHandler.h:357
int Height
Height dimension of the Window.
Definition KarmaGuiVulkanHandler.h:343
VkPresentModeKHR PresentMode
Presentation mode supported for a surface. Taken from VulkanContext::CreateSwapChain().
Definition KarmaGuiVulkanHandler.h:379
KarmaGui_ImplVulkanH_ImageFrame * ImageFrames
Just a container for rendertarget buffers (framebuffers, images, and imageviews etc) and all those si...
Definition KarmaGuiVulkanHandler.h:454
VkSurfaceKHR Surface
The surface is a cross-platform abstraction over windows to render to and is generally instantiated b...
Definition KarmaGuiVulkanHandler.h:365
int Width
Width dimension of the Window.
Definition KarmaGuiVulkanHandler.h:334
bool ClearEnable
No clue about the usage.
Definition KarmaGuiVulkanHandler.h:410
VkPipeline Pipeline
A huge object in Vulkan that encompasses the configuration of the entire GPU for the draw....
Definition KarmaGuiVulkanHandler.h:403
VkClearValue ClearValue
VkClearValue structures containing clear values for each attachment, if the attachment uses a loadOp ...
Definition KarmaGuiVulkanHandler.h:417
uint32_t TotalImageCount
Total Number of the images supported by swapchain.
Definition KarmaGuiVulkanHandler.h:431
uint32_t ImageFrameIndex
The number count of the image, returned by vkGetSwapchainImagesKHR, usually range derived from min_im...
Definition KarmaGuiVulkanHandler.h:424
A data structure for packaging of rendering buffers allocated for a current in-flight ImageFrame.
Definition KarmaGuiVulkanHandler.h:580
uint32_t Index
Current KarmaGui_ImplVulkanH_Window::SemaphoreIndex.
Definition KarmaGuiVulkanHandler.h:586
KarmaGui_ImplVulkanH_ImageFrameRenderBuffers * FrameRenderBuffers
Reusable buffers used for rendering, to be instantiated.
Definition KarmaGuiVulkanHandler.h:600
uint32_t Count
Basically MAX_FRAMES_IN_FLIGHT, representative of total number of KarmaGui_ImplVulkanH_ImageFrameRend...
Definition KarmaGuiVulkanHandler.h:593
Resources common to screen rendering of 3D scene to 2D texture elements.
Definition KarmaGuiVulkanHandler.h:834
VkSampler Sampler
Sampler for offscreen rendered 2D texture(s).
Definition KarmaGuiVulkanHandler.h:844
bool bAllocationDoneOnce
Flag indicating whether the allocation of offscreen rendering resources has been done at least once.
Definition KarmaGuiVulkanHandler.h:861
FVulkanRenderPass * RenderPass
Render pass for offscreen rendering of 3D scene to 2D texture(s).
Definition KarmaGuiVulkanHandler.h:854
Data structure for synchronous operations (relevant to rendering in this context).
Definition KarmaGuiVulkanHandler.h:207
VkSemaphore ImageAcquiredSemaphore
Handle to semaphore object for next available presentable image (vkAcquireNextImageKHR).
Definition KarmaGuiVulkanHandler.h:231
VkCommandBuffer CommandBuffer
Object used to record commands which can be subsequently submitted to a device queue for execution....
Definition KarmaGuiVulkanHandler.h:251
VkSemaphore RenderCompleteSemaphore
Handle to semaphore to wait for before issuing the present request (vkQueuePresentKHR).
Definition KarmaGuiVulkanHandler.h:244
FVulkanFence * Fence
A handle to fence object.
Definition KarmaGuiVulkanHandler.h:218
A Platform Window (always 1 unless multi-viewport are enabled. One per platform window to output to)....
Definition KarmaGui.h:3015