Skip to content

Vertex-pulling transform generates invalid metal code in certain cases #7410

Closed
@andyleiserson

Description

@andyleiserson

This is from one of the demos in https://bugzilla.mozilla.org/show_bug.cgi?id=1866068. The render pipeline descriptor defines an input with format float32x3, but the shader consumes it as a vec2f. The naga-generated metal shader is invalid because it attempts to cast the vec3f return value from unpackFloat32x3 (a helper function generated by the vertex-pulling transform) into a vec2f based on the declared type of texcoord in the shader:

7410-vertex-format-mismatch.metal:41:20: error:  from vector 'metal::float3' (aka 'float3') to vector 'metal::float2' (aka 'float2') of different size
        texcoord = metal::float2(unpackFloat32x3_(vb_1_elem.data[32], vb_1_elem.data[33], vb_1_elem.data[34], vb_1_elem.data[35], vb_1_elem.data[36], vb_1_elem.data[37], vb_1_elem.data[38], vb_1_elem.data[39], vb_1_elem.data[40], vb_1_elem.data[41], vb_1_elem.data[42], vb_1_elem.data[43]));
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Test case: 7410.tar.gz

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions