[naga spv-out] Use crate::proc::index::GuardedIndex.

Replace qualified paths with a `use` directive.
This commit is contained in:
Jim Blandy 2024-10-09 17:39:23 -07:00
parent 57b8858f96
commit 4427ff9622

View File

@ -6,7 +6,11 @@ use super::{
index::BoundsCheckResult, selection::Selection, Block, BlockContext, Dimension, Error, index::BoundsCheckResult, selection::Selection, Block, BlockContext, Dimension, Error,
Instruction, LocalType, LookupType, NumericType, ResultMember, Writer, WriterFlags, Instruction, LocalType, LookupType, NumericType, ResultMember, Writer, WriterFlags,
}; };
use crate::{arena::Handle, proc::TypeResolution, Statement}; use crate::{
arena::Handle,
proc::{index::GuardedIndex, TypeResolution},
Statement,
};
use spirv::Word; use spirv::Word;
fn get_dimension(type_inner: &crate::TypeInner) -> Dimension { fn get_dimension(type_inner: &crate::TypeInner) -> Dimension {
@ -1743,7 +1747,7 @@ impl<'w> BlockContext<'w> {
is_non_uniform_binding_array |= is_non_uniform_binding_array |=
self.is_nonuniform_binding_array_access(base, index); self.is_nonuniform_binding_array_access(base, index);
let index = crate::proc::index::GuardedIndex::Expression(index); let index = GuardedIndex::Expression(index);
let index_id = let index_id =
self.write_access_chain_index(base, index, &mut accumulated_checks, block)?; self.write_access_chain_index(base, index, &mut accumulated_checks, block)?;
self.temp_list.push(index_id); self.temp_list.push(index_id);
@ -1768,7 +1772,7 @@ impl<'w> BlockContext<'w> {
// through the bounds check process. // through the bounds check process.
self.write_access_chain_index( self.write_access_chain_index(
base, base,
crate::proc::index::GuardedIndex::Known(index), GuardedIndex::Known(index),
&mut accumulated_checks, &mut accumulated_checks,
block, block,
)? )?
@ -1861,7 +1865,7 @@ impl<'w> BlockContext<'w> {
fn write_access_chain_index( fn write_access_chain_index(
&mut self, &mut self,
base: Handle<crate::Expression>, base: Handle<crate::Expression>,
index: crate::proc::index::GuardedIndex, index: GuardedIndex,
accumulated_checks: &mut Option<Word>, accumulated_checks: &mut Option<Word>,
block: &mut Block, block: &mut Block,
) -> Result<Word, Error> { ) -> Result<Word, Error> {