Struct holding all vulkan data, like device, surface, swapchain, images, views, and more. More...
#include <context.hpp>
Public Member Functions | |
| VkCommandBuffer | beginSingleTimeCommands () |
| Function to begin single time command, used for stuff like creating vulkan image when loading textures. | |
| void | endSingleTimeCommands (VkCommandBuffer commandBuffer) |
| Function to end single time command. | |
| bool | isValidFrameIndex (uint32_t frameIndex) const |
| Validates a frame index against MAX_FRAMES_IN_FLIGHT. | |
| bool | isValidImageIndex (uint32_t imageIndex) const |
| Validates an image index against swapchain image count. | |
| void | validateSyncObjectSizes () const |
| Asserts that all frame-dependent synchronization vectors are properly sized. | |
Public Attributes | |
| VkInstance | instance |
| VkPhysicalDevice | physicalDevice |
| VkDevice | device |
| VkQueue | graphicsQueue |
| VkQueue | presentQueue |
| VmaAllocator | allocator |
| VkSurfaceKHR | surface |
| VkSwapchainKHR | swapchain = VK_NULL_HANDLE |
| std::vector< VkImage > | swapchainImages |
| VkFormat | swapchainImageFormat |
| VkExtent2D | swapchainExtent |
| std::vector< VkImageView > | swapchainImageViews |
| VkImage | depthImage = VK_NULL_HANDLE |
| VmaAllocation | depthAllocation = VK_NULL_HANDLE |
| VkImageView | depthImageView = VK_NULL_HANDLE |
| VkFormat | depthFormat |
| VkImage | lowResColorImage = VK_NULL_HANDLE |
| VmaAllocation | lowResColorAlloc = VK_NULL_HANDLE |
| VkImageView | lowResColorView = VK_NULL_HANDLE |
| VkImage | compositeImage = VK_NULL_HANDLE |
| VmaAllocation | compositeAlloc = VK_NULL_HANDLE |
| VkImageView | compositeView = VK_NULL_HANDLE |
| VkImage | uiImage = VK_NULL_HANDLE |
| VmaAllocation | uiAlloc = VK_NULL_HANDLE |
| VkImageView | uiView = VK_NULL_HANDLE |
| VkFormat | lowResColorFormat = VK_FORMAT_UNDEFINED |
| VkImage | accumImage = VK_NULL_HANDLE |
| VmaAllocation | accumAlloc = VK_NULL_HANDLE |
| VkImageView | accumView = VK_NULL_HANDLE |
| VkImage | revealImage = VK_NULL_HANDLE |
| VmaAllocation | revealAlloc = VK_NULL_HANDLE |
| VkImageView | revealView = VK_NULL_HANDLE |
| VkImage | gameViewImage = VK_NULL_HANDLE |
| VmaAllocation | gameViewAlloc = VK_NULL_HANDLE |
| VkImageView | gameViewView = VK_NULL_HANDLE |
| VkImage | colorLutImage = VK_NULL_HANDLE |
| VmaAllocation | colorLutAllocation = VK_NULL_HANDLE |
| VkImageView | colorLutView = VK_NULL_HANDLE |
| VkPipelineLayout | pipelineLayout |
| std::vector< VkCommandPool > | commandPools |
| std::vector< VkCommandBuffer > | commandBuffers |
| VkCommandPool | singleTimePool |
| uint32_t | graphicsQueueFamily |
| uint32_t | presentQueueFamily |
| uint32_t | currentFrame = 0 |
| Current frame index for triple-buffering. | |
| uint32_t | currentImageIndex = 0 |
| Current swapchain image index (acquired from vkAcquireNextImageKHR). | |
| uint32_t | MAX_FRAMES_IN_FLIGHT = 3 |
| Maximum frames in flight (triple-buffering). | |
| std::vector< VkSemaphore > | imageAvailableSemaphores |
| Synchronization semaphores - must be sized to MAX_FRAMES_IN_FLIGHT. | |
| std::vector< VkSemaphore > | renderFinishedSemaphores |
| Render finished semaphores - must be sized to MAX_FRAMES_IN_FLIGHT. | |
| std::vector< VkFence > | inFlightFences |
| In-flight fences - must be sized to MAX_FRAMES_IN_FLIGHT. | |
| VkDescriptorSetLayout | descriptorSetLayout = VK_NULL_HANDLE |
| VkDescriptorSetLayout | uboDescriptorSetLayout = VK_NULL_HANDLE |
| VkDescriptorSetLayout | textureDescriptorSetLayout = VK_NULL_HANDLE |
| VkDescriptorSetLayout | screenDescriptorSetLayout = VK_NULL_HANDLE |
| VkDescriptorSetLayout | particleDescriptorSetLayout = VK_NULL_HANDLE |
| vex_map< std::string, uint32_t > | textureIndices |
| uint32_t | nextTextureIndex = 0 |
| std::queue< uint32_t > | recycledTextureIndices |
| glm::uvec2 | currentRenderResolution |
| environment | m_environment |
| bool | supportsMultiDraw = false |
| bool | supportsIndirectDraw = false |
| bool | supportsBindlessTextures = false |
| bool | supportsShaderDrawParameters = false |
| VkDescriptorSetLayout | bindlessDescriptorSetLayout = VK_NULL_HANDLE |
| VkDescriptorPool | bindlessDescriptorPool = VK_NULL_HANDLE |
| VkDescriptorSet | bindlessDescriptorSet = VK_NULL_HANDLE |
| uint32_t | maxDrawIndirectCount = 1 |
| uint32_t | maxMultiDrawCount = 1 |
| bool | requestSwapchainRecreation = false |
| uint32_t | vulkanVersion = 0 |
Struct holding all vulkan data, like device, surface, swapchain, images, views, and more.
Definition at line 26 of file context.hpp.
|
inline |
Function to begin single time command, used for stuff like creating vulkan image when loading textures.
Definition at line 84 of file context.hpp.
|
inline |
Function to end single time command.
| VkCommandBuffer | commandBuffer - The command buffer to end. |
Definition at line 104 of file context.hpp.
|
inline |
Validates a frame index against MAX_FRAMES_IN_FLIGHT.
| frameIndex | - The frame index to validate |
Definition at line 156 of file context.hpp.
|
inline |
Validates an image index against swapchain image count.
| imageIndex | - The image index to validate |
Definition at line 169 of file context.hpp.
|
inline |
Asserts that all frame-dependent synchronization vectors are properly sized.
Should be called after swapchain creation to verify consistency
Definition at line 181 of file context.hpp.
| VmaAllocation vex::VulkanContext::accumAlloc = VK_NULL_HANDLE |
Definition at line 60 of file context.hpp.
| VkImage vex::VulkanContext::accumImage = VK_NULL_HANDLE |
Definition at line 59 of file context.hpp.
| VkImageView vex::VulkanContext::accumView = VK_NULL_HANDLE |
Definition at line 61 of file context.hpp.
| VmaAllocator vex::VulkanContext::allocator |
Definition at line 32 of file context.hpp.
| VkDescriptorPool vex::VulkanContext::bindlessDescriptorPool = VK_NULL_HANDLE |
Definition at line 209 of file context.hpp.
| VkDescriptorSet vex::VulkanContext::bindlessDescriptorSet = VK_NULL_HANDLE |
Definition at line 210 of file context.hpp.
| VkDescriptorSetLayout vex::VulkanContext::bindlessDescriptorSetLayout = VK_NULL_HANDLE |
Definition at line 208 of file context.hpp.
| VmaAllocation vex::VulkanContext::colorLutAllocation = VK_NULL_HANDLE |
Definition at line 72 of file context.hpp.
| VkImage vex::VulkanContext::colorLutImage = VK_NULL_HANDLE |
Definition at line 71 of file context.hpp.
| VkImageView vex::VulkanContext::colorLutView = VK_NULL_HANDLE |
Definition at line 73 of file context.hpp.
| std::vector<VkCommandBuffer> vex::VulkanContext::commandBuffers |
Definition at line 78 of file context.hpp.
| std::vector<VkCommandPool> vex::VulkanContext::commandPools |
Definition at line 77 of file context.hpp.
| VmaAllocation vex::VulkanContext::compositeAlloc = VK_NULL_HANDLE |
Definition at line 51 of file context.hpp.
| VkImage vex::VulkanContext::compositeImage = VK_NULL_HANDLE |
Definition at line 50 of file context.hpp.
| VkImageView vex::VulkanContext::compositeView = VK_NULL_HANDLE |
Definition at line 52 of file context.hpp.
| uint32_t vex::VulkanContext::currentFrame = 0 |
Current frame index for triple-buffering.
This wraps around at MAX_FRAMES_IN_FLIGHT. Always validate bounds before using it to index into frame-dependent arrays.
Definition at line 124 of file context.hpp.
| uint32_t vex::VulkanContext::currentImageIndex = 0 |
Current swapchain image index (acquired from vkAcquireNextImageKHR).
Should be validated against swapchainImages.size() before use
Definition at line 128 of file context.hpp.
| glm::uvec2 vex::VulkanContext::currentRenderResolution |
Definition at line 199 of file context.hpp.
| VmaAllocation vex::VulkanContext::depthAllocation = VK_NULL_HANDLE |
Definition at line 42 of file context.hpp.
| VkFormat vex::VulkanContext::depthFormat |
Definition at line 44 of file context.hpp.
| VkImage vex::VulkanContext::depthImage = VK_NULL_HANDLE |
Definition at line 41 of file context.hpp.
| VkImageView vex::VulkanContext::depthImageView = VK_NULL_HANDLE |
Definition at line 43 of file context.hpp.
| VkDescriptorSetLayout vex::VulkanContext::descriptorSetLayout = VK_NULL_HANDLE |
Definition at line 147 of file context.hpp.
| VkDevice vex::VulkanContext::device |
Definition at line 29 of file context.hpp.
| VmaAllocation vex::VulkanContext::gameViewAlloc = VK_NULL_HANDLE |
Definition at line 68 of file context.hpp.
| VkImage vex::VulkanContext::gameViewImage = VK_NULL_HANDLE |
Definition at line 67 of file context.hpp.
| VkImageView vex::VulkanContext::gameViewView = VK_NULL_HANDLE |
Definition at line 69 of file context.hpp.
| VkQueue vex::VulkanContext::graphicsQueue |
Definition at line 30 of file context.hpp.
| uint32_t vex::VulkanContext::graphicsQueueFamily |
Definition at line 118 of file context.hpp.
| std::vector<VkSemaphore> vex::VulkanContext::imageAvailableSemaphores |
Synchronization semaphores - must be sized to MAX_FRAMES_IN_FLIGHT.
Array size must equal MAX_FRAMES_IN_FLIGHT. Validate index bounds before access.
Definition at line 137 of file context.hpp.
| std::vector<VkFence> vex::VulkanContext::inFlightFences |
In-flight fences - must be sized to MAX_FRAMES_IN_FLIGHT.
Array size must equal MAX_FRAMES_IN_FLIGHT. Validate index bounds before access.
Definition at line 145 of file context.hpp.
| VkInstance vex::VulkanContext::instance |
Definition at line 27 of file context.hpp.
| VmaAllocation vex::VulkanContext::lowResColorAlloc = VK_NULL_HANDLE |
Definition at line 47 of file context.hpp.
| VkFormat vex::VulkanContext::lowResColorFormat = VK_FORMAT_UNDEFINED |
Definition at line 57 of file context.hpp.
| VkImage vex::VulkanContext::lowResColorImage = VK_NULL_HANDLE |
Definition at line 46 of file context.hpp.
| VkImageView vex::VulkanContext::lowResColorView = VK_NULL_HANDLE |
Definition at line 48 of file context.hpp.
| environment vex::VulkanContext::m_environment |
Definition at line 201 of file context.hpp.
| uint32_t vex::VulkanContext::MAX_FRAMES_IN_FLIGHT = 3 |
Maximum frames in flight (triple-buffering).
This is set dynamically during swapchain creation. Always use for bounds checking: index < MAX_FRAMES_IN_FLIGHT
Definition at line 133 of file context.hpp.
| uint32_t vex::VulkanContext::maxDrawIndirectCount = 1 |
Definition at line 212 of file context.hpp.
| uint32_t vex::VulkanContext::maxMultiDrawCount = 1 |
Definition at line 213 of file context.hpp.
| uint32_t vex::VulkanContext::nextTextureIndex = 0 |
Definition at line 195 of file context.hpp.
| VkDescriptorSetLayout vex::VulkanContext::particleDescriptorSetLayout = VK_NULL_HANDLE |
Definition at line 151 of file context.hpp.
| VkPhysicalDevice vex::VulkanContext::physicalDevice |
Definition at line 28 of file context.hpp.
| VkPipelineLayout vex::VulkanContext::pipelineLayout |
Definition at line 75 of file context.hpp.
| VkQueue vex::VulkanContext::presentQueue |
Definition at line 31 of file context.hpp.
| uint32_t vex::VulkanContext::presentQueueFamily |
Definition at line 119 of file context.hpp.
| std::queue<uint32_t> vex::VulkanContext::recycledTextureIndices |
Definition at line 197 of file context.hpp.
| std::vector<VkSemaphore> vex::VulkanContext::renderFinishedSemaphores |
Render finished semaphores - must be sized to MAX_FRAMES_IN_FLIGHT.
Array size must equal MAX_FRAMES_IN_FLIGHT. Validate index bounds before access.
Definition at line 141 of file context.hpp.
| bool vex::VulkanContext::requestSwapchainRecreation = false |
Definition at line 214 of file context.hpp.
| VmaAllocation vex::VulkanContext::revealAlloc = VK_NULL_HANDLE |
Definition at line 64 of file context.hpp.
| VkImage vex::VulkanContext::revealImage = VK_NULL_HANDLE |
Definition at line 63 of file context.hpp.
| VkImageView vex::VulkanContext::revealView = VK_NULL_HANDLE |
Definition at line 65 of file context.hpp.
| VkDescriptorSetLayout vex::VulkanContext::screenDescriptorSetLayout = VK_NULL_HANDLE |
Definition at line 150 of file context.hpp.
| VkCommandPool vex::VulkanContext::singleTimePool |
Definition at line 80 of file context.hpp.
| bool vex::VulkanContext::supportsBindlessTextures = false |
Definition at line 205 of file context.hpp.
| bool vex::VulkanContext::supportsIndirectDraw = false |
Definition at line 204 of file context.hpp.
| bool vex::VulkanContext::supportsMultiDraw = false |
Definition at line 203 of file context.hpp.
| bool vex::VulkanContext::supportsShaderDrawParameters = false |
Definition at line 206 of file context.hpp.
| VkSurfaceKHR vex::VulkanContext::surface |
Definition at line 33 of file context.hpp.
| VkSwapchainKHR vex::VulkanContext::swapchain = VK_NULL_HANDLE |
Definition at line 35 of file context.hpp.
| VkExtent2D vex::VulkanContext::swapchainExtent |
Definition at line 38 of file context.hpp.
| VkFormat vex::VulkanContext::swapchainImageFormat |
Definition at line 37 of file context.hpp.
| std::vector<VkImage> vex::VulkanContext::swapchainImages |
Definition at line 36 of file context.hpp.
| std::vector<VkImageView> vex::VulkanContext::swapchainImageViews |
Definition at line 39 of file context.hpp.
| VkDescriptorSetLayout vex::VulkanContext::textureDescriptorSetLayout = VK_NULL_HANDLE |
Definition at line 149 of file context.hpp.
| vex_map<std::string, uint32_t> vex::VulkanContext::textureIndices |
Definition at line 194 of file context.hpp.
| VkDescriptorSetLayout vex::VulkanContext::uboDescriptorSetLayout = VK_NULL_HANDLE |
Definition at line 148 of file context.hpp.
| VmaAllocation vex::VulkanContext::uiAlloc = VK_NULL_HANDLE |
Definition at line 55 of file context.hpp.
| VkImage vex::VulkanContext::uiImage = VK_NULL_HANDLE |
Definition at line 54 of file context.hpp.
| VkImageView vex::VulkanContext::uiView = VK_NULL_HANDLE |
Definition at line 56 of file context.hpp.
| uint32_t vex::VulkanContext::vulkanVersion = 0 |
Definition at line 216 of file context.hpp.