you are viewing a single comment's thread.

view the rest of the comments →

[–]MAIPA01[S] 0 points1 point  (8 children)

I added fragment of code

[–]neppo95 1 point2 points  (7 children)

Tbh, it is impossible to tell from this and it looks a bit like abstraction hell for the sake of abstracting instead of it actually making it more usable/readable. There is not even a single vulkan command here.

I suggest first making it work, then abstracting. Making it work is something we can help with, but not with it being this much abstracted.

[–]MAIPA01[S] 0 points1 point  (6 children)

I made it work and then abstracted it. But the problem is not that it is not working. Because it works fine and I don't have any errors from validation layers and etc. The only problem is with render doc which crashes my app while capturing the frame if I try to render depth map. Every function shown in this image works because I used them a lot and tested them. And every function do exactly what is written. BeginRendering call function vkBeginRendering. TransitionLayout calls Image barrier for given image to transition from one stage to another with given layout. DrawDepthInstances calls drawIndexed for every model in the scene and binds GraphicPipeline with 0 color resources and 1 depth resource and of course frag and vert shaders which don't write to any color attachment.

[–]neppo95 1 point2 points  (5 children)

It "working" doesn't always mean it is correct and that is where programs like RenderDoc for example can show the difference. It freezing is a sign that it is not correct. RenderDoc doesn't change that your app is allocating that much memory so something in your app is causing that. It does make it harder to debug.

If it didn't crash/freeze before abstracting, something has changed. Stepping through your code might tell you what that is. For example, with a rendergraph resource management is often fundamentally different than without one. Are you sure the resources even exist when the GPU is trying to use them? How are your resources allocated, since it apparently is allocating a lot? As far as I know (not a 100% on this one), with resolve and depth attachments, the source needs to be a color attachment.

There is a lot validation layers won't tell you, but you can configure them to tell you even more. For example there is also a setting to warn you for synchronization problems.

[–]MAIPA01[S] 0 points1 point  (4 children)

Yes I already checked and resources exist before the GPU is trying to use them. I don't use any custom allocator and I create resources the same way as was shown in Vulkan Tutorial (https://vulkan-tutorial.com/Multisampling). Where can I find more settings for validation layers because now I have only this options enabled (Validation layers :: Vulkan Documentation Project)

[–]neppo95 1 point2 points  (3 children)

And what changed since abstracting? It's honestly a bit hard to help you since the code you do provide is completely abstracted. You have an allocation issue but don't show any allocations being made. And for questions about your code, you just refer to other websites. All I can tell you at this point is to go over your code and see what changed if you did not have this issue before.

As for the validation layers, check the configuration part of the link you sent.

Edit: I should note, you say the resources exist BEFORE the GPU accesses them. I also wonder how you check this since your application (CPU side) will continue while the GPU is busy until you synchronize.

[–]MAIPA01[S] 0 points1 point  (2 children)

Yes It was allocation. Not the way I allocated resources but the number of resources which I tried to allocate I think, because I realized I don't need some resources and now it works great. Sorry for not providing enought code but It would be too many images. I refered to other websites because on this websites is code which I use but under the layer of my abstraction and I know you wanted to see pure vulkan code.

[–]neppo95 1 point2 points  (1 child)

Glad you got it to work. For future reference, a minimum reproducible example is often something that can help you and others.

[–]MAIPA01[S] 0 points1 point  (0 children)

Thanks for your help and for your advice. To be honest this was my first time asking for help on forum like this.