New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidate Render(Ui)Materials(2d) into RenderAssets #12827
Consolidate Render(Ui)Materials(2d) into RenderAssets #12827
Conversation
This will enable removal of RenderMaterials, and it allows implementing creation of GPU types from any type. Co-authored-by: Wilhelm Vallrand <>
I would love to find a way to not require people to implement |
8f133a8
to
7abd50e
Compare
My ideas: Keep the |
@infmagic2047 great idea! So simple! :) I love it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine. I'll trust you that it was necessary to move RenderAsset
over to be implemented on the render world type.
@pcwalton here's the justification from the original PR:
|
Please don’t merge this yet. I want to think about a couple of things with it so I am convinced implementing RenderAsset on the destination type is better. |
I turned out that robtfm had a branch that did basically the same thing last year after I commented that implementing RenderAsset on types that implement Materials was problematic in various ways: |
Objective
RenderMaterials
/RenderMaterials2d
/RenderUiMaterials
withRenderAssets
to enable implementing changes to one thing,RenderAssets
, that applies to all use cases rather than duplicating changes everywhere for multiple things that should be one thing.Solution
RenderAssets<PreparedMaterial<M>>
etc for render materialsChangelog
RenderAsset
trait is now implemented on the destination type. ItsSourceAsset
associated type refers to the type of the source asset.RenderMaterials
,RenderMaterials2d
, andRenderUiMaterials
have been replaced byRenderAssets<PreparedMaterial<M>>
and similar.Migration Guide
RenderAsset
is now implemented for the destination type rather that the source asset type. The source asset type is now theRenderAsset
trait'sSourceAsset
associated type.