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

[Potential Bug] Render Complete Semaphore is specified using currentFrame rather than imageIndex which can cause sync validation errors. #90

Open
Mjrlun opened this issue Jul 16, 2024 · 5 comments

Comments

@Mjrlun
Copy link

Mjrlun commented Jul 16, 2024

As title suggests. I noticed this after comparing my work with yours (having previously followed the tutorial before), and having conferred with someone in the Vulkan discord.

The solution would be to create an array of Semaphores and access them using the imageIndex passed back from acquireNextImage, in place of the current renderCompleteSemaphore within the SyncSemaphores record.
You could also do the same by specially accessing the SyncSemaphores array for the render complete semaphore: syncSemaphores[imageIndex].renderCompleteSemaphore().vkSemaphore

@Mjrlun
Copy link
Author

Mjrlun commented Jul 17, 2024

Additionally, the index for the LightingFrameBuffer VkFrameBuffers should also be using this same imageIndex, rather than how it currently uses the current frame.

@lwjglgamedev
Copy link
Owner

Ok,

I saw this issue some weeks ago, becuase it caused validation warnings. Perviously, everything as reported as correct. I was not using the proper image index returned while acquiring the image. But I already uploaded a fix for that, and the valiaton error messages are goone. Therfore, it seems to be working now.

In any case, just for you to know. I'm currently working on a new version of the book with the following deisgn goals:

  • Use Vulkan 1.3.
  • Use dynamyc render (no more render passes). I feel this is the proper way, it is more explicit sometines, but no burden on render passes, frame buffers, and implicit barriers and transitions though dependencies.
  • Better overall handling, in terms of descriptor sets, and better model for swap chain image acquisition.

I'm also planning in including a sample for PhysX.

It is taking some time, but I'm working on it.

@Mjrlun
Copy link
Author

Mjrlun commented Jul 18, 2024

Sounds awesome! I will take a look at it when it's done, although not looking forward to more sync error nightmares. Hopefully it will run faster though :)

@lwjglgamedev
Copy link
Owner

I can give access to the working source code if you want to have a look. I'm regulary testing with sync validation layers on.

@Mjrlun
Copy link
Author

Mjrlun commented Jul 19, 2024

Sure if you want. Just DM me on discord I guess.

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

2 participants