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
 Visual Assist no longer works in shaders VS 2022
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

daniwrig
Starting Member

1 Posts

Posted - Dec 13 2022 :  3:39:18 PM  Show Profile  Reply with Quote
Hi, I'm a graphics programmer at Epic Games. I've been using Visual Assist in shader files for many years now and it has been broken ever since I switched to Visual Studio 2022. This is having a severe impact on my productivity.

I'm using the old method of adding .usf & .ush files to be handled as C++, then editing the registry keys EXTHeader and EXTSource to add them as well, rebuild VAX database. This workflow has worked for many years. I am NOT using the new 'Enable support for shader files (beta)' which I found to be completely broken.

VAssistX.OpenCorrespondingFile doesn't work when in a .usf or .ush file, which I really need to work. Functions are also not parsed and I can't go to their definitions.

Here's my version info.

VA_X64.dll file version 10.9.2471.0 built 2022.11.25
DevEnv.exe version 17.4.33103.184 Enterprise
msenv.dll version 17.0.33103.184
Comctl32.dll version 6.10.19041.1110
Windows 10 10.0 21H2 Build 19044.2251

I don't have a bunch of time to mess around with different settings and debug what might be causing this. It reproduces 2/2 times installing VS 2022 and latest VAX from scratch, so it should reproduce easily for you.

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Dec 14 2022 :  08:15:47 AM  Show Profile  Reply with Quote
Can you give me a simple, just a few lines each, example of what a matching usf and ush file should look like? I know very little about shader files, and trying to work out the basics is going rather slowly. Looking at sample files that ship with Unreal Engine isn't showing me any obvious pairs at all, so no examples there.

The syntax looks C++ like, so it makes sense that telling VA to treat these as C++ files would work fairly well, but I don't see why your VA settings would have stopped working in VS2022.

For shader support, using VS2022 and VA 2471.0 I have dragged the file:

C:\Program Files\Epic Games\UE_4.27\Engine\Shaders\Private\ACES.ush

into the IDE. I do have VA's shader support enabled. Function calls are being coloured by VA as functions, and Alt-G is taking me to the function declaration. If I use Alt-M or VA Outline then I am seeing a list of the functions in this file.

Can you please try opening the same file and see if you get the same results? This would allow me to test the same file here that you are looking at.

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

knarkowicz
New Member

9 Posts

Posted - Dec 19 2022 :  10:16:57 AM  Show Profile  Reply with Quote
Hi feline,

I have the same issue with usf/ush shader file highlighting. I tried using both the old and new method of shader highlighting and sometimes when I open the project it stops working at all.

When it breaks I usually can restore it though:
* Rebuild and clear VAX database
* Close Visual Studio
* Regenerate UE project
* Re-open Visual Studio

Not sure what's happening here, but maybe it's an issue triggered by the UE project size.

VA_X64.dll file version 10.9.2471.0 built 2022.11.25
DevEnv.exe version 17.4.33103.184 Professional
msenv.dll version 17.0.33103.184
Comctl32.dll version 6.10.19041.1110
Windows 10 10.0 21H2 Build 19044.2251
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Dec 20 2022 :  12:13:28 PM  Show Profile  Reply with Quote
OK, some progress. You can tell VA to treat shader files with the USF and USH file extensions as C++ code files instead in VS2022, using VA 2451, but not the next build, VA 2458. VA 2458 is the first version that adds support for shader files, so this support, even when not enabled, is overriding the custom file extension handling. Not ideal, but it is happening, and it makes a form of sense.

For VS2022 and VA 2471 shader support, I have a very simple C++ solution that contains the two files "shaderAsCpp.usf" and "shaderAsCpp.ush". Starting with a new, default install of VA 2471 VA is not active in these files, as expected. I turned On:

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

and restarted. The files are now coloured as code by VA, Alt-O is moving me between the two files quite happily. The files have been placed into the same directory and are both part of the solution, in case this matters. I don't know if this is correct, but in this simple test Alt-O works as expected.

In the USH file I have the code:

float NormalCurvatureToRoughness(float3 WorldNormal)
{
	return 1.0f;
}


and in the USF file I have the code:

#include "shaderAsCpp.ush"
	
void FPixelShaderInOut_MainPS(
	FVertexFactoryInterpolantsVSToPS Interpolants,
	FBasePassInterpolantsVSToPS BasePassInterpolants,
	in FPixelShaderIn In,
	inout FPixelShaderOut Out)
{
	float GeometricAARoughness = NormalCurvatureToRoughness(MaterialParameters.WorldVertexNormal_Center);
}

in the USF file, when I place the caret into the function call "NormalCurvatureToRoughness" and press Alt-G I am taken to the function implementation in the USH file.

knarkowicz, there is a known bug that VA does not apply syntax highlighting to a single shader file if that is the default open file when you load a solution. But once you change files syntax highlighting should be applied normally:

case=148477

but this doesn't match what you are describing.

When you se this problem, is VA active in the shader files at all? Is VA showing its context and definition fields at the top of the editor window? Does Alt-M show the list of methods in the file? What happens if you show VA Outline? I am trying to work out the sort of problem we have here. Even if VA does not realise that the file is part of the solution, assuming it is part of the solution, VA should still be active in an open file of a type it recognises.

Even if VA is confused, regenerating the UE project should not be required, so I am really confused as to what is going on here.

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

knarkowicz
New Member

9 Posts

Posted - Jan 02 2023 :  10:01:36 AM  Show Profile  Reply with Quote
Hi feline,

"When you se this problem, is VA active in the shader files at all? Is VA showing its context and definition fields at the top of the editor window? Does Alt-M show the list of methods in the file? What happens if you show VA Outline? I am trying to work out the sort of problem we have here. Even if VA does not realise that the file is part of the solution, assuming it is part of the solution, VA should still be active in an open file of a type it recognises."

Context and definition fields, VA outline and Alt-M work fine:
https://imgur.com/a/9UD3vhl

"Even if VA is confused, regenerating the UE project should not be required"

Repair steps are somewhat random. Sometimes it's enough just to restart Visual Studio. Sometimes I need also to clear VAX caches. Sometimes I need also to regenerate the project. Though maybe one of those steps is a red herring, as sometimes it fixes itself immediately after one restart and sometimes I need to repeat all 3 steps outlined above multiple times.

Edited by - knarkowicz on Jan 02 2023 10:06:05 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Jan 03 2023 :  06:38:32 AM  Show Profile  Reply with Quote
Thank you for the screen shot. The only reasonable conclusion is that somehow VA is ending up in a bad state. As a simple test, can you please turn On:

VA Options -> Coloring and Attributes -> Apply coloring to -> VA Navigation Bar

since the VA navigation bar is still showing, and showing something sensible, this will tell us if VA syntax colouring is still working outside of the editor. It is possible that the "connection" to the editor window is the problem.

Do you also have C++ code in your solution? If so, does VA work correctly in the C++ code, or is it broken there as well? I am wondering if the problem extends beyond shader files or not.

Do you have a sense, on average, of how long it takes for this problem takes to appear again once you have managed to fix things? A few minutes, a few hours, a few days? I am wondering about VA logging, but hours worth of logs is a lot of logs to check.

I don't suppose you have any ideas for a possible trigger? Worth asking on the off chance.

Would it be possible to get a dump file of the "devenv.exe" process once the problem has happened? This will give us some information about VA's state, so may help to explain what is going on. The obvious concern here is that this will reveal some state information about the solution you have open, but we are only interested in looking at VA's state. If this is an option, this page explains saving out a mini dump file, if you are not sure how:

https://support.wholetomato.com/default.asp?W303

can you please send a download link to the file, which is probably going to be to large to email, to:

support@wholetomato.com

including this thread ID or URL in the description, so we can match it up.

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

kathanylion4
Starting Member

USA
1 Posts

Posted - Jan 05 2023 :  03:48:55 AM  Show Profile  Reply with Quote
Interesting information

Edited by - kathanylion4 on Jan 05 2023 03:49:21 AM
Go to Top of Page

knarkowicz
New Member

9 Posts

Posted - Jan 09 2023 :  10:22:33 AM  Show Profile  Reply with Quote
VA Navigation Bar syntax coloring works fine:
https://imgur.com/a/kCr2wCV

"Do you also have C++ code in your solution? If so, does VA work correctly in the C++ code, or is it broken there as well? "
Yeah, I'm working in a full UE solution and C++ syntax coloring works fine.

"Do you have a sense, on average, of how long it takes for this problem takes to appear again once you have managed to fix things?"
Quite random. This time it took 5 workdays for the issue to reappear.

"I don't suppose you have any ideas for a possible trigger?"
Randomly when I open a shader file (or VS open with a shader file tab) it just stop highlighting shaders.

Edited by - knarkowicz on Jan 09 2023 10:25:16 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Jan 09 2023 :  1:46:44 PM  Show Profile  Reply with Quote
Thank you for trying that. Do you keep the machine on and the IDE open 24/7, or does the IDE get closed and the machine turned off / suspended over night? I am wondering if run time could be a factor here, not that this makes much sense since there is no problem in C++ code files.

I have asked our developers what they make of this, since it's really strange, and hard to really get a handle on:

case=149003

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

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Jan 09 2023 :  1:53:05 PM  Show Profile  Reply with Quote
A follow up thought, once this happens can you please close any open Shader files, then turn On VA logging via:

VA Options -> Performance -> Enable logging

then open a shader file and try moving around it for a few moments, look at the Alt-M list, then close the IDE to stop the VA log files getting any larger. I am wondering if logging will show anything useful about VA trying, and failing, to start applying syntax highlighting to the file.

This page explains where to look for the log files that VA generates:

https://docs.wholetomato.com/default.asp?W305

Can you please send them to me via the email:

support@wholetomato.com

including this thread ID or URL in the description, so we can match it up.

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

accord
Whole Tomato Software

United Kingdom
3282 Posts

Posted - Jan 11 2023 :  5:01:15 PM  Show Profile  Reply with Quote
Regarding the problem of randomly disappearing colors:
- Is Intellisense enabled? To know that, what are the state of the below to VS settings?
VS options -> Text Editor -> C/C++ -> Advanced -> Disable Database
VS options -> Text Editor -> C/C++ -> Advanced -> Disable Intellisense
- Is VA coloring applied to code editor window?
VA options -> Coloring and attributes -> Text Editors
- Based on the screenshot, no syntax coloring is working which suggest a VS problem, since at least the keywords should still be colored, even if VA coloring wouldn't work
- What Visual Studio version are you using? It might worth a try of updating it to latest version to see if it helps
Go to Top of Page

knarkowicz
New Member

9 Posts

Posted - Jan 17 2023 :  11:27:13 AM  Show Profile  Reply with Quote
"Do you keep the machine on and the IDE open 24/7, or does the IDE get closed and the machine turned off / suspended over night?"
I turn it off.

"Can you please send them to me via the email"
Just followed the instructions and sent logs.

"Is Intellisense enabled?"
Yes

"Is VA coloring applied to code editor window?"
Yes

"Based on the screenshot, no syntax coloring is working which suggest a VS problem, since at least the keywords should still be colored, even if VA coloring wouldn't work"
VS doesn't color shader files by default and VAX coloring works fine in C++ files.

"What Visual Studio version are you using?"
17.4.0

Edited by - knarkowicz on Jan 17 2023 11:28:20 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Jan 18 2023 :  08:53:02 AM  Show Profile  Reply with Quote
We have the logs, many thanks for these:

case=149050

Hopefully this will shed some light on this rather confusing problem.

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

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Jan 19 2023 :  09:18:11 AM  Show Profile  Reply with Quote
Many thanks for the logs, unfortunately they are not offering any clues. Syntax highlighting in shader files works by telling the IDE that syntax highlighting should be enabled in shader files, and then we get the IDE to pass the syntax highlighting work over to us, so it could be that for some reason the IDE has stopped enabling syntax highlighting in shader files, thus cutting us out of the loop.

In case this is what is happening, next time you load the IDE can you enable IDE logging, and then work normally, and see if the problem happens again. You do this by running the command:

"C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.exe" /log c:\src\vs2022ShaderLog.xml

you don't have to specify a log file name, but if you do, you can set it to appear in a helpful, easy to locate folder, rather than the rather buried default location. On a day when the problem happens, can you please send us the log file. Fingers crossed it will contain some clues as to what is going on here.

At the risk of asking a stupid question, is VA syntax colouring active in a different shader file? I have occasionally seen problems that seem file specific, so while its unlikely, its not impossible.

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

knarkowicz
New Member

9 Posts

Posted - Jan 23 2023 :  09:56:54 AM  Show Profile  Reply with Quote
Sent new logs. On my end:
* Run VS with logs
* Open a few shader files. Syntax highlighting doesn't work.
* Open C++ file. Syntax highlighting does work.
* Close VS

"is VA syntax colouring active in a different shader file"
I didn't check all the shader files, but it seems like when it breaks, then it breaks globally in all files.

Also updated VS tp 17.4.4, but it didn't fix anything.

BTW one more thing which I just noticed - when syntax highlighting breaks in shaders, it still can color "#something" tags. Additionally VAX marks spelling mistakes in comments with a red wavy line.

Edited by - knarkowicz on Jan 23 2023 1:26:30 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Jan 24 2023 :  11:17:03 AM  Show Profile  Reply with Quote
I have the log file, many thanks for this, I have asked our developers what they make of it. There are a few warnings that might offer a clue, so fingers crossed this tells us something:

case=149076

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

knarkowicz
New Member

9 Posts

Posted - Jan 25 2023 :  10:42:36 AM  Show Profile  Reply with Quote
After updating to 17.4.4 my previous tricks don't work at all and I completely lost syntax highlighting in shaders.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Jan 26 2023 :  06:25:00 AM  Show Profile  Reply with Quote
I am also seeing a complete lack of syntax highlighting in shader files in 17.4.4, I am now checking to see if this is an IDE version specific problem.

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

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Jan 26 2023 :  08:30:01 AM  Show Profile  Reply with Quote
Urg, well "good" news, shader syntax highlighting works on one machine with VS 2022 version 17.4.4, but fails on a second machine with the same versions of VS2022, VA and the same simple test solution. So its not automatically broken in 17.4.4. Now I need to try and find out what the difference is between these two systems.

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

knarkowicz
New Member

9 Posts

Posted - Jan 26 2023 :  1:43:59 PM  Show Profile  Reply with Quote
Awesome! Thanks for the update.
Go to Top of Page

knarkowicz
New Member

9 Posts

Posted - Jan 26 2023 :  11:28:12 PM  Show Profile  Reply with Quote
And after 3 days it just randomly started working again. No idea what's happening here.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Jan 27 2023 :  07:45:26 AM  Show Profile  Reply with Quote
Thank you for the update, it is good it is working again for you. For me, the trigger is an IDE setting. I am currently importing different blocks of settings, to try and find the specific trigger for this odd bug.

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

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Jan 27 2023 :  11:16:33 AM  Show Profile  Reply with Quote
My IDE window layout settings are the trigger! No idea how or why, but if you ran into the same problem it could explain why it appeared and disappeared:

case=149104

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

knarkowicz
New Member

9 Posts

Posted - Jan 31 2023 :  4:35:15 PM  Show Profile  Reply with Quote
I don't touch any IDE window layout settings and syntax highlighting randomly works or doesn't.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18097 Posts

Posted - Feb 01 2023 :  06:01:09 AM  Show Profile  Reply with Quote
The fact that this bug, for me, requires an IDE restart to start or stop shader syntax highlighting working made it look different. But it is interesting, since the window layout should have no effect at all here. Maybe, if we are lucky, a fix for this will help you. We are still working on this, looking for clues and a solution.

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:
© 2021 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000