Search Unity

Question Include .hlsl shader code file with #pragma part, only the .shader inspector will error.

Discussion in 'Universal Render Pipeline' started by y-iwanaga, May 31, 2023.

  1. y-iwanaga

    y-iwanaga

    Joined:
    Jul 2, 2021
    Posts:
    23
    When I separated the common part of the shader code as "xxx.hlsl" including the #pragma part...
    'Unknown pragma errors' appears only on the inspector of .shader.
    Therefore, "SRP Batcher Compatible" cannot be confirmed.
    Is there a smart workaround?
    (Unity2021.3.24f1)
     
  2. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    766
    Hi, did you use the
    #include_with_pragmas "xxx.hlsl"
    to include shader files? (documentation)
     
  3. y-iwanaga

    y-iwanaga

    Joined:
    Jul 2, 2021
    Posts:
    23
    Thank you very much. I forgot to thank you.