Search Issue Tracker
Fixed in 2022.2.X
"'_MainTex': Dimensions must match" error if assigning 2D texture to 2D Array texture property
How to reproduce:
1. Open project "My project (5).zip"
2. Create a Custom Render Texture (Assets>Create>Custom Render Texture)
3. Select newly created Custom Render Texture
4. In the Inspector menu change Dimension to "2D Array"
5. Press CTRL + Z or command + Z
6. Look at the Console window
7. Again create a Custom Render Texture (Assets>Create>Custom Render Texture)
8. Click in a Project window to deselect a Texture
9. Look at the Console window
Expected result: No warnings or errors appear
Actual result: "Metal: Shader[Hidden/Preview Color2D]: Incompatible texture type [MTLTextureType2DArray] of texture [New Custom Render Texture 6] bound at index 0, expected [MTLTextureType2D]" warnings appear after the 5th step and "Error assigning 2D texture to 2DArray texture property '_MainTex': Dimensions must match UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)" error appears after the 8th step
Reproducible with: 2020.3.20f1, 2021.1.25f1, 2021.2.0b16, 2022.1.0a12
Could not test with: 2019.4.31f1 (No 2D Array option)
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [Quest 2] Surface shader and multi-view sampling custom textures broken in Quest 2
- Lighting Data asset is not created when baking multiple Scenes at the same time
- Performance issues when instantiating a recognizer under UnityEngine.Windows.Speech
- Build fails with "Exception: Unity.IL2CPP.Building.BuilderFailedException: Build failed with 0 successful nodes and 0 failed ones" when building the project for iOS
- [Android] .aab Build fails when using Asset Bundles