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 implicit truncation of vector type caused by ShaderGraphFunctions.hlsl

Discussion in 'Shader Graph' started by Peter77, Jul 29, 2023.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,419
    I have hundreds of "implicit truncation of vector type" warnings when building a Windows Player. I'm using Unity 2022.3.0f1 and URP/ShaderGraph 14.0.7-

    These warnings all seem to come from
    shadergraph_LWReflectionProbe
    in
    com.unity.render-pipelines.universal@14.0.7\ShaderLibrary\ShaderGraphFunctions.hlsl


    Code (CSharp):
    1. float3 shadergraph_LWReflectionProbe(float3 viewDir, float3 normalOS, float lod)
    2. {
    3.     float3 reflectVec = reflect(-viewDir, normalOS);
    4. #if USE_FORWARD_PLUS
    5.     return half4(SAMPLE_TEXTURECUBE_LOD(_GlossyEnvironmentCubeMap, sampler_GlossyEnvironmentCubeMap, reflectVec, lod));
    6. #else
    7.     return DecodeHDREnvironment(SAMPLE_TEXTURECUBE_LOD(unity_SpecCube0, samplerunity_SpecCube0, reflectVec, lod), unity_SpecCube0_HDR);
    8. #endif
    9. }
    Please notice the
    return half4
    statement, but the expected return type is
    float3
    actually.

    Can you tell me when it's being fixed? Thank you in advance.
     
    ElliotB and Qriva like this.
  2. BenCloward

    BenCloward

    Unity Technologies

    Joined:
    Jul 15, 2021
    Posts:
    93
    Thank you for letting us know about this, Peter. The URP team owns this code and should be the ones to fix it (rather than the Shader Graph team). Please submit a bug for them to look at.
     
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,419
    Thank you for your reply, Ben. I have submitted a bug report with a repro case: IN-49731.

    Could you please notify the person who would be interested in this? Thank you in advance.
     
  4. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,419