diff --git a/Flowgraph.puml b/Flowgraph.puml index 760b9ce..b5b8283 100644 --- a/Flowgraph.puml +++ b/Flowgraph.puml @@ -30,7 +30,7 @@ split again split ://**createInstance()**//; <> split -:Debug::checkUnavailableValidationLayers(); +:**Debug**::checkUnavailableValidationLayers(); :**VkApplicationInfo** appInfo{}; ://set appInfo data, Vulkan version,// //Engine version and name, and title//; @@ -39,16 +39,17 @@ split :Debug::vulkanDebugSetup(createInfo, vulkaninstance); end split split again -:Debug::setupDebugMessenger(VkInstance&); +:**Debug**::setupDebugMessenger(VkInstance&); note right: Setup debug messenger, print data to console -:glfwCreateWindowSurface(...); + +partition "**DeviceControl**" { +:createSurface(...); note right This function handles Window System Integration automatically across platforms based on build environment. ==== //Basically, this is an abstraction of the Window across platforms// end note -partition "**DeviceControl**" { :pickPhysicalDevice(...); note right Enumerate through GPU's in the @@ -97,11 +98,6 @@ partition "**Graphics**" { step of the render pipeline and sets the settings we desire for each step! **HEAVILY** documented. end note - :createFramebuffers(...); - note right - This function creates framebuffers for all the images - that are queued to be displayed, very important! - end note :createCommandPool(...); note right Commands in Vulkan are not executed using function calls @@ -109,7 +105,20 @@ partition "**Graphics**" { buffer objects, pools manage the memory used for buffers. end note } -partition "**TextureLibraries**" { + +:**Texture**::createDepthResources(); +note right + This function sets up the image views and sets for the + depth testing buffer to handle objects above or below + other objects! +end note +:**Graphics**::createFramebuffers(...); +note right + This function creates framebuffers for all the images + that are queued to be displayed, very important! +end note + +partition "**Texture**" { :createTextureImage(); note right This function imports the pixels from an image, puts them @@ -132,6 +141,16 @@ partition "**TextureLibraries**" { //Mipmap modes// end note } +partition "**Model**" { + :loadModel(); + note right + Exactly what it sounds like, as of now, call our function + to load .OBJ files with STB. Obviously want to support FBX + in the future but the format is quite complex. + This function simply loads vertices and indices into the + arrays to be parsed! + end note +} partition "**Buffers**" { :createVertexBuffer(); note right diff --git a/Flowgraph.svg b/Flowgraph.svg index 62f28a1..f95ac82 100644 --- a/Flowgraph.svg +++ b/Flowgraph.svg @@ -1 +1 @@ -Main ExecutionMain Executionmain()run()initWindow()glfwInit()Create window and initialize default settingswindow = glfwCreateWindow(...)Set the user-defined pointer of the windowglfwSetWindowUserPointer(...)This is a callback to resizing of the windowwe call and set a bool to true, which we getand rebuild the swap chain when true.glfwSetFramebufferSizeCallback(...)initVulkan()createInstance()Debug::checkUnavailableValidationLayers()VkApplicationInfoappInfo{}set appInfo data, Vulkan version,Engine version and name, and titleVkApplicationCreateInfocreateInfo{}createInfo.pApplicationInfo = &appInfoDebug::vulkanDebugSetup(createInfo, vulkaninstance)Setup debug messenger, print data to consoleDebug::setupDebugMessenger(VkInstance&)This function handles Window System Integrationautomatically across platforms based on build environment.Basically, this is an abstraction of the Window across platformsglfwCreateWindowSurface(...)DeviceControlEnumerate through GPU's in thesystem and choose a compatible one.in the future, this should choose the BEST GPU, not just the first one that is compatible..pickPhysicalDevice(...)Logical devices interface with thephysical device and defines queuescreateLogicalDevice(...)Swap Chains are used to handle buffer ownershipinfrastructure. Being platform agnostic has itscomplications, this is a perfect example.This process is HEAVILY documented.createSwapChain(...)This is a cool function, quite a simpledescription of images that will be shown on thescreen! It also determineshowto access the imagecreateImageViews(...)This is pretty simple, it sets up the image bit depthand the color bit depth! Basically, the format of thedisplayed images, simple, but important!Graphics::createRenderPass(...)This function creates a table of pointers to the storeddata that we want, in this case it would be pointing topre-programmed model view and projection values, anda time variable.Buffers::createDescriptorSetLayout()GraphicsThis is a complex function that goes through everystep of the render pipeline and sets the settings wedesire for each step!HEAVILYdocumented.createGraphicsPipeline(...)This function creates framebuffers for all the imagesthat are queued to be displayed, very important!createFramebuffers(...)Commands in Vulkan are not executed using function callsYou have to record the ops you want to perform to commandbuffer objects, pools manage the memory used for buffers.createCommandPool(...)TextureLibrariesThis function imports the pixels from an image, puts theminto a buffer, and copies them from memory into a texture!A bit complicated because we are moving and freeing lots ofmemory, but quite useful.createTextureImage()This function creates a image view for the texture, justbuilds a struct holding information about the texture, likelayers, mip levels, and etc.createTextureImageView()This function isincrediblyimportant. This builds atexture sampler, information about what to do with thetexture once its created. This defines settings likeUVW mode,Filtering,Anisotropy, andMipmap modescreateTextureSampler()BuffersVertex buffers are incredibly useful, in essence,you can read data from memory as vertex input to thevertex shader rather than hardcoded data!createVertexBuffer()Index buffers are cool, basically, you can storesome vertices that would normally be duplicatedat corners to triangulate. this saves cycles atscale, complex objects rejoice!createIndexBuffer()Map the buffer data to memory (The struct) as a pointerwe can use this as a reference of where to write data towhen the fence lets us write data.(seerecordCommandBuffer()).createUniformBuffer()Here we create a pool to manage the memory and allocatespace for the descriptor sets! Very useful and the samestructure as command buffers & pools.createDescriptorPool()Descriptor setlayoutsspecify the types of resources accessibleby the graphical pipeline. A descriptor set is the actual bufferor resource that gets bound to descriptors and passed in.These differ from Vertex & Index buffers, as they are not uniqueto the graphics pipeline. Specification of compute vs. graphics istherefore necessary. (seecreateDescriptorSets())createDescriptorSetLayout()This is the partner to the commandPool creator,storing the commands we wish to perform whilstwaiting in a queue. These are very efficient.Graphics::createCommandBuffer()This isHEAVILYdocumented, create Semaphoresand Fences, for halting and starting execution, basicallya traffic controller for the GPU.RenderPresent::createSyncObject()glfwPollEvents()RenderPresent::drawFrame()mainLoop()!glfwWindowShouldClose(...)vkDeviceWaitIdle(...)This function initiates a series of shutdowndestroy functions, safely stopping execution;cleanup()return EXIT_SUCCESSMain execution from the run function in the entrypointThis dictates basic flow of the vulkan boilerplate system. \ No newline at end of file +Main ExecutionMain Executionmain()run()initWindow()glfwInit()Create window and initialize default settingswindow = glfwCreateWindow(...)Set the user-defined pointer of the windowglfwSetWindowUserPointer(...)This is a callback to resizing of the windowwe call and set a bool to true, which we getand rebuild the swap chain when true.glfwSetFramebufferSizeCallback(...)initVulkan()createInstance()Debug::checkUnavailableValidationLayers()VkApplicationInfoappInfo{}set appInfo data, Vulkan version,Engine version and name, and titleVkApplicationCreateInfocreateInfo{}createInfo.pApplicationInfo = &appInfoDebug::vulkanDebugSetup(createInfo, vulkaninstance)Setup debug messenger, print data to consoleDebug::setupDebugMessenger(VkInstance&)DeviceControlThis function handles Window System Integrationautomatically across platforms based on build environment.Basically, this is an abstraction of the Window across platformscreateSurface(...)Enumerate through GPU's in thesystem and choose a compatible one.in the future, this should choose the BEST GPU, not just the first one that is compatible..pickPhysicalDevice(...)Logical devices interface with thephysical device and defines queuescreateLogicalDevice(...)Swap Chains are used to handle buffer ownershipinfrastructure. Being platform agnostic has itscomplications, this is a perfect example.This process is HEAVILY documented.createSwapChain(...)This is a cool function, quite a simpledescription of images that will be shown on thescreen! It also determineshowto access the imagecreateImageViews(...)This is pretty simple, it sets up the image bit depthand the color bit depth! Basically, the format of thedisplayed images, simple, but important!Graphics::createRenderPass(...)This function creates a table of pointers to the storeddata that we want, in this case it would be pointing topre-programmed model view and projection values, anda time variable.Buffers::createDescriptorSetLayout()GraphicsThis is a complex function that goes through everystep of the render pipeline and sets the settings wedesire for each step!HEAVILYdocumented.createGraphicsPipeline(...)Commands in Vulkan are not executed using function callsYou have to record the ops you want to perform to commandbuffer objects, pools manage the memory used for buffers.createCommandPool(...)This function sets up the image views and sets for thedepth testing buffer to handle objects above or belowother objects!Texture::createDepthResources()This function creates framebuffers for all the imagesthat are queued to be displayed, very important!Graphics::createFramebuffers(...)TextureThis function imports the pixels from an image, puts theminto a buffer, and copies them from memory into a texture!A bit complicated because we are moving and freeing lots ofmemory, but quite useful.createTextureImage()This function creates a image view for the texture, justbuilds a struct holding information about the texture, likelayers, mip levels, and etc.createTextureImageView()This function isincrediblyimportant. This builds atexture sampler, information about what to do with thetexture once its created. This defines settings likeUVW mode,Filtering,Anisotropy, andMipmap modescreateTextureSampler()ModelExactly what it sounds like, as of now, call our functionto load .OBJ files with STB. Obviously want to support FBXin the future but the format is quite complex.This function simply loads vertices and indices into thearrays to be parsed!loadModel()BuffersVertex buffers are incredibly useful, in essence,you can read data from memory as vertex input to thevertex shader rather than hardcoded data!createVertexBuffer()Index buffers are cool, basically, you can storesome vertices that would normally be duplicatedat corners to triangulate. this saves cycles atscale, complex objects rejoice!createIndexBuffer()Map the buffer data to memory (The struct) as a pointerwe can use this as a reference of where to write data towhen the fence lets us write data.(seerecordCommandBuffer()).createUniformBuffer()Here we create a pool to manage the memory and allocatespace for the descriptor sets! Very useful and the samestructure as command buffers & pools.createDescriptorPool()Descriptor setlayoutsspecify the types of resources accessibleby the graphical pipeline. A descriptor set is the actual bufferor resource that gets bound to descriptors and passed in.These differ from Vertex & Index buffers, as they are not uniqueto the graphics pipeline. Specification of compute vs. graphics istherefore necessary. (seecreateDescriptorSets())createDescriptorSetLayout()This is the partner to the commandPool creator,storing the commands we wish to perform whilstwaiting in a queue. These are very efficient.Graphics::createCommandBuffer()This isHEAVILYdocumented, create Semaphoresand Fences, for halting and starting execution, basicallya traffic controller for the GPU.RenderPresent::createSyncObject()glfwPollEvents()RenderPresent::drawFrame()mainLoop()!glfwWindowShouldClose(...)vkDeviceWaitIdle(...)This function initiates a series of shutdowndestroy functions, safely stopping execution;cleanup()return EXIT_SUCCESSMain execution from the run function in the entrypointThis dictates basic flow of the vulkan boilerplate system. \ No newline at end of file