amethyst/rendy

Stop using Either in render pass node

ishitatsuyuki opened this issue · 5 comments

Either is used in render pass node for handling both images and surfaces:

type Attachment = Either<ImageId, RenderPassSurface>;

However, this is simply confusing and does not provide much benefit considering it's an additional dependency as well. We should use a custom enum instead.

Frizi commented

I'm planning to get rid of special surface handling soon anyway, which means we would stick to using ImageId exclusively here. We can change that for short term benefit, but this code will get removed on next api rendergraph iteration.

Sure, removing the need of enum is also fine.

Would removing special surface handling involve using the present node and thus require copying the image data, or did you have some other approach in mind? I guess the final solution to this is making the graph more dynamic/flexible and removing the need for this stuff at all?

the final solution to this is making the graph more dynamic/flexible and removing the need for this stuff at all

Exactly that. But I haven't heard from @Frizi (who was working on it) for a while now.

I have been working on a graph implementation based on the snippets he described in #240 for a little bit now. Mainly because I either need to patch rendy to add another case to the render pass node in order to do what I want, or to implement a more dynamic graph myself.

I presume there is interest in merging that into the upstream rendy if I ever get it done?