DiligentGraphics / DiligentSamples

Sample projects demonstrating the usage of Diligent Engine
http://diligentgraphics.com/diligent-engine/samples/
Apache License 2.0
320 stars 80 forks source link

Pipeline state update #112

Closed MPcoreDev closed 1 year ago

MPcoreDev commented 1 year ago

Hello I wonder what is the best way to update a pipeline state object ? Is it possible ? The need is that - for dev and debug purpose - I want to have the ability to toggle on/off at runtime some pipeline properties like depth testing, backface culling... Is there a way to change that dynamically in a given PipelineState or do I need to create a new one by copy and update the properties as desired ? Thanks for advices, JD

TheMostDiligent commented 1 year ago

The whole idea behind the pipeline state objects is that they are immutable, so that the driver can perform all required optimizations, shader compilation and validation checks up-front to avoid run-time stutters. You can't change any of the properties of the PSO and need to create a new one.