Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 2 Comments #5

Open
utterances-bot opened this issue Nov 22, 2020 · 21 comments
Open

Chapter 2 Comments #5

utterances-bot opened this issue Nov 22, 2020 · 21 comments

Comments

@utterances-bot
Copy link

Setting up Triangle shaders - Vulkan Guide

Brand new guide to vulkan graphics programming

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

Copy link

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?

Copy link

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

Copy link

Thanks I really enjoy the way this is written.

Copy link

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

Number of words needs to round-up.

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

Copy link

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

Copy link

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

Copy link

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.

Copy link

charles-lunarg commented Oct 7, 2021

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)

Copy link

Lucodivo commented Dec 1, 2021

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?

Copy link

sudarshanchoubey commented Dec 25, 2021

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.

Copy link

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

Copy link

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

Copy link

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

Copy link

bytewav commented May 26, 2022

DiarrheaMcgee,
Maybe you forgot to rebuild the shaders themselves?

@DiarrheaMcgee
Copy link

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
Copy link

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

Copy link

ghost commented Nov 27, 2022

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)

Copy link

ghost commented Nov 27, 2022

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)

Copy link

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

Copy link

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.

Copy link

zentros commented Dec 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests