Search Unity

  1. The 2021.2 beta is now available. To find out what's new, have a look at our 2021.2 beta blog post.
    Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  3. 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:
    233
    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
unityunity