mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Remove IndexableLength::Specializable variant.
Specializable constants are no longer permitted as array lengths, so this case should not arise in valid code.
This commit is contained in:
committed by
Dzmitry Malyshau
parent
90daa9edfe
commit
3d6cbcf8a6
@@ -109,10 +109,6 @@ impl<'w> BlockContext<'w> {
|
||||
let length_id = self.write_runtime_array_length(sequence, block)?;
|
||||
Ok(MaybeKnown::Computed(length_id))
|
||||
}
|
||||
crate::proc::IndexableLength::Specializable(constant) => {
|
||||
let length_id = self.writer.constant_ids[constant.index()];
|
||||
Ok(MaybeKnown::Computed(length_id))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,10 +49,6 @@ pub enum IndexableLength {
|
||||
/// Values of this type always have the given number of elements.
|
||||
Known(u32),
|
||||
|
||||
/// The value of the given specializable constant is the number of elements.
|
||||
/// (Non-specializable constants are reported as `Known`.)
|
||||
Specializable(crate::Handle<crate::Constant>),
|
||||
|
||||
/// The number of elements is determined at runtime.
|
||||
Dynamic,
|
||||
}
|
||||
@@ -65,7 +61,11 @@ impl crate::ArraySize {
|
||||
K {
|
||||
specialization: Some(_),
|
||||
..
|
||||
} => IndexableLength::Specializable(k),
|
||||
} => {
|
||||
// Specializable constants are not supported as array lengths.
|
||||
// See valid::TypeError::UnsupportedSpecializedArrayLength.
|
||||
return Err(ProcError::InvalidArraySizeConstant(k));
|
||||
}
|
||||
ref unspecialized => {
|
||||
let length = unspecialized
|
||||
.to_array_length()
|
||||
|
||||
Reference in New Issue
Block a user