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.

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:
    239
    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