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
- [OpenGLES][XR] Zooming in on the camera's URP opaque texture causes "double vision" on Quest in OpenGLES3
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
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