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
- Channel remapping dropdown in the Terrain Layer does not open when clicked on the title
- The Editor freezes indefinitely when a large number of elements are entered in the Subgraphs or Categories lists
- Some Visual Effects package Assets links to documentation are not working
- Heatmap asset’s documentation button in the Inspector window leads to “Sorry... that page seems to be missing!” page when clicked
- Crash on MonoBehaviour::CallMethodIfAvailable when performing various actions
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