Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Discussion Why did UUM-62756 get backported to LTS?

Discussion in 'Unity 6 Beta' started by Rowlan, Apr 22, 2024.

  1. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,449
  2. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    349
    I'm confused. The point of LTS is that nearly all bug fixes get backported to them, else they won't be LTS.
     
  3. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,449
    It's a fix, a valid fix. But that one causes problems for a lot of people including Asset Store publishers and implicitly the customers. This fix breaks more than it fixes :)

    Was that really necessary?
     
    Walter_Hulsebos likes this.
  4. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    349
    I see - yes a fix that causes unintended side effects (causes any other regression) probably is not safe for LTS.
     
  5. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,055
    Hi!
    We were under an impression it was a regression, but it looks like it worked this way since 2021.3.0f1.
    We'll revert it.

    Sorry for the inconvenience.
     
  6. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,055
    The fix will be available in 2022.3.27f1.
     
    forestrf and Rowlan like this.
  7. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    530
    Hey, are there cases where you don't want pragmas to be included? I just wondering, maybe I miss someting.

    Isn't using simple #include just lead to more issues if we actually have pragmas in your files? In my oppinion #include sould work as #include_with_pragmas, and maybe to have one to not include pragmas (but as I said I can't think of such cases)
     
  8. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,140
    The issue is not with how it should be but how it has been for many years and how changing this now in a minor LTS release breaks thousands of projects and Asset Store assets.
     
    BOXOPHOBIC likes this.
  9. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,055
    Yes, there are. And that's why there's #include_with_pragmas in the first place.
    Sadly, it turns out it was broken for a very long time (2021.3.0f1 had it broken already), so it didn't work as intended - ShaderLab #pragma directives from regular include files were reported as well.

    We'll keep this behaviour in 2021.3 and 2022.3, but Unity 6 will have it as specified in the manual.
    We'll fix the manual for 2021.3 and 2022.3 as well.
     
  10. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    530
    I'm an asset store store developer, working on shaders, nothing I haven't seen in the past few months in a minor LTS version :(
     
    Last edited: Apr 26, 2024
  11. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,449
    I'm actually wondering why this release doesn't get pulled. It costs so much more than what it brings.
     
    Walter_Hulsebos likes this.
  12. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    235
    First time I see #include_with_pragmas I will be changing my includes with that. Since 2019.X #include was the way I was doing it and it worked until I updated to 2022.3.26, which made me think that version was bugged. I will be using and replacing old #include with #include_with_variants.
    Where is it written in the docs? I want to see If I'm missing other stuff.

    Edit:
    I just tried using #include_with_variants "somefile.hlsl" inside both a HLSLPROGRAM and CGPROGRAM and it doesn't work when #include does. It throws the following error:

    Shader error in 'Some shader': invalid preprocessor command 'include_with_variants' at SomeShader.shader(29) (on d3d11)
     
    Last edited: May 9, 2024
  13. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,055
    @forestrf it's
    #include_with_pragmas
    , not
    #include_with_variants
    :)
     
    forestrf likes this.
  14. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,055
    Unity 2019 didn't look for pragmas in the included files at all.
     
    forestrf likes this.
  15. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    235
    Thank you.
    #include_with_pragmas
    is working perfectly, I couldn't see the misspelling I made.