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
- Editor Perforce login fails when Perforce shows a license expiry warning
- Assertion failed error in HDRP builds when enabling STP via script
- FBX Resamples Curves incorrectly when importing FBX files
- ProBuilder GameObject Faces disappear when increasing the Sides Count value
- FileUtil.CopyFileOrDirectory throws IOException when destination parent folder does not exist
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