Skip to content

Commit f8a2e49

Browse files
[HDRP] Merge HD/bugfix #6387
1 parent 85dce6e commit f8a2e49

File tree

27 files changed

+105
-46
lines changed

27 files changed

+105
-46
lines changed

com.unity.render-pipelines.core/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
- Fixed potentially conflicting runtime Rendering Debugger UI command by adding an option to disable runtime UI altogether (1345783).
1111
- Fixed issue when changing volume profiles at runtime with a script (case 1364256).
1212
- Fixed XR support in CoreUtils.DrawFullscreen function.
13+
- Fixed an issue causing Render Graph execution errors after a random amount of time.
1314

1415
## [10.7.0] - 2021-07-02
1516

com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,12 @@ void OnGUI()
378378
//GUILayout.Button(k_LoadButtonContent, EditorStyles.toolbarButton);
379379
//GUILayout.Button(k_SaveButtonContent, EditorStyles.toolbarButton);
380380
if (GUILayout.Button(k_ResetButtonContent, EditorStyles.toolbarButton))
381+
{
381382
DebugManager.instance.Reset();
383+
DestroyWidgetStates();
384+
UpdateWidgetStates();
385+
}
386+
382387
GUILayout.EndHorizontal();
383388

384389
using (new EditorGUILayout.HorizontalScope())

com.unity.render-pipelines.core/Editor/Volume/VolumeEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void RefreshEffectListEditor(VolumeProfile asset)
4545
{
4646
m_ComponentList.Clear();
4747

48-
asset.Sanitize();
48+
asset?.Sanitize();
4949

5050
if (asset != null)
5151
m_ComponentList.Init(asset, new SerializedObject(asset));

com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResources.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,21 @@ public bool IsValid()
4646

4747
static public void NewFrame(int executionIndex)
4848
{
49+
uint previousValidBit = s_CurrentValidBit;
4950
// Scramble frame count to avoid collision when wrapping around.
5051
s_CurrentValidBit = (uint)(((executionIndex >> 16) ^ (executionIndex & 0xffff) * 58546883) << 16);
5152
// In case the current valid bit is 0, even though perfectly valid, 0 represents an invalid handle, hence we'll
5253
// trigger an invalid state incorrectly. To account for this, we actually skip 0 as a viable s_CurrentValidBit and
5354
// start from 1 again.
54-
if (s_CurrentValidBit == 0)
55+
// In the same spirit, s_SharedResourceValidBit is reserved for shared textures so we should never use it otherwise
56+
// resources could be considered valid at frame N+1 (because shared) even though they aren't.
57+
if (s_CurrentValidBit == 0 || s_CurrentValidBit == s_SharedResourceValidBit)
5558
{
56-
s_CurrentValidBit = 1 << 16;
59+
// We need to make sure we don't pick the same value twice.
60+
uint value = 1;
61+
while (previousValidBit == (value << 16))
62+
value++;
63+
s_CurrentValidBit = (value << 16);
5764
}
5865
}
5966
}

com.unity.render-pipelines.core/Runtime/Utilities/CameraCaptureBridge.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static bool enabled
3535
/// <returns>Enumeration of actions</returns>
3636
public static IEnumerator<Action<RenderTargetIdentifier, CommandBuffer>> GetCaptureActions(Camera camera)
3737
{
38-
if (!actionDict.TryGetValue(camera, out var actions))
38+
if (!actionDict.TryGetValue(camera, out var actions) || actions.Count == 0)
3939
return null;
4040

4141
return actions.GetEnumerator();

com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,19 @@ public override int GetHashCode()
219219
}
220220
}
221221

222+
/// <summary>
223+
/// Returns true if any of the volume properites has been overridden.
224+
/// </summary>
225+
/// <returns>True if any of the volume properites has been overridden.</returns>
226+
public bool AnyPropertiesIsOverridden()
227+
{
228+
for (int i = 0; i < parameters.Count; ++i)
229+
{
230+
if (parameters[i].overrideState) return true;
231+
}
232+
return false;
233+
}
234+
222235
/// <summary>
223236
/// Unity calls this method before the object is destroyed.
224237
/// </summary>

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1919
- Fixed HDRP Decals performances when they use different materials (~5x improvement in the decal update loop code).
2020
- Fixed light unit conversion after changing mid gray value.
2121
- Fixed stencil buffer resolve when MSAA is enabled so that OR operator is used instead of picking the last sample.
22+
- Fixed rasterized accumulation motion blur when DoF is enabled (case 1378497).
23+
- Fixed light mode not available after switching a light to area "Disc" or "Tube" (case 1372588).
24+
- Fixed CoC size computation when dynamic resolution is enabled
25+
- Fixed shadow cascade transition not working properly with bias.
26+
- Fixed broken rendering when duplicating a camera while the Rendering Debugger is opened.
27+
- Fixed screen space shadow debug view not showing when no shadows is available.
28+
- Fixed debug window reset.
29+
- Fixed camera bridge action in release build (case 1367866).
30+
- Fixed contact shadow disappearing when shadowmask is used and no non-static object is available.
31+
- Fixed atmospheric scattering being incorrectly enabled when scene lighting is disabled.
32+
- Fixed for changes of color curves not being applied immediately.
2233

2334
### Changed
2435
- MaterialReimporter.ReimportAllMaterials and MaterialReimporter.ReimportAllHDShaderGraphs now batch the asset database changes to improve performance.

com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static void DrawGeneralContent(SerializedHDLight serialized, Editor owner)
223223
EditorGUI.showMixedValue = false;
224224

225225
// Draw the mode, for Tube and Disc lights, there is only one choice, so we can disable the enum.
226-
using (new EditorGUI.DisabledScope(serialized.areaLightShape == AreaLightShape.Tube || serialized.areaLightShape == AreaLightShape.Disc))
226+
using (new EditorGUI.DisabledScope(updatedLightType == HDLightType.Area && (serialized.areaLightShape == AreaLightShape.Tube || serialized.areaLightShape == AreaLightShape.Disc)))
227227
serialized.settings.DrawLightmapping();
228228

229229
if (updatedLightType == HDLightType.Area)

com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/AtmosphericScattering.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ void EvaluateAtmosphericScattering(PositionInputs posInput, float3 V, out float3
257257

258258
#ifdef DEBUG_DISPLAY
259259
// Don't sample atmospheric scattering when lighting debug more are enabled so fog is not visible
260-
if (_DebugLightingMode >= DEBUGLIGHTINGMODE_DIFFUSE_LIGHTING && _DebugLightingMode <= DEBUGLIGHTINGMODE_EMISSIVE_LIGHTING)
260+
if (_DebugLightingMode == DEBUGLIGHTINGMODE_MATCAP_VIEW || (_DebugLightingMode >= DEBUGLIGHTINGMODE_DIFFUSE_LIGHTING && _DebugLightingMode <= DEBUGLIGHTINGMODE_EMISSIVE_LIGHTING))
261261
return;
262262

263263
if (_DebugShadowMapMode == SHADOWMAPDEBUGMODE_SINGLE_SHADOW || _DebugLightingMode == DEBUGLIGHTINGMODE_LUX_METER || _DebugLightingMode == DEBUGLIGHTINGMODE_LUMINANCE_METER)

com.unity.render-pipelines.high-definition/Runtime/Lighting/LightDefinition.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ struct DirectionalLightData
105105
public float distanceFromCamera; // -1 -> no sky interaction
106106
public float angularDiameter; // Units: radians
107107
public float flareFalloff;
108-
public float __unused__;
108+
109+
public float flareCosInner;
110+
public float flareCosOuter;
111+
public float __unused__;
109112

110113
public Vector3 flareTint;
111114
public float flareSize; // Units: radians

0 commit comments

Comments
 (0)