Test Post: Does this work?
2023-04-21
This is only a dummy post that will be removed once there is actual content. This post is just used to "test" all features I'll probably use.
Test text only
What's happening?
What about this?
Still nice?
How far can we go?
And what about lists?
- Whacha say?
- Is this good?
Numbers:
- This is a one
- Two
- Drei
Test code
How does inline code look like?
Let's see how this looks:
#include <cstdio> #ifndef PREPRO_CHECK #define PREPRO_CHECK #endif // PREPRO_CHECK // what does comment look like? static bool recordDrawCommands(VkCommandBuffer commandBuffer, const VkHourglass::VulkanContext::GraphicsPipeline& graphicsPipeline, const VkExtent2D& swapchainExtent, size_t currentFrame, uint32_t swapchainImageIndex); static void submitCommands(const VkHourglass::VulkanContext& context); static VkResult presentFramebuffer(VkHourglass::VulkanContext& context, uint32_t swapchainImageIndex); int main(int argc, char* argv[]) { if (argc == 0 || !std::filesystem::exists(argv[0])) { fprintf(stderr, "argv[0] is expected to be executable path / path relative to shaders!\n"); return EXIT_FAILURE; } const std::filesystem::path executableDirectory = std::filesystem::absolute(argv[0]).parent_path(); VkHourglass::ApplicationSharedData applicationSharedData{executableDirectory, false, false, false}; VkHourglass::GlfwContext glfwContext(applicationSharedData, VkHourglass::ApplicationDefines::WINDOW_WIDTH, VkHourglass::ApplicationDefines::WINDOW_HEIGHT); if (!glfwContext) { fprintf(stderr, "Failed to initialize GLFW!\n"); return EXIT_FAILURE; } const std::vector<uint32_t> grid = VkHourglass::generateRandomCircles(); VkHourglass::VulkanContext vulkanContext(applicationSharedData, glfwContext, grid); if (!vulkanContext) { fprintf(stderr, "Failed to initialize Vulkan!\n"); return EXIT_FAILURE; } std::random_device randomDevice; std::mt19937 mtRand(randomDevice()); size_t currentGridBuffer = 0; VkHourglass::RuntimeStatistics runtimeStatistics; VkHourglass::ComputeUpdateTimer computeUpdateTimer(VkHourglass::ApplicationDefines::CELL_UPDATE_INTERVAL_MS); while (!applicationSharedData.exitApplication.load()) { runtimeStatistics.notifyFrameBegin(); glfwContext.update(); vkWaitForFences(vulkanContext.deviceWrapper.device, 1, &vulkanContext.inFlightFence, VK_TRUE, UINT64_MAX); uint32_t imageIndex = 0; VkResult result = vkAcquireNextImageKHR(vulkanContext.deviceWrapper.device, vulkanContext.swapchain.swapchain, UINT64_MAX, vulkanContext.imageAvailableSemaphore, VK_NULL_HANDLE, &imageIndex); if (result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR || applicationSharedData.framebufferResized) { applicationSharedData.framebufferResized.store(false); vulkanContext.recreateSwapchain(); continue; } vkResetFences(vulkanContext.deviceWrapper.device, 1, &vulkanContext.inFlightFence); const VkCommandBuffer commandBuffer = vulkanContext.commandBuffer; vkResetCommandBuffer(commandBuffer, 0); beginCommandBuffer(commandBuffer); if (applicationSharedData.toggleUpdates && computeUpdateTimer.isUpdateNeeded()) { recordComputeCommands(vulkanContext.computePipeline, commandBuffer, currentGridBuffer, mtRand); addMemoryBarrier( commandBuffer, vulkanContext.deviceWrapper.queueIndex, currentGridBuffer, vulkanContext.cellBuffers); currentGridBuffer = !currentGridBuffer; computeUpdateTimer.notifyUpdateScheduled(); } recordDrawCommands(commandBuffer, vulkanContext.graphicsPipeline, vulkanContext.swapchain.imageExtent, currentGridBuffer, imageIndex); submitCommands(vulkanContext); result = presentFramebuffer(vulkanContext, imageIndex); if (result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR) { vulkanContext.recreateSwapchain(); } } runtimeStatistics.printResults(); vkDeviceWaitIdle(vulkanContext.deviceWrapper.device); return EXIT_SUCCESS; }
Test Image
Here is some image:
Figure 1: Random Image
Test Quote
Here is a quote:
Hello, I'm super smart!
- Max