Closed CiRazDeveloper closed 3 months ago
This is not really debugging help forum.
Your semaphore indeed seems not retired while you are trying to reuse it.
Your code is basically:
1: vkAcquireNextImageKHR(signal: semaphoreImageAvailable); // no proof that wait for semaphore at step 2 finished
2: vkQueueSubmit(wait: semaphoreImageAvailable);
3: goto 1;
What would I have to do in order to fix the issue? I am new to Vulkan and I am following an old tutorial series that was made 7 years ago because the newer ones do not have such a thorough explanation.
Thank you for taking your time to read this!
Except some mistakes and inclarities here and there, I believe the tutuorial explains it, or at least does it in the code.
How you know a semaphore is retired is that the batch it was part of completed execution. In Vulkan 1.0 you would generally do this with a Fence. For purposes of learning, you may initially just use vk*WaitIdle()
.
Here's an example how I would do it. Here's documented the architecture of that, largely implying why I would do it that way (slide 6).
Thank you very much for your time and responses! I will now close this case :)
Additional Libraries:
Compiler, OS:
Windows
Details:
My Issue/Question:
Hello, I get an error related to the semaphore but I can not seem to find a fix for it.
Error:
VUID-vkAcquireNextImageKHR-semaphore-01779(ERROR / SPEC): msgNum: 1461184347 - Validation Error: [ VUID-vkAcquireNextImageKHR-semaphore-01779 ] | MessageID = 0x5717e75b | vkAcquireNextImageKHR(): Semaphore must not have any pending operations. The Vulkan spec states: If semaphore is not VK_NULL_HANDLE it must not have any uncompleted signal or wait operations pending (https://vulkan.lunarg.com/doc/view/1.3.280.0/windows/1.3-extensions/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01779) Objects: 0
Small Code View
Steps to recreate the issue start here
This is a Visual Studio 2022 C++ empty Project called "Vulkan" Cpp Language Standard: ISO C++17 Standard (/std:c++17)
Pictures to understand the settings:
Here we are in the Configuration Properties -> C/C++ -> General (Settings for the "Additional Include Directories):
32bit Configuration
64bit Configuration
Here we are in the Configuration Properties -> Linker -> General (Settings for the "Additional Library Directories):
32bit Configuration
64bit Configuration![VulkanLinkerAdditionalLibraryDirectories64](https://github.com/ocornut/imgui/assets/145051936/86d770cb-21a5-4967-83ec-996c599ff573)
Here we are in the Configuration Properties -> Linker -> Input (Settings for the "Additional Dependenciess):
All Platforms Configurations (so 32 and 64 bit Configuration settings together)
NOTE: In the Configuration of the Vulkan Project I added a Pre-Build Event (in Command Line) to run the runCompiler.bat file, so i do not have to manually run it every time I want to change the color of the Triangle.
(Vulkan Properties (All Platforms selected) --> Build Events --> Pre-Build Event)
Project Structure:
Note:
Complete and Verifiable Example code:
shader.frag file code
version 460
extension GL_ARB_separate_shader_objects : enable
extension GL_EXT_debug_printf : enable
layout(location = 0) out vec4 outColor;
void main() { outColor = vec4(0.0, 1.0, 0.0, 1.0); }
shader.vert file code
version 460
extension GL_ARB_separate_shader_objects : enable
extension GL_EXT_debug_printf : enable
out gl_PerVertex { vec4 gl_Position; };
vec2 positions[3] = vec2[]( vec2(0.0, -0.5), vec2(0.5, 0.5), vec2(-0.5, 0.5) );
void main() { gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0); }
runCompiler.bat file code
E:\VulkanSDK\1.3.280.0\Bin\glslangValidator.exe -V shader.vert E:\VulkanSDK\1.3.280.0\Bin\glslangValidator.exe -V shader.frag pause
(The runCompiler.bat code spits out 2 files that vulkan generated called "frag.spv" and "vert.spv" like you can see above in the picture of the Windows Explorer) (Note that the VulkanSDK is not located on the C-Drive, where Windows is installed)
vulkHeader.h code
main.cpp code
vulkErrors.h code