The Wayback Machine - https://web.archive.org/web/20210126165734/https://github.com/MonoGame/MonoGame/issues/7159
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Effect compiler warnings seem like errors in MGCB Editor #7159

Open
tomspilman opened this issue May 24, 2020 · 6 comments
Open

Effect compiler warnings seem like errors in MGCB Editor #7159

tomspilman opened this issue May 24, 2020 · 6 comments

Comments

@tomspilman
Copy link
Member

@tomspilman tomspilman commented May 24, 2020

If we have an effect which generates a few warnings:

image

The resulting output looks like an error because of the red X icon.

Would be best if this case shows a yellow warning icon... maybe a yellow/orange checkmark to match the green check icon. Or the same green check mark with a warning exclamation mark next to it?

So it tells the user hey there is something for you to maybe look at, but the asset still compiled correctly.

image

Since we have no "warning" output we can detect here... maybe this is just shown when it builds successfully, but there is additional output text that may be warnings or stats or something else you should maybe want to see.

@margorski
Copy link
Contributor

@margorski margorski commented May 28, 2020

Could you provide volume.fx file? I was not able to reproduce that. I tried to force implicit truncation of vector type in fx file but then result was as expected, success with warning:

image

@tomspilman
Copy link
Member Author

@tomspilman tomspilman commented May 28, 2020

@margorski - can't really... it is for a Stadia project and to get these warnings you need to be building for Stadia.

It is interesting you're not getting the failed icon. Let me dig deeper to see what is going on.

@tomspilman
Copy link
Member Author

@tomspilman tomspilman commented May 28, 2020

Here is the full text of the mgcb output i got:

Build started 5/28/2020 10:24:57 AM

Cleaning E:/Projects/Stadia/GameTest/Content/bin/Stadia/Content/volume.xnb
E:/Projects/Stadia/GameTest/Content/volume.fx
E:/Projects/Stadia/GameTest/Content/volume.fx: E:\Projects\Stadia\GameTest\Content\volume.fx:124:45: warning: implicit truncation of vector type [-Wconversion]
E:/Projects/Stadia/GameTest/Content/volume.fx:                 value = Volume.SampleLevel(VolumeSampler, pos.xyz, pos.w).r;
E:/Projects/Stadia/GameTest/Content/volume.fx:                                                           ^
E:/Projects/Stadia/GameTest/Content/volume.fx: E:\Projects\Stadia\GameTest\Content\volume.fx:124:45: warning: implicit truncation of vector type [-Wconversion]
E:/Projects/Stadia/GameTest/Content/volume.fx:                 value = Volume.SampleLevel(VolumeSampler, pos.xyz, pos.w).r;
E:/Projects/Stadia/GameTest/Content/volume.fx:                                                           ^
E:/Projects/Stadia/GameTest/Content/volume.fx: E:\Projects\Stadia\GameTest\Content\volume.fx:124:45: warning: implicit truncation of vector type [-Wconversion]
E:/Projects/Stadia/GameTest/Content/volume.fx:                 value = Volume.SampleLevel(VolumeSampler, pos.xyz, pos.w).r;
E:/Projects/Stadia/GameTest/Content/volume.fx:                                                           ^
E:/Projects/Stadia/GameTest/Content/volume.fx: E:\Projects\Stadia\GameTest\Content\volume.fx:124:45: warning: implicit truncation of vector type [-Wconversion]
E:/Projects/Stadia/GameTest/Content/volume.fx:                 value = Volume.SampleLevel(VolumeSampler, pos.xyz, pos.w).r;
E:/Projects/Stadia/GameTest/Content/volume.fx:                                                           ^
E:/Projects/Stadia/GameTest/Content/volume.fx: E:\Projects\Stadia\GameTest\Content\volume.fx:124:45: warning: implicit truncation of vector type [-Wconversion]
E:/Projects/Stadia/GameTest/Content/volume.fx:                 value = Volume.SampleLevel(VolumeSampler, pos.xyz, pos.w).r;
E:/Projects/Stadia/GameTest/Content/volume.fx:                                                           ^
E:/Projects/Stadia/GameTest/Content/volume.fx: E:\Projects\Stadia\GameTest\Content\volume.fx:124:45: warning: implicit truncation of vector type [-Wconversion]
E:/Projects/Stadia/GameTest/Content/volume.fx:                 value = Volume.SampleLevel(VolumeSampler, pos.xyz, pos.w).r;
E:/Projects/Stadia/GameTest/Content/volume.fx:                                                           ^

Build 1 succeeded, 0 failed.

Time elapsed 00:00:00.82.

In theory if you fake the MGCB.exe output that the editor captures to be the string data above. You should be able to recreate the situation.

@tomspilman
Copy link
Member Author

@tomspilman tomspilman commented May 28, 2020

I guess i've forgotten that the editor makes all the decisions about the icon to show based on just the text stream. So i guess this pattern matches the "we got an error" case.

@margorski
Copy link
Contributor

@margorski margorski commented May 30, 2020

I'll check that if it fits pattern. Wouldn't it be better to rely on return codes/error standard stream instead of pattern matching for error case?

@tomspilman
Copy link
Member Author

@tomspilman tomspilman commented May 30, 2020

Wouldn't it be better to rely on return codes/error standard stream instead of pattern matching for error case?

I don't see how a return code would work if MGCB.exe is building 100s of assets.

Our best method is what we're doing. I see no problem fixing/improving MGCB formatting to make errors vs warnings more clear.

We just need to know why it is failing in this case first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants