Skip to content

[Matrix] Define Behavior of a new MatrixSwizzleExpr ASTNode #354

@farzonl

Description

@farzonl

We need a means of supporting ._m and ._ chains so we can swizzle matrix elements
Like so:

export void fn() {
    float2x2 M = {1,2,3,4};
    float2 V = M._m00_m01; // produces a vector.
    M._m10_m01 = 1.xx; // prodces a swizzled vector l-value!
}

The new ASTNode would need to:

  • retain source information accurately enough to drive AST-driven tooling.
  • needs to be a single l-value of vector type that represents elements arbitrarily dispersed across the matrix.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Active

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions