Skip to content

[hlsl-out] Stores of vec2-based matrix inside struct tries to access raw matrix directly #4423

Open
@cwfitzgerald

Description

@cwfitzgerald

WGSL

struct Ah {
    inner: mat2x2<f32>,
};
@group(0) @binding(0)
var<storage, write> ah: Ah;

@compute @workgroup_size(1)
fn cs_main() {
    ah = Ah(mat2x2<f32>(vec2<f32>(0.0), vec2<f32>(1.0)));
}

HLSL

struct Ah {
    float2 inner_0; float2 inner_1;
};

RWByteAddressBuffer ah : register(u0);

Ah ConstructAh(float2x2 arg0) {
    Ah ret = (Ah)0;
    ret.inner_0 = arg0[0];
    ret.inner_1 = arg0[1];
    return ret;
}

[numthreads(1, 1, 1)]
void cs_main()
{
    {
        Ah _value2 = ConstructAh(float2x2((0.0).xx, (1.0).xx));
        {
            // ERROR: Inner doesn't exist
            float2x2 _value3 = _value2.inner;
            ah.Store2(0+0, asuint(_value3[0]));
            ah.Store2(0+8, asuint(_value3[1]));
        }
    }
    return;
}

Metadata

Metadata

Assignees

Labels

area: naga back-endOutputs of naga shader conversionlang: HLSLD3D Shading LanguagenagaShader Translatortype: bugSomething isn't working

Type

No type

Projects

Status

In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions