Replies: 1 comment 5 replies
-
Normally, you don't need to do anything - Diligent handles resource lifetimes and don't release them if they are in use by the GPU.
Like I said, this is not necessary.
Again, you don't normally to do anything - resource lifetime tracking is handled automatically. There may be multiple other reasons for flickering. Do you see anything in the output? If you use Vulkan, validation layers should definitely complain if resource are being used after being destroyed. |
Beta Was this translation helpful? Give feedback.
-
What is the correct way to handle Diligent Engine right before releasing graphical resources that may still be in use by the GPU? I've sometimes noticed weird flickering when exiting menus or shutting down the app. I believe this is caused by the resource being lost before the command is executed on the GPU.
I'm assuming this concept is pretty universal, regardless of how the engine is used, but please let me know if any specifics are important.
I'm currently using Diligent::IDeviceContext::Flush(), then Diligent::IRenderDevice::IdleGPU() right before graphical resources like textures and GPU buffers are released. Is this correct? And is there anything else I should be aware of?
My application avoids doing any of this in the middle of a drawing routine, so this process only happens outside of the rendering section. Intentionally.
I'm also aware of fences, but have largely avoided getting familiar with them. I believe I am using some type of barrier when switching certain resource states, such as switching the shadowmap between render target and shader resource. But apart from this, I haven't done much with any type of barriers or fences. I definitely intend to learn more about them, though.
Appreciate any advice!
Beta Was this translation helpful? Give feedback.
All reactions