#Fence error in triple framebuffer swap chain implementation

13 messages · Page 1 of 1 (latest)

swift orbit
#

Question:
I don't know why I get an image API error in the void Update() part of the Gist code.

What I've researched:
I investigated using ChatGPT and Gemini and found that there is a high possibility that there is a problem with the timing of the fence or the way the command buffer is used.

What I want to know:
The cause and solution.

Github Gist: https://gist.github.com/Shigurechan/93851d3c1ec16f665b742de092af9a3f

Gist

TripleFrameBuffer Error. GitHub Gist: instantly share code, notes, and snippets.

placid hamlet
#

please stop asking AI for help, they are never correct and are worst than useless

brazen moss
#
vk::Semaphore signalSemaphores[] = { renderFinishedSemaphoreList[currentFrame] };

I don't know what error you're getting exactly, but if it is what I think it is then that line is your problem.
Frames in flight are not the same thing as swapchain images.

swift orbit
#

Thank you, that's amazing, I'll try not to use the AI.

brazen moss
#

You need a render-finished semaphore per swapchain image, not per frame in flight. (Your image-ready semaphore should be per-FiF.)

brazen moss
#

Yeah, thus the caveat: if the error is what I think it is.

placid hamlet
#

@swift orbit spend some time reading the messages and see if you can figure it out

#

there are 2 things wrong on that line

brazen moss
#

Hah, I missed the validation screenshot. Thought it was part of the link preview for the gist. 🤦‍♂️

swift orbit
#

Thank you everyone for your comments.
Solved.
Changed to result = device.acquireNextImageKHR(swapChain,UINT64_MAX,imageAvailableSemaphoreList[currentFrame],VK_NULL_HANDLE,&imageIndex);

placid hamlet
#

do you understand why?