27 #include <ht_swapchain.h> 29 #include <ht_vkpipeline.h> 30 #include <ht_vkrendertarget.h> 31 #include <ht_vkqueue.h> 41 VkCommandBuffer command;
48 VkMemoryAllocateInfo memAllocInfo;
49 VkDeviceMemory memory;
61 void VClear(
float* color)
override;
62 bool VInitialize(uint32_t width, uint32_t height)
override;
63 void VResize(uint32_t width, uint32_t height)
override;
64 void VExecute(std::vector<RenderPassHandle> renderPasses)
override;
66 void VPresent()
override;
68 const VkCommandBuffer& GetVKCurrentCommand()
const;
69 const VkSurfaceKHR& GetVKSurface()
const;
70 const uint32_t& GetVKGraphicsQueueIndex()
const;
72 const VkClearValue& GetVKClearColor()
const;
74 bool BuildSwapchainCommands(VkClearValue clearColor);
76 VkResult VKGetNextImage(VkSemaphore presentSemaphore);
77 bool VKPostPresentBarrier(
const VkQueue& queue);
78 bool VKPrePresentBarrier(
const VkQueue& queue);
79 VkResult VKPresent(
const VkQueue& queue,
const VkSemaphore& renderSemaphore);
84 VkInstance m_instance;
85 VkPhysicalDevice m_gpu;
88 VkCommandPool m_commandPool;
89 VkDescriptorPool m_descriptorPool;
91 VkPipelineStageFlags m_submitStages;
92 VkSemaphore m_presentSemaphore;
93 VkSemaphore m_renderSemaphore;
94 VkSubmitInfo m_submitInfo;
98 VkSurfaceKHR m_surface;
99 VkPhysicalDeviceProperties m_gpuProps;
100 std::vector<VkQueueFamilyProperties> m_queueProps;
101 uint32_t m_graphicsQueueNodeIndex;
103 VkFormat m_preferredColorFormat;
104 VkFormat m_preferredDepthFormat;
105 VkColorSpaceKHR m_colorSpace;
106 VkClearValue m_clearColor;
112 VkRenderPass m_renderPass;
115 VkDescriptorSet m_descriptorSet;
117 std::vector<VkCommandBuffer> m_postPresentCommands;
118 std::vector<VkCommandBuffer> m_prePresentCommands;
120 VkSwapchainKHR m_swapchain;
121 std::vector<SwapchainBuffer> m_swapchainBuffers;
122 std::vector<VkFramebuffer> m_framebuffers;
125 UniformBlock_vk m_vertexBuffer;
126 std::vector<Texture_vk> m_inputTextures;
129 bool vkPrepareResources();
131 bool createAllocatorPools();
133 bool prepareSurface();
135 bool getQueueProperties();
137 bool findSutibleQueue();
139 bool getPreferredFormats();
142 bool prepareSwapchain(VkFormat preferredColorFormat, VkColorSpaceKHR colorSpace,
143 std::vector<VkPresentModeKHR> presentModes, VkSurfaceCapabilitiesKHR surfaceCapabilities, VkExtent2D surfaceExtents);
146 bool prepareSwapchainDepth(
const VkFormat& preferredDepthFormat, VkExtent2D extent);
149 bool prepareRenderPass();
152 bool prepareFramebuffers(VkExtent2D extents);
155 bool allocateCommandBuffers();
157 bool submitBarrier(
const VkQueue& queue,
const VkCommandBuffer& command);
160 void destroySurface();
161 void destroyPipeline();
163 void destroyFramebuffers();
164 void destroySwapchainBuffers();
165 void destroyRenderPass();
166 void destroySwapchain();
Definition: ht_vkswapchain.h:39
Definition: ht_vkrenderer.h:34
Definition: ht_vkqueue.h:39
Definition: ht_vkpipeline.h:42
Definition: ht_vkswapchain.h:55
Definition: ht_vkswapchain.h:45
Definition: ht_renderer.h:69
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_color.h:19
Definition: ht_swapchain.h:38
Definition: ht_vkrenderpass.h:41
Vulkan device wrapper.
Definition: ht_vkdevice.h:29