Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
28 changes: 15 additions & 13 deletions com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public interface IViewDisplayer
/// <summary>Callback on update requested</summary>
event Action OnUpdateRequested;
}

partial class DisplayWindow : EditorWindow, IViewDisplayer
{
static partial class Style
Expand Down Expand Up @@ -82,7 +82,7 @@ internal static readonly (Texture2D icon, string tooltip) k_LayoutStackIcon =
internal const string k_CameraMenuSync1On2 = "Align Camera 1 with Camera 2";
internal const string k_CameraMenuSync2On1 = "Align Camera 2 with Camera 1";
internal const string k_CameraMenuReset = "Reset Cameras";

internal const string k_EnvironmentSidePanelName = "Environment";
internal const string k_DebugSidePanelName = "Debug";

Expand Down Expand Up @@ -127,7 +127,7 @@ internal static readonly (Texture2D icon, string tooltip) k_LayoutStackIcon =
Label m_NoEnvironment2;

Image[] m_Views = new Image[2];

LayoutContext layout
=> LookDev.currentContext.layout;

Expand All @@ -143,7 +143,7 @@ Layout viewLayout
}
}
}

SidePanel sidePanel
{
get => layout.showedSidePanel;
Expand Down Expand Up @@ -218,7 +218,7 @@ event Action IViewDisplayer.OnUpdateRequested

void OnEnable()
{
//Stylesheet
//Stylesheet
// Try to load stylesheet. Timing can be odd while upgrading packages (case 1219692).
// In this case, it will be fixed in OnGUI. Though it can spawn error while reimporting assets.
// Waiting for filter on stylesheet (case 1228706) to remove last error.
Expand Down Expand Up @@ -486,7 +486,7 @@ Rect IViewDisplayer.GetRect(ViewCompositionIndex index)
throw new ArgumentException("Unknown ViewCompositionIndex: " + index);
}
}

Vector2 m_LastFirstViewSize = new Vector2();
Vector2 m_LastSecondViewSize = new Vector2();
void IViewDisplayer.SetTexture(ViewCompositionIndex index, Texture texture)
Expand Down Expand Up @@ -532,7 +532,7 @@ void IViewDisplayer.SetTexture(ViewCompositionIndex index, Texture texture)
throw new ArgumentException("Unknown ViewCompositionIndex: " + index);
}
}

void IViewDisplayer.Repaint() => Repaint();

void ApplyLayout(Layout value)
Expand Down Expand Up @@ -627,19 +627,21 @@ IStyle GetEnvironmentContenairDraggerStyle()

void OnGUI()
{
//Stylesheet
//Stylesheet
// [case 1219692] if LookDev is open while reimporting CoreRP package,
// stylesheet can be null. In this case, we can have a null stylesheet
// registered as it got destroyed. Reloading it. As we cannot just
// registered as it got destroyed. Reloading it. As we cannot just
// remove a null entry, we must filter and reconstruct the while list.
if (styleSheet == null || styleSheet.Equals(null)
|| (!EditorGUIUtility.isProSkin && (styleSheetLight == null || styleSheetLight.Equals(null))))
{
// While (case 1228706) is still on going, we sill close and reopen the look dev.
// This will prevent spawning error at frame.
LookDev.Close();
LookDev.Open();
return;
// Note 2: This actually causes the lookdev to break completely with light theme.
// Until the actual issue is fixed, we'll comment this fix out as it only concerns an upgrade problem.
//LookDev.Close();
//LookDev.Open();
//return;

// Following lines is the correct fix if UIElement filter garbage collected Stylesheet.

Expand Down Expand Up @@ -689,7 +691,7 @@ void OnGUI()
}

// [case 1245086] Guard in case the SRP asset is set to null (or to a not supported SRP) when the lookdev window is already open
// Note: After an editor reload, we might get a null OnUpdateRequestedInternal and null SRP for a couple of frames, hence the check.
// Note: After an editor reload, we might get a null OnUpdateRequestedInternal and null SRP for a couple of frames, hence the check.
if (!LookDev.supported && OnUpdateRequestedInternal !=null)
{
// Print an error and close the Lookdev window (to avoid spamming the console)
Expand Down
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed XR Display providers not getting zNear and zFar plane distances passed to them when in HDRP.
- Fixed issue with white flash when enabling SSR.
- Fixed issue with depth pyramid generation and dynamic resolution.
- Fixed an issue where opening the look dev window with the light theme would make the window blink and eventually crash unity.

### Changed
- Changed extensions of shader CAS include files.
Expand Down