Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Superweird glitch on Ubuntu.

Discussion in 'Linux' started by cubrman, Aug 21, 2023.

  1. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    403
    So I have two Ubuntu machines. One has many different libraries installed (dev machine) and one is "clean" - minimum libraries installed (test machine). I am rendering a cube, which I've built myself from sample data which I put into a new Mesh object. The only thing out of the ordinary here is the fact that both indices and vertices are stored in unmanaged memory and are set to a Mesh object via:

    Code (CSharp):
    1. newMesh.SetIndexBufferParams(indices.Length, IndexFormat.UInt32);
    2. newMesh.SetIndexBufferData(indices, 0, 0, indices.Length, MeshUpdateFlags.DontValidateIndices);
    3.  
    4.  
    5. newMesh.SetVertexBufferData(vertices, 0, 0, vertices.Length, stream: 0,
    6.     MeshUpdateFlags.DontValidateIndices);
    7. newMesh.SetVertexBufferData(data: normals, 0, 0, normals.Length, stream: 2,
    8.     MeshUpdateFlags.DontValidateIndices);
    9. newMesh.SetVertexBufferData(data: uvs, 0, 0, uvs.Length,
    10.     stream: 1, MeshUpdateFlags.DontValidateIndices);
    Here is how it looks:
    1.png

    This was dev machine. The cube renders perfectly fine there. However, when I try to launch the same app (built on the dev Ubuntu machine) on the Ubuntu test machine, I get this:
    2.png

    I have absolutely no clue how could this happen. Vertices and indices are equal in both cases (I read them directly from NativeArray-s befor assigning them to newMesh object) and this situation frankly blows my mind.

    Would appreciate any comment, any suggestion - I am completely out of ideas...
     
  2. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    403
    Both machines have the same Ubuntu version:
    upload_2023-8-22_20-27-46.png
     
  3. ChiwTheNeko

    ChiwTheNeko

    Joined:
    Mar 24, 2022
    Posts:
    107
    I doubt this has anything to do with libraries installed on the machine.

    This is just a wild guess but this very much look like an undefined behavior to me. Like a memory corruption or an unspecified layout. You're not showing your entire code though so it's hard to tell.
     
  4. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    530
    Doesn't look equal to me

    upload_2023-8-23_8-49-42.png

    And since positions are consistently wrong for all 3 triangles connecting in the same corner, I assume that your problem has already happened before filling vertices array.
     
    cubrman and hopeful like this.
  5. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    403
    Yeah, another case of criminal inattentiveness) Thanks guys!