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:
baldurk
2015-04-21 20:45:13 +02:00
parent 3701b46611
commit 392f9b7f2d
+2 -1
View File
@@ -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