vblanco20-1 / vkguide-comments

Storage for the comments of vulkan-guide
0 stars 0 forks source link

Chapter 2 Comments #5

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Setting up Triangle shaders - Vulkan Guide

Brand new guide to vulkan graphics programming

https://www.vkguide.dev/docs/chapter-2/triangle_walkthrough/

InsigMath commented 3 years ago

In the vulkan-guide folder I created a shader folder and included the triangle.vert and triangle.frag folder. Then re-generated the solution (and it shows in cmake that it build those ahders) and opened up my solution and some files called triangle.vert.sprv.rule and triangle.frag.sprv.rule. It is not located in a shaders folder, instead in some cmake folder in the build folder, and when I give those paths into load_module it doesnt seem to want to open. Did I do something wrong with my set up?

InsigMath commented 3 years ago

I figured out the issue on my own, I didn't build my shaders.

archsolar commented 3 years ago

Thanks I really enjoy the way this is written.

mhayenga commented 3 years ago

std::vector buffer(fileSize / sizeof(uint32_t));

Number of words needs to round-up.

fileSize + sizeof(uint32_t) - 1 / sizeof(uint32_t)

dortamiguel commented 3 years ago

By just simple doing vkDeviceWaitIdle(_device); before doing any cleanup you can avoid having to create a DeletionQueue

zheng95z commented 2 years ago

Is there missing a vkb::destroy_debug_utils_messenger(instance, debug_messenger) in the cleanup() function?

pntt3011 commented 2 years ago

can I ask why the relative spirv path is ../../shaders/*.spirv? I though the load function is in the src so ../shaders/ would make more sense.

charles-lunarg commented 2 years ago

Is there missing a vkb::destroy_debug_utils_messenger(instance, debug_messenger) in the cleanup() function?

@zheng95z Yes, this text is actually a little bit out of date. It'd be really easy to fix it, just modify the markdown and thats it. The source code should be correct (but worth checking too)

Lucodivo commented 2 years ago

It is imperative that objects are destroyed in the opposite order that they are created....

The way we are going to implement it is by having a queue of std::function lambdas, that will get called in order FIFO (first in, first out)

Aren't we actually looking for a FILO structure?

I'm confused why we need an std::dequeue? Doesn't seem like the std::dequeue is really utilized. We could just use a normal std::vector to push_back and iterate from the end to the beginning. Maybe it gets more complex down the line?

sudarshanchoubey commented 2 years ago

Check the code in VkBootstrap.cpp, it has a function for destroy_instance, if you use it instead of calling vkDestroyInstance in cleanup, you won't see the VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT validation error.

DiarrheaMcgee commented 2 years ago

i keep getting this error for some reason (halfway through chapter 2) /home/name/Programming/C++/vulkanProject/cmake-build-debug/vulkanProject [ERROR: Validation] Validation Error: [ VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter ] Object 0: handle = 0x56264a1562e0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x801f247e | Invalid VkSurfaceKHR Object 0x1000000006. The Vulkan spec states: surface must be a valid VkSurfaceKHR handle (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceSupportKHR-surface-parameter) [ERROR: Validation] Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x1000000006, type = VK_OBJECT_TYPE_SURFACE_KHR; | MessageID = 0x5d6b67e2 | Couldn't find VkSurfaceKHR Object 0x1000000006. This should not happen and may indicate a bug in the application.

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

im using clion on arch linux

DiarrheaMcgee commented 2 years ago

also the debugger gets stuck on vkb::Instance vkb_inst = inst_ret.value() with "command timed out process finished with exit code 0"

DiarrheaMcgee commented 2 years ago

the previous comment had a problem with copying and pasting but

the output is:

Triangle fragment shader succesfully loaded Triangle vertex shader succesfully loaded Red Triangle fragment shader succesfully loaded Red Triangle vertex shader succesfully loaded [ERROR: Validation] Validation Error: [ UNASSIGNED-CoreValidation-Shader-InputNotProduced ] Object 0: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_SHADER_MODULE; | MessageID = 0x23e43bb7 | Vertex shader consumes input at location 0 but not provided Detected Vulkan error: 2

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

and this even happens when i copy the entire github repository for chapter 2 and build it

bytewav commented 2 years ago

DiarrheaMcgee, Maybe you forgot to rebuild the shaders themselves?

DiarrheaMcgee commented 2 years ago

i didnt forget but after 9 hours of debugging i found out that it only works when i run it in the terminal but it still gives error messages

DiarrheaMcgee commented 2 years ago

is it because it requires a terminal for the output and has a fit if it cant output a log

ghost commented 1 year ago

Running into an issue where:

[ERROR: Validation]
Validation Error: [ VUID-VkPipelineVertexInputStateCreateInfo-sType-sType ] Object 0: handle = 0x1b20f062d80, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x8e6504e0 | vkCreat
eGraphicsPipelines: parameter pCreateInfos[i].pVertexInputState->sType must be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO. The Vulkan spec states: sType must b
e VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO (https://vulkan.lunarg.com/doc/view/1.3.231.1/windows/1.3-extensions/vkspec.html#VUID-VkPipelineVertexInputStateCr
eateInfo-sType-sType)
ghost commented 1 year ago

Gah sorry if there was a way to edit your own comments, but I'm also getting other error messages regarding incorrect sTypes? This is for cleanup and deletion queue

[ERROR: Validation]
Validation Error: [ VUID-VkPipelineVertexInputStateCreateInfo-sType-sType ] Object 0: handle = 0x1b20f062d80, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x8e6504e0 | vkCreat
eGraphicsPipelines: parameter pCreateInfos[i].pVertexInputState->sType must be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO. The Vulkan spec states: sType must b
e VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO (https://vulkan.lunarg.com/doc/view/1.3.231.1/windows/1.3-extensions/vkspec.html#VUID-VkPipelineVertexInputStateCr
eateInfo-sType-sType)
[ERROR: Validation]
Validation Error: [ VUID-vkDestroySemaphore-semaphore-01137 ] Object 0: handle = 0x1b20f062d80, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xa1569838 | Cannot call vkDestroy
Semaphore on VkSemaphore 0x980f360000000011[] that is currently in use by a command buffer. The Vulkan spec states: All submitted batches that refer to semaphore must have co
mpleted execution (https://vulkan.lunarg.com/doc/view/1.3.231.1/windows/1.3-extensions/vkspec.html#VUID-vkDestroySemaphore-semaphore-01137)
YongGame commented 1 year ago

If I set the timout = 0 in vkAcquireNextImageKHR, an error occurs. Why?My video card is UHD630. error msg :

Triangle fragment shader succesfully loaded
Triangle vertex shader succesfully loaded
Red Triangle fragment shader succesfully loaded
Red Triangle vertex shader succesfully loaded
Detected Vulkan error: 1
rickyjames35 commented 11 months ago

For the Vertex Shader it would be good to put #version 450 at the top like the Fragment Shader has. Otherwise you can get a "error: #version: Desktop shaders for Vulkan SPIR-V require version 140 or higher" when compiling the shader.

zentros commented 7 months ago

At the end of the init_sync_structures deletion queue you should have a vkDestroyFence(_device, _renderFence, nullptr); after the two vkDestroySemaphore functions.