@@Crimspn and all the dudes in the thread: It doesn't make sense to create an architecture with an API you have no idea how it works in the first place. in this scenario learning in a single file is optimal. Later, after you understand what's going on, is when splitting into different files becomes a necessity, and guess what? you will be in a better position to create an architecture that really fits your needs ;)
Thank you for your tutorial since my internship will use Vulkan in the projects. Small fixing- you guys should add #include in the device folder for those errors when you just put the files into the project folder.
From articulation to beginner-friendliness, I can easily say Brendan has a teaching style far better than 95% College and University professors. I will be far ahead of many students due to ease of learning and high reward/work ratio.
I had originally tried to start with this tutorial series, but felt a bit lost having copied much of this code. I ended up going back to the vulkan-tutorial site and really spending some time working through that and drawing out exactly how everything works. Coming back to this tutorial series after a few weeks of REALLY burying my head in the weeds of everything has made stuff a LOT clearer. I especially like how this tutorial shows how one could break things up into classes so you can build your own API around your specific needs. All in all, really great tutorial but for personally I found it easier to approach this tutorial series after having really dived into the details of Vulkan on my own both through the vulkan-tutorial site, and supplemental reading of documentation. So if you're finding it difficult to follow (like I was) perhaps take a step back to the original vulkan-tutorial first and really focus on reading the relevant documentation and playing around with that a bit on your own. Great tutorial, and has really helped me out! Thanks so much
What I like the most about your series is that you really teach something and also that you don't use an IDE. For many people IDE's make it easier, but I personally find that IDE's make everything more complicated. ^^" So a big thank you for using vs code!!
This is a fantastic tutorial. I'm a fairly experienced coder, however I'm new to C++ (Coming from C# and Python). Going through this is helping me learn both about C++ and Vulkan. Thanks
I watched this tutorial when it first came out but I hated the idea of copying code, i left and started doing stuff on my own. I figured how all of the Instance-Device-Surface stuff works and now I want to focus on the rest, so now this tutorial is perfect because it skips what i already know and goes to what I do not know.
For those of you who might have an error saying your window class is not recognized, be sure to change the namespace in both device files, don't think he mentiones that. Great video Brendan!
I would vote to skip the device setup video unless you had the extra time. It gives me a reason to dive into the docs and compile more notes anyway. Looking forward to more!
Ya my main focus is getting out more tutorials. Once I cover the basics, which should be around tutorial 25, then I think I'll do the appendix just to have a complete series.
I really appreciate your tutorials. They have been very helpful at explaining vulkan and graphics programming to me. I don't mean to be mean but I'd rather want a very flat code where it is shown what steps are taken one by one, that way it's easier for the beginners to see the usage and what has to happen in what order.
thanks for the feedback! I'd highly recommend checking out vulkan-tutorial.com for step by step instructions. I'm trying to structure this as how to build out an engine so its hard for the series not to jump around a bit. It's a bit of a balancing act between a bunch of different constraints for me when trying to design these tutorials, and I don't always get it right. So defintely don't use me as your only source. But I'll keep trying to do my best to make the series as easy to follow as possible
Ya I still need to get around to creating the device appendix video, but every time i start on it it just feels like im reiterating vulkan-tutorial.com :/ I highly recommend giving the device creation secion a 15 minute read, which gives a step by step appraoch as to how that code was constructure.
Not a big fan of tutorials that tell you to drag and drop code samples either, but after having done the Vulkan Tutorials previously to your tutorials, I'm happy you chose to do it this way and I won't have to watch you type those chapters. 😂
Love it. Vulkan seems to have a lot of boilerplate to set it up (which is good for fine tuning, but is a pain to churn through). This tutorial is fantastic.
I appreciated the approach of giving us those files-- my first time through vulkan-tutorial that part was really a drag to get through and very discouraging
`.clang-format` w/ "Format on Save" option in VSCode is awesome! 👍 I added these options to match the YT vids: DerivePointerAlignment: false, PointerAlignment: Left
Your approach with asking people to download some code is great if you're working with C++, but I've been following your tutorials and converting it to Rust on the go. So having to figure out what you're doing in your little C++ engine and mass-converting it is a lot harder. That's the only downside I can think of with that approach.
Ya that’s a really good point. What language are you using. I’ll ask on our discord if anyone has done it in a different language and if they are alright letting me share links to it.
Bro got me good with the code to download, unfortunatelly for me, im implementing the tutorial with other names so i'll take my time translating everything. Still think that i`ll end up learnng a lot, so thanks!!! I`m really enjoying thinks so far! Edit, it was actually very fast, nice.
I was having an issue when running this code in Debug configuration, turns out the validation layers couldn't load. If that happens, you need to define some system environment variables (on Windows): VK_INSTANCE_LAYERS and VK_LAYER_PATH. For some reason, the validation layers check didn't catch this problem.
I'm getting "terminating with uncaught exception of type std::runtime_error: validation layers requested, but not available!" What can possibly be the problem here?
this can be a bit tricky. My first recommendation is try re-installing vulkan, make sure you're downloading the vulkanSDK and not just the vulkan runtime. Next if that doesn't fix the issue, in the vulkanSDK/Applications directory there should be an application called vulkaninfo. Try running that and in the output nearish the top you should see something like Layers: count = 8 ================= Where validation layer count should be some number greater than 0. Then another thing you could try is in the same directory try opening vkconfig, have selected the validation layers option, and then run your program and see if the validation layers can be found in that case.
if you're getting a fatal compile error then try replacing all occurrences of std::endl in the lve_device.cpp with ' '. I think it could potentially interfere with the other output sequences(functions that are also using cout) since it flushes the output buffer when its called. very likely something a bit more complicated like multi threading issues but that's a rabbit hole i have yet to dive into.
In the pipeline class you're not deleting the copy assignment function. The copy assignment function returns a reference to the class name, it doesn't return void.
Great so far, but I can't get this stage working on an M1 Mac. I keep getting error about " Cocoa: Vulkan instance missing VK_EXT_metal_surface extension", despite it being included in the available extensions list.
I was trying to follow in python, translating the c++ code in real time. but how can i use the premade code?....... i'm not google translate of coding unfortunately
Maybe try translating with chatgpt? But I think others have done this in python. You could check the discord and ask there (link is on the later video descriptions) Sorry I can’t be more help. Dumb of me to not think of this scenario when I was making these originally. I regret not covering this content
the downloaded code is giving me syntax errors all over the place. I assume I did something wrong with the vulcan download or linking or so, but i cant figure it out.
13:02 when i build i get the std::runtime_error at memory location in device.cpp, how do i fix it ? EDIT : If i continue the code execution i get 4 more errors just like this one, but the last one is a stopping error at line 111 in device.cpp where it gives me an Access violation in deviceCount == 0
no idea what is happening, but when i run my code in debug mode in vs2022 (haven't tried any other ide), there are multiple memory related errors, that start at memory allocation for appInfo. dunno what's the problem, but when i run code in release mode, it's running smoothly
Just the default clear color. In the subsequent tutorials we set the background color each frame so you will be able to set it to black or whatever you wish then!
I'm getting an error: invalid conversion from ‘uint32_t’ {aka ‘unsigned int’} to ‘const uint32_t*’ {aka ‘const unsigned int*’} [-fpermissive] I'm using gcc in VSCode on linux. What should I do?
Hey just curious I see you using the brackets to create objects, e.g.: PipelineConfigInfo configInfo{}; I'm curious if there was a reason for that or if that's just your personal style? I googled it and I believe that statement sans brackets is the same. Similar for lveDevice{lveWindow}; Is that just cleaner than passing the window to it in the constructor? You could do something like FirstApp(lveWindow(w,h,name); lveDevice(lveWindow);). Isn't doing it how you did it functionally the same as doing it in the constructor? The way you did it looks clean just curious if it's the same or not.
I got through the past lecture and built the code successfully. I am now stuck when I download the code but visual studio cannot understand symbols like VkSurfaceFormatKHR.... Is there any header I need to include? (my os is windows)
Are you coding in Apple's XCode? I can't find the EXPLORER view shown on the left column. Also, how do I get XCode to recognize a make file. Sorry, just no luck finding these answers. It's still early days though. : )
Hello! I've been getting this error: " terminate called after throwing an instance of 'std::runtime_error' what(): failed to find a suitable GPU! Aborted (core dumped) " I think this comes from returning supportedFeatures.samplerAnisotrpy in the isDeviceSuitable function, but I don't know how to fix it. Does anyone know how to fix it? Also, thank you for these great tutorials!
ive had this same problem, seems like our gpus dont support anisotropic filtering. luckily this can be turned off. you can remove the check for supportedFeatures.samplerAnisotrpy and change deviceFeatures.samplerAnisotropy = VK_TRUE; to VK_FALSE in line 153 of your_enging_device.cpp im not 100% sure this works yet, ill reply to this comment after further testing
Ahh 🤦♂️ I’ll add that to my list of known issues. Mistakes like this become a lot harder to fix in an ongoing video tutorial series. Thanks for letting me know, I appreciate it!
validation layer: loader_get_json: Failed to open JSON file C:\Program Files (x86)\Epic Games\Launcher\Portal\Extras\Overlay\EOSOverlayVkLayer-Win32.json Can anyone explain to me why Vulkan is trying to grab a file from a launcher i haven't even installed (beyond shoddy uninstallers that leave crap in the registry)? Are there .json files my VulkanSDK is missing?
Are you running any processes in the background. Things like screen capture and over clocking software hook in pretty low level into the system and validation layers can pick these messages up from other programs. Perhaps the epic launcher uses some vulkan processes in some way and you’re getting cross talk. If it is just cross talk, it won’t affect how your vulkan program runs, just may clog up your logs a bit
I am doing your tutorial (btw love it so far) and I came across this error: validation layer: vkCreateInstance: Found drivers that contain devices which support the portability subset, but the portability enumeration bit was not set! Applications that wish to enumerate portability drivers must set the VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR bit in the VkInstanceCreateInfo flags and enable the VK_KHR_portability_enumeration instance extension. validation layer: vkCreateInstance: Found no drivers! How do I fix this?
If just like me you are using a Mac with M1 chip, you can define a precompilation variable for this condition that we will use later : In lve_device.hpp #if __APPLE__ #include #if TARGET_OS_MAC #if TARGET_CPU_ARM64 #define __ADD_MOLTEN_VK_CAPABILITY_MAC_ARM64__ #endif #endif #endif And later in the same file change the device extensions vector to const std::vector deviceExtensions = { VK_KHR_SWAPCHAIN_EXTENSION_NAME #ifdef __ADD_MOLTEN_VK_CAPABILITY_MAC_ARM64__ , "VK_KHR_portability_subset" #endif }; In the lve_device.cpp before creating the vk instance (vkCreateInstance), we can change the lines auto extensions = getRequiredExtensions(); createInfo.enabledExtensionCount = static_cast(extensions.size()); createInfo.ppEnabledExtensionNames = extensions.data(); to auto extensions = getRequiredExtensions(); #ifdef __ADD_MOLTEN_VK_CAPABILITY_MAC_ARM64__ extensions.emplace_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME); extensions.emplace_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); createInfo.flags |= VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR; #endif createInfo.enabledExtensionCount = static_cast(extensions.size()); createInfo.ppEnabledExtensionNames = extensions.data(); I'm not sure if this is the right condition so that it will only affect m1 macs, but it works for me and I do not have the hardware to test on multiple setup, let me know if it works!
@@homemadetech3776 Ok, it is probably just an issue with macs, you could remove the if TARGET_CPU_ARM64 and change the defined variable name to something more significative. Should probably work.
Excelent video. An honest student question, if you already had an lve namespace then why start your class names with Lve, it just could be called lve::Device instead of lve::LveDevice. Am I missing something here?
question: noticed in the LveDevice class you have a member called "properties" and in some methods you have arguments passed to them also called properties is this an issue because this is hiding the class member?
It's not causing any issues (currently) but you are absolutely right in that this does shadow the variable and isn't clean code. I should've used differentiated names. Thanks for bringing this to my attention!
yes, i would like to see a step by step tutorial for the device code :), 1 question, I have 2 gpus in my laptop that i am learning this on (integrated intel, and dedicated nvidia) it shows 3 ? plus why did it pick intel over the dedicated nvidia ?
The device code is pretty dumb, and just picks the first device that is suitable for the requested features. In your case the ordering happens to present the intel first. i still haven't gotten around to the device code walk through yet unfortunately, I'm still propritzing adding new tutorials currently. But the device code very closely follows the setup section vulkan-tutorial.com/Drawing_a_triangle/Setup/Base_code so thats a good place to start
I have a lot of mistakes : "validation layer : extension VK_KHR_surface has not been enabled", "vkGetPhysicalDeviceSupportKHR not executed!", "a bug in the application"
Hey friend! Thanks for the enthusiasm and energy in these videos! At the end on vkCreateShaderModule I had to make my shader Module a pointer, because of some compilation error, or better yet a conversion error. Do you know if it's some error in my code/compiler? It ran just fine afterwards
@@BrendanGalea Yes I like that. Is there a keybinding or something for this or was it a jump cut in your video? Because you didnt do this manually in the video.
Great tutorial series so far! I have a question though... I know you already said we'd come back to the Device class, but why does the Device class require a window on construction? It is also keeping the window as a reference, but windows can come and go, I wish to eventually support multiple windows, and it would seem off to have a 1:1 relationship between Device instances and Window instances
Great question! You are absolutely right in that this is an unnecessary restriction, but for now it really simplifies a lot. Currently I'm taking the approach of 1:1:1 for our window, device and swapchain. But it should be possible to have 1 device, with multiple window/swapchain pairs. I'm not 100% about this, but I believe there could be situations though that you can't share your device (or have to re-create it). For example, if you have a full screen window on a 10 bit HDR monitor, and then a window on another second monitor. It might be possible that the required extensions are incompatible? So until I've looked into this more I figured it would be best to keep things as straightforward as possible. Multiple windows is a really good idea for a future tutorial.
At 6:20, you create a struct that contains info for the pipeline, but isnt there a class that already exists for that, declared in glfw header files? I hope you still read comments :(
I’m not sure what you mean by the glfw header files? The struct declared at 6:20 is to specify configuration info. It’s purpose is to make it so that we can eventually create multiple pipeline objects but with slightly different behaviour as specified by the configuration info. For example one pipeline could be used to draw solid objects, when a second pipeline would be used to draw just the wireframes of an object.
Another way to think of this struct is as a replacement for the arguments to the LvePipeline constructor. Since there are so many configuration options it would be a bit impractical to create a constructor for the class with every argument. So this just cleans up the code a bit.
haha I didn't know yt comments could be that long! You're using windows right? In the LveDevice.cpp file at around line ~219 you can remove VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT The verbose level messages don't mean you're doing anything wrong and can clutter up the console.
@@BrendanGalea Ya that would make things easier i realized that when i read it. Thank you. Also Didn't know youtube messages could be that long either lmao
@@multikillgames Keep in mind this is only printed when building in Debug mode. The device class checks NDEBUG and enables some more stuff to be printed.
No unfortunately not. I’d still recommend reading the chapters on vulkan tutorial at some point as you go. You can do the tutorial series up to where I’ve left off without needing to touch anything there. But if you want to continue on after that yourself it’s definitely worth reading
I find another error in my project linked with includes. And apparently it's the structure of the include folder in the vulkan SDK, because after I manually added vulkan.h I no longer need the previous fixes.
I'm not exactly sure why, but visual studio gave me a syntax error when VkInstance is declared. I managed to fix that including "vulkan/vulkan.h" at the top of the file. Idk if I'm doing it the right way. Also thank you so much for the helpful tutorials.
i might have been relying on it being declared in some other file that was being included, glad you found the solution. That is a good way to do it and typically it's good practice to include anything you are using directly, rather than relying on it being included indirectly as I may have done.
I like your tutorial, it is more easier to understand than others. I met a problem in device.cpp: createInstance() if (enableValidationLayers && !checkValidationLayerSupport()) { throw std::runtime_error("validation layers requested, but not available!"); } It throw runtime error here evertime. Irun in visual studio 2019, x64 Vulkan version is 1.2.170.0. Vulkan should be installed correctly , because vkcube.exe was runnig like yours. I try clean the project and bind again, but still the same issue
I'm not really sure but there are a couple things we could try. It is possible that vulkan was installed correctly but for some reason the validation layers extension was not. Maybe try re-installing vulkan and see if that works. Make sure to install the SDK rather than just the runtime. It could also be a driver issue, you could try updating you graphics card drivers if you haven't recently and that could fix the issue. If those don't work let me know and we can keep looking for a solution, because debugging without validation layers would be a bit of a nightmare.
@@BrendanGalea Hey, I got the same issue with the throw std::runtime_error("validation layers requested, but not available!"); My Vulkan version is 1.2.162.1 and I am on MacOS. I have already clean all the project file, reinstall SDK and headers but it didn't change anything. Any thought ? PS: Huge thanks for this tutorial it rocks ;)
@@etiennep.1593 in your vulkansdk/Applications folder try running the vulkaninfo application. It should open a terminal and output a bunch of information. Do you see something like Layers: count = 9 ================= You should have a non-zero number of layers.
@@BrendanGalea Hey. I have checked that and it doesn't return me a count but an error... Here it is: ERROR: [Loader Message] Code 0 : loader_get_json: Failed to open JSON file /usr/local/Caskroom/vulkan-sdk/1.2.162.1/macOS/etc/vulkan/icd.d/MoltenVK_icd.json ERROR at /Users/lunarg/Dev/macos-sdk-build/Vulkan-Tools/vulkaninfo/vulkaninfo.h:668:vkCreateInstance failed with ERROR_INITIALIZATION_FAILED Saving session...completed. I have tried to reinstall MoltenVK with brew but it doesn't changed anything. It looks that the "/usr/local/Caskroom/vulkan-sdk/1.2.162.1/macOS/etc/" directory didn't exist... Even if I reinstall all SDK. EDIT: OK, I greped the JSON file and found it. The /etc/ dir was called "share" IDK why... I rename it and it looks better now. But I got an other problem... When I try to execute the programme, it can't create window surface. Here are logs: ./executable validation layer: ReadDataFilesInSearchPaths: Searching the following paths for manifest files: /Users/etienne/Documents/Vulkan/vulkan/implicit_layer.d:/etc/xdg/vulkan/implicit_layer.d:/Users/lunarg/Dev/macos-sdk-build/Vulkan-Loader/build/install/etc/vulkan/implicit_layer.d:/etc/vulkan/implicit_layer.d:/usr/local/share/vulkan/implicit_layer.d:/usr/share/vulkan/implicit_layer.d:/Users/etienne/.local/share/vulkan/implicit_layer.d validation layer: ReadDataFilesInSearchPaths: Searching the following paths for manifest files: /usr/local/Caskroom/vulkan-sdk/1.2.162.1/macOS/etc/vulkan/explicit_layer.d validation layer: ReadDataFilesInSearchPaths: Searching the following paths for manifest files: /usr/local/Caskroom/vulkan-sdk/1.2.162.1/macOS/etc/vulkan/icd.d/MoltenVK_icd.json validation layer: Searching for ICD drivers named /usr/local/lib/libMoltenVK.dylib validation layer: Build ICD instance extension list validation layer: Instance Extension: VK_KHR_device_group_creation (/usr/local/lib/libMoltenVK.dylib) version 0.0.1 validation layer: Instance Extension: VK_KHR_external_fence_capabilities (/usr/local/lib/libMoltenVK.dylib) version 0.0.1 validation layer: Instance Extension: VK_KHR_external_memory_capabilities (/usr/local/lib/libMoltenVK.dylib) version 0.0.1 validation layer: Instance Extension: VK_KHR_external_semaphore_capabilities (/usr/local/lib/libMoltenVK.dylib) version 0.0.1 validation layer: Instance Extension: VK_KHR_get_physical_device_properties2 (/usr/local/lib/libMoltenVK.dylib) version 0.0.2 validation layer: Instance Extension: VK_KHR_get_surface_capabilities2 (/usr/local/lib/libMoltenVK.dylib) version 0.0.1 validation layer: Instance Extension: VK_KHR_surface (/usr/local/lib/libMoltenVK.dylib) version 0.0.25 validation layer: Instance Extension: VK_EXT_debug_report (/usr/local/lib/libMoltenVK.dylib) version 0.0.9 validation layer: Instance Extension: VK_EXT_debug_utils (/usr/local/lib/libMoltenVK.dylib) version 0.0.2 validation layer: Instance Extension: VK_EXT_metal_surface (/usr/local/lib/libMoltenVK.dylib) version 0.0.1 validation layer: Instance Extension: VK_EXT_swapchain_colorspace (/usr/local/lib/libMoltenVK.dylib) version 0.0.4 validation layer: Instance Extension: VK_MVK_macos_surface (/usr/local/lib/libMoltenVK.dylib) version 0.0.3 validation layer: Instance Extension: VK_MVK_moltenvk (/usr/local/lib/libMoltenVK.dylib) version 0.0.29 validation layer: Loading layer library /usr/local/lib/libVkLayer_khronos_validation.dylib validation layer: Build ICD instance extension list validation layer: Instance Extension: VK_KHR_device_group_creation (/usr/local/lib/libMoltenVK.dylib) version 0.0.1 validation layer: Instance Extension: VK_KHR_external_fence_capabilities (/usr/local/lib/libMoltenVK.dylib) version 0.0.1 validation layer: Instance Extension: VK_KHR_external_memory_capabilities (/usr/local/lib/libMoltenVK.dylib) version 0.0.1 validation layer: Instance Extension: VK_KHR_external_semaphore_capabilities (/usr/local/lib/libMoltenVK.dylib) version 0.0.1 validation layer: Instance Extension: VK_KHR_get_physical_device_properties2 (/usr/local/lib/libMoltenVK.dylib) version 0.0.2 validation layer: Instance Extension: VK_KHR_get_surface_capabilities2 (/usr/local/lib/libMoltenVK.dylib) version 0.0.1 validation layer: Instance Extension: VK_KHR_surface (/usr/local/lib/libMoltenVK.dylib) version 0.0.25 validation layer: Instance Extension: VK_EXT_debug_report (/usr/local/lib/libMoltenVK.dylib) version 0.0.9 validation layer: Instance Extension: VK_EXT_debug_utils (/usr/local/lib/libMoltenVK.dylib) version 0.0.2 validation layer: Instance Extension: VK_EXT_metal_surface (/usr/local/lib/libMoltenVK.dylib) version 0.0.1 validation layer: Instance Extension: VK_EXT_swapchain_colorspace (/usr/local/lib/libMoltenVK.dylib) version 0.0.4 validation layer: Instance Extension: VK_MVK_macos_surface (/usr/local/lib/libMoltenVK.dylib) version 0.0.3 validation layer: Instance Extension: VK_MVK_moltenvk (/usr/local/lib/libMoltenVK.dylib) version 0.0.29 available extensions: VK_KHR_device_group_creation VK_KHR_external_fence_capabilities VK_KHR_external_memory_capabilities VK_KHR_external_semaphore_capabilities VK_KHR_get_physical_device_properties2 VK_KHR_get_surface_capabilities2 VK_KHR_surface VK_EXT_debug_report VK_EXT_debug_utils VK_EXT_metal_surface VK_EXT_swapchain_colorspace VK_MVK_macos_surface required extensions: VK_KHR_surface VK_EXT_metal_surface VK_EXT_debug_utils libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: failed to create window surface [1] 16229 abort ./executable If i comment the throw instruction, that tell me that: vkGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, pSupported) returns VkResultvalidation layer: Validation Error: [ UNASSIGNED-GeneralParameterError-RequiredParameter ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x99fb7dfd | vkGetPhysicalDeviceSurfaceSupportKHR: required parameter surface specified as VK_NULL_HANDLE validation layer: Validation Error: [ VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x801f247e | Invalid VkSurfaceKHR Object 0x0. The Vulkan spec states: surface must be a valid VkSurfaceKHR handle. Seems that i got a problem with the surface...
Sorry!! I didn't see this reply. Is this still not working? Can you check the output of glfwCreateWindowSurface in the window implementation? Make sure in the initWindow function you have the line glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
Hi, first of all, thanks for the tutorial i'm enjoying it! and second, at this point, can anyone knows if the error message "validation layer: Failed to open dynamic library "X:\PathToFolder\ReShade\.\ReShade64.dll" with error 1114" that appear at the top of the console (but not break the program itself so it continues printing the extensions and physical device info...) will become a problem later, my GPU is an "AMD Radeon RX 6700 XT" if it helps and Again thank you so much for this tutorial series.
Anyone have any idea why I get an abort() error when trying to run in debug mode but works completely fine in release? I'm thinking it's to do with Vulkan compatibility with visual studio unless I'm missing something obvious. Been through the video twice and I have all the code correct. Any feedback at all is great thanks (:
Not quite, vulkan is an API to communicate with a computer's graphics card. So an engine like unity or unreal could use the vulkan API for things such as rendering. But an engine also handles a lot of other systems beyond just rendering such as audio, physics, ai, animation, input, networking, etc. In this tutorial series we're using vulkan and creating our own basic engine. The initial focus of the series is mostly on rendering.
I'm using VSCode and after coping the files over and changing the namespaces and prefixes with find/replace I'm still getting many errors specifically in places that are being templemented for example: (In the .hpp file) "std::vector presentMode" The VkPresentModeKHR is what has the error on it, For the .cpp file its even weirder giving me errors on "std::" specifically even though iostream is included quite odd, any ideas why this may happen? I'ma keep working on it just curious if anyone else has had similar happen! Specifically the error is that those things are not defined The glfwCreateWindowSurface also isn't defined when I attempt to use it in my window class implementation 3:15
No need to reply it was simply a typo in my " #define GLFW_INCLUDE_VULKAN #include " I had #define GLFE_INCLUDE_VULKAN simple typo, thanks for the videos they've been great so far! :D
In file included from lve_device.cpp:1: lve_device.hpp:33:15: error: ‘LveWindow’ has not been declared 33 | LveDevice(LveWindow::LveWindow &window); lve_device.hpp:33:39: error: expected ‘)’ before ‘&’ token 33 | LveDevice(LveWindow::LveWindow &window); lve_device.hpp:96:3: error: ‘LveWindow’ does not name a type 96 | LveWindow &window; lve_device.cpp:50:25: error: expected constructor, destructor, or type conversion before ‘(’ token 50 | LveDevice::LveDevice(LveWindow &window) : window{window} { lve_device.cpp:50:64: error: expected unqualified-id before ‘{’ token 50 | LveDevice::LveDevice(LveWindow &window) : window{window} { lve_device.cpp: In member function ‘void lve::LveDevice::createSurface()’: lve_device.cpp:196:37: error: ‘window’ was not declared in this scope 196 | void LveDevice::createSurface() { window.createWindowSurface(instance, &surface_); }
sorry for the slow reply, any luck figuring this out? For debugging-help you can try posting in that group on the discord discord.gg/CUQkuKsszr, Myself or somebody else is usually pretty quick to respond
prolly would've been better off writing it instead tbh, trying to do this with SDL instead of GLFW and process is it bit more frustrating converting code to be compatible.
@@tweetyguy7347 sdl is not only the standard for engines but more powerful than glfw in terms of its features. Im also more familiar with it since ive been using sdl for around 4+ years
Creating a Cpp class is a fucking chore. You have to create 6 object lifetime functions. The dawn implicit move and assignement functions don't do what they are suppose to do.
I am using GitHub? Or do you mean for the pastebin… lol that’s a good point, mainly because I record the videos before committing to git but I could make it work. Thanks for the feedback!
Great videos, but throwing code out of the blue that does x, y and z and change a, b and c to make it work it is a little bit discouraging, I'll continue with the videos left no matter what. As a suggestion, for the 3 initial videos, spending more time on the device setup code would have been more useful than the time spent explaining how to read a file or basic c++ stuff, in my opinion, people who already have knowledge in c++ should already known how to find the compiler and modify the makefile and whatnot, having a class diagram, since we are using classes, would have been useful too, take this as a constructive opinion, I'm already subscribed to your channel, thanks.
Thank you, I appreaciate the honest feedback! The main reasoning I avoided spending much time on the device setup code was I wanted to avoid just re-treading material on vulkan-tutorial.com, and also felt like its a lot of information to take in, and without some more context the later tutorials provide, is difficult to understand. But ya... honestly I'd really like to completely re-do the first 5 tutorials if I could, especially now that Vulkan 1.3 has been released which would drastically simplify the swap chain code to the point where I could have covered it from the start. As for all the other points you brought up, noted and I agree. I'll keep that in my when making future tutorials. Thanks again!
The problem with this tutorial is that this is a Vulkan tutorial. Although this series is most likely completed, I wanted to point out that what makes copying code so bad is that it's defeating the entire purpose of Vulkan, by copying code which is integral to Vulkan and what actually makes Vulkan it's own. The main goal of Vulkan is not to render a cube, this could be done with OpenGL or any other API, but what makes Vulkan different from an OpenGL tutorial is it's verbose low level design like setting up a logical device, etc. You can't learn a language like Spanish by using google translate. Of course this is just my opinion but again the viewers should not be dependent on downloaded code that they don't understand as beginners, which should have been the main talking points of this tutorial. Anyways that's my only issue with it, I do really like the quality of this series and how beginner friendly it is (excluding the copying).
Thanks for the honest critical feedback. I agree with what you’re saying. However if I was to do this again I would do it in the same way. I want to build up more of the surrounding context around renderpasses, framebuffers, etc where the tutorials covering each of these topics can really go into the proper depth, before going back and then going over the swap chain and device code. When I was first writing the tutorials for the device and swap chain code it was just information overload so I scrapped them and went the other direction. So hopefully in about 4ish months when I have a chance to start making videos again there will be just a few more topics covered before we finally go back to rewrite the swap chain and device code
It is nice that you split the code into separate classes unlike the original tutorial.
It is pretty nice, i'm more of a fan of mostly single files myself tho :)
@@abarry6002 programmers must enjoy collaborating with you ;)
@@Crimspn lmao
@@abarry6002 Programmers after finding your file: "Cast into the fire! Destroy it!"
You:
"No."
@@Crimspn and all the dudes in the thread:
It doesn't make sense to create an architecture with an API you have no idea how it works in the first place. in this scenario learning in a single file is optimal. Later, after you understand what's going on, is when splitting into different files becomes a necessity, and guess what? you will be in a better position to create an architecture that really fits your needs ;)
Thank you for your tutorial since my internship will use Vulkan in the projects. Small fixing- you guys should add #include in the device folder for those errors when you just put the files into the project folder.
Please make that appendix! I would love to know this stuff in depth.
From articulation to beginner-friendliness, I can easily say Brendan has a teaching style far better than 95% College and University professors.
I will be far ahead of many students due to ease of learning and high reward/work ratio.
I had originally tried to start with this tutorial series, but felt a bit lost having copied much of this code. I ended up going back to the vulkan-tutorial site and really spending some time working through that and drawing out exactly how everything works. Coming back to this tutorial series after a few weeks of REALLY burying my head in the weeds of everything has made stuff a LOT clearer. I especially like how this tutorial shows how one could break things up into classes so you can build your own API around your specific needs.
All in all, really great tutorial but for personally I found it easier to approach this tutorial series after having really dived into the details of Vulkan on my own both through the vulkan-tutorial site, and supplemental reading of documentation. So if you're finding it difficult to follow (like I was) perhaps take a step back to the original vulkan-tutorial first and really focus on reading the relevant documentation and playing around with that a bit on your own.
Great tutorial, and has really helped me out! Thanks so much
I'm so thankful that you did it that way instead of writing all the code manually and simultaneously explaining it, exactly what I was looking for
almost a year later and this series is still a goldmine of information
What I like the most about your series is that you really teach something and also that you don't use an IDE. For many people IDE's make it easier, but I personally find that IDE's make everything more complicated. ^^" So a big thank you for using vs code!!
vscode is an ide but a slim down version of your typical IDE.
@@EmperorKagato Not really. Its a beefed up text editor.
This is a fantastic tutorial. I'm a fairly experienced coder, however I'm new to C++ (Coming from C# and Python). Going through this is helping me learn both about C++ and Vulkan. Thanks
I watched this tutorial when it first came out but I hated the idea of copying code, i left and started doing stuff on my own. I figured how all of the Instance-Device-Surface stuff works and now I want to focus on the rest, so now this tutorial is perfect because it skips what i already know and goes to what I do not know.
Nice!! That will definitely be useful information going forward and will provide some context for what we’re doing.
Thank you for making this! I'm a software engineer transitioning into graphics, and this tutorial is absolutely amazing!! Thank you for making these!
Yes please make that appendix tutorial.. you are a great tutor
+1 on this request :D
+1 on this request
To all the things you said in the end.
"Yes please :)"
Thanks for the videos :)
Have a great day kind sir!
Really loving these tutorials
They help write nice, clean code for the engine
and you explain things really well
thanks for these
oh boy , I'm enjoying this series , it's much simpler to grasp when compare to Vulkan tutorial docs. 👍
For those of you who might have an error saying your window class is not recognized, be sure to change the namespace in both device files, don't think he mentiones that. Great video Brendan!
Thanks for catching this!
@@BrendanGalea No problem :). THank YOU for this amazing content!
thanks! I thought I was going crazy and redid everything a few times.
Personally, learning Mr. Galea's tutorial on different platform (Windows 10) with my own variable naming and style, makes everything more make sense
I would vote to skip the device setup video unless you had the extra time. It gives me a reason to dive into the docs and compile more notes anyway. Looking forward to more!
Ya my main focus is getting out more tutorials. Once I cover the basics, which should be around tutorial 25, then I think I'll do the appendix just to have a complete series.
Love this series so much. Thanks for existing man
I really appreciate your tutorials. They have been very helpful at explaining vulkan and graphics programming to me. I don't mean to be mean but I'd rather want a very flat code where it is shown what steps are taken one by one, that way it's easier for the beginners to see the usage and what has to happen in what order.
thanks for the feedback! I'd highly recommend checking out vulkan-tutorial.com for step by step instructions. I'm trying to structure this as how to build out an engine so its hard for the series not to jump around a bit. It's a bit of a balancing act between a bunch of different constraints for me when trying to design these tutorials, and I don't always get it right. So defintely don't use me as your only source. But I'll keep trying to do my best to make the series as easy to follow as possible
You are actually a really amazing person Brendan Galea. I really respect your approach to teaching.
Step by step is mush appreciated. This is the way i learn.
Ya I still need to get around to creating the device appendix video, but every time i start on it it just feels like im reiterating vulkan-tutorial.com :/
I highly recommend giving the device creation secion a 15 minute read, which gives a step by step appraoch as to how that code was constructure.
I really like the progressive way this difficult subject is taught.
Not a big fan of tutorials that tell you to drag and drop code samples either, but after having done the Vulkan Tutorials previously to your tutorials, I'm happy you chose to do it this way and I won't have to watch you type those chapters. 😂
Love it. Vulkan seems to have a lot of boilerplate to set it up (which is good for fine tuning, but is a pain to churn through). This tutorial is fantastic.
I appreciated the approach of giving us those files-- my first time through vulkan-tutorial that part was really a drag to get through and very discouraging
`.clang-format` w/ "Format on Save" option in VSCode is awesome! 👍
I added these options to match the YT vids:
DerivePointerAlignment: false,
PointerAlignment: Left
thanks so much, this is perfect timing as i'm just starting my Vulkan journey. please do the explanation video (if that ship hasn't sailed)
Yes will do!
Your approach with asking people to download some code is great if you're working with C++, but I've been following your tutorials and converting it to Rust on the go. So having to figure out what you're doing in your little C++ engine and mass-converting it is a lot harder. That's the only downside I can think of with that approach.
Thank you, That is a good point. I should make rust files available as well.
@@BrendanGalea I'm going through your code now trying to convert it using the Vulkano crate rather than an unsafe wrapper like Erupt.
@@BrendanGalea BTW, I am really excited about this series. Not just from a Vulkan point of view, but graphics programming in general.
Let me know if you run into issues and I’ll do my best to help. (Ive never used rust though so the capacity I can help in is limited)
Another amazing one. I watched all the series and thank you again!
Having to download code is a huge bummer for anyone not using C++. Still an excellent series but I thought I'd share the feedback.
Ya that’s a really good point. What language are you using. I’ll ask on our discord if anyone has done it in a different language and if they are alright letting me share links to it.
Quality content at every step!
love your tutorial thus far!
Thank you!!
You do really great explanations, keep up tge good work. I am really interested :)
+1
thanks for this, man, don't give up, wellwork
Bro got me good with the code to download, unfortunatelly for me, im implementing the tutorial with other names so i'll take my time translating everything. Still think that i`ll end up learnng a lot, so thanks!!! I`m really enjoying thinks so far! Edit, it was actually very fast, nice.
Keep up the good work !!
I was having an issue when running this code in Debug configuration, turns out the validation layers couldn't load. If that happens, you need to define some system environment variables (on Windows): VK_INSTANCE_LAYERS and VK_LAYER_PATH. For some reason, the validation layers check didn't catch this problem.
Thanks for mentioning! I wasn't aware of this issue.
@theRPGmaster Dude tysm, you're thee year old comment saved me a BUNCH of time probably :D.
For anyone encountering issues with the validation layer on Arch Linux, try installing the `vulkan-extra-layers` package via your package manager.
that's good to know, thanks for sharing this!
I'm getting "terminating with uncaught exception of type std::runtime_error: validation layers requested, but not available!"
What can possibly be the problem here?
this can be a bit tricky. My first recommendation is try re-installing vulkan, make sure you're downloading the vulkanSDK and not just the vulkan runtime.
Next if that doesn't fix the issue,
in the vulkanSDK/Applications directory there should be an application called vulkaninfo.
Try running that and in the output nearish the top you should see something like
Layers: count = 8
=================
Where validation layer count should be some number greater than 0.
Then another thing you could try is in the same directory try opening vkconfig, have selected the validation layers option, and then run your program and see if the validation layers can be found in that case.
if you're getting a fatal compile error then try replacing all occurrences of std::endl in the lve_device.cpp with '
'. I think it could potentially interfere with the other output sequences(functions that are also using cout) since it flushes the output buffer when its called. very likely something a bit more complicated like multi threading issues but that's a rabbit hole i have yet to dive into.
In the pipeline class you're not deleting the copy assignment function. The copy assignment function returns a reference to the class name, it doesn't return void.
yikes, thanks for catching this! I go on to make this mistake in multiple spots. I'll mention this in the next tutorial I make.
best of best
Great so far, but I can't get this stage working on an M1 Mac. I keep getting error about " Cocoa: Vulkan instance missing VK_EXT_metal_surface extension", despite it being included in the available extensions list.
its throwing me a runtime error at VkApplication info. how to solve that error?
I was trying to follow in python, translating the c++ code in real time. but how can i use the premade code?....... i'm not google translate of coding unfortunately
Maybe try translating with chatgpt?
But I think others have done this in python. You could check the discord and ask there (link is on the later video descriptions)
Sorry I can’t be more help. Dumb of me to not think of this scenario when I was making these originally. I regret not covering this content
the downloaded code is giving me syntax errors all over the place. I assume I did something wrong with the vulcan download or linking or so, but i cant figure it out.
13:02 when i build i get the std::runtime_error at memory location in device.cpp, how do i fix it ?
EDIT : If i continue the code execution i get 4 more errors just like this one, but the last one is a stopping error at line 111 in device.cpp where it gives me an Access violation in deviceCount == 0
no idea what is happening, but when i run my code in debug mode in vs2022 (haven't tried any other ide), there are multiple memory related errors, that start at memory allocation for appInfo. dunno what's the problem, but when i run code in release mode, it's running smoothly
Great tutorials. Thanks!
Appendix would be helpful!
sir, why my window background is white not black as yours?, i'm using windows11
Just the default clear color. In the subsequent tutorials we set the background color each frame so you will be able to set it to black or whatever you wish then!
I'm getting an error: invalid conversion from ‘uint32_t’ {aka ‘unsigned int’} to ‘const uint32_t*’ {aka ‘const unsigned int*’} [-fpermissive]
I'm using gcc in VSCode on linux. What should I do?
Sounds like you’re trying to pass an int to something that takes and int pointer. You might be missing an &.
What’s the line of code?
I keep getting a linker tools error even though I copied the entire files it keeps failing to run if I build with the device
Hey just curious I see you using the brackets to create objects, e.g.: PipelineConfigInfo configInfo{}; I'm curious if there was a reason for that or if that's just your personal style? I googled it and I believe that statement sans brackets is the same. Similar for lveDevice{lveWindow}; Is that just cleaner than passing the window to it in the constructor? You could do something like FirstApp(lveWindow(w,h,name); lveDevice(lveWindow);). Isn't doing it how you did it functionally the same as doing it in the constructor? The way you did it looks clean just curious if it's the same or not.
I have a question, is it possible to use std::a vector for queue indexes, if I need all queues with one property?
I'm not sure what you're referring to, could you please elaborate?
I got through the past lecture and built the code successfully. I am now stuck when I download the code but visual studio cannot understand symbols like VkSurfaceFormatKHR.... Is there any header I need to include? (my os is windows)
Are you coding in Apple's XCode? I can't find the EXPLORER view shown on the left column. Also, how do I get XCode to recognize a make file. Sorry, just no luck finding these answers. It's still early days though. : )
He's using VS Code, not XCode. Hope it helps.
Hello! I've been getting this error: " terminate called after throwing an instance of 'std::runtime_error'
what(): failed to find a suitable GPU!
Aborted (core dumped) "
I think this comes from returning supportedFeatures.samplerAnisotrpy in the isDeviceSuitable function, but I don't know how to fix it.
Does anyone know how to fix it? Also, thank you for these great tutorials!
ive had this same problem, seems like our gpus dont support anisotropic filtering.
luckily this can be turned off.
you can remove the check for supportedFeatures.samplerAnisotrpy and change deviceFeatures.samplerAnisotropy = VK_TRUE; to VK_FALSE in line 153 of your_enging_device.cpp
im not 100% sure this works yet, ill reply to this comment after further testing
I have a small problem. It only works in release mode. In debug mode I get an unhandled exception at runtime. Does anyone know if this is ok?
In the device class, you misspelled glfw as gflw in the function "hasGlfwRequiredInstanceExtensions".
Ahh 🤦♂️ I’ll add that to my list of known issues. Mistakes like this become a lot harder to fix in an ongoing video tutorial series.
Thanks for letting me know, I appreciate it!
the device setup "appendix A" video would be quite welcome, if you have the time to add it. thanks a lot!
validation layer: loader_get_json: Failed to open JSON file C:\Program Files (x86)\Epic Games\Launcher\Portal\Extras\Overlay\EOSOverlayVkLayer-Win32.json
Can anyone explain to me why Vulkan is trying to grab a file from a launcher i haven't even installed (beyond shoddy uninstallers that leave crap in the registry)?
Are there .json files my VulkanSDK is missing?
Are you running any processes in the background. Things like screen capture and over clocking software hook in pretty low level into the system and validation layers can pick these messages up from other programs.
Perhaps the epic launcher uses some vulkan processes in some way and you’re getting cross talk.
If it is just cross talk, it won’t affect how your vulkan program runs, just may clog up your logs a bit
I am doing your tutorial (btw love it so far) and I came across this error:
validation layer: vkCreateInstance: Found drivers that contain devices which support the portability subset, but the portability enumeration bit was not set! Applications that wish to enumerate portability drivers must set the VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR bit in the VkInstanceCreateInfo flags and enable the VK_KHR_portability_enumeration instance extension.
validation layer: vkCreateInstance: Found no drivers!
How do I fix this?
Try this:
1. On device.cpp VkInstanceCreateInfo struct, after getRequiredExtensions() function call add following: extensions.emplace_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME); extensions.emplace_back("VK_KHR_get_physical_device_properties2");
createInfo.flags |= VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
2. On device.hpp modify deviceExtensions vector as following:
const std::vector deviceExtensions = {VK_KHR_SWAPCHAIN_EXTENSION_NAME, "VK_KHR_portability_subset"};
If just like me you are using a Mac with M1 chip, you can define a precompilation variable for this condition that we will use later :
In lve_device.hpp
#if __APPLE__
#include
#if TARGET_OS_MAC
#if TARGET_CPU_ARM64
#define __ADD_MOLTEN_VK_CAPABILITY_MAC_ARM64__
#endif
#endif
#endif
And later in the same file change the device extensions vector to
const std::vector deviceExtensions = {
VK_KHR_SWAPCHAIN_EXTENSION_NAME
#ifdef __ADD_MOLTEN_VK_CAPABILITY_MAC_ARM64__
, "VK_KHR_portability_subset"
#endif
};
In the lve_device.cpp before creating the vk instance (vkCreateInstance), we can change the lines
auto extensions = getRequiredExtensions();
createInfo.enabledExtensionCount = static_cast(extensions.size());
createInfo.ppEnabledExtensionNames = extensions.data();
to
auto extensions = getRequiredExtensions();
#ifdef __ADD_MOLTEN_VK_CAPABILITY_MAC_ARM64__
extensions.emplace_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME);
extensions.emplace_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
createInfo.flags |= VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
#endif
createInfo.enabledExtensionCount = static_cast(extensions.size());
createInfo.ppEnabledExtensionNames = extensions.data();
I'm not sure if this is the right condition so that it will only affect m1 macs, but it works for me and I do not have the hardware to test on multiple setup, let me know if it works!
I am sorry but I am using intel
@@homemadetech3776 Ok, it is probably just an issue with macs, you could remove the if TARGET_CPU_ARM64 and change the defined variable name to something more significative. Should probably work.
Thank you!
Excelent video. An honest student question, if you already had an lve namespace then why start your class names with Lve, it just could be called lve::Device instead of lve::LveDevice. Am I missing something here?
question: noticed in the LveDevice class you have a member called "properties" and in some methods you have arguments passed to them also called properties is this an issue because this is hiding the class member?
It's not causing any issues (currently) but you are absolutely right in that this does shadow the variable and isn't clean code. I should've used differentiated names. Thanks for bringing this to my attention!
@@BrendanGalea also noticed same shadowing warnings for "swapChainExtent" when I added the swap chain class is video 5.
yes, i would like to see a step by step tutorial for the device code :), 1 question, I have 2 gpus in my laptop that i am learning this on (integrated intel, and dedicated nvidia) it shows 3 ? plus why did it pick intel over the dedicated nvidia ?
The device code is pretty dumb, and just picks the first device that is suitable for the requested features. In your case the ordering happens to present the intel first.
i still haven't gotten around to the device code walk through yet unfortunately, I'm still propritzing adding new tutorials currently. But the device code very closely follows the setup section vulkan-tutorial.com/Drawing_a_triangle/Setup/Base_code so thats a good place to start
I have a lot of mistakes : "validation layer : extension VK_KHR_surface has not been enabled", "vkGetPhysicalDeviceSupportKHR not executed!", "a bug in the application"
hmm thats strange, is the program crashing?
Hey friend! Thanks for the enthusiasm and energy in these videos! At the end on vkCreateShaderModule I had to make my shader Module a pointer, because of some compilation error, or better yet a conversion error. Do you know if it's some error in my code/compiler? It ran just fine afterwards
Hmm that’s pretty strange. I’ve tested the code on most compilers now. What compiler were you using? And do you have the error message?
I'm sorry, it was a typo on my code. I found it today, just a missing pointer operator. Thanks
No worries! Hope you’ve been finding the tutorials helpful ☺️
7:13 How did you align those parameters (keybinding?) ?
I'm not sure which parameters you're referring to?
The parameters of createGraphicsPipeline(...). I'm talking about the code style formatting of a bunch of parameters (= new line for each argument)
Oh it’s still just the order of the arguments. It’s just multiline for formatting to make it more readable
@@BrendanGalea Yes I like that. Is there a keybinding or something for this or was it a jump cut in your video? Because you didnt do this manually in the video.
ya that was just my editor. It applies auto-formatting when I save.
Great tutorial series so far! I have a question though... I know you already said we'd come back to the Device class, but why does the Device class require a window on construction? It is also keeping the window as a reference, but windows can come and go, I wish to eventually support multiple windows, and it would seem off to have a 1:1 relationship between Device instances and Window instances
Great question! You are absolutely right in that this is an unnecessary restriction, but for now it really simplifies a lot. Currently I'm taking the approach of 1:1:1 for our window, device and swapchain. But it should be possible to have 1 device, with multiple window/swapchain pairs.
I'm not 100% about this, but I believe there could be situations though that you can't share your device (or have to re-create it). For example, if you have a full screen window on a 10 bit HDR monitor, and then a window on another second monitor. It might be possible that the required extensions are incompatible?
So until I've looked into this more I figured it would be best to keep things as straightforward as possible. Multiple windows is a really good idea for a future tutorial.
@@BrendanGalea Yeah right, a number of good points! That's very useful info to keep in mind when I do eventually break the 1:1:1 in my own engine
You have a MacBook Pro 13" i5 from 2017 either 3.3 or 3.5, am i correct?
Correct!
At 6:20, you create a struct that contains info for the pipeline, but isnt there a class that already exists for that, declared in glfw header files?
I hope you still read comments :(
I’m not sure what you mean by the glfw header files?
The struct declared at 6:20 is to specify configuration info. It’s purpose is to make it so that we can eventually create multiple pipeline objects but with slightly different behaviour as specified by the configuration info. For example one pipeline could be used to draw solid objects, when a second pipeline would be used to draw just the wireframes of an object.
Another way to think of this struct is as a replacement for the arguments to the LvePipeline constructor. Since there are so many configuration options it would be a bit impractical to create a constructor for the class with every argument.
So this just cleans up the code a bit.
@@BrendanGalea I see, thx for the explanation.
awesome
When I compile at the end the validation layer: gives me a bunch of messages.
Something like this:
tory
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_8bit_storage (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_bind_memory2 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_buffer_device_address (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_copy_commands2 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_create_renderpass2 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_dedicated_allocation (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.3
validation layer: Device Extension: VK_KHR_deferred_host_operations (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.3
validation layer: Device Extension: VK_KHR_depth_stencil_resolve (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_descriptor_update_template (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_device_group (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.4
validation layer: Device Extension: VK_KHR_draw_indirect_count (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_driver_properties (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_external_fence (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_external_fence_win32 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_external_memory (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_external_memory_win32 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_external_semaphore (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_external_semaphore_win32 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_get_memory_requirements2 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_image_format_list (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_imageless_framebuffer (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_maintenance1 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.2
validation layer: Device Extension: VK_KHR_maintenance2 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_maintenance3 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_multiview (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_pipeline_executable_properties (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_pipeline_library (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_push_descriptor (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.2
validation layer: Device Extension: VK_KHR_relaxed_block_layout (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_sampler_mirror_clamp_to_edge (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.3
validation layer: Device Extension: VK_KHR_sampler_ycbcr_conversion (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.14
validation layer: Device Extension: VK_KHR_separate_depth_stencil_layouts (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_shader_atomic_int64 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_shader_clock (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_shader_draw_parameters (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_shader_float16_int8 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_shader_float_controls (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.4
validation layer: Device Extension: VK_KHR_shader_non_semantic_info (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_shader_subgroup_extended_types (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_shader_terminate_invocation (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_spirv_1_4 (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_storage_buffer_storage_class (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_swapchain (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.70
validation layer: Device Extension: VK_KHR_swapchain_mutable_format (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_timeline_semaphore (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.2
validation layer: Device Extension: VK_KHR_uniform_buffer_standard_layout (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_variable_pointers (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_KHR_vulkan_memory_model (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.3
validation layer: Device Extension: VK_KHR_win32_keyed_mutex (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_EXT_4444_formats (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_EXT_blend_operation_advanced (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.2
validation layer: Device Extension: VK_EXT_buffer_device_address (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.2
validation layer: Device Extension: VK_EXT_calibrated_timestamps (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_EXT_conditional_rendering (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.2
validation layer: Device Extension: VK_EXT_conservative_rasterization (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.1
validation layer: Device Extension: VK_EXT_custom_border_color (C:\Windows\System32\DriverStore\FileRepository
vmii.inf_amd64_ea7416dfc07162e7\.
voglv64.dll) version 0.0.12
haha I didn't know yt comments could be that long! You're using windows right? In the LveDevice.cpp file at around line ~219 you can remove VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT
The verbose level messages don't mean you're doing anything wrong and can clutter up the console.
@@BrendanGalea Ya that would make things easier i realized that when i read it. Thank you. Also Didn't know youtube messages could be that long either lmao
@@multikillgames Keep in mind this is only printed when building in Debug mode. The device class checks NDEBUG and enables some more stuff to be printed.
Did you ever get a device setup video in more detail?
No unfortunately not. I’d still recommend reading the chapters on vulkan tutorial at some point as you go. You can do the tutorial series up to where I’ve left off without needing to touch anything there. But if you want to continue on after that yourself it’s definitely worth reading
Hello! Why VKAPI_ATTR, VkDebugUtilsMessageSeverityFlagBitsEXT and other VK structs and macros highlighted in red? Can't find answer in google(
This applies to newly added files. The code from the previous tutorials works fine.
The IDE claims that these types are not defined
I fix it, with including:
#include
#include
but i don't understand why i should include it manualy.
I find another error in my project linked with includes. And apparently it's the structure of the include folder in the vulkan SDK, because after I manually added vulkan.h I no longer need the previous fixes.
This is the final part of my diary. I was so stupid. I must define #define GLFW_INCLUDE_VULKAN, but define this: #define GLFW_VULKAN_INCLUDE
I'm not exactly sure why, but visual studio gave me a syntax error when VkInstance is declared. I managed to fix that including "vulkan/vulkan.h" at the top of the file. Idk if I'm doing it the right way.
Also thank you so much for the helpful tutorials.
i might have been relying on it being declared in some other file that was being included, glad you found the solution. That is a good way to do it and typically it's good practice to include anything you are using directly, rather than relying on it being included indirectly as I may have done.
@@BrendanGalea I also needed to add #include "vulkan/vulkan.h" to both device files for it to work
I know it's 3 years late, but please an step-by-step video of the device code
Great tutorial, thanks! But when i tried to run example to this tutorial, i got assert that pipelineLayout in configInfo is nullptr.
Yup that’s expected at this point!
@@BrendanGalea my bad!
I like your tutorial, it is more easier to understand than others.
I met a problem in device.cpp: createInstance()
if (enableValidationLayers && !checkValidationLayerSupport()) {
throw std::runtime_error("validation layers requested, but not available!");
}
It throw runtime error here evertime.
Irun in visual studio 2019, x64
Vulkan version is 1.2.170.0.
Vulkan should be installed correctly , because vkcube.exe was runnig like yours.
I try clean the project and bind again, but still the same issue
I'm not really sure but there are a couple things we could try. It is possible that vulkan was installed correctly but for some reason the validation layers extension was not.
Maybe try re-installing vulkan and see if that works. Make sure to install the SDK rather than just the runtime.
It could also be a driver issue, you could try updating you graphics card drivers if you haven't recently and that could fix the issue.
If those don't work let me know and we can keep looking for a solution, because debugging without validation layers would be a bit of a nightmare.
@@BrendanGalea Hey, I got the same issue with the throw std::runtime_error("validation layers requested, but not available!"); My Vulkan version is 1.2.162.1 and I am on MacOS. I have already clean all the project file, reinstall SDK and headers but it didn't change anything. Any thought ? PS: Huge thanks for this tutorial it rocks ;)
@@etiennep.1593 in your vulkansdk/Applications folder try running the vulkaninfo application. It should open a terminal and output a bunch of information.
Do you see something like
Layers: count = 9
=================
You should have a non-zero number of layers.
@@BrendanGalea Hey. I have checked that and it doesn't return me a count but an error... Here it is:
ERROR: [Loader Message] Code 0 : loader_get_json: Failed to open JSON file /usr/local/Caskroom/vulkan-sdk/1.2.162.1/macOS/etc/vulkan/icd.d/MoltenVK_icd.json
ERROR at /Users/lunarg/Dev/macos-sdk-build/Vulkan-Tools/vulkaninfo/vulkaninfo.h:668:vkCreateInstance failed with ERROR_INITIALIZATION_FAILED
Saving session...completed.
I have tried to reinstall MoltenVK with brew but it doesn't changed anything. It looks that the "/usr/local/Caskroom/vulkan-sdk/1.2.162.1/macOS/etc/" directory didn't exist... Even if I reinstall all SDK.
EDIT: OK, I greped the JSON file and found it. The /etc/ dir was called "share" IDK why... I rename it and it looks better now. But I got an other problem... When I try to execute the programme, it can't create window surface. Here are logs:
./executable
validation layer: ReadDataFilesInSearchPaths: Searching the following paths for manifest files: /Users/etienne/Documents/Vulkan/vulkan/implicit_layer.d:/etc/xdg/vulkan/implicit_layer.d:/Users/lunarg/Dev/macos-sdk-build/Vulkan-Loader/build/install/etc/vulkan/implicit_layer.d:/etc/vulkan/implicit_layer.d:/usr/local/share/vulkan/implicit_layer.d:/usr/share/vulkan/implicit_layer.d:/Users/etienne/.local/share/vulkan/implicit_layer.d
validation layer: ReadDataFilesInSearchPaths: Searching the following paths for manifest files: /usr/local/Caskroom/vulkan-sdk/1.2.162.1/macOS/etc/vulkan/explicit_layer.d
validation layer: ReadDataFilesInSearchPaths: Searching the following paths for manifest files: /usr/local/Caskroom/vulkan-sdk/1.2.162.1/macOS/etc/vulkan/icd.d/MoltenVK_icd.json
validation layer: Searching for ICD drivers named /usr/local/lib/libMoltenVK.dylib
validation layer: Build ICD instance extension list
validation layer: Instance Extension: VK_KHR_device_group_creation (/usr/local/lib/libMoltenVK.dylib) version 0.0.1
validation layer: Instance Extension: VK_KHR_external_fence_capabilities (/usr/local/lib/libMoltenVK.dylib) version 0.0.1
validation layer: Instance Extension: VK_KHR_external_memory_capabilities (/usr/local/lib/libMoltenVK.dylib) version 0.0.1
validation layer: Instance Extension: VK_KHR_external_semaphore_capabilities (/usr/local/lib/libMoltenVK.dylib) version 0.0.1
validation layer: Instance Extension: VK_KHR_get_physical_device_properties2 (/usr/local/lib/libMoltenVK.dylib) version 0.0.2
validation layer: Instance Extension: VK_KHR_get_surface_capabilities2 (/usr/local/lib/libMoltenVK.dylib) version 0.0.1
validation layer: Instance Extension: VK_KHR_surface (/usr/local/lib/libMoltenVK.dylib) version 0.0.25
validation layer: Instance Extension: VK_EXT_debug_report (/usr/local/lib/libMoltenVK.dylib) version 0.0.9
validation layer: Instance Extension: VK_EXT_debug_utils (/usr/local/lib/libMoltenVK.dylib) version 0.0.2
validation layer: Instance Extension: VK_EXT_metal_surface (/usr/local/lib/libMoltenVK.dylib) version 0.0.1
validation layer: Instance Extension: VK_EXT_swapchain_colorspace (/usr/local/lib/libMoltenVK.dylib) version 0.0.4
validation layer: Instance Extension: VK_MVK_macos_surface (/usr/local/lib/libMoltenVK.dylib) version 0.0.3
validation layer: Instance Extension: VK_MVK_moltenvk (/usr/local/lib/libMoltenVK.dylib) version 0.0.29
validation layer: Loading layer library /usr/local/lib/libVkLayer_khronos_validation.dylib
validation layer: Build ICD instance extension list
validation layer: Instance Extension: VK_KHR_device_group_creation (/usr/local/lib/libMoltenVK.dylib) version 0.0.1
validation layer: Instance Extension: VK_KHR_external_fence_capabilities (/usr/local/lib/libMoltenVK.dylib) version 0.0.1
validation layer: Instance Extension: VK_KHR_external_memory_capabilities (/usr/local/lib/libMoltenVK.dylib) version 0.0.1
validation layer: Instance Extension: VK_KHR_external_semaphore_capabilities (/usr/local/lib/libMoltenVK.dylib) version 0.0.1
validation layer: Instance Extension: VK_KHR_get_physical_device_properties2 (/usr/local/lib/libMoltenVK.dylib) version 0.0.2
validation layer: Instance Extension: VK_KHR_get_surface_capabilities2 (/usr/local/lib/libMoltenVK.dylib) version 0.0.1
validation layer: Instance Extension: VK_KHR_surface (/usr/local/lib/libMoltenVK.dylib) version 0.0.25
validation layer: Instance Extension: VK_EXT_debug_report (/usr/local/lib/libMoltenVK.dylib) version 0.0.9
validation layer: Instance Extension: VK_EXT_debug_utils (/usr/local/lib/libMoltenVK.dylib) version 0.0.2
validation layer: Instance Extension: VK_EXT_metal_surface (/usr/local/lib/libMoltenVK.dylib) version 0.0.1
validation layer: Instance Extension: VK_EXT_swapchain_colorspace (/usr/local/lib/libMoltenVK.dylib) version 0.0.4
validation layer: Instance Extension: VK_MVK_macos_surface (/usr/local/lib/libMoltenVK.dylib) version 0.0.3
validation layer: Instance Extension: VK_MVK_moltenvk (/usr/local/lib/libMoltenVK.dylib) version 0.0.29
available extensions:
VK_KHR_device_group_creation
VK_KHR_external_fence_capabilities
VK_KHR_external_memory_capabilities
VK_KHR_external_semaphore_capabilities
VK_KHR_get_physical_device_properties2
VK_KHR_get_surface_capabilities2
VK_KHR_surface
VK_EXT_debug_report
VK_EXT_debug_utils
VK_EXT_metal_surface
VK_EXT_swapchain_colorspace
VK_MVK_macos_surface
required extensions:
VK_KHR_surface
VK_EXT_metal_surface
VK_EXT_debug_utils
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: failed to create window surface
[1] 16229 abort ./executable
If i comment the throw instruction, that tell me that:
vkGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, surface, pSupported) returns VkResultvalidation layer: Validation Error: [ UNASSIGNED-GeneralParameterError-RequiredParameter ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x99fb7dfd | vkGetPhysicalDeviceSurfaceSupportKHR: required parameter surface specified as VK_NULL_HANDLE
validation layer: Validation Error: [ VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x801f247e | Invalid VkSurfaceKHR Object 0x0. The Vulkan spec states: surface must be a valid VkSurfaceKHR handle.
Seems that i got a problem with the surface...
Sorry!! I didn't see this reply. Is this still not working?
Can you check the output of glfwCreateWindowSurface in the window implementation? Make sure in the initWindow function you have the line glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
Hi, first of all, thanks for the tutorial i'm enjoying it! and second, at this point, can anyone knows if the error message "validation layer: Failed to open dynamic library "X:\PathToFolder\ReShade\.\ReShade64.dll" with error 1114" that appear at the top of the console (but not break the program itself so it continues printing the extensions and physical device info...) will become a problem later, my GPU is an "AMD Radeon RX 6700 XT" if it helps and Again thank you so much for this tutorial series.
goole drive link has failed, please update it
Anyone have any idea why I get an abort() error when trying to run in debug mode but works completely fine in release? I'm thinking it's to do with Vulkan compatibility with visual studio unless I'm missing something obvious. Been through the video twice and I have all the code correct. Any feedback at all is great thanks (:
When I run the exe file I have abort() error but when I run it on vs it works fine
I'm really lost. Vulkan is a game engine like unity and unreal?
Not quite, vulkan is an API to communicate with a computer's graphics card. So an engine like unity or unreal could use the vulkan API for things such as rendering. But an engine also handles a lot of other systems beyond just rendering such as audio, physics, ai, animation, input, networking, etc.
In this tutorial series we're using vulkan and creating our own basic engine. The initial focus of the series is mostly on rendering.
I'm using VSCode and after coping the files over and changing the namespaces and prefixes with find/replace I'm still getting many errors specifically in places that are being templemented for example:
(In the .hpp file)
"std::vector presentMode"
The VkPresentModeKHR is what has the error on it,
For the .cpp file its even weirder giving me errors on "std::" specifically even though iostream is included quite odd, any ideas why this may happen? I'ma keep working on it just curious if anyone else has had similar happen!
Specifically the error is that those things are not defined
The glfwCreateWindowSurface also isn't defined when I attempt to use it in my window class implementation 3:15
No need to reply it was simply a typo in my
"
#define GLFW_INCLUDE_VULKAN
#include
"
I had #define GLFE_INCLUDE_VULKAN simple typo, thanks for the videos they've been great so far! :D
In file included from lve_device.cpp:1:
lve_device.hpp:33:15: error: ‘LveWindow’ has not been declared
33 | LveDevice(LveWindow::LveWindow &window);
lve_device.hpp:33:39: error: expected ‘)’ before ‘&’ token
33 | LveDevice(LveWindow::LveWindow &window);
lve_device.hpp:96:3: error: ‘LveWindow’ does not name a type
96 | LveWindow &window;
lve_device.cpp:50:25: error: expected constructor, destructor, or type conversion before ‘(’ token
50 | LveDevice::LveDevice(LveWindow &window) : window{window} {
lve_device.cpp:50:64: error: expected unqualified-id before ‘{’ token
50 | LveDevice::LveDevice(LveWindow &window) : window{window} {
lve_device.cpp: In member function ‘void lve::LveDevice::createSurface()’:
lve_device.cpp:196:37: error: ‘window’ was not declared in this scope
196 | void LveDevice::createSurface() { window.createWindowSurface(instance, &surface_); }
sorry for the slow reply, any luck figuring this out? For debugging-help you can try posting in that group on the discord discord.gg/CUQkuKsszr, Myself or somebody else is usually pretty quick to respond
C++ is pretty based
prolly would've been better off writing it instead tbh, trying to do this with SDL instead of GLFW and process is it bit more frustrating converting code to be compatible.
What was the purpose of using SDL? Why try and use it over GLFW?
@@tweetyguy7347 sdl is not only the standard for engines but more powerful than glfw in terms of its features. Im also more familiar with it since ive been using sdl for around 4+ years
Creating a Cpp class is a fucking chore. You have to create 6 object lifetime functions. The dawn implicit move and assignement functions don't do what they are suppose to do.
this fails totally on windows. macros and types are undefined. something is missing.
I do not know if I missed this is one of your previous videos, but you need to add #define GLFW_INCLUDE_VULKAN in the lve_window.h
only 10k subs?!?
The full series of tutorial videos: th-cam.com/video/Y9U9IE0gVHA/w-d-xo.html
why are you not useing github
I am using GitHub? Or do you mean for the pastebin… lol that’s a good point, mainly because I record the videos before committing to git but I could make it work. Thanks for the feedback!
Great videos, but throwing code out of the blue that does x, y and z and change a, b and c to make it work it is a little bit discouraging, I'll continue with the videos left no matter what. As a suggestion, for the 3 initial videos, spending more time on the device setup code would have been more useful than the time spent explaining how to read a file or basic c++ stuff, in my opinion, people who already have knowledge in c++ should already known how to find the compiler and modify the makefile and whatnot, having a class diagram, since we are using classes, would have been useful too, take this as a constructive opinion, I'm already subscribed to your channel, thanks.
Thank you, I appreaciate the honest feedback! The main reasoning I avoided spending much time on the device setup code was I wanted to avoid just re-treading material on vulkan-tutorial.com, and also felt like its a lot of information to take in, and without some more context the later tutorials provide, is difficult to understand.
But ya... honestly I'd really like to completely re-do the first 5 tutorials if I could, especially now that Vulkan 1.3 has been released which would drastically simplify the swap chain code to the point where I could have covered it from the start.
As for all the other points you brought up, noted and I agree. I'll keep that in my when making future tutorials. Thanks again!
downloading code,.. you almost lost me there
If you are having validation layer errors with Mac M1, try the following in replies (since youtube for some reason deletes my comment).
you sound a bit like joseph anderson
The problem with this tutorial is that this is a Vulkan tutorial. Although this series is most likely completed, I wanted to point out that what makes copying code so bad is that it's defeating the entire purpose of Vulkan, by copying code which is integral to Vulkan and what actually makes Vulkan it's own. The main goal of Vulkan is not to render a cube, this could be done with OpenGL or any other API, but what makes Vulkan different from an OpenGL tutorial is it's verbose low level design like setting up a logical device, etc. You can't learn a language like Spanish by using google translate. Of course this is just my opinion but again the viewers should not be dependent on downloaded code that they don't understand as beginners, which should have been the main talking points of this tutorial. Anyways that's my only issue with it, I do really like the quality of this series and how beginner friendly it is (excluding the copying).
Thanks for the honest critical feedback. I agree with what you’re saying. However if I was to do this again I would do it in the same way. I want to build up more of the surrounding context around renderpasses, framebuffers, etc where the tutorials covering each of these topics can really go into the proper depth, before going back and then going over the swap chain and device code.
When I was first writing the tutorials for the device and swap chain code it was just information overload so I scrapped them and went the other direction.
So hopefully in about 4ish months when I have a chance to start making videos again there will be just a few more topics covered before we finally go back to rewrite the swap chain and device code
Yeah, I don't like this downloading code.