A sturdy Vulkan app that draw a tri. Yay :) !

parent a842451f
......@@ -16,7 +16,7 @@ SHADIR = shaders
TARGET = learn
LIBS = -L$(VULKAN_SDK_PATH)/lib `pkg-config --static --libs glfw3` -lvulkan
CXXFLAGS = -Wall -fopenmp -I$(VULKAN_SDK_PATH)/include -std=c++14 -DNDEBUG
CXXFLAGS = -Wall -I$(VULKAN_SDK_PATH)/include -std=c++14 -O3 -DNDEBUG
CXX = g++
LINKER = g++
......
......@@ -295,7 +295,7 @@ class HelloTriangleApplication {
vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, extensionProps.data()); //Read into the vector.
std::cout << "Available Extensions:" << std::endl;
std::cout << "Loaded Extensions:" << std::endl;
for (const auto &extension : extensionProps) {
std::cout << "\t" << extension.extensionName << std::endl;
......@@ -894,12 +894,12 @@ class HelloTriangleApplication {
dependency.dstSubpass = 0; //The index of our one and only subpass. dst must be higher than src to prevent cyclic dependencies.
//Wait for the swap chain to finish reading from the image before accessing it.
dependency.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; //The operations to wait on.
dependency.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; //The operations to wait for.
dependency.srcAccessMask = 0; //The operations we should wait to do.
//The operation that should wait is r/w of the color attachment in the color attachment stage.
// Prevent the transition from happening until it's actually allowed.
dependency.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; //The operations to wait on.
dependency.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; //The operations to wait for.
dependency.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; //The operations to wait to do.
......@@ -1220,7 +1220,7 @@ class HelloTriangleApplication {
//To allocate command buffers, we need a VkCommandBufferAllocateInfo struct param.
VkCommandBufferAllocateInfo allocInfo = {};
allocInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO;
allocInfo.commandPool = commandPool;; //The command pool.
allocInfo.commandPool = commandPool; //The command pool.
// The level parameter specifies if the allocated command buffers are primary or secondary.
// Primary: Can be submitted for execution, but can't be called from other command buffers.
......@@ -1379,13 +1379,13 @@ class HelloTriangleApplication {
presentInfo.waitSemaphoreCount = 1; //Wait for one semaphore to submit the result back to the swap chain.
presentInfo.pWaitSemaphores = signalSemaphores; //The semaphores to wait for before submitting the render result.
VkSwapchainKHR swapChains[] = {swapChain}; //The swap cain to present to.
VkSwapchainKHR swapChains[] = {swapChain}; //The swap chain to present to.
presentInfo.swapchainCount = 1; //Using one swapchain.
presentInfo.pSwapchains = swapChains; //The swapchains to use.
presentInfo.pImageIndices = &imageIndex; //The index of the image to present, for each swap chain.
presentInfo.pResults = nullptr; //Can check every individual swap chain to see if presentation was successful. Useless with only one.
//Time to submit the request to present an image to the swap chain onto the presentQueue!
//Time to submit the command to present an image to the swap chain onto the presentQueue!
result = vkQueuePresentKHR(presentQueue, &presentInfo);
// Remake the swap chain if it's suboptimal here.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment