|
Aeon Engine c550894
AeonGames Open Source Game Engine
|
Vulkan rendering backend implementing the Renderer interface. More...
#include <C:/Code/AeonEngine/engine/renderers/vulkan/VulkanRenderer.hpp>


Public Member Functions | |
| VulkanRenderer (void *aWindow) | |
| Construct from a native window handle. | |
| const VkInstance & | GetInstance () const |
| Get the Vulkan instance handle. | |
| const VkPhysicalDevice & | GetPhysicalDevice () const |
| Get the physical device handle. | |
| const VkDevice & | GetDevice () const |
| Get the logical device handle. | |
| const VkQueue & | GetQueue () const |
| Get the graphics queue handle. | |
| const VkPhysicalDeviceProperties & | GetPhysicalDeviceProperties () const |
| Get the physical device properties. | |
| const VkPhysicalDeviceMemoryProperties & | GetPhysicalDeviceMemoryProperties () const |
| Get the physical device memory properties. | |
| const VkDescriptorSetLayout & | GetDescriptorSetLayout (const VkDescriptorSetLayoutCreateInfo &aDescriptorSetLayoutCreateInfo) const |
| Get or create a descriptor set layout matching the given create info. | |
| uint32_t | GetQueueFamilyIndex () const |
| Get the queue family index used for graphics operations. | |
| uint32_t | GetMemoryTypeIndex (VkMemoryPropertyFlags aVkMemoryPropertyFlags) const |
| Get a memory type index matching the requested property flags. | |
| uint32_t | FindMemoryTypeIndex (uint32_t typeFilter, VkMemoryPropertyFlags properties) const |
| Find a memory type index matching both a type filter and property flags. | |
| VkCommandBuffer | BeginSingleTimeCommands () const |
| Begin recording a single-use command buffer. | |
| void | EndSingleTimeCommands (VkCommandBuffer commandBuffer) const |
| Submit and free a single-use command buffer. | |
| void | LoadMesh (const Mesh &aMesh) final |
| Loads mesh data into GPU memory. | |
| void | UnloadMesh (const Mesh &aMesh) final |
| Unloads mesh data from GPU memory. | |
| void | LoadPipeline (const Pipeline &aPipeline) final |
| Loads a rendering pipeline (shaders and state) into the renderer. | |
| void | UnloadPipeline (const Pipeline &aPipeline) final |
| Unloads a rendering pipeline from the renderer. | |
| void | LoadMaterial (const Material &aMaterial) final |
| Loads material data into the renderer. | |
| void | UnloadMaterial (const Material &aMaterial) final |
| Unloads material data from the renderer. | |
| void | LoadTexture (const Texture &aTexture) final |
| Loads a texture into GPU memory. | |
| void | UnloadTexture (const Texture &aTexture) final |
| Unloads a texture from GPU memory. | |
| const VkDescriptorImageInfo * | GetTextureDescriptorImageInfo (const Texture &aTexture) const |
| Get the descriptor image info for a loaded texture. | |
| void | AttachWindow (void *aWindowId) final |
| Attach a Window as a rendering surface. | |
| void | DetachWindow (void *aWindowId) final |
| Detach a Window as a rendering surface. | |
| void | SetClearColor (void *aWindowId, float R, float G, float B, float A) final |
| Sets the color to be used to clear the window background. | |
| void | SetProjectionMatrix (void *aWindowId, const Matrix4x4 &aMatrix) final |
| Sets the projection matrix for a specific window surface. | |
| void | SetViewMatrix (void *aWindowId, const Matrix4x4 &aMatrix) final |
| Sets the view matrix for a specific window surface. | |
| void | ResizeViewport (void *aWindowId, int32_t aX, int32_t aY, uint32_t aWidth, uint32_t aHeight) final |
| Resizes the specific window surface's viewport. | |
| void | BeginRender (void *aWindowId) final |
| Begins a render pass for the given window surface. | |
| void | EndRender (void *aWindowId) final |
| Ends the current render pass for the given window surface. | |
| void | Render (void *aWindowId, const Matrix4x4 &aModelMatrix, const Mesh &aMesh, const Pipeline &aPipeline, const Material *aMaterial=nullptr, const BufferAccessor *aSkeleton=nullptr, Topology aTopology=Topology::TRIANGLE_LIST, uint32_t aVertexStart=0, uint32_t aVertexCount=0xffffffff, uint32_t aInstanceCount=1, uint32_t aFirstInstance=0) const final |
| Issues a draw call for a mesh with the given pipeline and optional material. | |
| const Frustum & | GetFrustum (void *aWindowId) const final |
| Returns the view frustum for the given window surface. | |
| BufferAccessor | AllocateSingleFrameUniformMemory (void *aWindowId, size_t aSize) final |
| Allocates uniform buffer memory that is valid for a single frame. | |
| VkRenderPass | GetRenderPass () const |
| Get the common Vulkan render pass. | |
| const VulkanPipeline * | GetVulkanPipeline (const Pipeline &aPipeline) |
| Get the cached VulkanPipeline for a Pipeline resource. | |
| const VulkanMaterial * | GetVulkanMaterial (const Material &aMaterial) |
| Get the cached VulkanMaterial for a Material resource. | |
| const VulkanMesh * | GetVulkanMesh (const Mesh &aMesh) |
| Get the cached VulkanMesh for a Mesh resource. | |
| Public Member Functions inherited from AeonGames::Renderer | |
| virtual DLL | ~Renderer ()=0 |
| Virtual destructor. | |
Vulkan rendering backend implementing the Renderer interface.
Definition at line 41 of file VulkanRenderer.hpp.
| AeonGames::VulkanRenderer::VulkanRenderer | ( | void * | aWindow | ) |
Construct from a native window handle.
Definition at line 46 of file VulkanRenderer.cpp.
|
final |
Definition at line 74 of file VulkanRenderer.cpp.
|
finalvirtual |
Allocates uniform buffer memory that is valid for a single frame.
| aWindowId | Platform dependent window handle. |
| aSize | Size in bytes of the requested allocation. |
Implements AeonGames::Renderer.
Definition at line 968 of file VulkanRenderer.cpp.
|
finalvirtual |
Attach a Window as a rendering surface.
| aWindowId | Platform depended window handle. |
Implements AeonGames::Renderer.
Definition at line 869 of file VulkanRenderer.cpp.
|
finalvirtual |
Begins a render pass for the given window surface.
| aWindowId | Platform dependent window handle. |
Implements AeonGames::Renderer.
Definition at line 919 of file VulkanRenderer.cpp.
| VkCommandBuffer AeonGames::VulkanRenderer::BeginSingleTimeCommands | ( | ) | const |
Begin recording a single-use command buffer.
Definition at line 550 of file VulkanRenderer.cpp.
|
finalvirtual |
Detach a Window as a rendering surface.
| aWindowId | Platform depended window handle. |
Implements AeonGames::Renderer.
Definition at line 879 of file VulkanRenderer.cpp.
|
finalvirtual |
Ends the current render pass for the given window surface.
| aWindowId | Platform dependent window handle. |
Implements AeonGames::Renderer.
Definition at line 928 of file VulkanRenderer.cpp.
| void AeonGames::VulkanRenderer::EndSingleTimeCommands | ( | VkCommandBuffer | commandBuffer | ) | const |
Submit and free a single-use command buffer.
Definition at line 566 of file VulkanRenderer.cpp.
| uint32_t AeonGames::VulkanRenderer::FindMemoryTypeIndex | ( | uint32_t | typeFilter, |
| VkMemoryPropertyFlags | properties ) const |
Find a memory type index matching both a type filter and property flags.
Definition at line 139 of file VulkanRenderer.cpp.
| const VkDescriptorSetLayout & AeonGames::VulkanRenderer::GetDescriptorSetLayout | ( | const VkDescriptorSetLayoutCreateInfo & | aDescriptorSetLayoutCreateInfo | ) | const |
Get or create a descriptor set layout matching the given create info.
Definition at line 750 of file VulkanRenderer.cpp.
| const VkDevice & AeonGames::VulkanRenderer::GetDevice | ( | ) | const |
Get the logical device handle.
Definition at line 93 of file VulkanRenderer.cpp.
|
finalvirtual |
Returns the view frustum for the given window surface.
| aWindowId | Platform dependent window handle. |
Implements AeonGames::Renderer.
Definition at line 957 of file VulkanRenderer.cpp.
| const VkInstance & AeonGames::VulkanRenderer::GetInstance | ( | ) | const |
Get the Vulkan instance handle.
Definition at line 103 of file VulkanRenderer.cpp.
| uint32_t AeonGames::VulkanRenderer::GetMemoryTypeIndex | ( | VkMemoryPropertyFlags | aVkMemoryPropertyFlags | ) | const |
Get a memory type index matching the requested property flags.
Definition at line 158 of file VulkanRenderer.cpp.
| const VkPhysicalDevice & AeonGames::VulkanRenderer::GetPhysicalDevice | ( | ) | const |
Get the physical device handle.
Definition at line 108 of file VulkanRenderer.cpp.
| const VkPhysicalDeviceMemoryProperties & AeonGames::VulkanRenderer::GetPhysicalDeviceMemoryProperties | ( | ) | const |
Get the physical device memory properties.
Definition at line 118 of file VulkanRenderer.cpp.
| const VkPhysicalDeviceProperties & AeonGames::VulkanRenderer::GetPhysicalDeviceProperties | ( | ) | const |
Get the physical device properties.
Definition at line 113 of file VulkanRenderer.cpp.
| const VkQueue & AeonGames::VulkanRenderer::GetQueue | ( | ) | const |
Get the graphics queue handle.
Definition at line 98 of file VulkanRenderer.cpp.
| uint32_t AeonGames::VulkanRenderer::GetQueueFamilyIndex | ( | ) | const |
Get the queue family index used for graphics operations.
Definition at line 134 of file VulkanRenderer.cpp.
| VkRenderPass AeonGames::VulkanRenderer::GetRenderPass | ( | ) | const |
Get the common Vulkan render pass.
Definition at line 123 of file VulkanRenderer.cpp.
| const VkDescriptorImageInfo * AeonGames::VulkanRenderer::GetTextureDescriptorImageInfo | ( | const Texture & | aTexture | ) | const |
Get the descriptor image info for a loaded texture.
Definition at line 736 of file VulkanRenderer.cpp.
| const VulkanMaterial * AeonGames::VulkanRenderer::GetVulkanMaterial | ( | const Material & | aMaterial | ) |
Get the cached VulkanMaterial for a Material resource.
Definition at line 634 of file VulkanRenderer.cpp.
| const VulkanMesh * AeonGames::VulkanRenderer::GetVulkanMesh | ( | const Mesh & | aMesh | ) |
Get the cached VulkanMesh for a Mesh resource.
Definition at line 602 of file VulkanRenderer.cpp.
| const VulkanPipeline * AeonGames::VulkanRenderer::GetVulkanPipeline | ( | const Pipeline & | aPipeline | ) |
Get the cached VulkanPipeline for a Pipeline resource.
Definition at line 619 of file VulkanRenderer.cpp.
|
finalvirtual |
Loads material data into the renderer.
| aMaterial | The material to load. |
Implements AeonGames::Renderer.
Definition at line 676 of file VulkanRenderer.cpp.
|
finalvirtual |
Loads mesh data into GPU memory.
| aMesh | The mesh to load. |
Implements AeonGames::Renderer.
Definition at line 578 of file VulkanRenderer.cpp.
|
finalvirtual |
Loads a rendering pipeline (shaders and state) into the renderer.
| aPipeline | The pipeline to load. |
Implements AeonGames::Renderer.
Definition at line 650 of file VulkanRenderer.cpp.
|
finalvirtual |
Loads a texture into GPU memory.
| aTexture | The texture to load. |
Implements AeonGames::Renderer.
Definition at line 715 of file VulkanRenderer.cpp.
|
finalvirtual |
Issues a draw call for a mesh with the given pipeline and optional material.
| aWindowId | Platform dependent window handle. |
| aModelMatrix | Model transformation matrix. |
| aMesh | Mesh to render. |
| aPipeline | Pipeline (shaders/state) to use. |
| aMaterial | Optional material to bind. |
| aSkeleton | Optional skeleton buffer for skinned meshes. |
| aTopology | Primitive topology (default: TRIANGLE_LIST). |
| aVertexStart | First vertex index. |
| aVertexCount | Number of vertices to draw (default: all). |
| aInstanceCount | Number of instances to draw. |
| aFirstInstance | Index of the first instance. |
Implements AeonGames::Renderer.
Definition at line 937 of file VulkanRenderer.cpp.
|
finalvirtual |
Resizes the specific window surface's viewport.
| aWindowId | Platform dependent window handle. |
| aX | X coordinate of the viewport. |
| aY | Y coordinate of the viewport. |
| aWidth | Width of the viewport. |
| aHeight | Height of the viewport. |
Implements AeonGames::Renderer.
Definition at line 909 of file VulkanRenderer.cpp.
|
finalvirtual |
Sets the color to be used to clear the window background.
| aWindowId | Platform depended window handle. |
| R | Red component of the clear color. |
| G | Green component of the clear color. |
| B | Blue component of the clear color. |
| A | Alpha component of the clear color. |
Implements AeonGames::Renderer.
Definition at line 979 of file VulkanRenderer.cpp.
|
finalvirtual |
Sets the projection matrix for a specific window surface.
| aWindowId | Platform depended window handle. |
| aMatrix | The projection matrix. |
Implements AeonGames::Renderer.
Definition at line 889 of file VulkanRenderer.cpp.
|
finalvirtual |
Sets the view matrix for a specific window surface.
| aWindowId | Platform depended window handle. |
| aMatrix | The view matrix. |
Implements AeonGames::Renderer.
Definition at line 899 of file VulkanRenderer.cpp.
|
finalvirtual |
Unloads material data from the renderer.
| aMaterial | The material to unload. |
Implements AeonGames::Renderer.
Definition at line 696 of file VulkanRenderer.cpp.
|
finalvirtual |
Unloads mesh data from GPU memory.
| aMesh | The mesh to unload. |
Implements AeonGames::Renderer.
Definition at line 593 of file VulkanRenderer.cpp.
|
finalvirtual |
Unloads a rendering pipeline from the renderer.
| aPipeline | The pipeline to unload. |
Implements AeonGames::Renderer.
Definition at line 661 of file VulkanRenderer.cpp.
|
finalvirtual |
Unloads a texture from GPU memory.
| aTexture | The texture to unload. |
Implements AeonGames::Renderer.
Definition at line 726 of file VulkanRenderer.cpp.