MCPcopy Create free account
hub / github.com/Overv/VulkanTutorial / ComputeShaderApplication

Class ComputeShaderApplication

code/31_compute_shader.cpp:113–1401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111};
112
113class ComputeShaderApplication {
114public:
115 void run() {
116 initWindow();
117 initVulkan();
118 mainLoop();
119 cleanup();
120 }
121
122private:
123 GLFWwindow* window;
124
125 VkInstance instance;
126 VkDebugUtilsMessengerEXT debugMessenger;
127 VkSurfaceKHR surface;
128
129 VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
130 VkDevice device;
131
132 VkQueue graphicsQueue;
133 VkQueue computeQueue;
134 VkQueue presentQueue;
135
136 VkSwapchainKHR swapChain;
137 std::vector<VkImage> swapChainImages;
138 VkFormat swapChainImageFormat;
139 VkExtent2D swapChainExtent;
140 std::vector<VkImageView> swapChainImageViews;
141 std::vector<VkFramebuffer> swapChainFramebuffers;
142
143 VkRenderPass renderPass;
144 VkPipelineLayout pipelineLayout;
145 VkPipeline graphicsPipeline;
146
147 VkDescriptorSetLayout computeDescriptorSetLayout;
148 VkPipelineLayout computePipelineLayout;
149 VkPipeline computePipeline;
150
151 VkCommandPool commandPool;
152
153 std::vector<VkBuffer> shaderStorageBuffers;
154 std::vector<VkDeviceMemory> shaderStorageBuffersMemory;
155
156 std::vector<VkBuffer> uniformBuffers;
157 std::vector<VkDeviceMemory> uniformBuffersMemory;
158 std::vector<void*> uniformBuffersMapped;
159
160 VkDescriptorPool descriptorPool;
161 std::vector<VkDescriptorSet> computeDescriptorSets;
162
163 std::vector<VkCommandBuffer> commandBuffers;
164 std::vector<VkCommandBuffer> computeCommandBuffers;
165
166 std::vector<VkSemaphore> imageAvailableSemaphores;
167 std::vector<VkSemaphore> renderFinishedSemaphores;
168 std::vector<VkSemaphore> computeFinishedSemaphores;
169 std::vector<VkFence> inFlightFences;
170 std::vector<VkFence> computeInFlightFences;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected