rust-gpu icon indicating copy to clipboard operation
rust-gpu copied to clipboard

Operator Overlaoding support

Open Makogan opened this issue 1 year ago • 3 comments

Currently, it seems that rustgpu does not support operator overloading (there is no ops module under spirv_std, and none of the examples seem to do this).

This is useful because although linear algebra is the most popular mathematical representation for transformations in computer graphics, it is not the only option.

For example, I currently use projective geometric algebra for skin animations. To do this I need to define a multivector type on the shader that is capable of addition, multiplication, scalar multiplication...

Of course, one can work around the issue by defining methods, but this is less ergonomic than having operators.

Makogan avatar May 01 '24 21:05 Makogan

I thought there was a form of operator overloading via glam? Though, I might be mistaken.

FishArmy100 avatar May 02 '24 05:05 FishArmy100

there is no ops module under spirv_std, and none of the examples seem to do this

But there's core::ops, no? spirv_std is just a couple of extra stuff - it just complements core, not replaces it.

Patryk27 avatar May 19 '24 14:05 Patryk27