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

[ShaderGraph][2022.1] Fix 1356725 - incorrect appearance of warning message in Node Settings #5672

Merged
merged 3 commits into from
Sep 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix for 1356725 - update the sample virtual texture node property dra…
…wer to generate a correct warning message and make it wrap.
  • Loading branch information
jessebarker committed Sep 15, 2021
commit cd16045359c0abf3f918bfc76e0a855330c6d6f2
Original file line number Diff line number Diff line change
Expand Up @@ -101,25 +101,30 @@ VisualElement CreateGUI(SampleVirtualTextureNode node, InspectableAttribute attr
// }

// display warning if the current render pipeline doesn't support virtual texturing
HelpBoxRow help = new HelpBoxRow(MessageType.Warning);
string labelText;
IVirtualTexturingEnabledRenderPipeline vtRp =
GraphicsSettings.currentRenderPipeline as IVirtualTexturingEnabledRenderPipeline;
if (vtRp == null)
propertySheet.Add(new HelpBoxRow(MessageType.Warning),
(row) => row.Add(new Label(
"The current render pipeline does not support Virtual Texturing, this node will do regular 2D sampling.")));
labelText = "The current render pipeline does not support Virtual Texturing, this node will do regular 2D sampling.";
else if (vtRp.virtualTexturingEnabled == false)
propertySheet.Add(new HelpBoxRow(MessageType.Warning),
(row) => row.Add(new Label(
"The current render pipeline has disabled Virtual Texturing, this node will do regular 2D sampling.")));
labelText = "The current render pipeline has disabled Virtual Texturing, this node will do regular 2D sampling.";
else
{
#if !ENABLE_VIRTUALTEXTURES
propertySheet.Add(new HelpBoxRow(MessageType.Warning),
(row) => row.Add(new Label(
"Virtual Texturing is disabled globally (possibly by the render pipeline settings), this node will do regular 2D sampling.")));
labelText = "Virtual Texturing is disabled globally (possibly by the render pipeline settings), this node will do regular 2D sampling.";
#endif
}

if (!string.IsNullOrEmpty(labelText))
{
var label = new Label(labelText)
{
name = "message-warn"
};
label.style.whiteSpace = WhiteSpace.Normal;
propertySheet.Add(help, (row) => row.Add(label));
}
propertyVisualElement = propertySheet;
return propertySheet;
}
Expand Down