On 10/15/21 03:36, Giovanni Mascellani wrote:
For example, the common shape between a matrix 1x4 and a matrix 2x4 is a vector of length 4, not a matrix 1x4.
What leads you to this conclusion? Even the most obvious case I checked suggests this isn't true:
---
uniform float2x4 x; uniform float1x4 y;
float4 main() : sv_target { return (x + y).xyzw; }
---
Native d3dcompiler_47 fails here with:
Z:\home\meg\test.hlsl(6,13-17): warning X3206: implicit truncation of vector type Z:\home\meg\test.hlsl(6,12-23): error X3018: invalid subscript 'xyzw' Z:\home\meg\test.hlsl(6,5-24): error X3080: 'main': function must return a value
Same if I swap the order of addition, or the x and y dimensions.
Returning (x + y) works fine, but as I understand that's because an implicit cast from float1x4 to float4 is valid.