Search Issue Tracker
By Design
Votes
0
Found in
2020.3.47f1
2021.3.22f1
2022.2.15f1
2023.1.0b12
2023.2.0a10
Issue ID
UUM-32750
Regression
No
[Metal] Declaring a TexCoord Attribute as an int4 shows “Metal: Error creating pipeline state (Unlit/VertexError): Vertex attribute TEXCOORD1(2) of type int4 cannot be read using MTLAttributeFormatFloat2“ error when Pipeline State is created
How to reproduce:
1. Open the user’s attached “MetalVertexAttributeErrorRepro.zip” project
2. Observe the Console window
Expected result: No error
Actual result: “Metal: Error creating pipeline state (Unlit/VertexError): Vertex attribute TEXCOORD1(2) of type int4 cannot be read using MTLAttributeFormatFloat2 (null)” error appears
Reproducible with: 2020.3.47f1, 2021.3.22f1, 2022.2.15f1, 2023.1.0b12, 2023.2.0a10
Reproduced on: macOS 13.2.1 (Intel)
Not reproduced on: Windows 11
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Floating Material Preview window has a burger icon button that does nothing when pressed
- TreeView drag and drop operation is not cancelled when a modal opens over it
- Remote Config window causes performance drop in Editor when multiple settings are added
- Property field override bar does not update transparency correctly when switching between valid and invalid GameObjects
- Project window selection is not updated when search term is changed
Resolution Note:
The reason for the error message is that the mesh rendered with the shader provides float data, while the shader declares an int4 shader input. When declaring an int4 in the shader, the mesh needs to provide integer data. This can be done using mesh.SetVertexBufferParams and mesh.SetVertexBufferData, following the example at https://docs.unity3d.com/ScriptReference/Mesh.SetVertexBufferData.html