[go: up one dir, main page]

Stop FIR from generating vectors of vectors, so that operators like !+! and !-! work

Ref #95

This change makes FIR classify all vectors of vectors as matrices to SPIRV.

I don't know what the implications of doing this are, but it's my understanding that SPIRV doesn't support vectors of vectors at all, so it should be fine. See #95

This allows !+! and anything that uses Mat :& ... to work properly.

Perhaps it messes up the axis orders, I haven't tested these changes extensively yet.

EDIT: It seems like GitLab doesn't do word-wise diff, only line-wise. That makes it hard to see what I changed. My change is simply to add one line:

tyOp (Vector _ (Vector _ _)) = TypeMatrix

That ensures that all vectors of vectors are typed as matrices.

EDIT 2: I found some documentation clarifying that SPIRV only supports vectors with scalars, not vectors of vectors. See: https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#_types

Relevant parts:

Vector: An ordered homogeneous collection of two or more scalars...

Scalar: A single instance of a numerical type or Boolean type.

Edited by Sebastian Wålinder

Merge request reports

Loading