Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Shader compile pipe in Lightweight Rendepipeline

Discussion in 'Shaders' started by polar1225, Jul 23, 2018.

  1. polar1225

    polar1225

    Joined:
    May 19, 2017
    Posts:
    7
    I'm reading the shader in Lightweight Render Pipeline.I found that the shader passes in LWRP contains the pragma feature:
    Code (CSharp):
    1. #pragma prefer_hlslcc gles
    I guess that it means,we are using the HLSLcc compilation pipeline for GL ES 2.0.After reading the article of the shader compile of unity:https://blogs.unity3d.com/cn/2015/05/26/dx11-features-on-mobile/,I am confused about this compile pipe.How does the GLES 2.0 shader be compiled in LWRP.
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    976
    Hi!
    It's not different from the rest of Unity.
    Cg code is fed to the DX compiler, the output is translated to GLSL using HLSLcc and optimized.
    Starting with 2018.3 HLSLcc is going to be the default compiler for ES2, with a possibility to choose hlsl2glsl on a per-shader basis.
     
  3. polar1225

    polar1225

    Joined:
    May 19, 2017
    Posts:
    7
    Thank you for your reply,Maybe you can update the documentation about this。:)
     
  4. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    976
    Yes, this should be possible ;)