mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 09:30:44 +00:00
Clamp texture view slice to number of slices (sanity checking)
* This should in theory be impossible as you can't create a view that points to after the number of slices, and we always make a list of all slices, but there was a crash report here so for now we'll just clamp so that it doesn't crash completely.
This commit is contained in:
@@ -1335,7 +1335,8 @@ namespace renderdocui.Windows
|
||||
}
|
||||
}
|
||||
|
||||
sliceFace.SelectedIndex = (int)m_Following.GetFirstArraySlice(m_Core);
|
||||
int firstArraySlice = (int)m_Following.GetFirstArraySlice(m_Core);
|
||||
sliceFace.SelectedIndex = Helpers.Clamp(firstArraySlice, 0, (int)numSlices - 1);
|
||||
}
|
||||
|
||||
// mip and slice were reset to 0 above, we must restore any per-tex settings to apply
|
||||
|
||||
Reference in New Issue
Block a user