Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Yorick van de Haar
    @Cambesa
    Thank you!
    Tim Jones
    @tgjones
    I've just released v1.1.301, which should fix the macOS (and Linux!) executable permission problem. Thanks for reporting that @hvent90_twitter and @Tossrock .
    JasonMa
    @Jason-Ma-233
    Do you have plans to provide support for Unity SRP (HLSL)?
    Bagrat Dabaghyan
    @dBagrat
    Hi, is there any options to fully disable auto-formatting, to use "default" one ?
    already using clang-format with VS 2019 for auto-formatting for whole project, and it works also on HLSL files.
    But wanna to have highlighting and other nice features of your extension ^_^
    the problem is, that my clang-format settings are a little more specific, and I cannot get the same formatting consistency like before )
    Tim Jones
    @tgjones
    @dBagrat you can go into Tools > Options > Text Editor > HLSL > Formatting, and then all auto-formatting off there.
    I mean, turn off all auto-formatting there.
    Bagrat Dabaghyan
    @dBagrat
    @tgjones thank you!
    turned off, but unfortunately for some reason, when I am pressing Ctrl-D, it does auto-formatting with HlslTools settings not a VS/clang-format like before :)
    Tim Jones
    @tgjones
    Yeah, I don’t know how to fix that. I’m hooking into VS’s auto-formatting commands. I can see if there’s a way to completely disable it.
    Please could you log an issue on the GItHub repo to remind me?
    Bagrat Dabaghyan
    @dBagrat
    @tgjones yes ofc, thanks a lot !
    Nicolas Diot
    @ndiot
    Hello. I have a question.
    Can we add "include directories" path in the extension ?
    Tim Jones
    @tgjones
    @ndiot yes you can - there are some notes about how to do it here: https://github.com/tgjones/hlsltools#custom-preprocessor-definitions-and-additional-include-directories
    Let me know how you get on :)
    Nicolas Diot
    @ndiot
    It works. Thanks a lot :)
    madmuffin
    @madmuffin
    Hi, I am a beginner learning HLSL. I just installed HLSL Tools for Visual Studio Community 2017, how do I actually turn it on though? Nothing has changed in the program after installing it. HLSL shows up in the options but it doesnt do any of the things it says it does, no error red line, no suggested autofil, etc.
    Tim Jones
    @tgjones
    Hi @madmuffin - there isn’t a “turn it on” step as such. Presumably you’re opening a shader file, and finding that none of the expected features are working? What is the file extension of the file you’re opening?
    madmuffin
    @madmuffin
    *.shader
    image.png
    This message was deleted
    Tim Jones
    @tgjones
    Ah, that would explain it. HLSL Tools doesn’t support Unity shaders, unfortunately.
    madmuffin
    @madmuffin
    Aw nuts
    Okay, thank then, Ill keep googling maybe something out there does
    Tim Jones
    @tgjones
    I tried to add it a few years ago but it turned out it was more work than I could handle.
    JetBrains Rider has recently added support, I believe.
    madmuffin
    @madmuffin
    Ill look that up, thanks!
    Sherwin-Ke
    @Sherwin-Ke
    preprocessor.PNG
    Hi @tgjones , is there anyway to disable preprocessor feature?
    recently I was working on UE4 shader, the preprocessor seems like dim all code within #if
    Tim Jones
    @tgjones
    @Sherwin-Ke unfortunately there isn’t, because it’s integral to the whole way HLSL Tools works. It simply doesn’t parse the bits that are #if’d out, so it can’t highlight them.
    You can use the INTELLISENSE macro to help with that by #define-ing some stuff: https://marketplace.visualstudio.com/items?itemName=TimGJones.HLSLToolsforVisualStudio#preprocessor-support
    Sherwin-Ke
    @Sherwin-Ke
    @tgjones that does help! however, it will trigger UE4 to rebuild shaders after I added the macro, but it is not a big deal. Thanks!
    bettina4you
    @bettina4you

    hello, tgjones, first i want to thank you very much for your great toll

    To explain my problem lets consider the following situation.

    // definition of a global used structure Source File A: structure_def.inc

    struct Global_used_structure
    {
    float a;
    float b;
    }

    // B is using it Source File B: B_using_structure_A.fx

    include "structure_def.inc"

    Global_used_structure my_point ;

    // C is using it

    Source File C: C_using_structure_A.fx

    in
    clude "structure_def.inc"

    Global_used_structure my_other_point ;

    // D is also using it Source File D: problem_file.fx

    include "structure_def.inc"
    include “B_using_structure_A.fx”
    include “C_using_structure_A.fx”

    Global_used_structure my_new_point ;

    here i will get error of redefinition of structure because it is included several times. But in this version syntax highlighting and context help of HLSL tools works correctly.

    OK i can change

    // definition of a global used structure Source File A: structure_def.inc

    ifndef Global_used_structure_H

    def Global_used_structure_H

    struct Global_used_structure
    {
    float a;
    float b;
    }

    endif

    In this version the code wil compile,

    but i loose code sensitive functions of the include file contents

    e.g. goto definitions and also the HLSL tool will highlight me much errors in the code, because the structure is not correctly identified.

    How to solve this ?

    sorry for the bad formated text, i dont know how to re-edit
    Tim Jones
    @tgjones
    Is problem_file.fx accepted by the HLSL compiler? Normally you need to surround headers, which are included multiple times, with #IFNDEF MY_HEADER ...
    bettina4you
    @bettina4you
    Hello Tim, many thanks for yout answer, yes if i use the variant, that i surround headers, which are included multiple times all comiles fine and is ok
    int the problem_file.fx however the code parts and the declarations of the included files are no more recognized, so the error messages arrise.
    I am working on NVIDIA RTGI global illumintion integrating in my indie game engine.
    There are quite very much included files, which are included in many other files and so on.
    Tim Jones
    @tgjones
    Can you file an issue (with the repro files, ideally) on the GitHub repo please? I’m not quite following what the problem is.
    bettina4you
    @bettina4you
    Hallo Tim, my problem has been solved. The problem was 1). current HLSL Tools version does not recognize the new keywords introduced for dx12 raytracing (shown as error), 2). does recognize a RWTexture2d.load(int3) as error (code compiles fine with dxc) 3). does not update the error List although a error in the vs editor has been fixed and file has been saved
    Nevertheless you have made a wonderful tool !!!
    MattTree
    @MattTree
    Removing the extra "PrimitiveIndex" block from IntrinsicFunctions.SM6.cs fixes the bug mentioned in this issue: https://github.com/tgjones/HlslTools/issues/205#issuecomment-823624141
    @tgjones I don't want to do a PR nor do I want credit, so feel free to fix this or not at your leisure. Thank you for all your work
    Tim Jones
    @tgjones
    @MattTree Thank you so much for getting to the bottom of this! I’ll get this fixed.
    ompadu
    @ompadu

    hi, i'm having problems with virtual directory mappings

    i have a SMAA.ushwhere i have #include "/Engine/Private/Common.ush"(ush is associated with hlsl in vscode)
    i've created a shadertoolsconfig.json file and placed next to my SMAA.ush shader file
    it contains:

    {
        "hlsl.virtualDirectoryMappings": {
            "/Engine": "C:\\Program Files\\Epic Games\\UE_4.26\\Engine\\Shaders"
        }
    }
    the particular included file exists at C:\Program Files\Epic Games\UE_4.26\Engine\Shaders\Private\Common.ush
    @tgjones ^
    ompadu
    @ompadu
    just to clarify, i am getting an Cannot open source file error on #include "/Engine/Private/Common.ush"
    KStocky
    @KStocky
    Hi @tgjones I have a fix for issue #213 (virtual unreal directory mappings don't work). Just wondered if there is any other person that you know of who is fixing this before I submit a pull request?
    1901881
    @1901881
    Hi after installing this tool when I attempt to comment on my hlsl files using // and / comment / it keeps trying to autofill my message making it difficult to comment my code. I was wondering if anyone knows how to resolve this issue.
    image.png
    Tim Jones
    @tgjones
    @1901881 please could you log an issue in the GitHub repo? That will need a code fix.