Hi!
I’ve a problem : it seems that each time I recreate the graphics pipeline, vulkan clears the window.
Or I don’t want that behaviour because I need to draw several pipeline types on the window without clearing it.
Is there a way to set up a clear function like in opengl and not clearing everything when recrerating the graphics pipeline ?
Thanks.
What do you mean by that? Are you talking about VkGraphicsPipeline objects, or something else? Because you can’t really “recreate” those; you can destroy one and create a new one (which you shouldn’t be doing). But most Vulkan objects are immutable; once created, you can’t change their state.
Yes I have to destroy and create one graphic pipeline each time I want to change the draw parameters because we can’t modify the pipeline parameters like we do with opengl by calling opengl functions.
The problem is each time I create a new pipeline the window is cleared and I don’t want that I want to call a clear function to clear the window.
You’re supposed to avoid recreating graphics pipelines. If some state needs changing frequently, then try to give it dynamic state. If it can’t be given dynamic state, then rearrange the data so that it need not be changed.
At the very least, don’t destroy the old graphics pipeline. You might need that configuration later.
The problem is each time I create a new pipeline the window is cleared and I don’t want that I want to call a clear function to clear the window.
I don’t believe that the only thing you’re doing is creating the new pipeline.
Ok I’ve found how to do it in this vidéo :
https://www.youtube.com/watch?v=u5qNqIGRFHY
And I had to change the loadOp of the renderPasss to op_load.
And now it’s working.
Thanks.