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
- Shader Graph Create Node window cannot be resized or moved after maximizing and reopening it
- [Usability] Cannot toggle Scene checkboxes using TAB/Enter in Build Profiles’ > Open Scene List
- Installing HDRP package throws Shader Graph validation warning about Exposure node when installed in Universal 3D Template
- ShaderGraph “Create Node” menu’s resize icon overlaps with the menu's scrollbar
- ShaderGraph “Create Node” menu’s Search bar's typing cursor is barely visible since it's black on a dark background
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