Rename BoundsCheckPolicy::UndefinedBehavior to Unchecked.

When we are leaning on robust buffer access to do the job for us, there's no
undefined behavior going on. So `UndefinedBehavior` suggests people are doing
something reckless even if they're not. The policy just says what Naga is doing,
and it shouldn't pretend to say what the rest of the system is doing.
This commit is contained in:
Jim Blandy
2021-08-24 17:44:16 -07:00
committed by Dzmitry Malyshau
parent 1e9f2b9287
commit bdf774aa8b
5 changed files with 27 additions and 15 deletions

View File

@@ -13,13 +13,13 @@ struct Args {
/// what policy to use for index bounds checking for arrays, vectors, and
/// matrices.
///
/// May be `Restrict`, `ReadZeroSkipWrite`, or `UndefinedBehavior`
/// May be `Restrict`, `ReadZeroSkipWrite`, or `Unchecked`
#[argh(option)]
index_bounds_check_policy: Option<BoundsCheckPolicyArg>,
/// what policy to use for texture bounds checking.
///
/// May be `Restrict`, `ReadZeroSkipWrite`, or `UndefinedBehavior`
/// May be `Restrict`, `ReadZeroSkipWrite`, or `Unchecked`
#[argh(option)]
image_bounds_check_policy: Option<BoundsCheckPolicyArg>,
@@ -62,7 +62,7 @@ impl FromStr for BoundsCheckPolicyArg {
Ok(Self(match s.to_lowercase().as_str() {
"restrict" => BoundsCheckPolicy::Restrict,
"readzeroskipwrite" => BoundsCheckPolicy::ReadZeroSkipWrite,
"undefinedbehavior" => BoundsCheckPolicy::UndefinedBehavior,
"unchecked" => BoundsCheckPolicy::Unchecked,
_ => {
return Err(format!(
"Invalid value for --index-bounds-check-policy: {}",