By implementing
impl<T1, T2> Add<T1> for Ref<T2>
where T2: Add<T1>
// and
impl<T> Add<Ref<T>> for vec<N, L>
where vec<N, L>: Add<T>
// and similarly for sm::Struct<S>, u32, i32, f32 and so on
for all binary operations, we can massively improve the ergonomics of using Ref.
Would you be open for that?
I implemented it already so I could prepare a PR very quickly.
Also, there is a lot of functions/methods in shame that accept impl To<T> and it would be nice if those accepted Ref<T>. For testing purposes I implemented ToGpuType for Ref<T> which implies impl To<T> for Ref<T> and it works great, but of course that's not the intended way for ToGpuType to be used.
With those two improvements I think Buffer could safely be removed in favor of renaming BufferRef to Buffer.
By implementing
for all binary operations, we can massively improve the ergonomics of using
Ref.Would you be open for that?
I implemented it already so I could prepare a PR very quickly.
Also, there is a lot of functions/methods in
shamethat acceptimpl To<T>and it would be nice if those acceptedRef<T>. For testing purposes I implementedToGpuType for Ref<T>which impliesimpl To<T> for Ref<T>and it works great, but of course that's not the intended way forToGpuTypeto be used.With those two improvements I think
Buffercould safely be removed in favor of renamingBufferReftoBuffer.