Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 hope VA add Shader-code-format feature like other
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jzq740176597
Tomato Guru

China
343 Posts

Posted - Aug 21 2024 :  10:27:19 PM  Show Profile  Reply with Quote
AS we all see , I have seen a lot of work & features , of course more attention to the game-dev support & dev.
Thanks for your excellent work to ext our productivity.

As a senior unity3d dev, I used it a lot for shader (shaderlab,hlsl, compute, C#.. file) code, The top priorty / most important feature still missing from VA is <file format> for shader file.

btw, I just have to take another extension as last resort to compensate this.

Hope you can consider about this request. (if it achieved Then I will take another personal lisense immediatelly, ^_^)

JUST FYI, same feature I used as a detour is ShaderLabPro.

https://assetstore.unity.com/packages/tools/utilities/shaderlabvs-pro-186176

maybe your team can check & as a ref.


Creation come from persist!

Edited by - jzq740176597 on Aug 21 2024 10:27:54 PM

feline
Whole Tomato Software

United Kingdom
18988 Posts

Posted - Aug 22 2024 :  10:38:35 AM  Show Profile  Reply with Quote
What do you mean by file format?

What file extensions are you using for shader files? I have put together simple test cases for the file extensions HLSH, USH and USF, and VA is active in all of these extensions for me. This does assume you have turned On:

VA Options -> Game Development -> Enable support for shader files (requires restart)

you can also specify other file extensions to treat as shader files here.

zen is the art of being at one with the two'ness
Go to Top of Page

jzq740176597
Tomato Guru

China
343 Posts

Posted - Aug 22 2024 :  9:28:13 PM  Show Profile  Reply with Quote
Of course I turn it on




but when I Ctrl+K ,Ctrl + D (format document) commmand on hlsl file. Vs2022 complains like this:



I really exported result is when I save, It will auto reformat like cs file
(as I turn on [Code CleanUp] feature in vs2022 , see pic ;
I think it auto-invoke Format-document automaticlly)





Creation come from persist!
Go to Top of Page

jzq740176597
Tomato Guru

China
343 Posts

Posted - Aug 22 2024 :  9:30:45 PM  Show Profile  Reply with Quote
btw, as mention before, the default setting for va shader-files inc ".shader", as format-document not work, So I use ShaderVsPro for the shaderlab file (.shader) So I exclude it from va. At lease Va can feature other type of files I think.

Creation come from persist!
Go to Top of Page

jzq740176597
Tomato Guru

China
343 Posts

Posted - Aug 22 2024 :  9:49:56 PM  Show Profile  Reply with Quote
for addition
I create a FooFunc() in both .cs or .hlsl. by typing: int FooFunc(){/*hit Enter*/}

1. both can has auto-closing bracket.

2. hlsl Got this:



Conclusion: NO AUTO-FORMAT feature, just highlight/Suggestion list in hlsl

3. cs Got this: Auto format



Conclusion: FORMAT feature avaiable: left-align / put closing-bracket in new-line.

(Still I don't really ensure the format option is belongs to vs stuff or extension stuff like VA)


Problems is: as the end-user where I should have a format-setting place to get it done.

FYI Again, ShaderVSPro supply format option as integrated in VS.








Creation come from persist!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18988 Posts

Posted - Aug 23 2024 :  07:59:20 AM  Show Profile  Reply with Quote
This makes more sense. Unfortunately VA does not do much formatting at all, of any language. The IDE offers a lot of formatting options for C++ and C# code, and trying to copy all of this in VA doesn't make much sense. So VA relies on the IDE formatting commands that are built in.

Have you installed the VS2022 component "HLSL Tools"? If not this might help.

zen is the art of being at one with the two'ness
Go to Top of Page

jzq740176597
Tomato Guru

China
343 Posts

Posted - Aug 29 2024 :  9:32:50 PM  Show Profile  Reply with Quote
Yes. I Do.



But no format feature available from that.(I really donot understand VS team thought)

So what's a pity for missing this feature for VA. Even I really hope va can.


Creation come from persist!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18988 Posts

Posted - Aug 30 2024 :  08:22:06 AM  Show Profile  Reply with Quote
You can tell Visual Studio to treat other extensions as known file types, under:

Tools menu -> Options -> Text Editor -> File Extensions

but I don't see any option to tell the IDE that a file is a shader file. So I don't know if this is possible yet.

Have you considered using clang format, or another command line formatting tool? Its not the same, but you could set up a command in the IDE to call the formatting tool on the saved shader file, thus formatting it.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000