- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 4.2k
 
Closed
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ShadersThis code uses GPU shader languagesThis code uses GPU shader languages
Description
What problem does this solve or what need does it fill?
Currently, it's possible to bind a Vec or a raw Buffer to a custom material, but this has two problems:
- The 
Vecversion eagerly creates a new buffer every frame, regardless of whether the buffer actually needs to be resized. It also isn't usable as aRenderAssetas theBufferis created in theAsBindGroupimpl. - The 
Bufferversion isn't usable from the main world without additional hacks, since aBuffercan only be created in the render world. This makes it difficult to work with, particularly if you also want to bind thatBufferto another custom pass, like a compute shader. 
What solution would you like?
We should implement a Handle<Storage> abstraction that can replace both these use cases. This will be the Buffer equivalent to Handle<Image> and will produce a RenderAsset (likely one of our higher level wrapper types, or possibly a new type erased version that avoids needing a generic plugin).
What alternative(s) have you considered?
It's possible to work around this right now as noted above, but it's very painful and the docs are confusing.
Additional context
This infrastructure may be able to be re-used for portions of #13373
Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ShadersThis code uses GPU shader languagesThis code uses GPU shader languages