KarmaEngine
Game Engine for practical learning and research purposes
|
Vulkan API has the following concepts. More...
#include <VulkanContext.h>
Public Member Functions | |
VulkanContext (GLFWwindow *windowHandle) | |
A constructor to set the m_vulkanRendererAPI (using static_cast, or compilet time cast). Also checks the validity of windowHandle. | |
virtual | ~VulkanContext () override |
Destructor of vulkan context. Does the following. | |
virtual void | Init () override |
Initializes VulkanContext by creating appropriate Vulkan and glslang specific instruments and allocating resources accordingly. | |
virtual void | SwapBuffers () override |
This function swaps the front and back buffers of the specified window. If the swap interval is greater than zero, the GPU driver waits the specified number of screen updates before swapping the buffers. | |
virtual bool | OnWindowResize (WindowResizeEvent &event) override |
Calls glViewport function which specifies the affine transformation of x and y from normalized device coordinates to window coordinates. | |
void | CreateInstance () |
void | PrintAvailableExtensions () |
void | PrintAvailablePhysicalDevices (const std::vector< VkPhysicalDevice > &physicalDevices) |
bool | CheckValidationLayerSupport () |
std::vector< const char * > | GetRequiredExtensions (VkInstanceCreateFlags &flagsToBeSet) |
void | SetupDebugMessenger () |
void | PopulateDebugMessengerCreateInfo (VkDebugUtilsMessengerCreateInfoEXT &createInfo) |
VkResult | CreateDebugUtilsMessengerEXT (VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pDebugMessenger) |
void | DestroyDebugUtilsMessengerEXT (VkInstance instance, VkDebugUtilsMessengerEXT debugMessenger, const VkAllocationCallbacks *pAllocator) |
void | CreateSurface () |
void | PickPhysicalDevice () |
bool | IsDeviceSuitable (VkPhysicalDevice device) |
QueueFamilyIndices | FindQueueFamilies (VkPhysicalDevice device) |
void | CreateLogicalDevice () |
The so called logical device for interfacing with the physical device. All the machinery (swapchain, graphicspipeline, and all that) are created from logical device. | |
void | CreateSwapChain () |
Vulkan does not have the concept of a "default framebuffer", hence it requires an infrastructure that will own the buffers we will render to before we visualize them on the screen. This infrastructure is known as the swap chain and must be created explicitly in Vulkan. The swap chain is essentially a queue of images that are waiting to be presented to the screen. Our backend will acquire such an image to draw to it, and then return it to the queue. | |
bool | CheckDeviceExtensionSupport (VkPhysicalDevice device) |
SwapChainSupportDetails | QuerySwapChainSupport (VkPhysicalDevice device) |
VkSurfaceFormatKHR | ChooseSwapSurfaceFormat (const std::vector< VkSurfaceFormatKHR > &availableFormats) |
VkPresentModeKHR | ChooseSwapPresentMode (const std::vector< VkPresentModeKHR > &availablePresentModes) |
VkExtent2D | ChooseSwapExtent (const VkSurfaceCapabilitiesKHR &capabilities) |
uint32_t | FindMemoryType (uint32_t typeFilter, VkMemoryPropertyFlags properties) |
void | CreateImageViews () |
An image view is quite literally a view into an image. It describes how to access the image and which part of the image to access, for example if it should be treated as a 2D texture depth texture without any mipmapping levels. | |
void | CreateRenderPass () |
A VkRenderPass is a Vulkan object that encapsulates the state needed to setup the “target” for rendering, and the state of the images we will be rendering to. | |
void | CreateFrameBuffers () |
A framebuffer represents a collection of specific memory attachments that a render pass instance uses. | |
void | CreateCommandPool () |
Command pools are opaque objects that command buffer memory is allocated from, and which allow the implementation to amortize the cost of resource creation. | |
void | CreateDepthResources () |
VkFormat | FindSupportedFormat (const std::vector< VkFormat > &candidates, VkImageTiling tiling, VkFormatFeatureFlags features) |
VkFormat | FindDepthFormat () |
bool | HasStencilComponent (VkFormat format) |
void | TransitionImageLayout (VkImage image, VkFormat format, VkImageLayout oldLayout, VkImageLayout newLayout) |
void | CopyBufferToImage (VkBuffer buffer, VkImage image, uint32_t width, uint32_t height) |
void | RecreateSwapChain () |
void | CleanupSwapChain () |
void | SetVSync (bool bEnable) |
void | Initializeglslang () |
void | RegisterUBO (const std::shared_ptr< VulkanUniformBuffer > &ubo) |
void | ClearUBO () |
void | RecreateUBO () |
void | UploadUBO (size_t frameIndex) |
VkDevice | GetLogicalDevice () const |
VkPhysicalDevice | GetPhysicalDevice () const |
VkExtent2D | GetSwapChainExtent () const |
VkRenderPass | GetRenderPass () const |
const std::vector< VkFramebuffer > & | GetSwapChainFrameBuffer () const |
VkSwapchainKHR | GetSwapChain () const |
const std::vector< VkImage > & | GetSwapChainImages () const |
VkFormat | GetSwapChainImageFormat () const |
const std::vector< VkImageView > & | GetSwapChainImageViews () const |
VkSurfaceFormatKHR | GetSurfaceFormat () const |
VkQueue | GetGraphicsQueue () const |
VkQueue | GetPresentQueue () const |
VkCommandPool | GetCommandPool () const |
const VkPhysicalDeviceFeatures & | GetSupportedDeviceFeatures () const |
VkInstance | GetInstance () const |
uint32_t | GetImageCount () const |
uint32_t | GetMinImageCount () const |
VkSurfaceKHR | GetSurface () const |
VkPresentModeKHR | GetPresentMode () const |
![]() | |
virtual | ~GraphicsContext () |
A destructor. | |
Vulkan API has the following concepts.
Host : is CPU the host?
Karma::VulkanContext::VulkanContext | ( | GLFWwindow * | windowHandle | ) |
A constructor to set the m_vulkanRendererAPI (using static_cast, or compilet time cast). Also checks the validity of windowHandle.
windowHandle | The glfw window handle |
|
overridevirtual |
Destructor of vulkan context. Does the following.
void Karma::VulkanContext::CreateCommandPool | ( | ) |
Command pools are opaque objects that command buffer memory is allocated from, and which allow the implementation to amortize the cost of resource creation.
void Karma::VulkanContext::CreateFrameBuffers | ( | ) |
A framebuffer represents a collection of specific memory attachments that a render pass instance uses.
void Karma::VulkanContext::CreateImageViews | ( | ) |
An image view is quite literally a view into an image. It describes how to access the image and which part of the image to access, for example if it should be treated as a 2D texture depth texture without any mipmapping levels.
void Karma::VulkanContext::CreateLogicalDevice | ( | ) |
The so called logical device for interfacing with the physical device. All the machinery (swapchain, graphicspipeline, and all that) are created from logical device.
void Karma::VulkanContext::CreateRenderPass | ( | ) |
A VkRenderPass is a Vulkan object that encapsulates the state needed to setup the “target” for rendering, and the state of the images we will be rendering to.
void Karma::VulkanContext::CreateSwapChain | ( | ) |
Vulkan does not have the concept of a "default framebuffer", hence it requires an infrastructure that will own the buffers we will render to before we visualize them on the screen. This infrastructure is known as the swap chain and must be created explicitly in Vulkan. The swap chain is essentially a queue of images that are waiting to be presented to the screen. Our backend will acquire such an image to draw to it, and then return it to the queue.
Karma 1.0.0
|
overridevirtual |
Initializes VulkanContext by creating appropriate Vulkan and glslang specific instruments and allocating resources accordingly.
Implements Karma::GraphicsContext.
|
inlineoverridevirtual |
Calls glViewport function which specifies the affine transformation of x and y from normalized device coordinates to window coordinates.
Implements Karma::GraphicsContext.
|
overridevirtual |
This function swaps the front and back buffers of the specified window. If the swap interval is greater than zero, the GPU driver waits the specified number of screen updates before swapping the buffers.
Implements Karma::GraphicsContext.