My to-do list: Grade update again A note on organization before we go on too far: Object management, and game engines, and the software development challenge Not really going there in this class, but you might want to OpenGL: It's seen a lot of use There haven't been a lot of things where we needed more direct control But more advanced users wanted something more flexible Enter Vulkan (and DX12): Much less is determined by default The rendering pipeline, for example Hello triangle is 1K lines A lot of it is simply making descriptions for various functions Going through it in detail will help understand But I'm concerned we'll run out of time There used to be a lot of lengthy tasks with OpenGL too They've been largely handled by library functions glfw, glm, etc. Somebody could come up with something similar for vulkan nVidia sort of has nvidia tutorials nvvk inside nvpro_core Is it a good idea to use it? Copyright, but it's actually expired, and uses Apache license So I don't see the harm Incidentally, they've done the same thing for OpenGL It has a 355-line file for error handling It would make a lot of sense to use it The way I put examples together is intended for instruction Not really required for this class, but I'd recommend following the tutorial This class: We'll go over the highlights Then have a lab where we change things The vulkan SDK: I'm guessing this will be a package manager thing eventually For now: Download, extract, source setup-env.sh Let's have a look at the makefile The nVidia tutorials: We'll go there for ray tracing, but today, I want to introduce vulkan hello_triangle_gui: Can we build it? (I hope so!) Can we update to the latest vulkan SDK? (Again, I hope so!) Everything is in main.cpp Well, most things (shaders, scolor, imgui, etc) What you need to draw a triangle: A physical device. You get it from a VkInstance Pick a VkPhysicalDevice VkDevice is a logical device Maybe not 1:1 mapping with physical devices Need a VkQueue to put operations into There are queue families which support different operations A window to render to GLFW can get the window, like we're used to The "surface" rendered to isa VkSurfaceKHR A swap chain, VkSwapchainKHR, to produce images Image views and framebuffers VkImageView and VkFramebuffer VkImageView represents part of an image (probably all of it) VkFramebuffer is the memory objects a render pass uses This demo uses a different VkImageView for each image in the swap chain We'll pick an image to render each frame Render passes What image will we render to, etc Is it a color image? A depth map? Something completely different? Graphics pipeline Uses a VkPipeline object Contains viewport size, etc. Uses VkShaderModule objects Have to recreate the VkPipeline if changing shaders, vertex layout, etc So at render time, you might need a few of these Contrast with OpenGL Command pools, command buffers VkCommandBuffer records commands VkCommandPool is associated with a queue family, carries out commands Can keep a bunch of prepared VkCommandBuffers around Main loop Pick a swap chain image Submit the command buffer with vkQueueSubmit Get the completed image from the chain with VkQueuePresentKHR and put it on the screen That's it, no big deal!