Skip to content

Fixed invalid loop length for probe baking (case 1289680) #2830

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

Merged
merged 3 commits into from
Dec 15, 2020
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
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 @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed ShaderGraph Decal material not showing exposed properties.
- Fixed wrong coat normal space in shader graph
- Fixed issue with faulty shadow transition when view is close to an object under some aspect ratio conditions
- Fixed NullPointerException when baking probes from the lighting window (case 1289680)

### Changed
- Removed the material pass probe volumes evaluation mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,20 +322,22 @@ IScriptableBakedReflectionSystemStageNotifier handle
// == 5. ==

// Create new baked state array
var targetSize = m_HDProbeBakedStates.Length + addCount - remCount;
var targetSize = m_HDProbeBakedStates.Length - remCount + toBakeIndicesList.Count;
var targetBakedStates = stackalloc HDProbeBakedState[targetSize];
// Copy baked state that are not removed
var targetI = 0;
for (int i = 0; i < m_HDProbeBakedStates.Length; ++i)
{
if (CoreUnsafeUtils.IndexOf(remIndices, remCount, i) != -1)
continue;
Assert.IsTrue(targetI < targetSize);
targetBakedStates[targetI++] = m_HDProbeBakedStates[i];
}
// Add new baked states
for (int i = 0; i < toBakeIndicesList.Count; ++i)
{
var state = states[toBakeIndicesList.GetUnchecked(i)];
Assert.IsTrue(targetI < targetSize);
targetBakedStates[targetI++] = new HDProbeBakedState
{
instanceID = state.instanceID,
Expand Down