Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Fix for InvalidDataException: SerializeShaderGLSL: Could not extract shader stage from source string

Discussion in 'Project Tiny' started by Seto, Jun 5, 2021.

  1. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    243
    0.33 is still not released. And anyone using 0.32 may encounter this problem.
    This problem is caused by slow computer. And here's the fix for 0.32. If the computer is slow, the receive buffer is incomplete with the original line.
    Code (CSharp):
    1.         /// <remarks>
    2.         /// Includes header
    3.         /// </remarks>
    4.         internal static byte[] ReceiveBuffer(this Socket socket)
    5.         {
    6.             byte[] buffer = new byte[0];
    7.             uint size = socket.ReceiveHeader();
    8.             if (size > 0)
    9.             {
    10.                 buffer = new byte[size];
    11.                 //socket.Receive(buffer, buffer.Length, SocketFlags.None);
    12.                 var received = 0;
    13.                 while (received < size)
    14.                 {
    15.                     received += socket.Receive(buffer, received, buffer.Length - received, SocketFlags.None);
    16.                 }
    17.             }
    18.  
    19.             return buffer;
    20.         }
    21.  
    The fix should go to com.unity.tiny/Unity.Tiny.Rendering.Authoring/ShaderCompiler/ShaderCompiler.cs
     
    Last edited: Jun 6, 2021