StarArawn / harmony

A modern 3D/2D game engine that uses wgpu.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rendergaph vs pipeline confused

happydpc opened this issue · comments

The struct "SimplePipelineDesc" may rename to SimpleRenderPipelineDesc, because what it generates is a "wgpu::RenderPipeline".I am confused about it with "PipelineDesc" in pipeline_manager.

The RenderGraph is to make sub render passes, and the PipelineManager is to make primary passes. Am I right about these concepts?

commented

No, there is no concept of sub passes yet in wgpu. Originally I had designed the pipelines around a trait system similar to how rendy is setup. I quickly found though that it doesn't work well when you need to quickly spawn in a slight variation of the same pipeline. As an example if you look at the probe stuff here:
https://github.com/StarArawn/harmony/blob/master/src/graphics/resources/probe.rs#L249

Where I create a variation of both the realtime and cubemap skyboxes using a different color format. The new model allows you to clone pipeline descriptions and create a new pipeline based off the original. This will also be used for hot-reloading of pipelines if a shader changes on disk. One thing I did not do that still needs to be done is more cleanup. I don't think in its current form the unlit pipeline even works(it might I haven't tested it really). Any pipelines that are using SimplePipelineDesc should be changed to use the PipelineManager code instead. Also the pipeline manager should be considered the "new" render graph as it handles pipeline dependencies just like the old RenderGraph did.

With all that said the current example hello-pipeline is up to date, and has some comments explaining its use:
https://github.com/StarArawn/harmony/blob/master/examples/hello-pipeline.rs

I really need to start documenting everything as well..

Oh, I see. That means the "RenderGraph" will be deprecated. But could you simply make a render to target example for this new pipeline? That will be very helpful.

commented

@happydpc
Sure thing. I'm not entirely sure the API for that is very consumable right now, but let me see what I can do.

That will be very nice. The rendy project missing many things and no updates for so long. Hope this project will become a solid solution for rust graphic framework. Good job.

commented

@happydpc Does this api overview make sense to you:
#49

Yes, concise enough