Please enable JavaScript.
Coggle requires JavaScript to display documents.
YTE Graphics Engine (Vulkan (VkUtilities (QueueFamilyIndices
Static…
YTE Graphics Engine
Vulkan
VkFuncionLoader
Loads all Vulkan information, DO NOT EVER LOAD ANY VULKAN HEADERS DIRECTLY, only load this file
VkInstantiatedModel
Derives from InstantiatedModel
shared_ptr<vkhlf::Buffer> UBOPerModel
shared_ptr<vkhlf::PipelineLayout> PipelineLayout
shared_ptr<vkhlf::DescriptorSet> DescriptorSet
VkInternals
- shared_ptr<Surface> InitializeVulkan(Engine*)
- starts up vulkan and returns the first initialized surface to the first window of the engine
- DeinitializeVulkan()
- stops the main parts of vulkan
- shared_ptr<vkhlf::Instance> GetInstance()
- returns the instance of vulkan we are using
- shared_ptr<vkhlf::PhysicalDevice> GetPhysicalDevice()
- returns the currently selected physical device
- QueryFamilyIndices GetQueryFamilyIndices()
- returns the family indices for the physical device
- SelectDevice(shared_ptr<vkhlf::Surface>)
- selects what physical device to use
- FindDeviceOfType(vk::PhysicalDeviceType)
- Finds the device of a specific type (descrete, virtual, ...)
- PrintDeviceProperties(shared_ptr<vkhlf::PhysicalDevice>)
- prints information from the device
shared_ptr<vkhlf::Instance> Instance
shared_ptr<vkhlf::DebugReportCallback> DebugReportCallback
shared_ptr<vkhlf::PhysicalDevice> MainDevice
vector<shared_ptr<vkhlf::PhysicalDevice>> PhysicalDevices
QueueFamilyIndices queueFamilyIndices
VkMesh
Derives from Mesh
- Ctor(Window, string file, createInfo = null)
- Creates the underlying mesh class, then loads that data into the VkSubmeshes in this class
- LoadToVulkan(GraphicsDataUpdateVk* event)
- EventFunction, loops through all the VkSubmeshes and calls their LoadToVulkan function
vector<shared_ptr<VkSubmesh>> Submeshes
VkSubmesh
Defined in VkMesh Header
- ctor takes all the data from the generic Submesh, constructs the vulkan data needed for the UBO, Vertex, and Index Buffers, then tells the renderer to load the shader it needs, and any textures too
- LoadToVulkan(GraphicsDataUpdateVk* Event)
shared_ptr<vkhlf::Buffer> VertexBuffer
shared_ptr<vkhlf::Buffer> IndexBuffer
shared_ptr<vkhlf::Buffer> UBOMaterial
shared_ptr<VkTexture> DiffuseTexture
shared_ptr<VkTexture> SpecularTexture
shared_ptr<VkTexture> NormalTexture
shared_ptr<VkShader> Shader
u64 IndexCount
VkRendererdSurface
Derives from EventHandler
- Ctor(Window, VkRenderer, shared_ptr<vkhlf::Surface>, shared_ptr<vkhlf::Instance>)
- UpdateSurfaceViewBuffer(UBOView)
- Updates the view and projection matrix for this surface
- PrintSurfaceFormats(vector<vk::SurfaceFormatKHR>)
- Prints information about the surface
- FrameUpdate(LogicUpdate*)
- PresentFrame()
- Presents the surface to the screen
- GraphicsDataUpdate()
- starts a graphics data update vk event and creates a CBO for data to be updated with
- shared_ptr<InstantiatedModel> CreateModel(string File)
- Creates the instantiated model which will then create/load/get the mesh, textures, and shaders needed for it
- shared_ptr<VkMesh> CreateMesh(string file)
- returns a mesh for use (either makes it, or returns one that already exists)
- shared_ptr<VkTexture> CreateTexture(string file)
- does the same as create mesh but for textures
- shared_ptr<VkShader> CreateShader(string file)
- does the same as the create mesh but for shaders
- bool DestroyMesh(string file)
- attempts to unload a mesh. This is not successful if other objects are using this mesh
- bool DestroyShader(string file)
- same as destroy mesh but with shaders
- bool DestroyTexture(string file)
- same as destroy mesh but with textures
- ResizeEvent(WindowResize*)
- EventFunction, accepts events for the window being resized
- GraphicsDataUpdateVkEvent(GraphicsDataUpdateVk*)
- EventFunction, loads the UBOView to the view buffer for this surface if it needs to be updated
- Window* GetWindow()
- returns the window to this surface
- VkRenderer* GetRenderer()
- returns the renderer for this surface
- shared_ptr<vkhlf::Surface> GetSurface()
- returns the surface for this
- vec4 GetClearColor()
- returns the clear color for this surface
- shared_ptr<vkhlf::Device> GetDevice()
- returns the logical device used by surface
- shared_ptr<vkhfl::DeviceMemoryAllocator> GetAllocator(string name)
- returns the allocator used by this surface for the type given by name
- shared_ptr<vkhlf::RenderPass> GetRenderPass()
- returns the render pass used
- SetWindow(Window*)
- sets a new window for this surface
- SetRenderer(VkRenderer*)
- SetClearColor(vec4)
- RenderFrameForSurface()
- actually calls the rendering on the surface
Window Window
VkRenderer Renderer
unordered_map<string, shared_ptr<vkhlf::DeviceMemoryAllocator>> Allocators
shared_ptr<vkhlf::Surface> Surface
shared_ptr<vkhlf::Queue> GraphicsQueue
shared_ptr<vkhlf::RenderPass> RenderPass
shared_ptr<vkhlf::Semaphore> RenderCompleteSemaphore
shared_ptr<vkhlf::CommandPool> CommandPool
shared_ptr<vkhlf::CommandBuffer> RenderingCommandBuffer
shared_ptr<vkhlf::Device> Device
vk::Format ColorFormat
vk::Format DepthFormat
shared_ptr<vkhlf::Buffer> ViewUBO
vec4 ClearColor
unordered_map<string, shared_ptr<VkTexture>> Textures
unordered_map<string, shared_ptr<VkMesh>> Meshes
unordered_map<string, shared_ptr<VkShaders>> Shaders
unordered_map<shared_ptr<VkMesh>, shared_ptr<VkInstantiatedModel>> InstantiatedModels
UBOView ViewUBOData
GraphicsDataUpdateVk
Defined in VkRenderedSurface header
Derives from Event
shared_ptr<vkhlf::CommandBuffer> CBO
VkRenderer
Derives from Renderer
- Ctor(Engine *) creates internals, surfaces
- CreateModel(Window*, string file)
- Loads a model to a surface (of window) with the file
- UpdateWindowViewBuffer(Window*, UBOView)
- updates the surface view and projection matrix
- GraphicsDataUpdate()
- runs graphics data update over all surfaces
- FrameUpdate(LogicUpdate*)
- Calls Frame update on all surfaces
- PresentFrame()
- Calls present frame on all surfaces
- SetClearColor(Window*, vec4)
- sets the clear color on the windows surface
- vec4 GetClearColor(Window*)
- gets the clear color on the windows surface
- Engine* GetEngine()
- returns the engine this renderer belongs to
- unordered_map<Window*, unqiue_ptr<VkRenderedSurface>> GetSurfaces()
- VkInternals* GetVkInternals();
- returns the internal vulkan stuff
unique_ptr<VkInternals> VulkanInternals
unordered_map<Window*, unique_ptr<VkRenderedSurface>> Surfaces
Engine* Engine
VkShader
Derives from Shader
- LoadToVulkan(GraphicsDataUpdateVK*)
- loads the shader to graphics memory
shared_ptr<vkhlf::Pipeline> Shader
shared_ptr<VkRenderedSurface> Surface
shared_ptr<vkhlf::PipelineLayout> PipelineLayout
VkShaderDescriptions
Loads bindings and locations in the shaderTemplatedFunctions:
- AddAttribute(vk::Format)
- adds the attribute to the list with the format and increments the location counter and offset
- AddBinding(vk::VertexInputRate)
- adds a new binding, increments the binding count
- vk::VertexInputBindingDescription* BindingData()
- returns the binding data (raw pointer)
- size_t BindingSize()
- returns the number of bindings
- vk::VertexInputAttruibuteDescription* AttrubuteData()
- returns the attrubutes data (raw pointer)
- size_t AttrubuteSize()
- returns the number of attributes
- Bindings()
- returns the bindings vector
- Attrubutes()
- returns the attibutes vector
vector<vk::VertexInputBindingDescription> Bindings
vector<vk::VertexInputAttributeDescription> Attributes
u32 Binding
u32 VertexOffset
u32 Location
VkTexture
Derives from Texture
- LoadToVulkan(GraphicsDataUpdateVk*)
- laods the data to gpu ram
shared_ptr<vkhfl::Sampler> Sampler
shared_ptr<vkhlf::ImageView> ImageView
shared_ptr<vkhlf::Image> Image
vk::ImageLayout ImageLayout
vk::DeviceMemory DeviceMemory
vk::DescriptorImageInfo Descriptor
shared_ptr<VkRenderedSurface> Surface
VkUtilities
QueueFamilyIndices
Static Functions:
- QueueFamilyIndices FindQueueFamilies(vk::PhysicalDevice)
- creates the queue family indices class and finds them on a device
- AddRequiredExtensions(const char* extension)
- adds an extension needed to select a device
- ClearRequiredExtensions()
Functions:
- IsComplete()
- Checks if we have all the families we need (graphics right now)
- IsDeviceSuitable(vk::PhysicalDevice, vk::SurfaceKHR)
- Checks if the device is suitable for the requirements we have
- CheckDeviceExtensionSupport(vk::PhysicalDevice)
- Checks if the device has the extensions we need
- u32 GetGraphicsFamily()
- Gets the family needed for the graphics of this device
vector<const char*> DeviceExtensions
u32 GraphicsFamily
SwapChainSupportDetails
Static Functions:
- SwapChainSupportDetails QuerySwapChainSupport(vk::PhysicalDevice, vk::SurfaceKHR)
- reads in the data from the surface and device
Functions:
- vk::SurfaceCapabilitiesKHR Capabilities()
- vector<vk::SurfaceFormatKHR> Formats()
- vector<vk::PresentModeKHR> PresentModes()
- returns the present modes
vk::SurfaceCapabilitiesKHR Capabilities
vector<vk::SurfaceFormatKHR> Formats
vector<vk::PresentModeKHR> PresentModes
-
Generics
-
Mesh
Derives from Event Handler
- Ctor(Window, string File, CreateInfo = null)
- creates a Submesh while reading them in from the file
vector<Submesh> Parts
Submesh
Defined in Mesh header file
- Ctor loads the mesh into CPU ram
vector<Vertex> VertexBuffer
vector<u32> IndexBuffer
UBOMaterial material
string DiffuseMap
string NormalMap
string SpecularMap
Dimension dimension
size_t vertexBufferSize
size_t indexBufferSize
string Name
string MaterialName
string ShaderSetName
-
Renderer
This class does nothing, simply an inheritance layer
- shared_ptr<InstantiatedModel> CreateModel(Window*, string MeshFile)
- Creates and returns a new instantiated model to caller
- vec4 GetClearColor(Window*)
- Returns the clear color for that specified window
- SetClearColor(Window*, vec4)
- Sets the clear color for a window
- UpdateWindowViewBuffer(Window*, UBOView)
- Updates the view and projection matrix for a window
- GraphicsDataUpdate()
- Runs the graphics data update event across all internal managers, for vulkan this is on all Surfaces
- FrameUpdate(LogicUpdate*)
- Calls render on all internal managers, for vulkan this is on all surfaces
- PresentFrame()
- Calls present on all internal managers, for vulkan this is on all surfaces
Shader
Derives from EventHandler
- Ctor loads the code from the vertex and fragment shaders
- Load actually does the file io
string ShaderSetName
string VertexShaderCode
string FragmentShaderCode
Texture
Derives from EventHandler
- Texture(string&)
- Loads the texture from the file
- Texture(const char*)
- Loads the texture from the file
- Load(string&)
- Does the actual file io for the loading
u32 Width
u32 Height
u32 MipLevels
u32 LayerCountvector<u8> Datastring TexturePath
string TextureFileNameTextureType Type
-
UBOs
-
-
UBOMaterial
vec3 Diffuse
vec3 Ambient
vec3 Specular
vec3 Emissive
vec3 Transparent
vec3 Reflective
float Opacity
float Shininess
float ShininessStrength
float Reflectivity
float ReflectivityIndex
float BumpScaling
GraphicsSystem
Derives from Component
- SetupWindow(Window*)
- FrameUpdate(LogicUpdate*)
- Event Function, calls frame update to render all the objects
- GraphicsDataUpdate(LogicUpdate*)
- Event Function, calls graphics data update on the renderer to update all the GPU data for that frame
- PresentFrame(LogicUpdate*)
- Event Function, calls present on the frame
- SetupDrawing()
- SetupInstanceDataBuffer()
- Renderer* GetRenderer()
- Returns the current renderer
Engine* Engine
unique_ptr<Renderer> Renderer
i32 VulkanSuccess
-
Camera
Derives from Component
Has camera controls, view matrix and projection matrix creation, and also calls the GraphicsViews Update View function to update the view UBO
GraphicsView
Derived from Component
- UpdateView(Camera*, UBOView&)
- Updates the view of the window this class is associated with
- Window* GetWindow()
- Gets the window this class uses
- Camera* GetLastCamera()
- Gets the last camera that was used to update this window
- vec4 GetClearColor()
- Gets the clear color of the screen for this window
- SetClearColor(vec4)
- Sets the clear color that this window uses
Camera* LastCamera
Window* Window
Renderer* Renderer
vec4 ClearColor
string WindowName
Model
Derived from Component
Transform Transform
std::shared_ptr<InstantiatedModel> InstantiatedModel
Window Window
Renderer* Renderer
string MeshName
-