mikialex / rendiation

Rendiation Rendering Framework
58 stars 5 forks source link

WGSL primitive arithmetic rules are not same as our math lib #111

Closed mikialex closed 1 year ago

mikialex commented 2 years ago

mat4 * vec3 is supported in rrf math lib, but not supported in wgsl. so we can not simply apply this:

impl<I, T, U> Mul<Node<I>> for Node<T>
where
  U: ShaderGraphNodeType,
  T: ShaderGraphNodeType,
  T: Mul<I, Output = U>,
{
  type Output = Node<U>;

  fn mul(self, other: Node<I>) -> Self::Output {
    OperatorNode::Binary {
      left: self.handle(),
      right: other.handle(),
      operator: BinaryOperator::Mul,
    }
    .insert_graph()
  }
}`

and this will cause wgsl ty check error

mikialex commented 1 year ago

already fixed