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.
17
18#pragma once
19
20#include "krpch.h"
21
22#include "KarmaGui.h"
23#include "KarmaGuiInternal.h"
25#include <vulkan/vulkan.h>
26
27namespace Karma
28{
29
36 #define KR_MEMALIGN(_OFF,_ALIGN) (((_OFF) + ((_ALIGN) - 1)) & ~((_ALIGN) - 1))
37
43 #define KR_MAX(A, B) (((A) >= (B)) ? (A) : (B))
44
53 {
59 VkInstance Instance;
60
66 VkPhysicalDevice PhysicalDevice;
67
74 VkDevice Device;
75
83 uint32_t QueueFamily;
84
90 VkQueue Queue;
91
97 VkDescriptorPool DescriptorPool;
98
104 VkRenderPass RenderPass; // Very experimental here
105
106 // begin Optional
112 VkPipelineCache PipelineCache;
113
119 uint32_t Subpass;
120 // end Optional
121
129
136 uint32_t ImageCount;
137
144 VkSampleCountFlagBits MSAASamples;
145
152 const VkAllocationCallbacks* Allocator;
153 };
154
155 //-------------------------------------------------------------------------
156 // Internal / Miscellaneous Vulkan Helpers
157 // (Used by example's main.cpp. Used by multi-viewport features. PROBABLY NOT used by your own engine/app.)
158 //-------------------------------------------------------------------------
159 // You probably do NOT need to use or care about those functions.
160 // Those functions only exist because:
161 // 1) they facilitate the readability and maintenance of the multiple main.cpp examples files.
162 // 2) the multi-viewport / platform window implementation needs them internally.
163 // Generally we avoid exposing any kind of superfluous high-level helpers in the bindings,
164 // but it is too much code to duplicate everywhere so we exceptionally expose them.
165 //
166 // Your engine/app(lication) will likely _already_ have code to setup all that stuff (swap chain, render pass, frame buffers, etc.).
167 // You may read this code to learn about Vulkan, but it is recommended you use you own custom tailored code to do equivalent work.
168 // (The ImGui_ImplVulkanH_XXX functions do not interact with any of the state used by the regular ImGui_ImplVulkan_XXX functions)
169 //-------------------------------------------------------------------------
170
171 // Cowboy's confusion clarification concept!
172 // It seems the ImGUI author(s) have mixed and/or confused notion of
173 // ImageCount, which decides the number of SwapChainImages, framebuffer, and so on (contained within
174 // ImGui_ImplVulkanH_ImageFrame structure).
175 // (https://vulkan-tutorial.com/Drawing_a_triangle/Presentation/Swap_chain#page_Retrieving-the-swap-chain-images)
176 // and SemaphoreIndex MAX_FRAMES_IN_FLIGHT, which is representative of (linearly proportional to or indicative of) number of commandbuffer recordings on CPU that may happen whilst the rendering is being done on GPU. That should determine the semaphore, fence, and commandbuffer size.
177 // https://vulkan-tutorial.com/Drawing_a_triangle/Drawing/Frames_in_flight
178 // The argument is elicited by the comment line https://github.com/ravimohan1991/imgui/blob/e4967701b67edd491e884632f239ab1f38867d86/backends/imgui_impl_vulkan.h#L144
179
194 {
205 VkFence Fence;
206
219
232
238 VkCommandBuffer CommandBuffer;
239 };
240
251 {
258 VkImage Backbuffer;
259
265 VkImageView BackbufferView;
266
272 VkFramebuffer Framebuffer;
273 };
274
281 {
289 int Width;
290
299
305 VkSwapchainKHR Swapchain;
306
312 VkCommandPool CommandPool;
313
320 VkSurfaceKHR Surface;
321
327 VkSurfaceFormatKHR SurfaceFormat;
328
334 VkPresentModeKHR PresentMode;
335
341 VkRenderPass RenderPass;
342
349 VkPipeline Pipeline;
350
357
363 VkClearValue ClearValue;
364
371
378
385
392
399
400 // Cowboy's Modification
401
408
416 VkRect2D RenderArea;
417
424 {
425 memset((void*)this, 0, sizeof(*this));
426 PresentMode = (VkPresentModeKHR)~0; // Ensure we get an error if user doesn't set this.
427 ClearEnable = true;
428 }
429 };
430
438 {
449 VkDeviceMemory VertexBufferMemory;
450
461 VkDeviceMemory IndexBufferMemory;
462
468 VkDeviceSize VertexBufferSize;
469
475 VkDeviceSize IndexBufferSize;
476
482 VkBuffer VertexBuffer;
483
489 VkBuffer IndexBuffer;
490
491 public:
492
504 };
505
535
589
598 {
605 std::string TextureLable;
606
612 uint32_t width;
613
619 uint32_t height;
620
627 uint32_t channels;
628
639 size_t size;
640
646 VkSampler TextureSampler;
647
653 VkDeviceMemory TextureMemory;
654
661
667 VkImageView TextureView;
668
674 VkDescriptorSet TextureDescriptorSet;
675
681 VkDeviceMemory UploadBufferMemory;
682
688 VkBuffer UploadBuffer;
689
696 {
697 TextureLable = "NO LABLE YET";
698 }
699 };
700
712 {
719
727 VkRenderPass RenderPass;
728
736
742 VkPipelineCreateFlags PipelineCreateFlags;
743
753 VkDescriptorSetLayout DescriptorSetLayout;
754
761 VkPipelineLayout PipelineLayout;
762
768 VkPipeline Pipeline;
769
775 uint32_t Subpass;
776
782 VkShaderModule ShaderModuleVert;
783
789 VkShaderModule ShaderModuleFrag;
790
791 // Font data
797 VkSampler FontSampler;
798
804 VkDeviceMemory FontMemory;
805
819 VkImage FontImage;
820
826 VkImageView FontView;
827
833 VkDescriptorSet FontDescriptorSet;
834
840 VkDeviceMemory UploadBufferMemory;
841
847 VkBuffer UploadBuffer;
848
849 // Image data
855 std::vector<KarmaGui_ImplVulkan_Image_TextureData*> vulkanMesaDecalDataList;
856
857 // Render buffers for main window
858 //KarmaGui_ImplVulkanH_WindowRenderBuffers MainWindowRenderBuffers;
859
860 // heh, not working with initializers in MSVC. Need a blog post!
861
862 /*
863 ImGui_ImplVulkan_Data()
864 {
865 memset((void*)this, 0, sizeof(*this));
866 BufferMemoryAlignment = 256;
867 }*/
868 };
869
874 {
875 public:
876 /*
877 inline static KarmaGui_ImplVulkan_Data* KarmaGui_ImplVulkan_GetBackendData()
878 {
879 return KarmaGui::GetCurrentContext() ? (KarmaGui_ImplVulkan_Data*)KarmaGui::GetIO().BackendRendererUserData : nullptr;
880 }*/
881 // GetIO should fetche the configuration settings and whatnot, which in this case is the struct KarmaGui_ImplVulkan_Data
882
894 static uint32_t KarmaGui_ImplVulkan_MemoryType(VkMemoryPropertyFlags properties, uint32_t type_bits);
895
908 static void CreateOrResizeBuffer(VkBuffer& buffer, VkDeviceMemory& bufferMemory, VkDeviceSize& pBufferSize, size_t newSize, VkBufferUsageFlagBits usage);
909
924 static void KarmaGui_ImplVulkan_SetupRenderState(KGDrawData* drawData, VkPipeline pipeline, VkCommandBuffer commandBuffer, KarmaGui_ImplVulkanH_ImageFrameRenderBuffers* remderingBufferData, int width, int height);
925
926 // Experimental
941 static void KarmaGui_ImplVulkan_SetupRenderStateFor3DRendering(Scene* sceneToDraw, VkCommandBuffer commandBuffer, KGDrawData* drawData);
942
951 static void KarmaGui_ImplVulkan_CreateShaderModules(VkDevice device, const VkAllocationCallbacks* allocator);
952
961 static void KarmaGui_ImplVulkan_CreateFontSampler(VkDevice device, const VkAllocationCallbacks* allocator);
962
971 static void KarmaGui_ImplVulkan_CreateDescriptorSetLayout(VkDevice device, const VkAllocationCallbacks* allocator);
972
981 static void KarmaGui_ImplVulkan_CreatePipelineLayout(VkDevice device, const VkAllocationCallbacks* allocator);
982
996 static void KarmaGui_ImplVulkan_CreatePipeline(VkDevice device, const VkAllocationCallbacks* allocator, VkPipelineCache pipelineCache, VkRenderPass renderPass, VkSampleCountFlagBits MSAASamples, VkPipeline* pipeline, uint32_t subpass);
997
1005
1006 // Overload for destroying KarmaGui window
1014
1024
1034 static void KarmaGui_ImplVulkan_SetWindowSize(KarmaGuiViewport* viewport, KGVec2 size);
1035
1045
1073 static void KarmaGui_ImplVulkan_RenderDrawData(KGDrawData* drawData, VkCommandBuffer commandBuffer, VkPipeline pipeline, uint32_t imageFrameIndex);
1074
1092 static void KarmaGui_ImplVulkan_SwapBuffers(KarmaGuiViewport* viewport, void*);
1093
1109 static void ShareVulkanContextResourcesOfMainWindow(KarmaGui_ImplVulkanH_Window* windowData, bool bCreateSyncronicity = false);
1110
1123 static void ClearVulkanWindowData(KarmaGui_ImplVulkanH_Window* vulkanWindowData, bool bDestroySyncronicity = false);
1124
1133
1140 static void DestroyFramesOnFlightData(KarmaGui_Vulkan_Frame_On_Flight* frameSyncronicityData);
1141
1151 static void KarmaGui_ImplVulkan_CreateOrResizeWindow(KarmaGui_ImplVulkanH_Window* windowData, bool bCreateSyncronicity, bool bRecreateSwapChainAndCommandBuffers);
1152
1160 static void KarmaGui_ImplVulkan_DestroyAllViewportsRenderBuffers(VkDevice device, const VkAllocationCallbacks* allocator);
1161
1171 static void KarmaGui_ImplVulkan_ShivaWindowRenderBuffers(VkDevice device, KarmaGui_ImplVulkanH_WindowRenderBuffers* buffers, const VkAllocationCallbacks* allocator);
1172
1184 static void KarmaGui_ImplVulkan_ShivaFrameRenderBuffers(VkDevice device, KarmaGui_ImplVulkanH_ImageFrameRenderBuffers* buffers, const VkAllocationCallbacks* allocator);
1185
1192 static bool KarmaGui_ImplVulkan_CreateFontsTexture(VkCommandBuffer commandBuffer);
1193
1202 static bool KarmaGui_ImplVulkan_CreateTexture(VkCommandBuffer commandBuffer, char const* fileName, const std::string& lable = "");
1203
1215
1225
1243
1253 static void KarmaGui_ImplVulkan_Shutdown();
1254
1261 static void KarmaGui_ImplVulkan_NewFrame();
1262
1263 // Register a texture (VkDescriptorSet == ImTextureID)
1264 // 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.
1273 static VkDescriptorSet KarmaGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView imageView, VkImageLayout imageLayout);
1274
1282
1290 };
1291}
#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 class Scene.
A class for required Vulkan routines for KarmaGui Vulkan backend.
Definition KarmaGuiVulkanHandler.h:874
static void KarmaGui_ImplVulkan_SwapBuffers(KarmaGuiViewport *viewport, void *)
Called in KarmaGui_ImplVulkan_InitPlatformInterface for setting the field KarmaGuiPlatformIO::Rendere...
Definition KarmaGuiVulkanHandler.cpp:1700
static void KarmaGui_ImplVulkan_SetupRenderStateFor3DRendering(Scene *sceneToDraw, VkCommandBuffer commandBuffer, KGDrawData *drawData)
A routine to bind index/vertex buffers, setup a external viewport, and bind pipeline....
Definition KarmaGuiVulkanHandler.cpp:158
static void KarmaGui_ImplVulkan_CreateDescriptorSetLayout(VkDevice device, const VkAllocationCallbacks *allocator)
Creates KarmaGui_ImplVulkan_Data.DescriptorSetLayout if not already in KarmaGuiVulkanHandler::KarmaGu...
Definition KarmaGuiVulkanHandler.cpp:821
static void KarmaGui_ImplVulkan_DestroyDeviceObjects()
The following objects are destroyed.
Definition KarmaGuiVulkanHandler.cpp:1057
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:92
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:1426
static bool KarmaGui_ImplVulkan_CreateTexture(VkCommandBuffer commandBuffer, char const *fileName, const std::string &lable="")
Routine to create Image vulkan texture.
Definition KarmaGuiVulkanHandler.cpp:455
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:1153
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:239
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:1600
static void KarmaGui_ImplVulkan_ShivaFrameRenderBuffers(VkDevice device, KarmaGui_ImplVulkanH_ImageFrameRenderBuffers *buffers, const VkAllocationCallbacks *allocator)
Destroys and clears the following buffers.
Definition KarmaGuiVulkanHandler.cpp:1182
static void KarmaGui_ImplVulkan_DestroyWindow(KarmaGuiViewport *viewport)
Destroys the KarmaGui window relevant data (KarmaGui_ImplVulkan_ViewportData) and buffers....
Definition KarmaGuiVulkanHandler.cpp:1583
static void KarmaGui_ImplVulkan_Shutdown()
Called in the KarmaGuiRenderer::GracefulVulkanShutDown(). Basically does the following.
Definition KarmaGuiVulkanHandler.cpp:1257
static void KarmaGui_ImplVulkan_NewFrame()
No clue what this does. Legacy?
Definition KarmaGuiVulkanHandler.cpp:1284
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:113
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:1295
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:1481
static bool KarmaGui_ImplVulkan_CreateDeviceObjects()
Generates or creates the following objects.
Definition KarmaGuiVulkanHandler.cpp:978
static void DestroyWindowDataFrame(KarmaGui_ImplVulkanH_ImageFrame *frame)
Clears KarmaGui_ImplVulkanH_ImageFrame::BackBuffer and KarmaGui_ImplVulkanH_ImageFrame::Framebuffer a...
Definition KarmaGuiVulkanHandler.cpp:1470
static bool KarmaGui_ImplVulkan_CreateFontsTexture(VkCommandBuffer commandBuffer)
Creates fonts' texture for KarmaGui.
Definition KarmaGuiVulkanHandler.cpp:617
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:796
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:1554
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:845
static void KarmaGui_ImplVulkan_DestroyFontUploadObjects()
Function to destroy the fonts (created by KarmaGuiVulkanHandler::KarmaGui_ImplVulkan_CreateFontsTextu...
Definition KarmaGuiVulkanHandler.cpp:1041
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:770
static void ShareVulkanContextResourcesOfMainWindow(KarmaGui_ImplVulkanH_Window *windowData, bool bCreateSyncronicity=false)
The purpose of the routine is two-fold.
Definition KarmaGuiVulkanHandler.cpp:1330
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:190
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:871
static void KarmaGui_ImplVulkan_InitPlatformInterface()
Called in KarmaGuiRenderer::KarmaGui_ImplVulkan_Init, during the initialization of Vulkan backend for...
Definition KarmaGuiVulkanHandler.cpp:1736
static void KarmaGui_ImplVulkan_CreateOrResizeWindow(KarmaGui_ImplVulkanH_Window *windowData, bool bCreateSyncronicity, bool bRecreateSwapChainAndCommandBuffers)
KarmaGui_ImplVulkan_CreateOrResizeWindow.
Definition KarmaGuiVulkanHandler.cpp:1505
static void KarmaGui_ImplVulkan_ShutdownPlatformInterface()
Calls KarmaGui::DestroyPlatformWindows, which further calls KarmaGuiInternal::DestroyPlatformWindow o...
Definition KarmaGuiVulkanHandler.cpp:1750
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:1168
Class for organizing and containing Scene relevant data.
Definition Scene.h:23
Definition KarmaGui.h:2697
Definition KarmaGui.h:156
Backend data containing stuff for Vulkan renderer for KarmaGui.
Definition KarmaGuiVulkanHandler.h:712
KarmaGui_ImplVulkan_InitInfo VulkanInitInfo
KarmaGui's initialization data.
Definition KarmaGuiVulkanHandler.h:718
uint32_t Subpass
Not sure what the use of this Subpass is. Seems vestigial?
Definition KarmaGuiVulkanHandler.h:775
VkPipelineLayout PipelineLayout
Opaque handle to a pipeline layout object. Access to descriptor sets from a pipeline is accomplished ...
Definition KarmaGuiVulkanHandler.h:761
VkSampler FontSampler
Opaque handle to a sampler object. The object represents the state of an image sampler which is used ...
Definition KarmaGuiVulkanHandler.h:797
VkImage FontImage
A 2D font image object with following properties.
Definition KarmaGuiVulkanHandler.h:819
VkDeviceMemory FontMemory
The memory resource allocated for the fonts to be displayed by the backend.
Definition KarmaGuiVulkanHandler.h:804
VkPipelineCreateFlags PipelineCreateFlags
Flags to be set for Vulkan's graphics pipeline.
Definition KarmaGuiVulkanHandler.h:742
VkDeviceMemory UploadBufferMemory
Device allocated memory for font image pixels' buffer.
Definition KarmaGuiVulkanHandler.h:840
VkImageView FontView
The image view, for 2D font, representing contiguous ranges of the image subresources and containing ...
Definition KarmaGuiVulkanHandler.h:826
VkBuffer UploadBuffer
Vulkan buffer containing font texture pixels.
Definition KarmaGuiVulkanHandler.h:847
VkDescriptorSetLayout DescriptorSetLayout
A handle to the descriptorsetlayout created by backend in KarmaGuiVulkanHandler::KarmaGui_ImplVulkan_...
Definition KarmaGuiVulkanHandler.h:753
VkShaderModule ShaderModuleVert
Opaque handle to a vertex shader module object for backend. Shader modules contain shader code and on...
Definition KarmaGuiVulkanHandler.h:782
VkPipeline Pipeline
A huge object in Vulkan that encompasses the configuration of the entire GPU for the draw....
Definition KarmaGuiVulkanHandler.h:768
VkDescriptorSet FontDescriptorSet
Container for uploading image texture relevant data, TextureView for instance, from CPU to GPU.
Definition KarmaGuiVulkanHandler.h:833
VkShaderModule ShaderModuleFrag
Opaque handle to fragment shader module object for backend. Shader modules contain shader code and on...
Definition KarmaGuiVulkanHandler.h:789
std::vector< KarmaGui_ImplVulkan_Image_TextureData * > vulkanMesaDecalDataList
List of vulkan images' textures, for instance icons and stuff.
Definition KarmaGuiVulkanHandler.h:855
VkRenderPass RenderPass
A render pass object represents a collection of attachments, subpasses, and dependencies between the ...
Definition KarmaGuiVulkanHandler.h:727
VkDeviceSize BufferMemoryAlignment
The value for default alignment for index and vertex buffers. The value is set to 256 by DearImgui au...
Definition KarmaGuiVulkanHandler.h:735
VkSampler TextureSampler
This is a sampler handle, and is used in descriptor updates for types VK_DESCRIPTOR_TYPE_SAMPLER and ...
Definition KarmaGuiVulkanHandler.h:646
KarmaGui_ImplVulkan_Image_TextureData()
A constructor.
Definition KarmaGuiVulkanHandler.h:695
VkImage TextureImage
The actual vulkan's image object.
Definition KarmaGuiVulkanHandler.h:660
size_t size
The size, in bytes, of the image texture.
Definition KarmaGuiVulkanHandler.h:639
VkDeviceMemory TextureMemory
A VkDeviceMemory object describing the device memory, relevant to the image, to attach.
Definition KarmaGuiVulkanHandler.h:653
VkDeviceMemory UploadBufferMemory
Device allocated memory for image pixels' buffer.
Definition KarmaGuiVulkanHandler.h:681
VkDescriptorSet TextureDescriptorSet
Container for uploading image texture relevant data, TextureView for instance, from CPU to GPU.
Definition KarmaGuiVulkanHandler.h:674
VkImageView TextureView
The image view representing contiguous ranges of the image subresources and containing additional met...
Definition KarmaGuiVulkanHandler.h:667
uint32_t width
2D width of the texture.
Definition KarmaGuiVulkanHandler.h:612
uint32_t channels
The number of image components in image texture.
Definition KarmaGuiVulkanHandler.h:627
VkBuffer UploadBuffer
Vulkan buffer containing texture pixels.
Definition KarmaGuiVulkanHandler.h:688
std::string TextureLable
The name of the image texture for Mesa.
Definition KarmaGuiVulkanHandler.h:605
uint32_t height
2D height of the texture.
Definition KarmaGuiVulkanHandler.h:619
A data structure for Vulkan's initialization done in KarmaGuiRenderer::KarmaGui_ImplVulkan_Init()
Definition KarmaGuiVulkanHandler.h:53
VkPipelineCache PipelineCache
Usually this cache is set to VK_NULL_HANDLE, indicating that pipeline caching is disabled; or the han...
Definition KarmaGuiVulkanHandler.h:112
VkInstance Instance
The handle to Vulkan's instance object, for use in backend.
Definition KarmaGuiVulkanHandler.h:59
uint32_t QueueFamily
Graphics queue family (valued in unsigned integer) properties used for creating commandpool,...
Definition KarmaGuiVulkanHandler.h:83
VkDescriptorPool DescriptorPool
A fresh descriptor pool created in KarmaGuiRenderer::CreateDescriptorPool() (seperate from VulkanVert...
Definition KarmaGuiVulkanHandler.h:97
VkRenderPass RenderPass
A handle to render pass object which represents a collection of attachments (depth attachment or colo...
Definition KarmaGuiVulkanHandler.h:104
uint32_t MinImageCount
The minimum number of images the specified device supports for a swapchain created for the surface,...
Definition KarmaGuiVulkanHandler.h:128
VkSampleCountFlagBits MSAASamples
Is a VkSampleCountFlagBits value specifying the number of samples used in rasterization....
Definition KarmaGuiVulkanHandler.h:144
VkQueue Queue
Opaque handle to a queue object. For backend submission of queues via vkQueueSubmit.
Definition KarmaGuiVulkanHandler.h:90
VkDevice Device
A logical device handle. Device is an appropriate instance using which swapchains,...
Definition KarmaGuiVulkanHandler.h:74
const VkAllocationCallbacks * Allocator
A pointer to a valid VkAllocationCallbacks structure. Structure containing callback function pointers...
Definition KarmaGuiVulkanHandler.h:152
uint32_t Subpass
Not sure what the sue of this Subpass is. Seems vestigial?
Definition KarmaGuiVulkanHandler.h:119
VkPhysicalDevice PhysicalDevice
The handle to the Vulkan's software representaion of GPU, for use in backend.
Definition KarmaGuiVulkanHandler.h:66
uint32_t ImageCount
The number of elements in the pSwapchainImages array, i.e number of presentable swapchain images avai...
Definition KarmaGuiVulkanHandler.h:136
bool WindowOwned
Probabbly for multiview port which we are not supporting in the Current state.
Definition KarmaGuiVulkanHandler.h:551
KarmaGui_ImplVulkan_ViewportData()
A constructor for allocation and 0 initialization.
Definition KarmaGuiVulkanHandler.h:576
~KarmaGui_ImplVulkan_ViewportData()
A destructor.
Definition KarmaGuiVulkanHandler.h:587
KarmaGui_ImplVulkanH_WindowRenderBuffers RenderBuffers
The rendering relevant buffers to be used by viewport.
Definition KarmaGuiVulkanHandler.h:568
KarmaGui_ImplVulkanH_Window Window
Window data to be used by secondary viewports only.
Definition KarmaGuiVulkanHandler.h:559
Helper structure to hold the data needed by one rendering ImageFrame (different from the FRAME_IN_FLI...
Definition KarmaGuiVulkanHandler.h:251
VkImageView BackbufferView
VulkanContext m_swapChainImageViews equivalent. Again, the number is same.
Definition KarmaGuiVulkanHandler.h:265
VkImage Backbuffer
VulkanContext m_swapChainImages equivalent. The number of images (MinImageCount = m_MinImageCount + 1...
Definition KarmaGuiVulkanHandler.h:258
VkFramebuffer Framebuffer
A handle to framebuffer which represents a collection of specific memory attachments that a render pa...
Definition KarmaGuiVulkanHandler.h:272
Reusable buffers used for rendering 1 current in-flight ImageFrame, for KarmaGui_ImplVulkan_RenderDra...
Definition KarmaGuiVulkanHandler.h:438
VkBuffer VertexBuffer
Vulkan buffer to be bound to KarmaGui_Vulkan_Frame_On_Flight::CommandBuffer for vertexbuffer.
Definition KarmaGuiVulkanHandler.h:482
VkDeviceMemory VertexBufferMemory
Device (KarmaGui_ImplVulkan_InitInfo::Device) memory allocated via vkAllocateMemory for containing ve...
Definition KarmaGuiVulkanHandler.h:449
KarmaGui_ImplVulkanH_ImageFrameRenderBuffers()
A constructor for zelo initialization and relevant assignment.
Definition KarmaGuiVulkanHandler.h:498
VkDeviceMemory IndexBufferMemory
Device (KarmaGui_ImplVulkan_InitInfo::Device) memory allocated via vkAllocateMemory for containing in...
Definition KarmaGuiVulkanHandler.h:461
VkDeviceSize VertexBufferSize
The size in bytes of the vertex buffer.
Definition KarmaGuiVulkanHandler.h:468
VkDeviceSize IndexBufferSize
The size in bytes of the index buffer.
Definition KarmaGuiVulkanHandler.h:475
VkBuffer IndexBuffer
Vulkan buffer to be bound to KarmaGui_Vulkan_Frame_On_Flight::CommandBuffer for indexbuffer.
Definition KarmaGuiVulkanHandler.h:489
Helper structure to hold the data needed by one rendering context (Vulkan) of one OS window (Windows,...
Definition KarmaGuiVulkanHandler.h:281
KarmaGui_ImplVulkanH_Window()
Constructor for zero clearence and relevant stuff.
Definition KarmaGuiVulkanHandler.h:423
uint32_t SemaphoreIndex
Current set of swapchain wait semaphores and command buffers we're using (0 <= SemaphoreIndex < MAX_F...
Definition KarmaGuiVulkanHandler.h:384
VkRenderPass RenderPass
A render pass object represents a collection of attachments, subpasses, and dependencies between the ...
Definition KarmaGuiVulkanHandler.h:341
uint32_t MAX_FRAMES_IN_FLIGHT
Is representative of (linearly proportional to or indicative of) number of commandbuffer recordings o...
Definition KarmaGuiVulkanHandler.h:391
KarmaGui_Vulkan_Frame_On_Flight * FramesOnFlight
Data for synchronous operations of in-flight rendering frames.
Definition KarmaGuiVulkanHandler.h:407
VkSwapchainKHR Swapchain
Vulkan does not have the concept of a "default framebuffer", hence it requires an infrastructure that...
Definition KarmaGuiVulkanHandler.h:305
VkRect2D RenderArea
Most likely the glfw window size, set from VulkanHolder::GetVulkanContext()->GetSwapChainExtent()....
Definition KarmaGuiVulkanHandler.h:416
VkSurfaceFormatKHR SurfaceFormat
Structure describing a supported swapchain format-color space pair. Taken from VulkanContext::CreateS...
Definition KarmaGuiVulkanHandler.h:327
VkCommandPool CommandPool
Command pools manage the memory that is used to store the buffers and command buffers are allocated f...
Definition KarmaGuiVulkanHandler.h:312
int Height
Height dimension of the Window.
Definition KarmaGuiVulkanHandler.h:298
VkPresentModeKHR PresentMode
Presentation mode supported for a surface. Taken from VulkanContext::CreateSwapChain().
Definition KarmaGuiVulkanHandler.h:334
KarmaGui_ImplVulkanH_ImageFrame * ImageFrames
Just a container for buffers and all those sizes depending on VulkanHolder::GetVulkanContext()->GetSw...
Definition KarmaGuiVulkanHandler.h:398
VkSurfaceKHR Surface
The surface is a cross-platform abstraction over windows to render to and is generally instantiated b...
Definition KarmaGuiVulkanHandler.h:320
int Width
Width dimension of the Window.
Definition KarmaGuiVulkanHandler.h:289
bool ClearEnable
No clue about the usage.
Definition KarmaGuiVulkanHandler.h:356
VkPipeline Pipeline
A huge object in Vulkan that encompasses the configuration of the entire GPU for the draw....
Definition KarmaGuiVulkanHandler.h:349
VkClearValue ClearValue
VkClearValue structures containing clear values for each attachment, if the attachment uses a loadOp ...
Definition KarmaGuiVulkanHandler.h:363
uint32_t TotalImageCount
Total Number of the images supported by swapchain.
Definition KarmaGuiVulkanHandler.h:377
uint32_t ImageFrameIndex
The number count of the image, returned by vkGetSwapchainImagesKHR, usually range derived from min_im...
Definition KarmaGuiVulkanHandler.h:370
A data structure for packaging of rendering buffers allocated for a current in-flight ImageFrame.
Definition KarmaGuiVulkanHandler.h:513
uint32_t Index
Current KarmaGui_ImplVulkanH_Window::SemaphoreIndex.
Definition KarmaGuiVulkanHandler.h:519
KarmaGui_ImplVulkanH_ImageFrameRenderBuffers * FrameRenderBuffers
Reusable buffers used for rendering, to be instantiated.
Definition KarmaGuiVulkanHandler.h:533
uint32_t Count
Basically MAX_FRAMES_IN_FLIGHT, representative of total number of KarmaGui_ImplVulkanH_ImageFrameRend...
Definition KarmaGuiVulkanHandler.h:526
Data structure for synchronous operations (relevant to rendering in this context).
Definition KarmaGuiVulkanHandler.h:194
VkSemaphore ImageAcquiredSemaphore
Handle to semaphore object for next available presentable image (vkAcquireNextImageKHR).
Definition KarmaGuiVulkanHandler.h:218
VkFence Fence
A handle to fence object.
Definition KarmaGuiVulkanHandler.h:205
VkCommandBuffer CommandBuffer
Object used to record commands which can be subsequently submitted to a device queue for execution.
Definition KarmaGuiVulkanHandler.h:238
VkSemaphore RenderCompleteSemaphore
Handle to semaphore to wait for before issuing the present request (vkQueuePresentKHR).
Definition KarmaGuiVulkanHandler.h:231
A Platform Window (always 1 unless multi-viewport are enabled. One per platform window to output to)....
Definition KarmaGui.h:3005