diff --git a/Cargo.toml b/Cargo.toml index 1929bda828..0efdd20d12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,6 +38,7 @@ wgsl-out = [] hlsl-out = [] span = ["codespan-reporting", "termcolor"] validate = [] +compact = [] [[bench]] name = "criterion" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index a159b041f6..1a786ee03e 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -10,9 +10,28 @@ keywords = ["shader", "SPIR-V", "GLSL", "MSL"] license = "MIT OR Apache-2.0" [dependencies] -naga = { version = "0.13", path = "../", features = ["validate", "span", "wgsl-in", "wgsl-out", "glsl-in", "glsl-out", "spv-in", "spv-out", "msl-out", "hlsl-out", "dot-out", "serialize", "deserialize"] } bincode = "1" log = "0.4" codespan-reporting = "0.11" env_logger = "0.10" argh = "0.1.5" + +[dependencies.naga] +version = "0.13" +path = "../" +features = [ + "validate", + "compact", + "span", + "wgsl-in", + "wgsl-out", + "glsl-in", + "glsl-out", + "spv-in", + "spv-out", + "msl-out", + "hlsl-out", + "dot-out", + "serialize", + "deserialize" +] diff --git a/cli/src/bin/naga.rs b/cli/src/bin/naga.rs index d1e0e046b6..67e894fdbc 100644 --- a/cli/src/bin/naga.rs +++ b/cli/src/bin/naga.rs @@ -79,6 +79,20 @@ struct Args { #[argh(switch, short = 'g')] generate_debug_symbols: bool, + /// compact the module's IR and revalidate. + /// + /// Output files will reflect the compacted IR. If you want to see the IR as + /// it was before compaction, use the `--before-compaction` option. + #[argh(switch)] + compact: bool, + + /// write the module's IR before compaction to the given file. + /// + /// This implies `--compact`. Like any other output file, the filename + /// extension determines the form in which the module is written. + #[argh(option)] + before_compaction: Option, + /// show version #[argh(switch)] version: bool, @@ -288,7 +302,7 @@ fn run() -> Result<(), Box> { !params.keep_coordinate_space, ); - let (module, input_text) = match Path::new(&input_path) + let (mut module, input_text) = match Path::new(&input_path) .extension() .ok_or(CliError("Input filename has no extension"))? .to_str() @@ -377,12 +391,13 @@ fn run() -> Result<(), Box> { caps & !missing }); - // validate the IR + // Validate the IR before compaction. let info = match naga::valid::Validator::new(params.validation_flags, validation_caps) .validate(&module) { Ok(info) => Some(info), Err(error) => { + // Validation failure is not fatal. Just report the error. if let Some(input) = &input_text { let filename = input_path.file_name().and_then(std::ffi::OsStr::to_str); emit_annotated_error(&error, filename.unwrap_or("input"), input); @@ -392,6 +407,45 @@ fn run() -> Result<(), Box> { } }; + // Compact the module, if requested. + let info = if args.compact || args.before_compaction.is_some() { + // Compact only if validation succeeded. Otherwise, compaction may panic. + if info.is_some() { + // Write out the module state before compaction, if requested. + if let Some(ref before_compaction) = args.before_compaction { + write_output(&module, &info, ¶ms, before_compaction)?; + } + + naga::compact::compact(&mut module); + + // Re-validate the IR after compaction. + match naga::valid::Validator::new(params.validation_flags, validation_caps) + .validate(&module) + { + Ok(info) => Some(info), + Err(error) => { + // Validation failure is not fatal. Just report the error. + eprintln!("Error validating compacted module:"); + if let Some(input) = &input_text { + let filename = input_path.file_name().and_then(std::ffi::OsStr::to_str); + emit_annotated_error(&error, filename.unwrap_or("input"), input); + } + print_err(&error); + None + } + } + } else { + eprintln!("Skipping compaction due to validation failure."); + None + } + } else { + info + }; + + // If no output was requested, then report validation results and stop here. + // + // If the user asked for output, don't stop: some output formats (".txt", + // ".dot", ".bin") can be generated even without a `ModuleInfo`. if output_paths.is_empty() { if info.is_some() { println!("Validation successful"); diff --git a/src/arena.rs b/src/arena.rs index 5c2681c834..1499cf1772 100644 --- a/src/arena.rs +++ b/src/arena.rs @@ -192,12 +192,31 @@ impl Iterator for Range { } impl Range { + /// Return a range enclosing handles `first` through `last`, inclusive. pub fn new_from_bounds(first: Handle, last: Handle) -> Self { Self { inner: (first.index() as u32)..(last.index() as u32 + 1), marker: Default::default(), } } + + /// Return the first and last handles included in `self`. + /// + /// If `self` is an empty range, there are no handles included, so + /// return `None`. + pub fn first_and_last(&self) -> Option<(Handle, Handle)> { + if self.inner.start < self.inner.end { + Some(( + // `Range::new_from_bounds` expects a 1-based, start- and + // end-inclusive range, but `self.inner` is a zero-based, + // end-exclusive range. + Handle::new(Index::new(self.inner.start + 1).unwrap()), + Handle::new(Index::new(self.inner.end).unwrap()), + )) + } else { + None + } + } } /// An arena holding some kind of component (e.g., type, constant, @@ -382,6 +401,19 @@ impl Arena { Ok(()) } } + + #[cfg(feature = "compact")] + pub(crate) fn retain_mut

(&mut self, mut predicate: P) + where + P: FnMut(Handle, &mut T) -> bool, + { + let mut index = 0; + self.data.retain_mut(|elt| { + index += 1; + let handle = Handle::new(Index::new(index).unwrap()); + predicate(handle, elt) + }) + } } #[cfg(feature = "deserialize")] @@ -544,6 +576,44 @@ impl UniqueArena { Span::default() } } + + #[cfg(feature = "compact")] + pub(crate) fn drain_all(&mut self) -> UniqueArenaDrain { + UniqueArenaDrain { + inner_elts: self.set.drain(..), + #[cfg(feature = "span")] + inner_spans: self.span_info.drain(..), + index: Index::new(1).unwrap(), + } + } +} + +#[cfg(feature = "compact")] +pub(crate) struct UniqueArenaDrain<'a, T> { + inner_elts: indexmap::set::Drain<'a, T>, + #[cfg(feature = "span")] + inner_spans: std::vec::Drain<'a, Span>, + index: Index, +} + +#[cfg(feature = "compact")] +impl<'a, T> Iterator for UniqueArenaDrain<'a, T> { + type Item = (Handle, T, Span); + + fn next(&mut self) -> Option { + match self.inner_elts.next() { + Some(elt) => { + let handle = Handle::new(self.index); + self.index = self.index.checked_add(1).unwrap(); + #[cfg(feature = "span")] + let span = self.inner_spans.next().unwrap(); + #[cfg(not(feature = "span"))] + let span = Span::default(); + Some((handle, elt, span)) + } + None => None, + } + } } impl UniqueArena { diff --git a/src/compact/expressions.rs b/src/compact/expressions.rs new file mode 100644 index 0000000000..4ccf559c4e --- /dev/null +++ b/src/compact/expressions.rs @@ -0,0 +1,395 @@ +use super::{HandleMap, HandleSet, ModuleMap}; +use crate::arena::{Arena, Handle, UniqueArena}; + +pub struct ExpressionTracer<'tracer> { + pub types: &'tracer UniqueArena, + pub constants: &'tracer Arena, + + /// The arena in which we are currently tracing expressions. + pub expressions: &'tracer Arena, + + /// The used map for `types`. + pub types_used: &'tracer mut HandleSet, + + /// The used map for `constants`. + pub constants_used: &'tracer mut HandleSet, + + /// The used set for `arena`. + /// + /// This points to whatever arena holds the expressions we are + /// currently tracing: either a function's expression arena, or + /// the module's constant expression arena. + pub expressions_used: &'tracer mut HandleSet, + + /// The constant expression arena and its used map, if we haven't + /// switched to tracing constant expressions yet. + pub const_expressions: Option<( + &'tracer Arena, + &'tracer mut HandleSet, + )>, +} + +impl<'tracer> ExpressionTracer<'tracer> { + pub fn trace_expression(&mut self, expr: Handle) { + log::trace!( + "entering trace_expression of {}", + if self.const_expressions.is_some() { + "function expressions" + } else { + "const expressions" + } + ); + let mut work_list = vec![expr]; + while let Some(expr) = work_list.pop() { + // If we've already seen this expression, no need to trace further. + if !self.expressions_used.insert(expr) { + continue; + } + log::trace!("tracing new expression {:?}", expr); + + use crate::Expression as Ex; + match self.expressions[expr] { + // Expressions that do not contain handles that need to be traced. + Ex::Literal(_) + | Ex::FunctionArgument(_) + | Ex::GlobalVariable(_) + | Ex::LocalVariable(_) + | Ex::CallResult(_) + | Ex::RayQueryProceedResult => {} + + Ex::Constant(handle) => { + self.constants_used.insert(handle); + let constant = &self.constants[handle]; + self.trace_type(constant.ty); + self.trace_const_expression(constant.init); + } + Ex::ZeroValue(ty) => self.trace_type(ty), + Ex::Compose { ty, ref components } => { + self.trace_type(ty); + work_list.extend(components); + } + Ex::Access { base, index } => work_list.extend([base, index]), + Ex::AccessIndex { base, index: _ } => work_list.push(base), + Ex::Splat { size: _, value } => work_list.push(value), + Ex::Swizzle { + size: _, + vector, + pattern: _, + } => work_list.push(vector), + Ex::Load { pointer } => work_list.push(pointer), + Ex::ImageSample { + image, + sampler, + gather: _, + coordinate, + array_index, + offset, + ref level, + depth_ref, + } => { + work_list.push(image); + work_list.push(sampler); + work_list.push(coordinate); + work_list.extend(array_index); + if let Some(offset) = offset { + self.trace_const_expression(offset); + } + use crate::SampleLevel as Sl; + match *level { + Sl::Auto | Sl::Zero => {} + Sl::Exact(expr) | Sl::Bias(expr) => work_list.push(expr), + Sl::Gradient { x, y } => work_list.extend([x, y]), + } + work_list.extend(depth_ref); + } + Ex::ImageLoad { + image, + coordinate, + array_index, + sample, + level, + } => { + work_list.push(image); + work_list.push(coordinate); + work_list.extend(array_index); + work_list.extend(sample); + work_list.extend(level); + } + Ex::ImageQuery { image, ref query } => { + work_list.push(image); + use crate::ImageQuery as Iq; + match *query { + Iq::Size { level } => work_list.extend(level), + Iq::NumLevels | Iq::NumLayers | Iq::NumSamples => {} + } + } + Ex::Unary { op: _, expr } => work_list.push(expr), + Ex::Binary { op: _, left, right } => work_list.extend([left, right]), + Ex::Select { + condition, + accept, + reject, + } => work_list.extend([condition, accept, reject]), + Ex::Derivative { + axis: _, + ctrl: _, + expr, + } => work_list.push(expr), + Ex::Relational { fun: _, argument } => work_list.push(argument), + Ex::Math { + fun: _, + arg, + arg1, + arg2, + arg3, + } => { + work_list.push(arg); + work_list.extend(arg1); + work_list.extend(arg2); + work_list.extend(arg3); + } + Ex::As { + expr, + kind: _, + convert: _, + } => work_list.push(expr), + Ex::AtomicResult { ty, comparison: _ } => self.trace_type(ty), + Ex::WorkGroupUniformLoadResult { ty } => self.trace_type(ty), + Ex::ArrayLength(expr) => work_list.push(expr), + Ex::RayQueryGetIntersection { + query, + committed: _, + } => work_list.push(query), + } + } + } + + fn trace_type(&mut self, ty: Handle) { + let mut types_used = super::types::TypeTracer { + types: self.types, + types_used: self.types_used, + }; + types_used.trace_type(ty); + } + + pub fn as_const_expression(&mut self) -> ExpressionTracer { + match self.const_expressions { + Some((ref mut exprs, ref mut exprs_used)) => ExpressionTracer { + expressions: exprs, + expressions_used: exprs_used, + types: self.types, + constants: self.constants, + types_used: self.types_used, + constants_used: self.constants_used, + const_expressions: None, + }, + None => ExpressionTracer { + types: self.types, + constants: self.constants, + expressions: self.expressions, + types_used: self.types_used, + constants_used: self.constants_used, + expressions_used: self.expressions_used, + const_expressions: None, + }, + } + } + + fn trace_const_expression(&mut self, const_expr: Handle) { + self.as_const_expression().trace_expression(const_expr); + } +} + +impl ModuleMap { + /// Fix up all handles in `expr`. + /// + /// Use the expression handle remappings in `operand_map`, and all + /// other mappings from `self`. + pub fn adjust_expression( + &self, + expr: &mut crate::Expression, + operand_map: &HandleMap, + ) { + let adjust = |expr: &mut Handle| { + operand_map.adjust(expr); + }; + + use crate::Expression as Ex; + match *expr { + // Expressions that do not contain handles that need to be adjusted. + Ex::Literal(_) + | Ex::FunctionArgument(_) + | Ex::GlobalVariable(_) + | Ex::LocalVariable(_) + | Ex::CallResult(_) + | Ex::RayQueryProceedResult => {} + + // Expressions that contain handles that need to be adjusted. + Ex::Constant(ref mut constant) => self.constants.adjust(constant), + Ex::ZeroValue(ref mut ty) => self.types.adjust(ty), + Ex::Compose { + ref mut ty, + ref mut components, + } => { + self.types.adjust(ty); + for component in components { + adjust(component); + } + } + Ex::Access { + ref mut base, + ref mut index, + } => { + adjust(base); + adjust(index); + } + Ex::AccessIndex { + ref mut base, + index: _, + } => adjust(base), + Ex::Splat { + size: _, + ref mut value, + } => adjust(value), + Ex::Swizzle { + size: _, + ref mut vector, + pattern: _, + } => adjust(vector), + Ex::Load { ref mut pointer } => adjust(pointer), + Ex::ImageSample { + ref mut image, + ref mut sampler, + gather: _, + ref mut coordinate, + ref mut array_index, + ref mut offset, + ref mut level, + ref mut depth_ref, + } => { + adjust(image); + adjust(sampler); + adjust(coordinate); + operand_map.adjust_option(array_index); + // TEST: try adjusting this with plain operand_map + if let Some(ref mut offset) = *offset { + self.const_expressions.adjust(offset); + } + self.adjust_sample_level(level, operand_map); + operand_map.adjust_option(depth_ref); + } + Ex::ImageLoad { + ref mut image, + ref mut coordinate, + ref mut array_index, + ref mut sample, + ref mut level, + } => { + adjust(image); + adjust(coordinate); + operand_map.adjust_option(array_index); + operand_map.adjust_option(sample); + operand_map.adjust_option(level); + } + Ex::ImageQuery { + ref mut image, + ref mut query, + } => { + adjust(image); + self.adjust_image_query(query, operand_map); + } + Ex::Unary { + op: _, + ref mut expr, + } => adjust(expr), + Ex::Binary { + op: _, + ref mut left, + ref mut right, + } => { + adjust(left); + adjust(right); + } + Ex::Select { + ref mut condition, + ref mut accept, + ref mut reject, + } => { + adjust(condition); + adjust(accept); + adjust(reject); + } + Ex::Derivative { + axis: _, + ctrl: _, + ref mut expr, + } => adjust(expr), + Ex::Relational { + fun: _, + ref mut argument, + } => adjust(argument), + Ex::Math { + fun: _, + ref mut arg, + ref mut arg1, + ref mut arg2, + ref mut arg3, + } => { + adjust(arg); + operand_map.adjust_option(arg1); + operand_map.adjust_option(arg2); + operand_map.adjust_option(arg3); + } + Ex::As { + ref mut expr, + kind: _, + convert: _, + } => adjust(expr), + Ex::AtomicResult { + ref mut ty, + comparison: _, + } => self.types.adjust(ty), + Ex::WorkGroupUniformLoadResult { ref mut ty } => self.types.adjust(ty), + Ex::ArrayLength(ref mut expr) => adjust(expr), + Ex::RayQueryGetIntersection { + ref mut query, + committed: _, + } => adjust(query), + } + } + + fn adjust_sample_level( + &self, + level: &mut crate::SampleLevel, + operand_map: &HandleMap, + ) { + let adjust = |expr: &mut Handle| operand_map.adjust(expr); + + use crate::SampleLevel as Sl; + match *level { + Sl::Auto | Sl::Zero => {} + Sl::Exact(ref mut expr) => adjust(expr), + Sl::Bias(ref mut expr) => adjust(expr), + Sl::Gradient { + ref mut x, + ref mut y, + } => { + adjust(x); + adjust(y); + } + } + } + + fn adjust_image_query( + &self, + query: &mut crate::ImageQuery, + operand_map: &HandleMap, + ) { + use crate::ImageQuery as Iq; + + match *query { + Iq::Size { ref mut level } => operand_map.adjust_option(level), + Iq::NumLevels | Iq::NumLayers | Iq::NumSamples => {} + } + } +} diff --git a/src/compact/functions.rs b/src/compact/functions.rs new file mode 100644 index 0000000000..08ca289a5e --- /dev/null +++ b/src/compact/functions.rs @@ -0,0 +1,134 @@ +use super::handle_set_map::HandleSet; +use super::{FunctionMap, ModuleMap}; +use crate::arena::Handle; + +pub(super) struct FunctionTracer<'a> { + pub(super) module: &'a crate::Module, + pub(super) function: &'a crate::Function, + + pub(super) types_used: &'a mut HandleSet, + pub(super) constants_used: &'a mut HandleSet, + pub(super) const_expressions_used: &'a mut HandleSet, + + /// Function-local expressions used. + pub(super) expressions_used: HandleSet, +} + +impl<'a> FunctionTracer<'a> { + pub fn trace(&mut self) { + for argument in self.function.arguments.iter() { + self.trace_type(argument.ty); + } + + if let Some(ref result) = self.function.result { + self.trace_type(result.ty); + } + + for (_, local) in self.function.local_variables.iter() { + self.trace_type(local.ty); + if let Some(init) = local.init { + // TEST: try changing this to trace_expression + self.trace_const_expression(init); + } + } + + // Treat named expressions as alive, for the sake of our test suite, + // which uses `let blah = expr;` to exercise lots of things. + for (value, _name) in &self.function.named_expressions { + self.trace_expression(*value); + } + + self.trace_block(&self.function.body); + } + + pub fn trace_type(&mut self, ty: Handle) { + self.as_type().trace_type(ty) + } + + pub fn trace_expression(&mut self, expr: Handle) { + self.as_expression().trace_expression(expr); + } + + pub fn trace_const_expression(&mut self, expr: Handle) { + self.as_expression() + .as_const_expression() + .trace_expression(expr); + } + + /* + pub fn trace_const_expression(&mut self, const_expr: Handle) { + self.as_expression().as_const_expression().trace_expression(const_expr); + } + */ + + fn as_type(&mut self) -> super::types::TypeTracer { + super::types::TypeTracer { + types: &self.module.types, + types_used: self.types_used, + } + } + + fn as_expression(&mut self) -> super::expressions::ExpressionTracer { + super::expressions::ExpressionTracer { + types: &self.module.types, + constants: &self.module.constants, + expressions: &self.function.expressions, + + types_used: self.types_used, + constants_used: self.constants_used, + expressions_used: &mut self.expressions_used, + const_expressions: Some(( + &self.module.const_expressions, + &mut self.const_expressions_used, + )), + } + } +} + +impl FunctionMap { + pub fn compact( + &self, + function: &mut crate::Function, + module_map: &ModuleMap, + reuse: &mut crate::NamedExpressions, + ) { + assert!(reuse.is_empty()); + + for argument in function.arguments.iter_mut() { + module_map.types.adjust(&mut argument.ty); + } + + if let Some(ref mut result) = function.result { + module_map.types.adjust(&mut result.ty); + } + + for (_, local) in function.local_variables.iter_mut() { + log::trace!("adjusting local variable {:?}", local.name); + module_map.types.adjust(&mut local.ty); + if let Some(ref mut init) = local.init { + module_map.const_expressions.adjust(init); + } + } + + // Drop unused expressions, reusing existing storage. + function.expressions.retain_mut(|handle, expr| { + if self.expressions.used(handle) { + module_map.adjust_expression(expr, &self.expressions); + true + } else { + false + } + }); + + // Adjust named expressions. + for (mut handle, name) in function.named_expressions.drain(..) { + self.expressions.adjust(&mut handle); + reuse.insert(handle, name); + } + std::mem::swap(&mut function.named_expressions, reuse); + assert!(reuse.is_empty()); + + // Adjust statements. + self.adjust_block(&mut function.body); + } +} diff --git a/src/compact/handle_set_map.rs b/src/compact/handle_set_map.rs new file mode 100644 index 0000000000..3a7968a713 --- /dev/null +++ b/src/compact/handle_set_map.rs @@ -0,0 +1,125 @@ +use crate::arena::{Arena, Handle, UniqueArena}; + +type Index = std::num::NonZeroU32; + +/// A set of `Handle` values. +pub struct HandleSet { + /// Bound on zero-based indexes of handles stored in this set. + len: usize, + + /// `members[i]` is true if the handle with zero-based index `i` + /// is a member. + members: bit_set::BitSet, + + /// This type is indexed by values of type `T`. + as_keys: std::marker::PhantomData, +} + +impl HandleSet { + pub fn for_arena(arena: &impl ArenaType) -> Self { + let len = arena.len(); + Self { + len, + members: bit_set::BitSet::with_capacity(len), + as_keys: std::marker::PhantomData, + } + } + + /// Add `handle` to the set. + /// + /// Return `true` if the handle was not already in the set. In + /// other words, return true if it was newly inserted. + pub fn insert(&mut self, handle: Handle) -> bool { + // Note that, oddly, `Handle::index` does not return a 1-based + // `Index`, but rather a zero-based `usize`. + self.members.insert(handle.index()) + } +} + +pub trait ArenaType { + fn len(&self) -> usize; +} + +impl ArenaType for Arena { + fn len(&self) -> usize { + self.len() + } +} + +impl ArenaType for UniqueArena { + fn len(&self) -> usize { + self.len() + } +} + +/// A map from old handle indices to new, compressed handle indices. +pub struct HandleMap { + /// The indices assigned to handles in the compacted module. + /// + /// If `new_index[i]` is `Some(n)`, then `n` is the 1-based + /// `Index` of the compacted `Handle` corresponding to the + /// pre-compacted `Handle` whose zero-based index is `i`. ("Clear + /// as mud.") + new_index: Vec>, + + /// This type is indexed by values of type `T`. + as_keys: std::marker::PhantomData, +} + +impl HandleMap { + pub fn from_set(set: HandleSet) -> Self { + let mut next_index = Index::new(1).unwrap(); + Self { + new_index: (0..set.len) + .map(|zero_based_index| { + if set.members.contains(zero_based_index) { + // This handle will be retained in the compacted version, + // so assign it a new index. + let this = next_index; + next_index = next_index.checked_add(1).unwrap(); + Some(this) + } else { + // This handle will be omitted in the compacted version. + None + } + }) + .collect(), + as_keys: std::marker::PhantomData, + } + } + + /// Return true if `old` is used in the compacted module. + pub fn used(&self, old: Handle) -> bool { + self.new_index[old.index()].is_some() + } + + /// Return the counterpart to `old` in the compacted module. + /// + /// If we thought `old` wouldn't be used in the compacted module, return + /// `None`. + pub fn try_adjust(&self, old: Handle) -> Option> { + log::trace!( + "adjusting {} handle [{}] -> [{:?}]", + std::any::type_name::(), + old.index() + 1, + self.new_index[old.index()] + ); + // Note that `Handle::index` returns a zero-based index, + // but `Handle::new` accepts a 1-based `Index`. + self.new_index[old.index()].map(Handle::new) + } + + /// Return the counterpart to `old` in the compacted module. + /// + /// If we thought `old` wouldn't be used in the compacted module, panic. + pub fn adjust(&self, handle: &mut Handle) { + *handle = self.try_adjust(*handle).unwrap(); + } + + /// Like `adjust`, but for optional handles. + pub fn adjust_option(&self, handle: &mut Option>) { + if let Some(ref mut handle) = *handle { + self.adjust(handle); + } + } +} diff --git a/src/compact/mod.rs b/src/compact/mod.rs new file mode 100644 index 0000000000..e0de1fe971 --- /dev/null +++ b/src/compact/mod.rs @@ -0,0 +1,286 @@ +mod expressions; +mod functions; +mod handle_set_map; +mod statements; +mod types; + +use crate::{arena, compact::functions::FunctionTracer}; +use handle_set_map::{HandleMap, HandleSet}; + +/// Remove unused types, expressions, and constants from `module`. +/// +/// Assuming that all globals, named constants, special types, +/// functions and entry points in `module` are used, determine which +/// types, constants, and expressions (both function-local and global +/// constant expressions) are actually used, and remove the rest, +/// adjusting all handles as necessary. The result should be a module +/// functionally identical to the original. +/// +/// This may be useful to apply to modules generated in the snapshot +/// tests. Our backends often generate temporary names based on handle +/// indices, which means that adding or removing unused arena entries +/// can affect the output even though they have no semantic effect. +/// Such meaningless changes add noise to snapshot diffs, making +/// accurate patch review difficult. Compacting the modules before +/// generating snapshots makes the output independent of unused arena +/// entries. +/// +/// # Panics +/// +/// If `module` has not passed validation, this may panic. +pub fn compact(module: &mut crate::Module) { + let mut module_tracer = ModuleTracer::new(module); + + // We treat all globals as used by definition. + log::trace!("tracing global variables"); + { + for (_, global) in module.global_variables.iter() { + log::trace!("tracing global {:?}", global.name); + module_tracer.as_type().trace_type(global.ty); + if let Some(init) = global.init { + module_tracer.as_const_expression().trace_expression(init); + } + } + } + + // We treat all special types as used by definition. + module_tracer.trace_special_types(&module.special_types); + + // We treat all named constants as used by definition. + for (handle, constant) in module.constants.iter() { + if constant.name.is_some() { + module_tracer.constants_used.insert(handle); + module_tracer.as_type().trace_type(constant.ty); + module_tracer + .as_const_expression() + .trace_expression(constant.init); + } + } + + // We assume that all functions are used. + // + // Observe which types, constant expressions, constants, and + // expressions each function uses, and produce maps from + // pre-compaction to post-compaction handles. + log::trace!("tracing functions"); + let function_maps: Vec = module + .functions + .iter() + .map(|(_, f)| { + log::trace!("tracing function {:?}", f.name); + let mut function_tracer = module_tracer.enter_function(f); + function_tracer.trace(); + FunctionMap::from(function_tracer) + }) + .collect(); + + // Similiarly, observe what each entry point actually uses. + log::trace!("tracing entry points"); + let entry_point_maps: Vec = module + .entry_points + .iter() + .map(|e| { + log::trace!("tracing entry point {:?}", e.function.name); + let mut used = module_tracer.enter_function(&e.function); + used.trace(); + FunctionMap::from(used) + }) + .collect(); + + // Now that we know what is used and what is never touched, + // produce maps from the `Handle`s that appear in `module` now to + // the corresponding `Handle`s that will refer to the same items + // in the compacted module. + let module_map = ModuleMap::from(module_tracer); + + // Drop unused types from the type arena. + // + // `IndexSet`s don't have an underlying Vec that we can steal, compact in + // place, and then rebuild the `IndexSet` from. So we have to rebuild the + // type arena from scratch. + log::trace!("compacting types"); + let mut new_types = arena::UniqueArena::new(); + for (old_handle, mut ty, span) in module.types.drain_all() { + if let Some(expected_new_handle) = module_map.types.try_adjust(old_handle) { + module_map.adjust_type(&mut ty); + let actual_new_handle = new_types.insert(ty, span); + assert_eq!(actual_new_handle, expected_new_handle); + } + } + module.types = new_types; + log::trace!("adjusting special types"); + module_map.adjust_special_types(&mut module.special_types); + + // Drop unused constant expressions, reusing existing storage. + log::trace!("adjusting constant expressions"); + module.const_expressions.retain_mut(|handle, expr| { + if module_map.const_expressions.used(handle) { + module_map.adjust_expression(expr, &module_map.const_expressions); + true + } else { + false + } + }); + + // Drop unused constants in place, reusing existing storage. + log::trace!("adjusting constants"); + module.constants.retain_mut(|handle, constant| { + if module_map.constants.used(handle) { + module_map.types.adjust(&mut constant.ty); + module_map.const_expressions.adjust(&mut constant.init); + true + } else { + false + } + }); + + // Adjust global variables' types and initializers. + log::trace!("adjusting global variables"); + for (_, global) in module.global_variables.iter_mut() { + log::trace!("adjusting global {:?}", global.name); + module_map.types.adjust(&mut global.ty); + if let Some(ref mut init) = global.init { + module_map.const_expressions.adjust(init); + } + } + + // Temporary storage to help us reuse allocations of existing + // named expression tables. + let mut reused_named_expressions = crate::NamedExpressions::default(); + + // Compact each function. + for ((_, function), map) in module.functions.iter_mut().zip(function_maps.iter()) { + log::trace!("compacting function {:?}", function.name); + map.compact(function, &module_map, &mut reused_named_expressions); + } + + // Compact each entry point. + for (entry, map) in module.entry_points.iter_mut().zip(entry_point_maps.iter()) { + log::trace!("compacting entry point {:?}", entry.function.name); + map.compact( + &mut entry.function, + &module_map, + &mut reused_named_expressions, + ); + } +} + +struct ModuleTracer<'module> { + module: &'module crate::Module, + types_used: HandleSet, + constants_used: HandleSet, + const_expressions_used: HandleSet, +} + +impl<'module> ModuleTracer<'module> { + fn new(module: &'module crate::Module) -> Self { + Self { + module, + types_used: HandleSet::for_arena(&module.types), + constants_used: HandleSet::for_arena(&module.constants), + const_expressions_used: HandleSet::for_arena(&module.const_expressions), + } + } + + fn trace_special_types(&mut self, special_types: &crate::SpecialTypes) { + let crate::SpecialTypes { + ref ray_desc, + ref ray_intersection, + ref predeclared_types, + } = *special_types; + + let mut type_tracer = self.as_type(); + if let Some(ray_desc) = *ray_desc { + type_tracer.trace_type(ray_desc); + } + if let Some(ray_intersection) = *ray_intersection { + type_tracer.trace_type(ray_intersection); + } + for (_, &handle) in predeclared_types { + type_tracer.trace_type(handle); + } + } + + fn as_type(&mut self) -> types::TypeTracer { + types::TypeTracer { + types: &self.module.types, + types_used: &mut self.types_used, + } + } + + fn as_const_expression(&mut self) -> expressions::ExpressionTracer { + expressions::ExpressionTracer { + types: &self.module.types, + constants: &self.module.constants, + expressions: &self.module.const_expressions, + types_used: &mut self.types_used, + constants_used: &mut self.constants_used, + expressions_used: &mut self.const_expressions_used, + const_expressions: None, + } + } + + pub fn enter_function<'tracer>( + &'tracer mut self, + function: &'tracer crate::Function, + ) -> FunctionTracer<'tracer> { + FunctionTracer { + module: self.module, + function, + + types_used: &mut self.types_used, + constants_used: &mut self.constants_used, + const_expressions_used: &mut self.const_expressions_used, + expressions_used: HandleSet::for_arena(&function.expressions), + } + } +} + +struct ModuleMap { + types: HandleMap, + constants: HandleMap, + const_expressions: HandleMap, +} + +impl From> for ModuleMap { + fn from(used: ModuleTracer) -> Self { + ModuleMap { + types: HandleMap::from_set(used.types_used), + constants: HandleMap::from_set(used.constants_used), + const_expressions: HandleMap::from_set(used.const_expressions_used), + } + } +} + +impl ModuleMap { + fn adjust_special_types(&self, special: &mut crate::SpecialTypes) { + let crate::SpecialTypes { + ref mut ray_desc, + ref mut ray_intersection, + ref mut predeclared_types, + } = *special; + + if let Some(ref mut ray_desc) = *ray_desc { + self.types.adjust(ray_desc); + } + if let Some(ref mut ray_intersection) = *ray_intersection { + self.types.adjust(ray_intersection); + } + + for handle in predeclared_types.values_mut() { + self.types.adjust(handle); + } + } +} + +struct FunctionMap { + expressions: HandleMap, +} + +impl From> for FunctionMap { + fn from(used: FunctionTracer) -> Self { + FunctionMap { + expressions: HandleMap::from_set(used.expressions_used), + } + } +} diff --git a/src/compact/statements.rs b/src/compact/statements.rs new file mode 100644 index 0000000000..2c33df0494 --- /dev/null +++ b/src/compact/statements.rs @@ -0,0 +1,302 @@ +use super::functions::FunctionTracer; +use super::FunctionMap; +use crate::arena::Handle; + +impl FunctionTracer<'_> { + pub fn trace_block(&mut self, block: &[crate::Statement]) { + let mut worklist: Vec<&[crate::Statement]> = vec![block]; + while let Some(last) = worklist.pop() { + for stmt in last { + use crate::Statement as St; + match *stmt { + St::Emit(ref range) => { + for expr in range.clone() { + log::trace!("trace emitted expression {:?}", expr); + self.trace_expression(expr); + } + } + St::Block(ref block) => worklist.push(block), + St::If { + condition, + ref accept, + ref reject, + } => { + self.trace_expression(condition); + worklist.push(accept); + worklist.push(reject); + } + St::Switch { + selector, + ref cases, + } => { + self.trace_expression(selector); + for case in cases { + worklist.push(&case.body); + } + } + St::Loop { + ref body, + ref continuing, + break_if, + } => { + if let Some(break_if) = break_if { + self.trace_expression(break_if); + } + worklist.push(body); + worklist.push(continuing); + } + St::Return { value: Some(value) } => self.trace_expression(value), + St::Store { pointer, value } => { + self.trace_expression(pointer); + self.trace_expression(value); + } + St::ImageStore { + image, + coordinate, + array_index, + value, + } => { + self.trace_expression(image); + self.trace_expression(coordinate); + if let Some(array_index) = array_index { + self.trace_expression(array_index); + } + self.trace_expression(value); + } + St::Atomic { + pointer, + ref fun, + value, + result, + } => { + self.trace_expression(pointer); + self.trace_atomic_function(fun); + self.trace_expression(value); + self.trace_expression(result); + } + St::WorkGroupUniformLoad { pointer, result } => { + self.trace_expression(pointer); + self.trace_expression(result); + } + St::Call { + function: _, + ref arguments, + result, + } => { + for expr in arguments { + self.trace_expression(*expr); + } + if let Some(result) = result { + self.trace_expression(result); + } + } + St::RayQuery { query, ref fun } => { + self.trace_expression(query); + self.trace_ray_query_function(fun); + } + + // Trivial statements. + St::Break + | St::Continue + | St::Kill + | St::Barrier(_) + | St::Return { value: None } => {} + } + } + } + } + + fn trace_atomic_function(&mut self, fun: &crate::AtomicFunction) { + use crate::AtomicFunction as Af; + match *fun { + Af::Exchange { + compare: Some(expr), + } => self.trace_expression(expr), + Af::Exchange { compare: None } + | Af::Add + | Af::Subtract + | Af::And + | Af::ExclusiveOr + | Af::InclusiveOr + | Af::Min + | Af::Max => {} + } + } + + fn trace_ray_query_function(&mut self, fun: &crate::RayQueryFunction) { + use crate::RayQueryFunction as Qf; + match *fun { + Qf::Initialize { + acceleration_structure, + descriptor, + } => { + self.trace_expression(acceleration_structure); + self.trace_expression(descriptor); + } + Qf::Proceed { result } => self.trace_expression(result), + Qf::Terminate => {} + } + } +} + +impl FunctionMap { + pub fn adjust_block(&self, block: &mut [crate::Statement]) { + let mut worklist: Vec<&mut [crate::Statement]> = vec![block]; + let adjust = |handle: &mut Handle| { + self.expressions.adjust(handle); + }; + while let Some(last) = worklist.pop() { + for stmt in last { + use crate::Statement as St; + match *stmt { + St::Emit(ref mut range) => { + // Fortunately, compaction doesn't arbitrarily scramble + // the expressions in the arena, but instead preserves + // the order of the elements while squeezing out unused + // ones. That means that a contiguous range in the + // pre-compacted arena always maps to a contiguous range + // in the post-compacted arena. So we just need to + // adjust the endpoints. + let (mut first, mut last) = range.first_and_last().unwrap(); + self.expressions.adjust(&mut first); + self.expressions.adjust(&mut last); + *range = crate::arena::Range::new_from_bounds(first, last); + } + St::Block(ref mut block) => worklist.push(block), + St::If { + ref mut condition, + ref mut accept, + ref mut reject, + } => { + adjust(condition); + worklist.push(accept); + worklist.push(reject); + } + St::Switch { + ref mut selector, + ref mut cases, + } => { + adjust(selector); + for case in cases { + worklist.push(&mut case.body); + } + } + St::Loop { + ref mut body, + ref mut continuing, + ref mut break_if, + } => { + if let Some(ref mut break_if) = *break_if { + adjust(break_if); + } + worklist.push(body); + worklist.push(continuing); + } + St::Return { + value: Some(ref mut value), + } => adjust(value), + St::Store { + ref mut pointer, + ref mut value, + } => { + adjust(pointer); + adjust(value); + } + St::ImageStore { + ref mut image, + ref mut coordinate, + ref mut array_index, + ref mut value, + } => { + adjust(image); + adjust(coordinate); + if let Some(ref mut array_index) = *array_index { + adjust(array_index); + } + adjust(value); + } + St::Atomic { + ref mut pointer, + ref mut fun, + ref mut value, + ref mut result, + } => { + adjust(pointer); + self.adjust_atomic_function(fun); + adjust(value); + adjust(result); + } + St::WorkGroupUniformLoad { + ref mut pointer, + ref mut result, + } => { + adjust(pointer); + adjust(result); + } + St::Call { + function: _, + ref mut arguments, + ref mut result, + } => { + for expr in arguments { + adjust(expr); + } + if let Some(ref mut result) = *result { + adjust(result); + } + } + St::RayQuery { + ref mut query, + ref mut fun, + } => { + adjust(query); + self.adjust_ray_query_function(fun); + } + + // Trivial statements. + St::Break + | St::Continue + | St::Kill + | St::Barrier(_) + | St::Return { value: None } => {} + } + } + } + } + + fn adjust_atomic_function(&self, fun: &mut crate::AtomicFunction) { + use crate::AtomicFunction as Af; + match *fun { + Af::Exchange { + compare: Some(ref mut expr), + } => { + self.expressions.adjust(expr); + } + Af::Exchange { compare: None } + | Af::Add + | Af::Subtract + | Af::And + | Af::ExclusiveOr + | Af::InclusiveOr + | Af::Min + | Af::Max => {} + } + } + + fn adjust_ray_query_function(&self, fun: &mut crate::RayQueryFunction) { + use crate::RayQueryFunction as Qf; + match *fun { + Qf::Initialize { + ref mut acceleration_structure, + ref mut descriptor, + } => { + self.expressions.adjust(acceleration_structure); + self.expressions.adjust(descriptor); + } + Qf::Proceed { ref mut result } => { + self.expressions.adjust(result); + } + Qf::Terminate => {} + } + } +} diff --git a/src/compact/types.rs b/src/compact/types.rs new file mode 100644 index 0000000000..d11ab8a731 --- /dev/null +++ b/src/compact/types.rs @@ -0,0 +1,93 @@ +use super::{HandleSet, ModuleMap}; +use crate::{Handle, UniqueArena}; + +pub struct TypeTracer<'a> { + pub types: &'a UniqueArena, + pub types_used: &'a mut HandleSet, +} + +impl<'a> TypeTracer<'a> { + pub fn trace_type(&mut self, ty: Handle) { + let mut work_list = vec![ty]; + while let Some(ty) = work_list.pop() { + // If we've already seen this type, no need to traverse further. + if !self.types_used.insert(ty) { + continue; + } + + use crate::TypeInner as Ti; + match self.types[ty].inner { + // Types that do not contain handles. + Ti::Scalar { .. } + | Ti::Vector { .. } + | Ti::Matrix { .. } + | Ti::Atomic { .. } + | Ti::ValuePointer { .. } + | Ti::Image { .. } + | Ti::Sampler { .. } + | Ti::AccelerationStructure + | Ti::RayQuery => {} + + // Types that do contain handles. + Ti::Pointer { base, space: _ } => work_list.push(base), + Ti::Array { + base, + size: _, + stride: _, + } => work_list.push(base), + Ti::Struct { + ref members, + span: _, + } => { + work_list.extend(members.iter().map(|m| m.ty)); + } + Ti::BindingArray { base, size: _ } => work_list.push(base), + } + } + } +} + +impl ModuleMap { + pub fn adjust_type(&self, ty: &mut crate::Type) { + let adjust = |ty: &mut Handle| self.types.adjust(ty); + + use crate::TypeInner as Ti; + match ty.inner { + // Types that do not contain handles. + Ti::Scalar { .. } + | Ti::Vector { .. } + | Ti::Matrix { .. } + | Ti::Atomic { .. } + | Ti::ValuePointer { .. } + | Ti::Image { .. } + | Ti::Sampler { .. } + | Ti::AccelerationStructure + | Ti::RayQuery => {} + + // Types that do contain handles. + Ti::Pointer { + ref mut base, + space: _, + } => adjust(base), + Ti::Array { + ref mut base, + size: _, + stride: _, + } => adjust(base), + Ti::Struct { + ref mut members, + span: _, + } => { + for member in members { + self.types.adjust(&mut member.ty); + } + } + Ti::BindingArray { + ref mut base, + size: _, + } => { + adjust(base); + } + }; + } +} diff --git a/src/lib.rs b/src/lib.rs index 49fd9d4e5a..92a0ba2ce2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -279,6 +279,8 @@ An override expression can be evaluated at pipeline creation time. mod arena; pub mod back; mod block; +#[cfg(feature = "compact")] +pub mod compact; pub mod front; pub mod keywords; pub mod proc; diff --git a/tests/out/analysis/access.info.ron b/tests/out/analysis/access.info.ron index 03186d9f18..4a020e48c4 100644 --- a/tests/out/analysis/access.info.ron +++ b/tests/out/analysis/access.info.ron @@ -17,7 +17,6 @@ ("DATA | SIZED | COPY | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("DATA | SIZED | COPY | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("DATA | SIZED | COPY | IO_SHAREABLE | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), - ("DATA | SIZED | COPY | IO_SHAREABLE | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("DATA | SIZED | COPY | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("DATA | SIZED | COPY | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("DATA | SIZED | COPY | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), @@ -26,10 +25,7 @@ ("DATA | SIZED | COPY | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("DATA | SIZED | COPY | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("DATA | SIZED | COPY | IO_SHAREABLE | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), - ("SIZED | COPY"), ("DATA | SIZED | COPY | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), - ("DATA | SIZED | COPY | IO_SHAREABLE | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), - ("DATA | SIZED | COPY | IO_SHAREABLE | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("SIZED | COPY | ARGUMENT"), ("DATA | SIZED | COPY | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("SIZED | COPY | ARGUMENT"), @@ -164,18 +160,6 @@ space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -287,18 +271,6 @@ space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -313,18 +285,6 @@ space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -375,18 +335,6 @@ space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -483,18 +431,6 @@ space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: Some(2), @@ -698,7 +634,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 8, @@ -740,7 +676,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -836,7 +772,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -848,19 +784,7 @@ ), ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -899,7 +823,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -920,7 +844,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -959,7 +883,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -971,19 +895,7 @@ ), ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -997,19 +909,7 @@ ), ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -1035,7 +935,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -1047,19 +947,7 @@ ), ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -1082,7 +970,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -1108,7 +996,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -1129,7 +1017,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -1143,19 +1031,7 @@ ), ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -1181,7 +1057,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -1202,7 +1078,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -1225,7 +1101,7 @@ ), ( uniformity: ( - non_uniform_result: Some(55), + non_uniform_result: Some(50), requirements: (""), ), ref_count: 1, @@ -1333,7 +1209,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 21, + base: 20, space: Uniform, )), ), @@ -1345,7 +1221,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 20, + base: 19, space: Uniform, )), ), @@ -1356,7 +1232,7 @@ ), ref_count: 0, assignable_global: None, - ty: Handle(20), + ty: Handle(19), ), ( uniformity: ( @@ -1366,7 +1242,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 21, + base: 20, space: Uniform, )), ), @@ -1378,22 +1254,10 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 20, + base: 19, space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -1402,7 +1266,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 19, + base: 18, space: Uniform, )), ), @@ -1413,7 +1277,7 @@ ), ref_count: 0, assignable_global: None, - ty: Handle(19), + ty: Handle(18), ), ( uniformity: ( @@ -1423,7 +1287,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 21, + base: 20, space: Uniform, )), ), @@ -1435,22 +1299,10 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 20, + base: 19, space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -1459,22 +1311,10 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 19, + base: 18, space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -1510,7 +1350,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 21, + base: 20, space: Uniform, )), ), @@ -1522,22 +1362,10 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 20, + base: 19, space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -1546,7 +1374,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 19, + base: 18, space: Uniform, )), ), @@ -1594,7 +1422,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 21, + base: 20, space: Uniform, )), ), @@ -1606,22 +1434,10 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 20, + base: 19, space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -1630,22 +1446,10 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 19, + base: 18, space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -1660,18 +1464,6 @@ space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -1706,7 +1498,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 21, + base: 20, space: Uniform, )), ), @@ -1718,22 +1510,10 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 20, + base: 19, space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -1742,22 +1522,10 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 19, + base: 18, space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -1815,7 +1583,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 21, + base: 20, space: Uniform, )), ), @@ -1827,22 +1595,10 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 20, + base: 19, space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -1851,7 +1607,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 19, + base: 18, space: Uniform, )), ), @@ -1878,18 +1634,6 @@ space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: Some(2), @@ -1924,7 +1668,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 21, + base: 20, space: Uniform, )), ), @@ -1936,22 +1680,10 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 20, + base: 19, space: Uniform, )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: None, @@ -1960,7 +1692,7 @@ ref_count: 1, assignable_global: Some(5), ty: Value(Pointer( - base: 19, + base: 18, space: Uniform, )), ), @@ -2029,7 +1761,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(20), + ty: Handle(19), ), ( uniformity: ( @@ -2038,17 +1770,17 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(21), + ty: Handle(20), ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 9, assignable_global: None, ty: Value(Pointer( - base: 21, + base: 20, space: Function, )), ), @@ -2084,13 +1816,13 @@ ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, ty: Value(Pointer( - base: 20, + base: 19, space: Function, )), ), @@ -2101,41 +1833,29 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(20), + ty: Handle(19), ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, ty: Value(Pointer( - base: 20, + base: 19, space: Function, )), ), ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, ty: Value(Pointer( - base: 19, + base: 18, space: Function, )), ), @@ -2246,59 +1966,35 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(19), + ty: Handle(18), ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, ty: Value(Pointer( - base: 20, + base: 19, space: Function, )), ), ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, ty: Value(Pointer( - base: 19, + base: 18, space: Function, )), ), ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, @@ -2337,31 +2033,7 @@ ), ( uniformity: ( - non_uniform_result: Some(66), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Pointer( - base: 20, - space: Function, - )), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, @@ -2373,85 +2045,36 @@ ), ( uniformity: ( - non_uniform_result: Some(2), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Handle(3), - ), - ( - uniformity: ( - non_uniform_result: Some(66), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(ValuePointer( - size: Some(Bi), - kind: Float, - width: 4, - space: Function, - )), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Vector( - size: Bi, - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, ty: Value(Pointer( - base: 20, + base: 18, space: Function, )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(2), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), + ty: Handle(3), ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, - ty: Value(Pointer( - base: 19, + ty: Value(ValuePointer( + size: Some(Bi), + kind: Float, + width: 4, space: Function, )), ), @@ -2460,74 +2083,75 @@ non_uniform_result: None, requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, ty: Value(Scalar( - kind: Sint, + kind: Float, width: 4, )), ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: None, requirements: (""), ), ref_count: 1, assignable_global: None, - ty: Value(ValuePointer( - size: Some(Bi), + ty: Value(Vector( + size: Bi, kind: Float, width: 4, - space: Function, )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(54), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, + ty: Value(Pointer( + base: 19, + space: Function, )), ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, - ty: Value(ValuePointer( - size: None, - kind: Float, - width: 4, + ty: Value(Pointer( + base: 18, space: Function, )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, - ty: Value(Scalar( + ty: Value(ValuePointer( + size: Some(Bi), kind: Float, width: 4, + space: Function, )), ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, - ty: Value(Pointer( - base: 20, + ty: Value(ValuePointer( + size: None, + kind: Float, + width: 4, space: Function, )), ), @@ -2536,16 +2160,16 @@ non_uniform_result: None, requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, ty: Value(Scalar( - kind: Sint, + kind: Float, width: 4, )), ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, @@ -2557,19 +2181,19 @@ ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(54), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, + ty: Value(Pointer( + base: 18, + space: Function, )), ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, @@ -2592,7 +2216,7 @@ ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, @@ -2618,37 +2242,25 @@ ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, ty: Value(Pointer( - base: 20, + base: 19, space: Function, )), ), ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, ty: Value(Pointer( - base: 19, + base: 18, space: Function, )), ), @@ -2663,7 +2275,7 @@ ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, @@ -2677,19 +2289,7 @@ ), ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, @@ -2715,37 +2315,25 @@ ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, ty: Value(Pointer( - base: 20, + base: 19, space: Function, )), ), ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, assignable_global: None, ty: Value(Pointer( - base: 19, + base: 18, space: Function, )), ), @@ -2760,7 +2348,7 @@ ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, @@ -2783,7 +2371,7 @@ ), ( uniformity: ( - non_uniform_result: Some(66), + non_uniform_result: Some(54), requirements: (""), ), ref_count: 1, @@ -2836,7 +2424,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(23), + ty: Handle(22), ), ( uniformity: ( @@ -2845,7 +2433,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(22), + ty: Handle(21), ), ], sampling: [], @@ -2876,19 +2464,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(25), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), + ty: Handle(24), ), ( uniformity: ( @@ -2897,19 +2473,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(24), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), + ty: Handle(23), ), ( uniformity: ( @@ -2918,7 +2482,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(22), + ty: Handle(21), ), ], sampling: [], @@ -2949,7 +2513,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(31), + ty: Handle(27), ), ( uniformity: ( @@ -2992,7 +2556,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(33), + ty: Handle(29), ), ( uniformity: ( @@ -3051,7 +2615,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(32), + ty: Handle(28), ), ], sampling: [], @@ -3106,7 +2670,7 @@ ref_count: 4, assignable_global: None, ty: Value(Pointer( - base: 22, + base: 21, space: Function, )), ), @@ -3117,7 +2681,7 @@ ), ref_count: 0, assignable_global: None, - ty: Handle(22), + ty: Handle(21), ), ( uniformity: ( @@ -3469,18 +3033,6 @@ ), )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: Some(30), @@ -3516,7 +3068,7 @@ ), ref_count: 0, assignable_global: None, - ty: Handle(22), + ty: Handle(21), ), ( uniformity: ( @@ -3573,17 +3125,17 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(28), + ty: Handle(26), ), ( uniformity: ( - non_uniform_result: Some(41), + non_uniform_result: Some(40), requirements: (""), ), ref_count: 3, assignable_global: None, ty: Value(Pointer( - base: 28, + base: 26, space: Function, )), ), @@ -3610,7 +3162,7 @@ ), ( uniformity: ( - non_uniform_result: Some(41), + non_uniform_result: Some(40), requirements: (""), ), ref_count: 1, @@ -3634,7 +3186,7 @@ ), ( uniformity: ( - non_uniform_result: Some(41), + non_uniform_result: Some(40), requirements: (""), ), ref_count: 1, @@ -3646,7 +3198,7 @@ ), ( uniformity: ( - non_uniform_result: Some(41), + non_uniform_result: Some(40), requirements: (""), ), ref_count: 1, @@ -3660,7 +3212,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(25), + ty: Handle(24), ), ( uniformity: ( @@ -3669,11 +3221,11 @@ ), ref_count: 0, assignable_global: None, - ty: Handle(22), + ty: Handle(21), ), ( uniformity: ( - non_uniform_result: Some(41), + non_uniform_result: Some(40), requirements: (""), ), ref_count: 1, @@ -3686,7 +3238,7 @@ ), ( uniformity: ( - non_uniform_result: Some(41), + non_uniform_result: Some(40), requirements: (""), ), ref_count: 1, @@ -3729,7 +3281,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(26), + ty: Handle(25), ), ], sampling: [], @@ -3781,18 +3333,6 @@ ), )), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), ( uniformity: ( non_uniform_result: Some(1), @@ -3839,7 +3379,7 @@ ), ( uniformity: ( - non_uniform_result: Some(7), + non_uniform_result: Some(6), requirements: (""), ), ref_count: 1, @@ -3853,7 +3393,7 @@ ), ( uniformity: ( - non_uniform_result: Some(7), + non_uniform_result: Some(6), requirements: (""), ), ref_count: 1, @@ -3976,7 +3516,7 @@ ), ( uniformity: ( - non_uniform_result: Some(18), + non_uniform_result: Some(17), requirements: (""), ), ref_count: 1, @@ -3990,7 +3530,7 @@ ), ( uniformity: ( - non_uniform_result: Some(18), + non_uniform_result: Some(17), requirements: (""), ), ref_count: 1, @@ -4063,7 +3603,7 @@ ), ( uniformity: ( - non_uniform_result: Some(25), + non_uniform_result: Some(24), requirements: (""), ), ref_count: 1, @@ -4077,7 +3617,7 @@ ), ( uniformity: ( - non_uniform_result: Some(25), + non_uniform_result: Some(24), requirements: (""), ), ref_count: 1, @@ -4091,19 +3631,7 @@ ), ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(25), + non_uniform_result: Some(24), requirements: (""), ), ref_count: 1, @@ -4117,7 +3645,7 @@ ), ( uniformity: ( - non_uniform_result: Some(25), + non_uniform_result: Some(24), requirements: (""), ), ref_count: 1, @@ -4143,7 +3671,7 @@ ), ( uniformity: ( - non_uniform_result: Some(31), + non_uniform_result: Some(29), requirements: (""), ), ref_count: 1, @@ -4268,7 +3796,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(32), + ty: Handle(28), ), ( uniformity: ( @@ -4278,7 +3806,7 @@ ref_count: 2, assignable_global: None, ty: Value(Pointer( - base: 32, + base: 28, space: Function, )), ), @@ -4322,65 +3850,5 @@ width: 4, )), Handle(4), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), ], ) \ No newline at end of file diff --git a/tests/out/analysis/shadow.info.ron b/tests/out/analysis/shadow.info.ron index 7459466e2e..15ec6e2b3a 100644 --- a/tests/out/analysis/shadow.info.ron +++ b/tests/out/analysis/shadow.info.ron @@ -4,31 +4,15 @@ ("DATA | SIZED | COPY | IO_SHAREABLE | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("DATA | SIZED | COPY | IO_SHAREABLE | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("DATA | SIZED | COPY | IO_SHAREABLE | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), - ("DATA | SIZED | COPY | ARGUMENT | CONSTRUCTIBLE"), ("DATA | SIZED | COPY | IO_SHAREABLE | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("ARGUMENT"), - ("ARGUMENT"), ("DATA | SIZED | COPY | IO_SHAREABLE | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), - ("SIZED | COPY | ARGUMENT"), - ("SIZED | COPY | ARGUMENT"), ("DATA | SIZED | COPY | IO_SHAREABLE | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("DATA | SIZED | COPY | IO_SHAREABLE | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), - ("SIZED | COPY"), - ("SIZED | COPY"), - ("SIZED | COPY"), ("DATA | SIZED | COPY | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("DATA | SIZED | COPY | HOST_SHAREABLE | ARGUMENT | CONSTRUCTIBLE"), ("DATA | COPY | HOST_SHAREABLE"), ("DATA | COPY | HOST_SHAREABLE"), - ("SIZED | COPY"), - ("SIZED | COPY"), - ("SIZED | COPY"), - ("SIZED | COPY"), - ("SIZED | COPY | ARGUMENT"), - ("SIZED | COPY | ARGUMENT"), - ("SIZED | COPY"), - ("SIZED | COPY"), - ("SIZED | COPY | ARGUMENT"), ("ARGUMENT"), ], functions: [ @@ -36,7 +20,7 @@ flags: ("EXPRESSIONS | BLOCKS | CONTROL_FLOW_UNIFORMITY | STRUCT_LAYOUTS | CONSTANTS | BINDINGS"), available_stages: ("VERTEX | FRAGMENT | COMPUTE"), uniformity: ( - non_uniform_result: Some(4), + non_uniform_result: Some(1), requirements: (""), ), may_kill: false, @@ -58,92 +42,21 @@ expressions: [ ( uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: Some(3), - ty: Value(Pointer( - base: 13, - space: Uniform, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(2), - requirements: (""), - ), - ref_count: 0, - assignable_global: Some(6), - ty: Value(Pointer( - base: 2, - space: Private, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(3), - requirements: (""), - ), - ref_count: 0, - assignable_global: Some(5), - ty: Value(Pointer( - base: 4, - space: Private, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(4), + non_uniform_result: Some(1), requirements: (""), ), ref_count: 1, assignable_global: Some(1), - ty: Handle(7), + ty: Handle(6), ), ( uniformity: ( - non_uniform_result: Some(5), + non_uniform_result: Some(2), requirements: (""), ), ref_count: 1, assignable_global: Some(2), - ty: Handle(30), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: Some(4), - ty: Value(Pointer( - base: 20, - space: Storage( - access: ("LOAD"), - ), - )), - ), - ( - uniformity: ( - non_uniform_result: Some(7), - requirements: (""), - ), - ref_count: 0, - assignable_global: Some(7), - ty: Value(Pointer( - base: 4, - space: Private, - )), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), + ty: Handle(14), ), ( uniformity: ( @@ -154,78 +67,6 @@ assignable_global: None, ty: Handle(1), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(3), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), ( uniformity: ( non_uniform_result: None, @@ -235,105 +76,6 @@ assignable_global: None, ty: Handle(1), ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(1), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(3), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(3), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 0, - assignable_global: None, - ty: Handle(1), - ), ( uniformity: ( non_uniform_result: None, @@ -348,103 +90,118 @@ non_uniform_result: None, requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(1), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(7), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(3), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 6, assignable_global: None, - ty: Handle(9), + ty: Handle(4), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Value(Scalar( + kind: Bool, + width: 1, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(5), ), ( uniformity: ( non_uniform_result: None, requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(5), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(5), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(2), + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), ref_count: 1, @@ -453,130 +210,16 @@ ), ( uniformity: ( - non_uniform_result: Some(43), + non_uniform_result: Some(8), requirements: (""), ), ref_count: 1, assignable_global: None, - ty: Handle(3), + ty: Handle(5), ), ( uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 6, - assignable_global: None, - ty: Handle(4), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Bool, - width: 1, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Handle(6), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Handle(6), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Handle(6), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Handle(1), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Handle(6), - ), - ( - uniformity: ( - non_uniform_result: None, + non_uniform_result: None, requirements: (""), ), ref_count: 1, @@ -584,491 +227,284 @@ ty: Value(Vector( size: Bi, kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 2, - assignable_global: None, - ty: Handle(6), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(43), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(43), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 3, - assignable_global: None, - ty: Handle(2), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Handle(1), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Handle(1), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Handle(6), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(44), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Sint, - width: 4, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(4), - requirements: (""), - ), - ref_count: 1, - assignable_global: None, - ty: Value(Scalar( - kind: Float, - width: 4, - )), - ), - ], - sampling: [], - dual_source_blending: false, - ), - ( - flags: ("EXPRESSIONS | BLOCKS | CONTROL_FLOW_UNIFORMITY | STRUCT_LAYOUTS | CONSTANTS | BINDINGS"), - available_stages: ("VERTEX | FRAGMENT | COMPUTE"), - uniformity: ( - non_uniform_result: Some(4), - requirements: (""), - ), - may_kill: false, - sampling_set: [ - ( - image: 1, - sampler: 2, - ), - ], - global_uses: [ - ("READ"), - ("READ"), - ("READ"), - ("READ"), - ("READ"), - ("READ"), - ("WRITE"), - ], - expressions: [ - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 1, - assignable_global: Some(3), - ty: Value(Pointer( - base: 13, - space: Uniform, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(2), - requirements: (""), - ), - ref_count: 1, - assignable_global: Some(6), - ty: Value(Pointer( - base: 2, - space: Private, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(3), - requirements: (""), - ), - ref_count: 4, - assignable_global: Some(5), - ty: Value(Pointer( - base: 4, - space: Private, - )), - ), - ( - uniformity: ( - non_uniform_result: Some(4), - requirements: (""), - ), - ref_count: 0, - assignable_global: Some(1), - ty: Handle(7), - ), - ( - uniformity: ( - non_uniform_result: Some(5), - requirements: (""), - ), - ref_count: 0, - assignable_global: Some(2), - ty: Handle(30), - ), - ( - uniformity: ( - non_uniform_result: None, - requirements: (""), - ), - ref_count: 7, - assignable_global: Some(4), - ty: Value(Pointer( - base: 20, - space: Storage( - access: ("LOAD"), - ), - )), - ), - ( - uniformity: ( - non_uniform_result: Some(7), - requirements: (""), - ), - ref_count: 1, - assignable_global: Some(7), - ty: Value(Pointer( - base: 4, - space: Private, + width: 4, )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 2, assignable_global: None, - ty: Handle(9), + ty: Handle(5), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(1), + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(7), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(7), requirements: (""), ), ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 1, + ref_count: 3, assignable_global: None, - ty: Handle(9), + ty: Handle(2), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(3), + ty: Handle(1), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(1), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(1), + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(5), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(1), + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(8), requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(1), requirements: (""), ), ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Value(Scalar( + kind: Float, + width: 4, + )), + ), + ], + sampling: [], + dual_source_blending: false, + ), + ( + flags: ("EXPRESSIONS | BLOCKS | CONTROL_FLOW_UNIFORMITY | STRUCT_LAYOUTS | CONSTANTS | BINDINGS"), + available_stages: ("VERTEX | FRAGMENT | COMPUTE"), + uniformity: ( + non_uniform_result: Some(1), + requirements: (""), + ), + may_kill: false, + sampling_set: [ + ( + image: 1, + sampler: 2, ), + ], + global_uses: [ + ("READ"), + ("READ"), + ("READ"), + ("READ"), + ("READ"), + ("READ"), + ("WRITE"), + ], + expressions: [ ( uniformity: ( non_uniform_result: None, requirements: (""), ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), + ref_count: 1, + assignable_global: Some(3), + ty: Value(Pointer( + base: 9, + space: Uniform, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(2), requirements: (""), ), - ref_count: 0, - assignable_global: None, - ty: Handle(9), + ref_count: 1, + assignable_global: Some(6), + ty: Value(Pointer( + base: 2, + space: Private, + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(3), requirements: (""), ), - ref_count: 1, - assignable_global: None, - ty: Handle(9), + ref_count: 4, + assignable_global: Some(5), + ty: Value(Pointer( + base: 4, + space: Private, + )), ), ( uniformity: ( non_uniform_result: None, requirements: (""), ), - ref_count: 1, - assignable_global: None, - ty: Handle(3), + ref_count: 7, + assignable_global: Some(4), + ty: Value(Pointer( + base: 13, + space: Storage( + access: ("LOAD"), + ), + )), ), ( uniformity: ( - non_uniform_result: None, + non_uniform_result: Some(5), requirements: (""), ), ref_count: 1, - assignable_global: None, - ty: Handle(3), + assignable_global: Some(7), + ty: Value(Pointer( + base: 4, + space: Private, + )), ), ( uniformity: ( non_uniform_result: None, requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(1), + ty: Handle(7), ), ( uniformity: ( @@ -1077,7 +513,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(1), + ty: Handle(7), ), ( uniformity: ( @@ -1086,43 +522,43 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(7), ), ( uniformity: ( non_uniform_result: None, requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(7), ), ( uniformity: ( non_uniform_result: None, requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(7), ), ( uniformity: ( non_uniform_result: None, requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(7), ), ( uniformity: ( non_uniform_result: None, requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(3), ), ( uniformity: ( @@ -1131,7 +567,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(3), ), ( uniformity: ( @@ -1140,7 +576,7 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(1), ), ( uniformity: ( @@ -1149,34 +585,34 @@ ), ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(7), ), ( uniformity: ( non_uniform_result: None, requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(7), ), ( uniformity: ( non_uniform_result: None, requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(9), + ty: Handle(7), ), ( uniformity: ( non_uniform_result: None, requirements: (""), ), - ref_count: 0, + ref_count: 1, assignable_global: None, - ty: Handle(2), + ty: Handle(7), ), ( uniformity: ( @@ -1189,7 +625,7 @@ ), ( uniformity: ( - non_uniform_result: Some(43), + non_uniform_result: Some(20), requirements: (""), ), ref_count: 3, @@ -1201,7 +637,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 11, @@ -1213,7 +649,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1228,7 +664,7 @@ ref_count: 1, assignable_global: Some(3), ty: Value(Pointer( - base: 12, + base: 8, space: Uniform, )), ), @@ -1272,7 +708,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1284,7 +720,7 @@ ), ( uniformity: ( - non_uniform_result: Some(43), + non_uniform_result: Some(20), requirements: (""), ), ref_count: 1, @@ -1293,7 +729,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1308,7 +744,7 @@ ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 19, + base: 12, space: Storage( access: ("LOAD"), ), @@ -1316,7 +752,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1325,13 +761,13 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 18, + base: 11, space: Storage( access: ("LOAD"), ), @@ -1339,13 +775,13 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 17, + base: 10, space: Storage( access: ("LOAD"), ), @@ -1353,12 +789,12 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, assignable_global: None, - ty: Handle(17), + ty: Handle(10), ), ( uniformity: ( @@ -1371,7 +807,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1384,7 +820,7 @@ ), ( uniformity: ( - non_uniform_result: Some(4), + non_uniform_result: Some(1), requirements: (""), ), ref_count: 1, @@ -1417,7 +853,7 @@ ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 19, + base: 12, space: Storage( access: ("LOAD"), ), @@ -1425,7 +861,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1434,13 +870,13 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 18, + base: 11, space: Storage( access: ("LOAD"), ), @@ -1448,7 +884,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1462,7 +898,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1478,7 +914,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1496,7 +932,7 @@ ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 19, + base: 12, space: Storage( access: ("LOAD"), ), @@ -1504,7 +940,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1513,13 +949,13 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 18, + base: 11, space: Storage( access: ("LOAD"), ), @@ -1527,7 +963,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1541,7 +977,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1557,7 +993,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1575,7 +1011,7 @@ ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 19, + base: 12, space: Storage( access: ("LOAD"), ), @@ -1583,7 +1019,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1592,13 +1028,13 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 18, + base: 11, space: Storage( access: ("LOAD"), ), @@ -1606,7 +1042,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1620,7 +1056,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1636,7 +1072,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1648,7 +1084,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1744,7 +1180,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1753,7 +1189,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1783,7 +1219,7 @@ ), ( uniformity: ( - non_uniform_result: Some(4), + non_uniform_result: Some(1), requirements: (""), ), ref_count: 1, @@ -1798,7 +1234,7 @@ ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 19, + base: 12, space: Storage( access: ("LOAD"), ), @@ -1806,7 +1242,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1815,13 +1251,13 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 18, + base: 11, space: Storage( access: ("LOAD"), ), @@ -1829,7 +1265,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1843,7 +1279,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1859,7 +1295,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1877,7 +1313,7 @@ ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 19, + base: 12, space: Storage( access: ("LOAD"), ), @@ -1885,7 +1321,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1894,13 +1330,13 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 18, + base: 11, space: Storage( access: ("LOAD"), ), @@ -1908,7 +1344,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1922,7 +1358,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1938,7 +1374,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1956,7 +1392,7 @@ ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 19, + base: 12, space: Storage( access: ("LOAD"), ), @@ -1964,7 +1400,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -1973,13 +1409,13 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, assignable_global: Some(4), ty: Value(Pointer( - base: 18, + base: 11, space: Storage( access: ("LOAD"), ), @@ -1987,7 +1423,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -2001,7 +1437,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -2017,7 +1453,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -2029,7 +1465,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -2038,7 +1474,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -2047,7 +1483,7 @@ ), ( uniformity: ( - non_uniform_result: Some(43), + non_uniform_result: Some(20), requirements: (""), ), ref_count: 1, @@ -2056,7 +1492,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -2065,7 +1501,7 @@ ), ( uniformity: ( - non_uniform_result: Some(44), + non_uniform_result: Some(21), requirements: (""), ), ref_count: 1, @@ -2074,7 +1510,7 @@ ), ( uniformity: ( - non_uniform_result: Some(43), + non_uniform_result: Some(20), requirements: (""), ), ref_count: 1, @@ -2083,7 +1519,7 @@ ), ( uniformity: ( - non_uniform_result: Some(43), + non_uniform_result: Some(20), requirements: (""), ), ref_count: 1, @@ -2100,7 +1536,7 @@ flags: ("EXPRESSIONS | BLOCKS | CONTROL_FLOW_UNIFORMITY | STRUCT_LAYOUTS | CONSTANTS | BINDINGS"), available_stages: ("VERTEX | FRAGMENT | COMPUTE"), uniformity: ( - non_uniform_result: Some(4), + non_uniform_result: Some(1), requirements: (""), ), may_kill: false, @@ -2225,70 +1661,6 @@ kind: Uint, width: 4, )), - Value(Scalar( - kind: Float, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), - Value(Scalar( - kind: Sint, - width: 4, - )), Value(Scalar( kind: Sint, width: 4, diff --git a/tests/out/glsl/access.foo_vert.Vertex.glsl b/tests/out/glsl/access.foo_vert.Vertex.glsl index a25eda03bb..a505ee19eb 100644 --- a/tests/out/glsl/access.foo_vert.Vertex.glsl +++ b/tests/out/glsl/access.foo_vert.Vertex.glsl @@ -41,31 +41,31 @@ void test_matrix_within_struct_accesses() { idx = (_e3 - 1); mat3x2 l0_ = _group_0_binding_1_vs.m; vec2 l1_ = _group_0_binding_1_vs.m[0]; - int _e15 = idx; - vec2 l2_ = _group_0_binding_1_vs.m[_e15]; + int _e14 = idx; + vec2 l2_ = _group_0_binding_1_vs.m[_e14]; float l3_ = _group_0_binding_1_vs.m[0][1]; - int _e29 = idx; - float l4_ = _group_0_binding_1_vs.m[0][_e29]; - int _e34 = idx; - float l5_ = _group_0_binding_1_vs.m[_e34][1]; - int _e41 = idx; - int _e43 = idx; - float l6_ = _group_0_binding_1_vs.m[_e41][_e43]; + int _e25 = idx; + float l4_ = _group_0_binding_1_vs.m[0][_e25]; + int _e30 = idx; + float l5_ = _group_0_binding_1_vs.m[_e30][1]; + int _e36 = idx; + int _e38 = idx; + float l6_ = _group_0_binding_1_vs.m[_e36][_e38]; t = Baz(mat3x2(vec2(1.0), vec2(2.0), vec2(3.0))); - int _e56 = idx; - idx = (_e56 + 1); + int _e51 = idx; + idx = (_e51 + 1); t.m = mat3x2(vec2(6.0), vec2(5.0), vec2(4.0)); t.m[0] = vec2(9.0); - int _e72 = idx; - t.m[_e72] = vec2(90.0); + int _e66 = idx; + t.m[_e66] = vec2(90.0); t.m[0][1] = 10.0; + int _e76 = idx; + t.m[0][_e76] = 20.0; + int _e80 = idx; + t.m[_e80][1] = 30.0; int _e85 = idx; - t.m[0][_e85] = 20.0; - int _e89 = idx; - t.m[_e89][1] = 30.0; - int _e95 = idx; - int _e97 = idx; - t.m[_e95][_e97] = 40.0; + int _e87 = idx; + t.m[_e85][_e87] = 40.0; return; } @@ -78,32 +78,32 @@ void test_matrix_within_array_within_struct_accesses() { mat4x2 l0_1[2] = _group_0_binding_3_vs.am; mat4x2 l1_1 = _group_0_binding_3_vs.am[0]; vec2 l2_1 = _group_0_binding_3_vs.am[0][0]; - int _e24 = idx_1; - vec2 l3_1 = _group_0_binding_3_vs.am[0][_e24]; + int _e20 = idx_1; + vec2 l3_1 = _group_0_binding_3_vs.am[0][_e20]; float l4_1 = _group_0_binding_3_vs.am[0][0][1]; - int _e42 = idx_1; - float l5_1 = _group_0_binding_3_vs.am[0][0][_e42]; - int _e49 = idx_1; - float l6_1 = _group_0_binding_3_vs.am[0][_e49][1]; - int _e58 = idx_1; - int _e60 = idx_1; - float l7_ = _group_0_binding_3_vs.am[0][_e58][_e60]; + int _e33 = idx_1; + float l5_1 = _group_0_binding_3_vs.am[0][0][_e33]; + int _e39 = idx_1; + float l6_1 = _group_0_binding_3_vs.am[0][_e39][1]; + int _e46 = idx_1; + int _e48 = idx_1; + float l7_ = _group_0_binding_3_vs.am[0][_e46][_e48]; t_1 = MatCx2InArray(mat4x2[2](mat4x2(0.0), mat4x2(0.0))); - int _e67 = idx_1; - idx_1 = (_e67 + 1); + int _e55 = idx_1; + idx_1 = (_e55 + 1); t_1.am = mat4x2[2](mat4x2(0.0), mat4x2(0.0)); t_1.am[0] = mat4x2(vec2(8.0), vec2(7.0), vec2(6.0), vec2(5.0)); t_1.am[0][0] = vec2(9.0); - int _e93 = idx_1; - t_1.am[0][_e93] = vec2(90.0); + int _e77 = idx_1; + t_1.am[0][_e77] = vec2(90.0); t_1.am[0][0][1] = 10.0; - int _e110 = idx_1; - t_1.am[0][0][_e110] = 20.0; - int _e116 = idx_1; - t_1.am[0][_e116][1] = 30.0; - int _e124 = idx_1; - int _e126 = idx_1; - t_1.am[0][_e124][_e126] = 40.0; + int _e89 = idx_1; + t_1.am[0][0][_e89] = 20.0; + int _e94 = idx_1; + t_1.am[0][_e94][1] = 30.0; + int _e100 = idx_1; + int _e102 = idx_1; + t_1.am[0][_e100][_e102] = 40.0; return; } @@ -140,11 +140,11 @@ void main() { float b = _group_0_binding_0_vs._matrix[3][0]; int a_1 = _group_0_binding_0_vs.data[(uint(_group_0_binding_0_vs.data.length()) - 2u)].value; ivec2 c = _group_0_binding_2_vs; - float _e34 = read_from_private(foo); + float _e33 = read_from_private(foo); c2_ = int[5](a_1, int(b), 3, 4, 5); c2_[(vi + 1u)] = 42; int value = c2_[vi]; - float _e48 = test_arr_as_arg(float[5][10](float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0))); + float _e47 = test_arr_as_arg(float[5][10](float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), float[10](0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0))); gl_Position = vec4((_matrix * vec4(ivec4(value))), 2.0); gl_Position.yz = vec2(-gl_Position.y, gl_Position.z * 2.0 - gl_Position.w); return; diff --git a/tests/out/glsl/atomicOps.cs_main.Compute.glsl b/tests/out/glsl/atomicOps.cs_main.Compute.glsl index c40e85d30f..b69c5107ce 100644 --- a/tests/out/glsl/atomicOps.cs_main.Compute.glsl +++ b/tests/out/glsl/atomicOps.cs_main.Compute.glsl @@ -51,82 +51,82 @@ void main() { int l7_ = workgroup_struct.atomic_arr[1]; memoryBarrierShared(); barrier(); - uint _e59 = atomicAdd(_group_0_binding_0_cs, 1u); - int _e64 = atomicAdd(_group_0_binding_1_cs[1], 1); - uint _e68 = atomicAdd(_group_0_binding_2_cs.atomic_scalar, 1u); - int _e74 = atomicAdd(_group_0_binding_2_cs.atomic_arr[1], 1); - uint _e77 = atomicAdd(workgroup_atomic_scalar, 1u); - int _e82 = atomicAdd(workgroup_atomic_arr[1], 1); - uint _e86 = atomicAdd(workgroup_struct.atomic_scalar, 1u); - int _e92 = atomicAdd(workgroup_struct.atomic_arr[1], 1); + uint _e51 = atomicAdd(_group_0_binding_0_cs, 1u); + int _e55 = atomicAdd(_group_0_binding_1_cs[1], 1); + uint _e59 = atomicAdd(_group_0_binding_2_cs.atomic_scalar, 1u); + int _e64 = atomicAdd(_group_0_binding_2_cs.atomic_arr[1], 1); + uint _e67 = atomicAdd(workgroup_atomic_scalar, 1u); + int _e71 = atomicAdd(workgroup_atomic_arr[1], 1); + uint _e75 = atomicAdd(workgroup_struct.atomic_scalar, 1u); + int _e80 = atomicAdd(workgroup_struct.atomic_arr[1], 1); memoryBarrierShared(); barrier(); - uint _e95 = atomicAdd(_group_0_binding_0_cs, -1u); - int _e100 = atomicAdd(_group_0_binding_1_cs[1], -1); - uint _e104 = atomicAdd(_group_0_binding_2_cs.atomic_scalar, -1u); - int _e110 = atomicAdd(_group_0_binding_2_cs.atomic_arr[1], -1); - uint _e113 = atomicAdd(workgroup_atomic_scalar, -1u); - int _e118 = atomicAdd(workgroup_atomic_arr[1], -1); - uint _e122 = atomicAdd(workgroup_struct.atomic_scalar, -1u); - int _e128 = atomicAdd(workgroup_struct.atomic_arr[1], -1); + uint _e83 = atomicAdd(_group_0_binding_0_cs, -1u); + int _e87 = atomicAdd(_group_0_binding_1_cs[1], -1); + uint _e91 = atomicAdd(_group_0_binding_2_cs.atomic_scalar, -1u); + int _e96 = atomicAdd(_group_0_binding_2_cs.atomic_arr[1], -1); + uint _e99 = atomicAdd(workgroup_atomic_scalar, -1u); + int _e103 = atomicAdd(workgroup_atomic_arr[1], -1); + uint _e107 = atomicAdd(workgroup_struct.atomic_scalar, -1u); + int _e112 = atomicAdd(workgroup_struct.atomic_arr[1], -1); memoryBarrierShared(); barrier(); - uint _e131 = atomicMax(_group_0_binding_0_cs, 1u); - int _e136 = atomicMax(_group_0_binding_1_cs[1], 1); - uint _e140 = atomicMax(_group_0_binding_2_cs.atomic_scalar, 1u); - int _e146 = atomicMax(_group_0_binding_2_cs.atomic_arr[1], 1); - uint _e149 = atomicMax(workgroup_atomic_scalar, 1u); - int _e154 = atomicMax(workgroup_atomic_arr[1], 1); - uint _e158 = atomicMax(workgroup_struct.atomic_scalar, 1u); - int _e164 = atomicMax(workgroup_struct.atomic_arr[1], 1); + uint _e115 = atomicMax(_group_0_binding_0_cs, 1u); + int _e119 = atomicMax(_group_0_binding_1_cs[1], 1); + uint _e123 = atomicMax(_group_0_binding_2_cs.atomic_scalar, 1u); + int _e128 = atomicMax(_group_0_binding_2_cs.atomic_arr[1], 1); + uint _e131 = atomicMax(workgroup_atomic_scalar, 1u); + int _e135 = atomicMax(workgroup_atomic_arr[1], 1); + uint _e139 = atomicMax(workgroup_struct.atomic_scalar, 1u); + int _e144 = atomicMax(workgroup_struct.atomic_arr[1], 1); memoryBarrierShared(); barrier(); - uint _e167 = atomicMin(_group_0_binding_0_cs, 1u); - int _e172 = atomicMin(_group_0_binding_1_cs[1], 1); - uint _e176 = atomicMin(_group_0_binding_2_cs.atomic_scalar, 1u); - int _e182 = atomicMin(_group_0_binding_2_cs.atomic_arr[1], 1); - uint _e185 = atomicMin(workgroup_atomic_scalar, 1u); - int _e190 = atomicMin(workgroup_atomic_arr[1], 1); - uint _e194 = atomicMin(workgroup_struct.atomic_scalar, 1u); - int _e200 = atomicMin(workgroup_struct.atomic_arr[1], 1); + uint _e147 = atomicMin(_group_0_binding_0_cs, 1u); + int _e151 = atomicMin(_group_0_binding_1_cs[1], 1); + uint _e155 = atomicMin(_group_0_binding_2_cs.atomic_scalar, 1u); + int _e160 = atomicMin(_group_0_binding_2_cs.atomic_arr[1], 1); + uint _e163 = atomicMin(workgroup_atomic_scalar, 1u); + int _e167 = atomicMin(workgroup_atomic_arr[1], 1); + uint _e171 = atomicMin(workgroup_struct.atomic_scalar, 1u); + int _e176 = atomicMin(workgroup_struct.atomic_arr[1], 1); memoryBarrierShared(); barrier(); - uint _e203 = atomicAnd(_group_0_binding_0_cs, 1u); - int _e208 = atomicAnd(_group_0_binding_1_cs[1], 1); - uint _e212 = atomicAnd(_group_0_binding_2_cs.atomic_scalar, 1u); - int _e218 = atomicAnd(_group_0_binding_2_cs.atomic_arr[1], 1); - uint _e221 = atomicAnd(workgroup_atomic_scalar, 1u); - int _e226 = atomicAnd(workgroup_atomic_arr[1], 1); - uint _e230 = atomicAnd(workgroup_struct.atomic_scalar, 1u); - int _e236 = atomicAnd(workgroup_struct.atomic_arr[1], 1); + uint _e179 = atomicAnd(_group_0_binding_0_cs, 1u); + int _e183 = atomicAnd(_group_0_binding_1_cs[1], 1); + uint _e187 = atomicAnd(_group_0_binding_2_cs.atomic_scalar, 1u); + int _e192 = atomicAnd(_group_0_binding_2_cs.atomic_arr[1], 1); + uint _e195 = atomicAnd(workgroup_atomic_scalar, 1u); + int _e199 = atomicAnd(workgroup_atomic_arr[1], 1); + uint _e203 = atomicAnd(workgroup_struct.atomic_scalar, 1u); + int _e208 = atomicAnd(workgroup_struct.atomic_arr[1], 1); memoryBarrierShared(); barrier(); - uint _e239 = atomicOr(_group_0_binding_0_cs, 1u); - int _e244 = atomicOr(_group_0_binding_1_cs[1], 1); - uint _e248 = atomicOr(_group_0_binding_2_cs.atomic_scalar, 1u); - int _e254 = atomicOr(_group_0_binding_2_cs.atomic_arr[1], 1); - uint _e257 = atomicOr(workgroup_atomic_scalar, 1u); - int _e262 = atomicOr(workgroup_atomic_arr[1], 1); - uint _e266 = atomicOr(workgroup_struct.atomic_scalar, 1u); - int _e272 = atomicOr(workgroup_struct.atomic_arr[1], 1); + uint _e211 = atomicOr(_group_0_binding_0_cs, 1u); + int _e215 = atomicOr(_group_0_binding_1_cs[1], 1); + uint _e219 = atomicOr(_group_0_binding_2_cs.atomic_scalar, 1u); + int _e224 = atomicOr(_group_0_binding_2_cs.atomic_arr[1], 1); + uint _e227 = atomicOr(workgroup_atomic_scalar, 1u); + int _e231 = atomicOr(workgroup_atomic_arr[1], 1); + uint _e235 = atomicOr(workgroup_struct.atomic_scalar, 1u); + int _e240 = atomicOr(workgroup_struct.atomic_arr[1], 1); memoryBarrierShared(); barrier(); - uint _e275 = atomicXor(_group_0_binding_0_cs, 1u); - int _e280 = atomicXor(_group_0_binding_1_cs[1], 1); - uint _e284 = atomicXor(_group_0_binding_2_cs.atomic_scalar, 1u); - int _e290 = atomicXor(_group_0_binding_2_cs.atomic_arr[1], 1); - uint _e293 = atomicXor(workgroup_atomic_scalar, 1u); - int _e298 = atomicXor(workgroup_atomic_arr[1], 1); - uint _e302 = atomicXor(workgroup_struct.atomic_scalar, 1u); - int _e308 = atomicXor(workgroup_struct.atomic_arr[1], 1); - uint _e311 = atomicExchange(_group_0_binding_0_cs, 1u); - int _e316 = atomicExchange(_group_0_binding_1_cs[1], 1); - uint _e320 = atomicExchange(_group_0_binding_2_cs.atomic_scalar, 1u); - int _e326 = atomicExchange(_group_0_binding_2_cs.atomic_arr[1], 1); - uint _e329 = atomicExchange(workgroup_atomic_scalar, 1u); - int _e334 = atomicExchange(workgroup_atomic_arr[1], 1); - uint _e338 = atomicExchange(workgroup_struct.atomic_scalar, 1u); - int _e344 = atomicExchange(workgroup_struct.atomic_arr[1], 1); + uint _e243 = atomicXor(_group_0_binding_0_cs, 1u); + int _e247 = atomicXor(_group_0_binding_1_cs[1], 1); + uint _e251 = atomicXor(_group_0_binding_2_cs.atomic_scalar, 1u); + int _e256 = atomicXor(_group_0_binding_2_cs.atomic_arr[1], 1); + uint _e259 = atomicXor(workgroup_atomic_scalar, 1u); + int _e263 = atomicXor(workgroup_atomic_arr[1], 1); + uint _e267 = atomicXor(workgroup_struct.atomic_scalar, 1u); + int _e272 = atomicXor(workgroup_struct.atomic_arr[1], 1); + uint _e275 = atomicExchange(_group_0_binding_0_cs, 1u); + int _e279 = atomicExchange(_group_0_binding_1_cs[1], 1); + uint _e283 = atomicExchange(_group_0_binding_2_cs.atomic_scalar, 1u); + int _e288 = atomicExchange(_group_0_binding_2_cs.atomic_arr[1], 1); + uint _e291 = atomicExchange(workgroup_atomic_scalar, 1u); + int _e295 = atomicExchange(workgroup_atomic_arr[1], 1); + uint _e299 = atomicExchange(workgroup_struct.atomic_scalar, 1u); + int _e304 = atomicExchange(workgroup_struct.atomic_arr[1], 1); return; } diff --git a/tests/out/glsl/do-while.main.Fragment.glsl b/tests/out/glsl/do-while.main.Fragment.glsl index 50e9a48971..fb8f6e1efa 100644 --- a/tests/out/glsl/do-while.main.Fragment.glsl +++ b/tests/out/glsl/do-while.main.Fragment.glsl @@ -8,8 +8,8 @@ void fb1_(inout bool cond) { bool loop_init = true; while(true) { if (!loop_init) { - bool _e2 = cond; - if (!(_e2)) { + bool _e1 = cond; + if (!(_e1)) { break; } } diff --git a/tests/out/glsl/globals.main.Compute.glsl b/tests/out/glsl/globals.main.Compute.glsl index d1b2347345..b5e36f5414 100644 --- a/tests/out/glsl/globals.main.Compute.glsl +++ b/tests/out/glsl/globals.main.Compute.glsl @@ -40,8 +40,8 @@ void test_msl_packed_vec3_() { idx = 1; _group_0_binding_1_cs.v3_.x = 1.0; _group_0_binding_1_cs.v3_.x = 2.0; - int _e17 = idx; - _group_0_binding_1_cs.v3_[_e17] = 3.0; + int _e16 = idx; + _group_0_binding_1_cs.v3_[_e16] = 3.0; FooStruct data = _group_0_binding_1_cs; vec3 l0_ = data.v3_; vec2 l1_ = data.v3_.zx; @@ -62,20 +62,20 @@ void main() { float Foo = 0.0; bool at = false; test_msl_packed_vec3_(); - mat4x2 _e8 = _group_0_binding_7_cs[0][0]; - vec4 _e16 = _group_0_binding_6_cs[0][0][0]; - wg[7] = (_e8 * _e16).x; - mat3x2 _e23 = _group_0_binding_5_cs; - vec3 _e25 = _group_0_binding_4_cs; - wg[6] = (_e23 * _e25).x; - float _e35 = _group_0_binding_2_cs[1].y; - wg[5] = _e35; - float _e43 = _group_0_binding_3_cs[0].w; - wg[4] = _e43; - float _e49 = _group_0_binding_1_cs.v1_; - wg[3] = _e49; - float _e56 = _group_0_binding_1_cs.v3_.x; - wg[2] = _e56; + mat4x2 _e5 = _group_0_binding_7_cs[0][0]; + vec4 _e10 = _group_0_binding_6_cs[0][0][0]; + wg[7] = (_e5 * _e10).x; + mat3x2 _e16 = _group_0_binding_5_cs; + vec3 _e18 = _group_0_binding_4_cs; + wg[6] = (_e16 * _e18).x; + float _e26 = _group_0_binding_2_cs[1].y; + wg[5] = _e26; + float _e32 = _group_0_binding_3_cs[0].w; + wg[4] = _e32; + float _e37 = _group_0_binding_1_cs.v1_; + wg[3] = _e37; + float _e43 = _group_0_binding_1_cs.v3_.x; + wg[2] = _e43; _group_0_binding_1_cs.v1_ = 4.0; wg[1] = float(uint(_group_0_binding_2_cs.length())); at_1 = 2u; diff --git a/tests/out/glsl/operators.main.Compute.glsl b/tests/out/glsl/operators.main.Compute.glsl index 5adfec2f8a..ba3734be18 100644 --- a/tests/out/glsl/operators.main.Compute.glsl +++ b/tests/out/glsl/operators.main.Compute.glsl @@ -229,10 +229,10 @@ void assignment() { int _e36 = a_1; a_1 = (_e36 - 1); vec0_ = ivec3(0); - int _e43 = vec0_.y; - vec0_.y = (_e43 + 1); - int _e48 = vec0_.y; - vec0_.y = (_e48 - 1); + int _e42 = vec0_.y; + vec0_.y = (_e42 + 1); + int _e46 = vec0_.y; + vec0_.y = (_e46 - 1); return; } diff --git a/tests/out/glsl/quad-vert.main.Vertex.glsl b/tests/out/glsl/quad-vert.main.Vertex.glsl index eec208cdc6..db5089c2df 100644 --- a/tests/out/glsl/quad-vert.main.Vertex.glsl +++ b/tests/out/glsl/quad-vert.main.Vertex.glsl @@ -9,7 +9,7 @@ struct gen_gl_PerVertex { float gen_gl_ClipDistance[1]; float gen_gl_CullDistance[1]; }; -struct type_9 { +struct type_4 { vec2 member; vec4 gen_gl_Position; }; @@ -26,10 +26,10 @@ layout(location = 0) in vec2 _p2vs_location0; layout(location = 0) smooth out vec2 _vs2fs_location0; void main_1() { - vec2 _e8 = a_uv_1; - v_uv = _e8; - vec2 _e9 = a_pos_1; - perVertexStruct.gen_gl_Position = vec4(_e9.x, _e9.y, 0.0, 1.0); + vec2 _e6 = a_uv_1; + v_uv = _e6; + vec2 _e7 = a_pos_1; + perVertexStruct.gen_gl_Position = vec4(_e7.x, _e7.y, 0.0, 1.0); return; } @@ -41,7 +41,7 @@ void main() { main_1(); vec2 _e7 = v_uv; vec4 _e8 = perVertexStruct.gen_gl_Position; - type_9 _tmp_return = type_9(_e7, _e8); + type_4 _tmp_return = type_4(_e7, _e8); _vs2fs_location0 = _tmp_return.member; gl_Position = _tmp_return.gen_gl_Position; gl_Position.yz = vec2(-gl_Position.y, gl_Position.z * 2.0 - gl_Position.w); diff --git a/tests/out/hlsl/access.hlsl b/tests/out/hlsl/access.hlsl index 5fdd97fbcd..465643bb44 100644 --- a/tests/out/hlsl/access.hlsl +++ b/tests/out/hlsl/access.hlsl @@ -127,31 +127,31 @@ void test_matrix_within_struct_accesses() idx = (_expr3 - 1); float3x2 l0_ = GetMatmOnBaz(baz); float2 l1_ = GetMatmOnBaz(baz)[0]; - int _expr15 = idx; - float2 l2_ = GetMatmOnBaz(baz)[_expr15]; + int _expr14 = idx; + float2 l2_ = GetMatmOnBaz(baz)[_expr14]; float l3_ = GetMatmOnBaz(baz)[0].y; - int _expr29 = idx; - float l4_ = GetMatmOnBaz(baz)[0][_expr29]; - int _expr34 = idx; - float l5_ = GetMatmOnBaz(baz)[_expr34].y; - int _expr41 = idx; - int _expr43 = idx; - float l6_ = GetMatmOnBaz(baz)[_expr41][_expr43]; + int _expr25 = idx; + float l4_ = GetMatmOnBaz(baz)[0][_expr25]; + int _expr30 = idx; + float l5_ = GetMatmOnBaz(baz)[_expr30].y; + int _expr36 = idx; + int _expr38 = idx; + float l6_ = GetMatmOnBaz(baz)[_expr36][_expr38]; t = ConstructBaz(float3x2((1.0).xx, (2.0).xx, (3.0).xx)); - int _expr56 = idx; - idx = (_expr56 + 1); + int _expr51 = idx; + idx = (_expr51 + 1); SetMatmOnBaz(t, float3x2((6.0).xx, (5.0).xx, (4.0).xx)); t.m_0 = (9.0).xx; - int _expr72 = idx; - SetMatVecmOnBaz(t, (90.0).xx, _expr72); + int _expr66 = idx; + SetMatVecmOnBaz(t, (90.0).xx, _expr66); t.m_0[1] = 10.0; + int _expr76 = idx; + t.m_0[_expr76] = 20.0; + int _expr80 = idx; + SetMatScalarmOnBaz(t, 30.0, _expr80, 1); int _expr85 = idx; - t.m_0[_expr85] = 20.0; - int _expr89 = idx; - SetMatScalarmOnBaz(t, 30.0, _expr89, 1); - int _expr95 = idx; - int _expr97 = idx; - SetMatScalarmOnBaz(t, 40.0, _expr95, _expr97); + int _expr87 = idx; + SetMatScalarmOnBaz(t, 40.0, _expr85, _expr87); return; } @@ -172,32 +172,32 @@ void test_matrix_within_array_within_struct_accesses() float4x2 l0_1[2] = ((float4x2[2])nested_mat_cx2_.am); float4x2 l1_1 = ((float4x2)nested_mat_cx2_.am[0]); float2 l2_1 = nested_mat_cx2_.am[0]._0; - int _expr24 = idx_1; - float2 l3_1 = __get_col_of_mat4x2(nested_mat_cx2_.am[0], _expr24); + int _expr20 = idx_1; + float2 l3_1 = __get_col_of_mat4x2(nested_mat_cx2_.am[0], _expr20); float l4_1 = nested_mat_cx2_.am[0]._0.y; - int _expr42 = idx_1; - float l5_1 = nested_mat_cx2_.am[0]._0[_expr42]; - int _expr49 = idx_1; - float l6_1 = __get_col_of_mat4x2(nested_mat_cx2_.am[0], _expr49).y; - int _expr58 = idx_1; - int _expr60 = idx_1; - float l7_ = __get_col_of_mat4x2(nested_mat_cx2_.am[0], _expr58)[_expr60]; + int _expr33 = idx_1; + float l5_1 = nested_mat_cx2_.am[0]._0[_expr33]; + int _expr39 = idx_1; + float l6_1 = __get_col_of_mat4x2(nested_mat_cx2_.am[0], _expr39).y; + int _expr46 = idx_1; + int _expr48 = idx_1; + float l7_ = __get_col_of_mat4x2(nested_mat_cx2_.am[0], _expr46)[_expr48]; t_1 = ConstructMatCx2InArray((float4x2[2])0); - int _expr67 = idx_1; - idx_1 = (_expr67 + 1); + int _expr55 = idx_1; + idx_1 = (_expr55 + 1); t_1.am = (__mat4x2[2])(float4x2[2])0; t_1.am[0] = (__mat4x2)float4x2((8.0).xx, (7.0).xx, (6.0).xx, (5.0).xx); t_1.am[0]._0 = (9.0).xx; - int _expr93 = idx_1; - __set_col_of_mat4x2(t_1.am[0], _expr93, (90.0).xx); + int _expr77 = idx_1; + __set_col_of_mat4x2(t_1.am[0], _expr77, (90.0).xx); t_1.am[0]._0.y = 10.0; - int _expr110 = idx_1; - t_1.am[0]._0[_expr110] = 20.0; - int _expr116 = idx_1; - __set_el_of_mat4x2(t_1.am[0], _expr116, 1, 30.0); - int _expr124 = idx_1; - int _expr126 = idx_1; - __set_el_of_mat4x2(t_1.am[0], _expr124, _expr126, 40.0); + int _expr89 = idx_1; + t_1.am[0]._0[_expr89] = 20.0; + int _expr94 = idx_1; + __set_el_of_mat4x2(t_1.am[0], _expr94, 1, 30.0); + int _expr100 = idx_1; + int _expr102 = idx_1; + __set_el_of_mat4x2(t_1.am[0], _expr100, _expr102, 40.0); return; } @@ -264,11 +264,11 @@ float4 foo_vert(uint vi : SV_VertexID) : SV_Position float b = asfloat(bar.Load(0+48+0)); int a_1 = asint(bar.Load(0+(((NagaBufferLengthRW(bar) - 160) / 8) - 2u)*8+160)); int2 c = asint(qux.Load2(0)); - const float _e34 = read_from_private(foo); + const float _e33 = read_from_private(foo); c2_ = Constructarray5_int_(a_1, int(b), 3, 4, 5); c2_[(vi + 1u)] = 42; int value = c2_[vi]; - const float _e48 = test_arr_as_arg((float[5][10])0); + const float _e47 = test_arr_as_arg((float[5][10])0); return float4(mul(float4((value).xxxx), _matrix), 2.0); } diff --git a/tests/out/hlsl/atomicOps.hlsl b/tests/out/hlsl/atomicOps.hlsl index 0363920b31..640972a2fa 100644 --- a/tests/out/hlsl/atomicOps.hlsl +++ b/tests/out/hlsl/atomicOps.hlsl @@ -37,75 +37,75 @@ void cs_main(uint3 id : SV_GroupThreadID, uint3 __local_invocation_id : SV_Group uint l6_ = workgroup_struct.atomic_scalar; int l7_ = workgroup_struct.atomic_arr[1]; GroupMemoryBarrierWithGroupSync(); - uint _e59; storage_atomic_scalar.InterlockedAdd(0, 1u, _e59); - int _e64; storage_atomic_arr.InterlockedAdd(4, 1, _e64); - uint _e68; storage_struct.InterlockedAdd(0, 1u, _e68); - int _e74; storage_struct.InterlockedAdd(4+4, 1, _e74); - uint _e77; InterlockedAdd(workgroup_atomic_scalar, 1u, _e77); - int _e82; InterlockedAdd(workgroup_atomic_arr[1], 1, _e82); - uint _e86; InterlockedAdd(workgroup_struct.atomic_scalar, 1u, _e86); - int _e92; InterlockedAdd(workgroup_struct.atomic_arr[1], 1, _e92); + uint _e51; storage_atomic_scalar.InterlockedAdd(0, 1u, _e51); + int _e55; storage_atomic_arr.InterlockedAdd(4, 1, _e55); + uint _e59; storage_struct.InterlockedAdd(0, 1u, _e59); + int _e64; storage_struct.InterlockedAdd(4+4, 1, _e64); + uint _e67; InterlockedAdd(workgroup_atomic_scalar, 1u, _e67); + int _e71; InterlockedAdd(workgroup_atomic_arr[1], 1, _e71); + uint _e75; InterlockedAdd(workgroup_struct.atomic_scalar, 1u, _e75); + int _e80; InterlockedAdd(workgroup_struct.atomic_arr[1], 1, _e80); GroupMemoryBarrierWithGroupSync(); - uint _e95; storage_atomic_scalar.InterlockedAdd(0, -1u, _e95); - int _e100; storage_atomic_arr.InterlockedAdd(4, -1, _e100); - uint _e104; storage_struct.InterlockedAdd(0, -1u, _e104); - int _e110; storage_struct.InterlockedAdd(4+4, -1, _e110); - uint _e113; InterlockedAdd(workgroup_atomic_scalar, -1u, _e113); - int _e118; InterlockedAdd(workgroup_atomic_arr[1], -1, _e118); - uint _e122; InterlockedAdd(workgroup_struct.atomic_scalar, -1u, _e122); - int _e128; InterlockedAdd(workgroup_struct.atomic_arr[1], -1, _e128); + uint _e83; storage_atomic_scalar.InterlockedAdd(0, -1u, _e83); + int _e87; storage_atomic_arr.InterlockedAdd(4, -1, _e87); + uint _e91; storage_struct.InterlockedAdd(0, -1u, _e91); + int _e96; storage_struct.InterlockedAdd(4+4, -1, _e96); + uint _e99; InterlockedAdd(workgroup_atomic_scalar, -1u, _e99); + int _e103; InterlockedAdd(workgroup_atomic_arr[1], -1, _e103); + uint _e107; InterlockedAdd(workgroup_struct.atomic_scalar, -1u, _e107); + int _e112; InterlockedAdd(workgroup_struct.atomic_arr[1], -1, _e112); GroupMemoryBarrierWithGroupSync(); - uint _e131; storage_atomic_scalar.InterlockedMax(0, 1u, _e131); - int _e136; storage_atomic_arr.InterlockedMax(4, 1, _e136); - uint _e140; storage_struct.InterlockedMax(0, 1u, _e140); - int _e146; storage_struct.InterlockedMax(4+4, 1, _e146); - uint _e149; InterlockedMax(workgroup_atomic_scalar, 1u, _e149); - int _e154; InterlockedMax(workgroup_atomic_arr[1], 1, _e154); - uint _e158; InterlockedMax(workgroup_struct.atomic_scalar, 1u, _e158); - int _e164; InterlockedMax(workgroup_struct.atomic_arr[1], 1, _e164); + uint _e115; storage_atomic_scalar.InterlockedMax(0, 1u, _e115); + int _e119; storage_atomic_arr.InterlockedMax(4, 1, _e119); + uint _e123; storage_struct.InterlockedMax(0, 1u, _e123); + int _e128; storage_struct.InterlockedMax(4+4, 1, _e128); + uint _e131; InterlockedMax(workgroup_atomic_scalar, 1u, _e131); + int _e135; InterlockedMax(workgroup_atomic_arr[1], 1, _e135); + uint _e139; InterlockedMax(workgroup_struct.atomic_scalar, 1u, _e139); + int _e144; InterlockedMax(workgroup_struct.atomic_arr[1], 1, _e144); GroupMemoryBarrierWithGroupSync(); - uint _e167; storage_atomic_scalar.InterlockedMin(0, 1u, _e167); - int _e172; storage_atomic_arr.InterlockedMin(4, 1, _e172); - uint _e176; storage_struct.InterlockedMin(0, 1u, _e176); - int _e182; storage_struct.InterlockedMin(4+4, 1, _e182); - uint _e185; InterlockedMin(workgroup_atomic_scalar, 1u, _e185); - int _e190; InterlockedMin(workgroup_atomic_arr[1], 1, _e190); - uint _e194; InterlockedMin(workgroup_struct.atomic_scalar, 1u, _e194); - int _e200; InterlockedMin(workgroup_struct.atomic_arr[1], 1, _e200); + uint _e147; storage_atomic_scalar.InterlockedMin(0, 1u, _e147); + int _e151; storage_atomic_arr.InterlockedMin(4, 1, _e151); + uint _e155; storage_struct.InterlockedMin(0, 1u, _e155); + int _e160; storage_struct.InterlockedMin(4+4, 1, _e160); + uint _e163; InterlockedMin(workgroup_atomic_scalar, 1u, _e163); + int _e167; InterlockedMin(workgroup_atomic_arr[1], 1, _e167); + uint _e171; InterlockedMin(workgroup_struct.atomic_scalar, 1u, _e171); + int _e176; InterlockedMin(workgroup_struct.atomic_arr[1], 1, _e176); GroupMemoryBarrierWithGroupSync(); - uint _e203; storage_atomic_scalar.InterlockedAnd(0, 1u, _e203); - int _e208; storage_atomic_arr.InterlockedAnd(4, 1, _e208); - uint _e212; storage_struct.InterlockedAnd(0, 1u, _e212); - int _e218; storage_struct.InterlockedAnd(4+4, 1, _e218); - uint _e221; InterlockedAnd(workgroup_atomic_scalar, 1u, _e221); - int _e226; InterlockedAnd(workgroup_atomic_arr[1], 1, _e226); - uint _e230; InterlockedAnd(workgroup_struct.atomic_scalar, 1u, _e230); - int _e236; InterlockedAnd(workgroup_struct.atomic_arr[1], 1, _e236); + uint _e179; storage_atomic_scalar.InterlockedAnd(0, 1u, _e179); + int _e183; storage_atomic_arr.InterlockedAnd(4, 1, _e183); + uint _e187; storage_struct.InterlockedAnd(0, 1u, _e187); + int _e192; storage_struct.InterlockedAnd(4+4, 1, _e192); + uint _e195; InterlockedAnd(workgroup_atomic_scalar, 1u, _e195); + int _e199; InterlockedAnd(workgroup_atomic_arr[1], 1, _e199); + uint _e203; InterlockedAnd(workgroup_struct.atomic_scalar, 1u, _e203); + int _e208; InterlockedAnd(workgroup_struct.atomic_arr[1], 1, _e208); GroupMemoryBarrierWithGroupSync(); - uint _e239; storage_atomic_scalar.InterlockedOr(0, 1u, _e239); - int _e244; storage_atomic_arr.InterlockedOr(4, 1, _e244); - uint _e248; storage_struct.InterlockedOr(0, 1u, _e248); - int _e254; storage_struct.InterlockedOr(4+4, 1, _e254); - uint _e257; InterlockedOr(workgroup_atomic_scalar, 1u, _e257); - int _e262; InterlockedOr(workgroup_atomic_arr[1], 1, _e262); - uint _e266; InterlockedOr(workgroup_struct.atomic_scalar, 1u, _e266); - int _e272; InterlockedOr(workgroup_struct.atomic_arr[1], 1, _e272); + uint _e211; storage_atomic_scalar.InterlockedOr(0, 1u, _e211); + int _e215; storage_atomic_arr.InterlockedOr(4, 1, _e215); + uint _e219; storage_struct.InterlockedOr(0, 1u, _e219); + int _e224; storage_struct.InterlockedOr(4+4, 1, _e224); + uint _e227; InterlockedOr(workgroup_atomic_scalar, 1u, _e227); + int _e231; InterlockedOr(workgroup_atomic_arr[1], 1, _e231); + uint _e235; InterlockedOr(workgroup_struct.atomic_scalar, 1u, _e235); + int _e240; InterlockedOr(workgroup_struct.atomic_arr[1], 1, _e240); GroupMemoryBarrierWithGroupSync(); - uint _e275; storage_atomic_scalar.InterlockedXor(0, 1u, _e275); - int _e280; storage_atomic_arr.InterlockedXor(4, 1, _e280); - uint _e284; storage_struct.InterlockedXor(0, 1u, _e284); - int _e290; storage_struct.InterlockedXor(4+4, 1, _e290); - uint _e293; InterlockedXor(workgroup_atomic_scalar, 1u, _e293); - int _e298; InterlockedXor(workgroup_atomic_arr[1], 1, _e298); - uint _e302; InterlockedXor(workgroup_struct.atomic_scalar, 1u, _e302); - int _e308; InterlockedXor(workgroup_struct.atomic_arr[1], 1, _e308); - uint _e311; storage_atomic_scalar.InterlockedExchange(0, 1u, _e311); - int _e316; storage_atomic_arr.InterlockedExchange(4, 1, _e316); - uint _e320; storage_struct.InterlockedExchange(0, 1u, _e320); - int _e326; storage_struct.InterlockedExchange(4+4, 1, _e326); - uint _e329; InterlockedExchange(workgroup_atomic_scalar, 1u, _e329); - int _e334; InterlockedExchange(workgroup_atomic_arr[1], 1, _e334); - uint _e338; InterlockedExchange(workgroup_struct.atomic_scalar, 1u, _e338); - int _e344; InterlockedExchange(workgroup_struct.atomic_arr[1], 1, _e344); + uint _e243; storage_atomic_scalar.InterlockedXor(0, 1u, _e243); + int _e247; storage_atomic_arr.InterlockedXor(4, 1, _e247); + uint _e251; storage_struct.InterlockedXor(0, 1u, _e251); + int _e256; storage_struct.InterlockedXor(4+4, 1, _e256); + uint _e259; InterlockedXor(workgroup_atomic_scalar, 1u, _e259); + int _e263; InterlockedXor(workgroup_atomic_arr[1], 1, _e263); + uint _e267; InterlockedXor(workgroup_struct.atomic_scalar, 1u, _e267); + int _e272; InterlockedXor(workgroup_struct.atomic_arr[1], 1, _e272); + uint _e275; storage_atomic_scalar.InterlockedExchange(0, 1u, _e275); + int _e279; storage_atomic_arr.InterlockedExchange(4, 1, _e279); + uint _e283; storage_struct.InterlockedExchange(0, 1u, _e283); + int _e288; storage_struct.InterlockedExchange(4+4, 1, _e288); + uint _e291; InterlockedExchange(workgroup_atomic_scalar, 1u, _e291); + int _e295; InterlockedExchange(workgroup_atomic_arr[1], 1, _e295); + uint _e299; InterlockedExchange(workgroup_struct.atomic_scalar, 1u, _e299); + int _e304; InterlockedExchange(workgroup_struct.atomic_arr[1], 1, _e304); return; } diff --git a/tests/out/hlsl/binding-arrays.hlsl b/tests/out/hlsl/binding-arrays.hlsl index 13d93c43c5..4a22c2746c 100644 --- a/tests/out/hlsl/binding-arrays.hlsl +++ b/tests/out/hlsl/binding-arrays.hlsl @@ -64,121 +64,121 @@ float4 main(FragmentInput_main fragmentinput_main) : SV_Target0 v4_ = (0.0).xxxx; float2 uv = (0.0).xx; int2 pix = (0).xx; - uint2 _expr23 = u2_; - u2_ = (_expr23 + NagaDimensions2D(texture_array_unbounded[0])); - uint2 _expr28 = u2_; - u2_ = (_expr28 + NagaDimensions2D(texture_array_unbounded[uniform_index])); - uint2 _expr33 = u2_; - u2_ = (_expr33 + NagaDimensions2D(texture_array_unbounded[NonUniformResourceIndex(non_uniform_index)])); - float4 _expr42 = texture_array_bounded[0].Gather(samp[0], uv); - float4 _expr43 = v4_; - v4_ = (_expr43 + _expr42); - float4 _expr50 = texture_array_bounded[uniform_index].Gather(samp[uniform_index], uv); - float4 _expr51 = v4_; - v4_ = (_expr51 + _expr50); - float4 _expr58 = texture_array_bounded[NonUniformResourceIndex(non_uniform_index)].Gather(samp[NonUniformResourceIndex(non_uniform_index)], uv); - float4 _expr59 = v4_; - v4_ = (_expr59 + _expr58); - float4 _expr68 = texture_array_depth[0].GatherCmp(samp_comp[0], uv, 0.0); + uint2 _expr22 = u2_; + u2_ = (_expr22 + NagaDimensions2D(texture_array_unbounded[0])); + uint2 _expr27 = u2_; + u2_ = (_expr27 + NagaDimensions2D(texture_array_unbounded[uniform_index])); + uint2 _expr32 = u2_; + u2_ = (_expr32 + NagaDimensions2D(texture_array_unbounded[NonUniformResourceIndex(non_uniform_index)])); + float4 _expr38 = texture_array_bounded[0].Gather(samp[0], uv); + float4 _expr39 = v4_; + v4_ = (_expr39 + _expr38); + float4 _expr45 = texture_array_bounded[uniform_index].Gather(samp[uniform_index], uv); + float4 _expr46 = v4_; + v4_ = (_expr46 + _expr45); + float4 _expr52 = texture_array_bounded[NonUniformResourceIndex(non_uniform_index)].Gather(samp[NonUniformResourceIndex(non_uniform_index)], uv); + float4 _expr53 = v4_; + v4_ = (_expr53 + _expr52); + float4 _expr60 = texture_array_depth[0].GatherCmp(samp_comp[0], uv, 0.0); + float4 _expr61 = v4_; + v4_ = (_expr61 + _expr60); + float4 _expr68 = texture_array_depth[uniform_index].GatherCmp(samp_comp[uniform_index], uv, 0.0); float4 _expr69 = v4_; v4_ = (_expr69 + _expr68); - float4 _expr76 = texture_array_depth[uniform_index].GatherCmp(samp_comp[uniform_index], uv, 0.0); + float4 _expr76 = texture_array_depth[NonUniformResourceIndex(non_uniform_index)].GatherCmp(samp_comp[NonUniformResourceIndex(non_uniform_index)], uv, 0.0); float4 _expr77 = v4_; v4_ = (_expr77 + _expr76); - float4 _expr84 = texture_array_depth[NonUniformResourceIndex(non_uniform_index)].GatherCmp(samp_comp[NonUniformResourceIndex(non_uniform_index)], uv, 0.0); - float4 _expr85 = v4_; - v4_ = (_expr85 + _expr84); - float4 _expr91 = texture_array_unbounded[0].Load(int3(pix, 0)); - float4 _expr92 = v4_; - v4_ = (_expr92 + _expr91); - float4 _expr97 = texture_array_unbounded[uniform_index].Load(int3(pix, 0)); - float4 _expr98 = v4_; - v4_ = (_expr98 + _expr97); - float4 _expr103 = texture_array_unbounded[NonUniformResourceIndex(non_uniform_index)].Load(int3(pix, 0)); - float4 _expr104 = v4_; - v4_ = (_expr104 + _expr103); + float4 _expr82 = texture_array_unbounded[0].Load(int3(pix, 0)); + float4 _expr83 = v4_; + v4_ = (_expr83 + _expr82); + float4 _expr88 = texture_array_unbounded[uniform_index].Load(int3(pix, 0)); + float4 _expr89 = v4_; + v4_ = (_expr89 + _expr88); + float4 _expr94 = texture_array_unbounded[NonUniformResourceIndex(non_uniform_index)].Load(int3(pix, 0)); + float4 _expr95 = v4_; + v4_ = (_expr95 + _expr94); + uint _expr100 = u1_; + u1_ = (_expr100 + NagaNumLayers2DArray(texture_array_2darray[0])); + uint _expr105 = u1_; + u1_ = (_expr105 + NagaNumLayers2DArray(texture_array_2darray[uniform_index])); uint _expr110 = u1_; - u1_ = (_expr110 + NagaNumLayers2DArray(texture_array_2darray[0])); + u1_ = (_expr110 + NagaNumLayers2DArray(texture_array_2darray[NonUniformResourceIndex(non_uniform_index)])); uint _expr115 = u1_; - u1_ = (_expr115 + NagaNumLayers2DArray(texture_array_2darray[uniform_index])); + u1_ = (_expr115 + NagaNumLevels2D(texture_array_bounded[0])); uint _expr120 = u1_; - u1_ = (_expr120 + NagaNumLayers2DArray(texture_array_2darray[NonUniformResourceIndex(non_uniform_index)])); - uint _expr126 = u1_; - u1_ = (_expr126 + NagaNumLevels2D(texture_array_bounded[0])); - uint _expr131 = u1_; - u1_ = (_expr131 + NagaNumLevels2D(texture_array_bounded[uniform_index])); - uint _expr136 = u1_; - u1_ = (_expr136 + NagaNumLevels2D(texture_array_bounded[NonUniformResourceIndex(non_uniform_index)])); - uint _expr142 = u1_; - u1_ = (_expr142 + NagaMSNumSamples2D(texture_array_multisampled[0])); - uint _expr147 = u1_; - u1_ = (_expr147 + NagaMSNumSamples2D(texture_array_multisampled[uniform_index])); - uint _expr152 = u1_; - u1_ = (_expr152 + NagaMSNumSamples2D(texture_array_multisampled[NonUniformResourceIndex(non_uniform_index)])); - float4 _expr160 = texture_array_bounded[0].Sample(samp[0], uv); + u1_ = (_expr120 + NagaNumLevels2D(texture_array_bounded[uniform_index])); + uint _expr125 = u1_; + u1_ = (_expr125 + NagaNumLevels2D(texture_array_bounded[NonUniformResourceIndex(non_uniform_index)])); + uint _expr130 = u1_; + u1_ = (_expr130 + NagaMSNumSamples2D(texture_array_multisampled[0])); + uint _expr135 = u1_; + u1_ = (_expr135 + NagaMSNumSamples2D(texture_array_multisampled[uniform_index])); + uint _expr140 = u1_; + u1_ = (_expr140 + NagaMSNumSamples2D(texture_array_multisampled[NonUniformResourceIndex(non_uniform_index)])); + float4 _expr146 = texture_array_bounded[0].Sample(samp[0], uv); + float4 _expr147 = v4_; + v4_ = (_expr147 + _expr146); + float4 _expr153 = texture_array_bounded[uniform_index].Sample(samp[uniform_index], uv); + float4 _expr154 = v4_; + v4_ = (_expr154 + _expr153); + float4 _expr160 = texture_array_bounded[NonUniformResourceIndex(non_uniform_index)].Sample(samp[NonUniformResourceIndex(non_uniform_index)], uv); float4 _expr161 = v4_; v4_ = (_expr161 + _expr160); - float4 _expr167 = texture_array_bounded[uniform_index].Sample(samp[uniform_index], uv); - float4 _expr168 = v4_; - v4_ = (_expr168 + _expr167); - float4 _expr174 = texture_array_bounded[NonUniformResourceIndex(non_uniform_index)].Sample(samp[NonUniformResourceIndex(non_uniform_index)], uv); - float4 _expr175 = v4_; - v4_ = (_expr175 + _expr174); - float4 _expr184 = texture_array_bounded[0].SampleBias(samp[0], uv, 0.0); + float4 _expr168 = texture_array_bounded[0].SampleBias(samp[0], uv, 0.0); + float4 _expr169 = v4_; + v4_ = (_expr169 + _expr168); + float4 _expr176 = texture_array_bounded[uniform_index].SampleBias(samp[uniform_index], uv, 0.0); + float4 _expr177 = v4_; + v4_ = (_expr177 + _expr176); + float4 _expr184 = texture_array_bounded[NonUniformResourceIndex(non_uniform_index)].SampleBias(samp[NonUniformResourceIndex(non_uniform_index)], uv, 0.0); float4 _expr185 = v4_; v4_ = (_expr185 + _expr184); - float4 _expr192 = texture_array_bounded[uniform_index].SampleBias(samp[uniform_index], uv, 0.0); - float4 _expr193 = v4_; - v4_ = (_expr193 + _expr192); - float4 _expr200 = texture_array_bounded[NonUniformResourceIndex(non_uniform_index)].SampleBias(samp[NonUniformResourceIndex(non_uniform_index)], uv, 0.0); - float4 _expr201 = v4_; - v4_ = (_expr201 + _expr200); - float _expr210 = texture_array_depth[0].SampleCmp(samp_comp[0], uv, 0.0); - float _expr211 = v1_; - v1_ = (_expr211 + _expr210); - float _expr218 = texture_array_depth[uniform_index].SampleCmp(samp_comp[uniform_index], uv, 0.0); - float _expr219 = v1_; - v1_ = (_expr219 + _expr218); - float _expr226 = texture_array_depth[NonUniformResourceIndex(non_uniform_index)].SampleCmp(samp_comp[NonUniformResourceIndex(non_uniform_index)], uv, 0.0); - float _expr227 = v1_; - v1_ = (_expr227 + _expr226); - float _expr236 = texture_array_depth[0].SampleCmpLevelZero(samp_comp[0], uv, 0.0); - float _expr237 = v1_; - v1_ = (_expr237 + _expr236); - float _expr244 = texture_array_depth[uniform_index].SampleCmpLevelZero(samp_comp[uniform_index], uv, 0.0); - float _expr245 = v1_; - v1_ = (_expr245 + _expr244); - float _expr252 = texture_array_depth[NonUniformResourceIndex(non_uniform_index)].SampleCmpLevelZero(samp_comp[NonUniformResourceIndex(non_uniform_index)], uv, 0.0); - float _expr253 = v1_; - v1_ = (_expr253 + _expr252); - float4 _expr261 = texture_array_bounded[0].SampleGrad(samp[0], uv, uv, uv); + float _expr192 = texture_array_depth[0].SampleCmp(samp_comp[0], uv, 0.0); + float _expr193 = v1_; + v1_ = (_expr193 + _expr192); + float _expr200 = texture_array_depth[uniform_index].SampleCmp(samp_comp[uniform_index], uv, 0.0); + float _expr201 = v1_; + v1_ = (_expr201 + _expr200); + float _expr208 = texture_array_depth[NonUniformResourceIndex(non_uniform_index)].SampleCmp(samp_comp[NonUniformResourceIndex(non_uniform_index)], uv, 0.0); + float _expr209 = v1_; + v1_ = (_expr209 + _expr208); + float _expr216 = texture_array_depth[0].SampleCmpLevelZero(samp_comp[0], uv, 0.0); + float _expr217 = v1_; + v1_ = (_expr217 + _expr216); + float _expr224 = texture_array_depth[uniform_index].SampleCmpLevelZero(samp_comp[uniform_index], uv, 0.0); + float _expr225 = v1_; + v1_ = (_expr225 + _expr224); + float _expr232 = texture_array_depth[NonUniformResourceIndex(non_uniform_index)].SampleCmpLevelZero(samp_comp[NonUniformResourceIndex(non_uniform_index)], uv, 0.0); + float _expr233 = v1_; + v1_ = (_expr233 + _expr232); + float4 _expr239 = texture_array_bounded[0].SampleGrad(samp[0], uv, uv, uv); + float4 _expr240 = v4_; + v4_ = (_expr240 + _expr239); + float4 _expr246 = texture_array_bounded[uniform_index].SampleGrad(samp[uniform_index], uv, uv, uv); + float4 _expr247 = v4_; + v4_ = (_expr247 + _expr246); + float4 _expr253 = texture_array_bounded[NonUniformResourceIndex(non_uniform_index)].SampleGrad(samp[NonUniformResourceIndex(non_uniform_index)], uv, uv, uv); + float4 _expr254 = v4_; + v4_ = (_expr254 + _expr253); + float4 _expr261 = texture_array_bounded[0].SampleLevel(samp[0], uv, 0.0); float4 _expr262 = v4_; v4_ = (_expr262 + _expr261); - float4 _expr268 = texture_array_bounded[uniform_index].SampleGrad(samp[uniform_index], uv, uv, uv); - float4 _expr269 = v4_; - v4_ = (_expr269 + _expr268); - float4 _expr275 = texture_array_bounded[NonUniformResourceIndex(non_uniform_index)].SampleGrad(samp[NonUniformResourceIndex(non_uniform_index)], uv, uv, uv); - float4 _expr276 = v4_; - v4_ = (_expr276 + _expr275); - float4 _expr285 = texture_array_bounded[0].SampleLevel(samp[0], uv, 0.0); - float4 _expr286 = v4_; - v4_ = (_expr286 + _expr285); - float4 _expr293 = texture_array_bounded[uniform_index].SampleLevel(samp[uniform_index], uv, 0.0); + float4 _expr269 = texture_array_bounded[uniform_index].SampleLevel(samp[uniform_index], uv, 0.0); + float4 _expr270 = v4_; + v4_ = (_expr270 + _expr269); + float4 _expr277 = texture_array_bounded[NonUniformResourceIndex(non_uniform_index)].SampleLevel(samp[NonUniformResourceIndex(non_uniform_index)], uv, 0.0); + float4 _expr278 = v4_; + v4_ = (_expr278 + _expr277); + float4 _expr282 = v4_; + texture_array_storage[0][pix] = _expr282; + float4 _expr285 = v4_; + texture_array_storage[uniform_index][pix] = _expr285; + float4 _expr288 = v4_; + texture_array_storage[NonUniformResourceIndex(non_uniform_index)][pix] = _expr288; + uint2 _expr289 = u2_; + uint _expr290 = u1_; + float2 v2_ = float2((_expr289 + (_expr290).xx)); float4 _expr294 = v4_; - v4_ = (_expr294 + _expr293); - float4 _expr301 = texture_array_bounded[NonUniformResourceIndex(non_uniform_index)].SampleLevel(samp[NonUniformResourceIndex(non_uniform_index)], uv, 0.0); - float4 _expr302 = v4_; - v4_ = (_expr302 + _expr301); - float4 _expr307 = v4_; - texture_array_storage[0][pix] = _expr307; - float4 _expr310 = v4_; - texture_array_storage[uniform_index][pix] = _expr310; - float4 _expr313 = v4_; - texture_array_storage[NonUniformResourceIndex(non_uniform_index)][pix] = _expr313; - uint2 _expr314 = u2_; - uint _expr315 = u1_; - float2 v2_ = float2((_expr314 + (_expr315).xx)); - float4 _expr319 = v4_; - float _expr326 = v1_; - return ((_expr319 + float4(v2_.x, v2_.y, v2_.x, v2_.y)) + (_expr326).xxxx); + float _expr301 = v1_; + return ((_expr294 + float4(v2_.x, v2_.y, v2_.x, v2_.y)) + (_expr301).xxxx); } diff --git a/tests/out/hlsl/do-while.hlsl b/tests/out/hlsl/do-while.hlsl index 88a3d522e8..b09e62457f 100644 --- a/tests/out/hlsl/do-while.hlsl +++ b/tests/out/hlsl/do-while.hlsl @@ -3,8 +3,8 @@ void fb1_(inout bool cond) bool loop_init = true; while(true) { if (!loop_init) { - bool _expr2 = cond; - if (!(_expr2)) { + bool _expr1 = cond; + if (!(_expr1)) { break; } } diff --git a/tests/out/hlsl/empty-global-name.hlsl b/tests/out/hlsl/empty-global-name.hlsl index 2ad022d6bb..8bb32b3648 100644 --- a/tests/out/hlsl/empty-global-name.hlsl +++ b/tests/out/hlsl/empty-global-name.hlsl @@ -6,8 +6,8 @@ RWByteAddressBuffer unnamed : register(u0); void function() { - int _expr4 = asint(unnamed.Load(0)); - unnamed.Store(0, asuint((_expr4 + 1))); + int _expr3 = asint(unnamed.Load(0)); + unnamed.Store(0, asuint((_expr3 + 1))); return; } diff --git a/tests/out/hlsl/globals.hlsl b/tests/out/hlsl/globals.hlsl index f8cede1ac5..b4994837cd 100644 --- a/tests/out/hlsl/globals.hlsl +++ b/tests/out/hlsl/globals.hlsl @@ -86,8 +86,8 @@ void test_msl_packed_vec3_() idx = 1; alignment.Store(0+0, asuint(1.0)); alignment.Store(0+0, asuint(2.0)); - int _expr17 = idx; - alignment.Store(_expr17*4+0, asuint(3.0)); + int _expr16 = idx; + alignment.Store(_expr16*4+0, asuint(3.0)); FooStruct data = ConstructFooStruct(asfloat(alignment.Load3(0)), asfloat(alignment.Load(12))); float3 l0_ = data.v3_; float2 l1_ = data.v3_.zx; @@ -117,20 +117,20 @@ void main(uint3 __local_invocation_id : SV_GroupThreadID) bool at = (bool)0; test_msl_packed_vec3_(); - float4x2 _expr8 = ((float4x2)global_nested_arrays_of_matrices_4x2_[0][0]); - float4 _expr16 = global_nested_arrays_of_matrices_2x4_[0][0][0]; - wg[7] = mul(_expr16, _expr8).x; - float3x2 _expr23 = ((float3x2)global_mat); - float3 _expr25 = global_vec; - wg[6] = mul(_expr25, _expr23).x; - float _expr35 = asfloat(dummy.Load(4+8)); - wg[5] = _expr35; - float _expr43 = float_vecs[0].w; - wg[4] = _expr43; - float _expr49 = asfloat(alignment.Load(12)); - wg[3] = _expr49; - float _expr56 = asfloat(alignment.Load(0+0)); - wg[2] = _expr56; + float4x2 _expr5 = ((float4x2)global_nested_arrays_of_matrices_4x2_[0][0]); + float4 _expr10 = global_nested_arrays_of_matrices_2x4_[0][0][0]; + wg[7] = mul(_expr10, _expr5).x; + float3x2 _expr16 = ((float3x2)global_mat); + float3 _expr18 = global_vec; + wg[6] = mul(_expr18, _expr16).x; + float _expr26 = asfloat(dummy.Load(4+8)); + wg[5] = _expr26; + float _expr32 = float_vecs[0].w; + wg[4] = _expr32; + float _expr37 = asfloat(alignment.Load(12)); + wg[3] = _expr37; + float _expr43 = asfloat(alignment.Load(0+0)); + wg[2] = _expr43; alignment.Store(12, asuint(4.0)); wg[1] = float(((NagaBufferLength(dummy) - 0) / 8)); at_1 = 2u; diff --git a/tests/out/hlsl/operators.hlsl b/tests/out/hlsl/operators.hlsl index 4c57f31343..846f567f96 100644 --- a/tests/out/hlsl/operators.hlsl +++ b/tests/out/hlsl/operators.hlsl @@ -232,10 +232,10 @@ void assignment() int _expr36 = a_1; a_1 = (_expr36 - 1); vec0_ = (int3)0; - int _expr43 = vec0_.y; - vec0_.y = (_expr43 + 1); - int _expr48 = vec0_.y; - vec0_.y = (_expr48 - 1); + int _expr42 = vec0_.y; + vec0_.y = (_expr42 + 1); + int _expr46 = vec0_.y; + vec0_.y = (_expr46 - 1); return; } diff --git a/tests/out/hlsl/quad-vert.hlsl b/tests/out/hlsl/quad-vert.hlsl index bed52d5054..da2ff49dab 100644 --- a/tests/out/hlsl/quad-vert.hlsl +++ b/tests/out/hlsl/quad-vert.hlsl @@ -6,7 +6,7 @@ struct gl_PerVertex { int _end_pad_0; }; -struct type_9 { +struct type_4 { float2 member : LOC0; float4 gl_Position : SV_Position; }; @@ -32,15 +32,15 @@ struct VertexOutput_main { void main_1() { - float2 _expr8 = a_uv_1; - v_uv = _expr8; - float2 _expr9 = a_pos_1; - perVertexStruct.gl_Position = float4(_expr9.x, _expr9.y, 0.0, 1.0); + float2 _expr6 = a_uv_1; + v_uv = _expr6; + float2 _expr7 = a_pos_1; + perVertexStruct.gl_Position = float4(_expr7.x, _expr7.y, 0.0, 1.0); return; } -type_9 Constructtype_9(float2 arg0, float4 arg1) { - type_9 ret = (type_9)0; +type_4 Constructtype_4(float2 arg0, float4 arg1) { + type_4 ret = (type_4)0; ret.member = arg0; ret.gl_Position = arg1; return ret; @@ -53,7 +53,7 @@ VertexOutput_main main(float2 a_uv : LOC1, float2 a_pos : LOC0) main_1(); float2 _expr7 = v_uv; float4 _expr8 = perVertexStruct.gl_Position; - const type_9 type_9_ = Constructtype_9(_expr7, _expr8); - const VertexOutput_main type_9_1 = { type_9_.member, type_9_.gl_Position }; - return type_9_1; + const type_4 type_4_ = Constructtype_4(_expr7, _expr8); + const VertexOutput_main type_4_1 = { type_4_.member, type_4_.gl_Position }; + return type_4_1; } diff --git a/tests/out/ir/access.compact.ron b/tests/out/ir/access.compact.ron new file mode 100644 index 0000000000..b725765d46 --- /dev/null +++ b/tests/out/ir/access.compact.ron @@ -0,0 +1,2222 @@ +( + types: [ + ( + name: None, + inner: Scalar( + kind: Uint, + width: 4, + ), + ), + ( + name: None, + inner: Vector( + size: Tri, + kind: Uint, + width: 4, + ), + ), + ( + name: None, + inner: Scalar( + kind: Sint, + width: 4, + ), + ), + ( + name: Some("GlobalConst"), + inner: Struct( + members: [ + ( + name: Some("a"), + ty: 1, + binding: None, + offset: 0, + ), + ( + name: Some("b"), + ty: 2, + binding: None, + offset: 16, + ), + ( + name: Some("c"), + ty: 3, + binding: None, + offset: 28, + ), + ], + span: 32, + ), + ), + ( + name: Some("AlignedWrapper"), + inner: Struct( + members: [ + ( + name: Some("value"), + ty: 3, + binding: None, + offset: 0, + ), + ], + span: 8, + ), + ), + ( + name: None, + inner: Matrix( + columns: Quad, + rows: Tri, + width: 4, + ), + ), + ( + name: None, + inner: Matrix( + columns: Bi, + rows: Bi, + width: 4, + ), + ), + ( + name: None, + inner: Array( + base: 7, + size: Constant(2), + stride: 16, + ), + ), + ( + name: None, + inner: Atomic( + kind: Sint, + width: 4, + ), + ), + ( + name: None, + inner: Array( + base: 9, + size: Constant(10), + stride: 4, + ), + ), + ( + name: None, + inner: Vector( + size: Bi, + kind: Uint, + width: 4, + ), + ), + ( + name: None, + inner: Array( + base: 11, + size: Constant(2), + stride: 8, + ), + ), + ( + name: None, + inner: Array( + base: 5, + size: Dynamic, + stride: 8, + ), + ), + ( + name: Some("Bar"), + inner: Struct( + members: [ + ( + name: Some("_matrix"), + ty: 6, + binding: None, + offset: 0, + ), + ( + name: Some("matrix_array"), + ty: 8, + binding: None, + offset: 64, + ), + ( + name: Some("atom"), + ty: 9, + binding: None, + offset: 96, + ), + ( + name: Some("atom_arr"), + ty: 10, + binding: None, + offset: 100, + ), + ( + name: Some("arr"), + ty: 12, + binding: None, + offset: 144, + ), + ( + name: Some("data"), + ty: 13, + binding: None, + offset: 160, + ), + ], + span: 176, + ), + ), + ( + name: None, + inner: Matrix( + columns: Tri, + rows: Bi, + width: 4, + ), + ), + ( + name: Some("Baz"), + inner: Struct( + members: [ + ( + name: Some("m"), + ty: 15, + binding: None, + offset: 0, + ), + ], + span: 24, + ), + ), + ( + name: None, + inner: Vector( + size: Bi, + kind: Sint, + width: 4, + ), + ), + ( + name: None, + inner: Matrix( + columns: Quad, + rows: Bi, + width: 4, + ), + ), + ( + name: None, + inner: Array( + base: 18, + size: Constant(2), + stride: 32, + ), + ), + ( + name: Some("MatCx2InArray"), + inner: Struct( + members: [ + ( + name: Some("am"), + ty: 19, + binding: None, + offset: 0, + ), + ], + span: 64, + ), + ), + ( + name: None, + inner: Scalar( + kind: Float, + width: 4, + ), + ), + ( + name: None, + inner: Pointer( + base: 21, + space: Function, + ), + ), + ( + name: None, + inner: Array( + base: 21, + size: Constant(10), + stride: 4, + ), + ), + ( + name: None, + inner: Array( + base: 23, + size: Constant(5), + stride: 40, + ), + ), + ( + name: None, + inner: Vector( + size: Quad, + kind: Float, + width: 4, + ), + ), + ( + name: None, + inner: Array( + base: 3, + size: Constant(5), + stride: 4, + ), + ), + ( + name: None, + inner: Pointer( + base: 1, + space: WorkGroup, + ), + ), + ( + name: None, + inner: Array( + base: 25, + size: Constant(2), + stride: 16, + ), + ), + ( + name: None, + inner: Pointer( + base: 28, + space: Function, + ), + ), + ], + special_types: ( + ray_desc: None, + ray_intersection: None, + predeclared_types: {}, + ), + constants: [], + global_variables: [ + ( + name: Some("global_const"), + space: Private, + binding: None, + ty: 4, + init: Some(7), + ), + ( + name: Some("bar"), + space: Storage( + access: ("LOAD | STORE"), + ), + binding: Some(( + group: 0, + binding: 0, + )), + ty: 14, + init: None, + ), + ( + name: Some("baz"), + space: Uniform, + binding: Some(( + group: 0, + binding: 1, + )), + ty: 16, + init: None, + ), + ( + name: Some("qux"), + space: Storage( + access: ("LOAD | STORE"), + ), + binding: Some(( + group: 0, + binding: 2, + )), + ty: 17, + init: None, + ), + ( + name: Some("nested_mat_cx2"), + space: Uniform, + binding: Some(( + group: 0, + binding: 3, + )), + ty: 20, + init: None, + ), + ( + name: Some("val"), + space: WorkGroup, + binding: None, + ty: 1, + init: None, + ), + ], + const_expressions: [ + Literal(U32(0)), + Literal(U32(0)), + Literal(U32(0)), + Literal(U32(0)), + Compose( + ty: 2, + components: [ + 2, + 3, + 4, + ], + ), + Literal(I32(0)), + Compose( + ty: 4, + components: [ + 1, + 5, + 6, + ], + ), + ], + functions: [ + ( + name: Some("test_matrix_within_struct_accesses"), + arguments: [], + result: None, + local_variables: [ + ( + name: Some("idx"), + ty: 3, + init: None, + ), + ( + name: Some("t"), + ty: 16, + init: None, + ), + ], + expressions: [ + Literal(I32(1)), + LocalVariable(1), + Literal(I32(1)), + Load( + pointer: 2, + ), + Binary( + op: Subtract, + left: 4, + right: 3, + ), + GlobalVariable(3), + AccessIndex( + base: 6, + index: 0, + ), + Load( + pointer: 7, + ), + GlobalVariable(3), + AccessIndex( + base: 9, + index: 0, + ), + AccessIndex( + base: 10, + index: 0, + ), + Load( + pointer: 11, + ), + GlobalVariable(3), + AccessIndex( + base: 13, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 14, + index: 15, + ), + Load( + pointer: 16, + ), + GlobalVariable(3), + AccessIndex( + base: 18, + index: 0, + ), + AccessIndex( + base: 19, + index: 0, + ), + AccessIndex( + base: 20, + index: 1, + ), + Load( + pointer: 21, + ), + GlobalVariable(3), + AccessIndex( + base: 23, + index: 0, + ), + AccessIndex( + base: 24, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 25, + index: 26, + ), + Load( + pointer: 27, + ), + GlobalVariable(3), + AccessIndex( + base: 29, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 30, + index: 31, + ), + AccessIndex( + base: 32, + index: 1, + ), + Load( + pointer: 33, + ), + GlobalVariable(3), + AccessIndex( + base: 35, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 36, + index: 37, + ), + Load( + pointer: 2, + ), + Access( + base: 38, + index: 39, + ), + Load( + pointer: 40, + ), + Literal(F32(1.0)), + Splat( + size: Bi, + value: 42, + ), + Literal(F32(2.0)), + Splat( + size: Bi, + value: 44, + ), + Literal(F32(3.0)), + Splat( + size: Bi, + value: 46, + ), + Compose( + ty: 15, + components: [ + 43, + 45, + 47, + ], + ), + Compose( + ty: 16, + components: [ + 48, + ], + ), + LocalVariable(2), + Literal(I32(1)), + Load( + pointer: 2, + ), + Binary( + op: Add, + left: 52, + right: 51, + ), + AccessIndex( + base: 50, + index: 0, + ), + Literal(F32(6.0)), + Splat( + size: Bi, + value: 55, + ), + Literal(F32(5.0)), + Splat( + size: Bi, + value: 57, + ), + Literal(F32(4.0)), + Splat( + size: Bi, + value: 59, + ), + Compose( + ty: 15, + components: [ + 56, + 58, + 60, + ], + ), + AccessIndex( + base: 50, + index: 0, + ), + AccessIndex( + base: 62, + index: 0, + ), + Literal(F32(9.0)), + Splat( + size: Bi, + value: 64, + ), + AccessIndex( + base: 50, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 66, + index: 67, + ), + Literal(F32(90.0)), + Splat( + size: Bi, + value: 69, + ), + AccessIndex( + base: 50, + index: 0, + ), + AccessIndex( + base: 71, + index: 0, + ), + AccessIndex( + base: 72, + index: 1, + ), + Literal(F32(10.0)), + AccessIndex( + base: 50, + index: 0, + ), + AccessIndex( + base: 75, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 76, + index: 77, + ), + Literal(F32(20.0)), + AccessIndex( + base: 50, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 80, + index: 81, + ), + AccessIndex( + base: 82, + index: 1, + ), + Literal(F32(30.0)), + AccessIndex( + base: 50, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 85, + index: 86, + ), + Load( + pointer: 2, + ), + Access( + base: 87, + index: 88, + ), + Literal(F32(40.0)), + ], + named_expressions: { + 8: "l0", + 12: "l1", + 17: "l2", + 22: "l3", + 28: "l4", + 34: "l5", + 41: "l6", + }, + body: [ + Store( + pointer: 2, + value: 1, + ), + Emit(( + start: 3, + end: 5, + )), + Store( + pointer: 2, + value: 5, + ), + Emit(( + start: 6, + end: 8, + )), + Emit(( + start: 9, + end: 10, + )), + Emit(( + start: 10, + end: 12, + )), + Emit(( + start: 13, + end: 17, + )), + Emit(( + start: 18, + end: 19, + )), + Emit(( + start: 19, + end: 20, + )), + Emit(( + start: 20, + end: 22, + )), + Emit(( + start: 23, + end: 24, + )), + Emit(( + start: 24, + end: 28, + )), + Emit(( + start: 29, + end: 32, + )), + Emit(( + start: 32, + end: 34, + )), + Emit(( + start: 35, + end: 41, + )), + Emit(( + start: 42, + end: 43, + )), + Emit(( + start: 44, + end: 45, + )), + Emit(( + start: 46, + end: 49, + )), + Store( + pointer: 50, + value: 49, + ), + Emit(( + start: 51, + end: 53, + )), + Store( + pointer: 2, + value: 53, + ), + Emit(( + start: 53, + end: 54, + )), + Emit(( + start: 55, + end: 56, + )), + Emit(( + start: 57, + end: 58, + )), + Emit(( + start: 59, + end: 61, + )), + Store( + pointer: 54, + value: 61, + ), + Emit(( + start: 61, + end: 62, + )), + Emit(( + start: 62, + end: 63, + )), + Emit(( + start: 64, + end: 65, + )), + Store( + pointer: 63, + value: 65, + ), + Emit(( + start: 65, + end: 68, + )), + Emit(( + start: 69, + end: 70, + )), + Store( + pointer: 68, + value: 70, + ), + Emit(( + start: 70, + end: 71, + )), + Emit(( + start: 71, + end: 72, + )), + Emit(( + start: 72, + end: 73, + )), + Store( + pointer: 73, + value: 74, + ), + Emit(( + start: 74, + end: 75, + )), + Emit(( + start: 75, + end: 78, + )), + Store( + pointer: 78, + value: 79, + ), + Emit(( + start: 79, + end: 82, + )), + Emit(( + start: 82, + end: 83, + )), + Store( + pointer: 83, + value: 84, + ), + Emit(( + start: 84, + end: 89, + )), + Store( + pointer: 89, + value: 90, + ), + Return( + value: None, + ), + ], + ), + ( + name: Some("test_matrix_within_array_within_struct_accesses"), + arguments: [], + result: None, + local_variables: [ + ( + name: Some("idx"), + ty: 3, + init: None, + ), + ( + name: Some("t"), + ty: 20, + init: None, + ), + ], + expressions: [ + Literal(I32(1)), + LocalVariable(1), + Literal(I32(1)), + Load( + pointer: 2, + ), + Binary( + op: Subtract, + left: 4, + right: 3, + ), + GlobalVariable(5), + AccessIndex( + base: 6, + index: 0, + ), + Load( + pointer: 7, + ), + GlobalVariable(5), + AccessIndex( + base: 9, + index: 0, + ), + AccessIndex( + base: 10, + index: 0, + ), + Load( + pointer: 11, + ), + GlobalVariable(5), + AccessIndex( + base: 13, + index: 0, + ), + AccessIndex( + base: 14, + index: 0, + ), + AccessIndex( + base: 15, + index: 0, + ), + Load( + pointer: 16, + ), + GlobalVariable(5), + AccessIndex( + base: 18, + index: 0, + ), + AccessIndex( + base: 19, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 20, + index: 21, + ), + Load( + pointer: 22, + ), + GlobalVariable(5), + AccessIndex( + base: 24, + index: 0, + ), + AccessIndex( + base: 25, + index: 0, + ), + AccessIndex( + base: 26, + index: 0, + ), + AccessIndex( + base: 27, + index: 1, + ), + Load( + pointer: 28, + ), + GlobalVariable(5), + AccessIndex( + base: 30, + index: 0, + ), + AccessIndex( + base: 31, + index: 0, + ), + AccessIndex( + base: 32, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 33, + index: 34, + ), + Load( + pointer: 35, + ), + GlobalVariable(5), + AccessIndex( + base: 37, + index: 0, + ), + AccessIndex( + base: 38, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 39, + index: 40, + ), + AccessIndex( + base: 41, + index: 1, + ), + Load( + pointer: 42, + ), + GlobalVariable(5), + AccessIndex( + base: 44, + index: 0, + ), + AccessIndex( + base: 45, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 46, + index: 47, + ), + Load( + pointer: 2, + ), + Access( + base: 48, + index: 49, + ), + Load( + pointer: 50, + ), + ZeroValue(19), + Compose( + ty: 20, + components: [ + 52, + ], + ), + LocalVariable(2), + Literal(I32(1)), + Load( + pointer: 2, + ), + Binary( + op: Add, + left: 56, + right: 55, + ), + AccessIndex( + base: 54, + index: 0, + ), + ZeroValue(19), + AccessIndex( + base: 54, + index: 0, + ), + AccessIndex( + base: 60, + index: 0, + ), + Literal(F32(8.0)), + Splat( + size: Bi, + value: 62, + ), + Literal(F32(7.0)), + Splat( + size: Bi, + value: 64, + ), + Literal(F32(6.0)), + Splat( + size: Bi, + value: 66, + ), + Literal(F32(5.0)), + Splat( + size: Bi, + value: 68, + ), + Compose( + ty: 18, + components: [ + 63, + 65, + 67, + 69, + ], + ), + AccessIndex( + base: 54, + index: 0, + ), + AccessIndex( + base: 71, + index: 0, + ), + AccessIndex( + base: 72, + index: 0, + ), + Literal(F32(9.0)), + Splat( + size: Bi, + value: 74, + ), + AccessIndex( + base: 54, + index: 0, + ), + AccessIndex( + base: 76, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 77, + index: 78, + ), + Literal(F32(90.0)), + Splat( + size: Bi, + value: 80, + ), + AccessIndex( + base: 54, + index: 0, + ), + AccessIndex( + base: 82, + index: 0, + ), + AccessIndex( + base: 83, + index: 0, + ), + AccessIndex( + base: 84, + index: 1, + ), + Literal(F32(10.0)), + AccessIndex( + base: 54, + index: 0, + ), + AccessIndex( + base: 87, + index: 0, + ), + AccessIndex( + base: 88, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 89, + index: 90, + ), + Literal(F32(20.0)), + AccessIndex( + base: 54, + index: 0, + ), + AccessIndex( + base: 93, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 94, + index: 95, + ), + AccessIndex( + base: 96, + index: 1, + ), + Literal(F32(30.0)), + AccessIndex( + base: 54, + index: 0, + ), + AccessIndex( + base: 99, + index: 0, + ), + Load( + pointer: 2, + ), + Access( + base: 100, + index: 101, + ), + Load( + pointer: 2, + ), + Access( + base: 102, + index: 103, + ), + Literal(F32(40.0)), + ], + named_expressions: { + 8: "l0", + 12: "l1", + 17: "l2", + 23: "l3", + 29: "l4", + 36: "l5", + 43: "l6", + 51: "l7", + }, + body: [ + Store( + pointer: 2, + value: 1, + ), + Emit(( + start: 3, + end: 5, + )), + Store( + pointer: 2, + value: 5, + ), + Emit(( + start: 6, + end: 8, + )), + Emit(( + start: 9, + end: 10, + )), + Emit(( + start: 10, + end: 12, + )), + Emit(( + start: 13, + end: 14, + )), + Emit(( + start: 14, + end: 15, + )), + Emit(( + start: 15, + end: 17, + )), + Emit(( + start: 18, + end: 19, + )), + Emit(( + start: 19, + end: 23, + )), + Emit(( + start: 24, + end: 25, + )), + Emit(( + start: 25, + end: 26, + )), + Emit(( + start: 26, + end: 27, + )), + Emit(( + start: 27, + end: 29, + )), + Emit(( + start: 30, + end: 31, + )), + Emit(( + start: 31, + end: 32, + )), + Emit(( + start: 32, + end: 36, + )), + Emit(( + start: 37, + end: 38, + )), + Emit(( + start: 38, + end: 41, + )), + Emit(( + start: 41, + end: 43, + )), + Emit(( + start: 44, + end: 45, + )), + Emit(( + start: 45, + end: 51, + )), + Emit(( + start: 52, + end: 53, + )), + Store( + pointer: 54, + value: 53, + ), + Emit(( + start: 55, + end: 57, + )), + Store( + pointer: 2, + value: 57, + ), + Emit(( + start: 57, + end: 58, + )), + Store( + pointer: 58, + value: 59, + ), + Emit(( + start: 59, + end: 60, + )), + Emit(( + start: 60, + end: 61, + )), + Emit(( + start: 62, + end: 63, + )), + Emit(( + start: 64, + end: 65, + )), + Emit(( + start: 66, + end: 67, + )), + Emit(( + start: 68, + end: 70, + )), + Store( + pointer: 61, + value: 70, + ), + Emit(( + start: 70, + end: 71, + )), + Emit(( + start: 71, + end: 72, + )), + Emit(( + start: 72, + end: 73, + )), + Emit(( + start: 74, + end: 75, + )), + Store( + pointer: 73, + value: 75, + ), + Emit(( + start: 75, + end: 76, + )), + Emit(( + start: 76, + end: 79, + )), + Emit(( + start: 80, + end: 81, + )), + Store( + pointer: 79, + value: 81, + ), + Emit(( + start: 81, + end: 82, + )), + Emit(( + start: 82, + end: 83, + )), + Emit(( + start: 83, + end: 84, + )), + Emit(( + start: 84, + end: 85, + )), + Store( + pointer: 85, + value: 86, + ), + Emit(( + start: 86, + end: 87, + )), + Emit(( + start: 87, + end: 88, + )), + Emit(( + start: 88, + end: 91, + )), + Store( + pointer: 91, + value: 92, + ), + Emit(( + start: 92, + end: 93, + )), + Emit(( + start: 93, + end: 96, + )), + Emit(( + start: 96, + end: 97, + )), + Store( + pointer: 97, + value: 98, + ), + Emit(( + start: 98, + end: 99, + )), + Emit(( + start: 99, + end: 104, + )), + Store( + pointer: 104, + value: 105, + ), + Return( + value: None, + ), + ], + ), + ( + name: Some("read_from_private"), + arguments: [ + ( + name: Some("foo"), + ty: 22, + binding: None, + ), + ], + result: Some(( + ty: 21, + binding: None, + )), + local_variables: [], + expressions: [ + FunctionArgument(0), + Load( + pointer: 1, + ), + ], + named_expressions: { + 1: "foo", + }, + body: [ + Emit(( + start: 1, + end: 2, + )), + Return( + value: Some(2), + ), + ], + ), + ( + name: Some("test_arr_as_arg"), + arguments: [ + ( + name: Some("a"), + ty: 24, + binding: None, + ), + ], + result: Some(( + ty: 21, + binding: None, + )), + local_variables: [], + expressions: [ + FunctionArgument(0), + AccessIndex( + base: 1, + index: 4, + ), + AccessIndex( + base: 2, + index: 9, + ), + ], + named_expressions: { + 1: "a", + }, + body: [ + Emit(( + start: 1, + end: 2, + )), + Emit(( + start: 2, + end: 3, + )), + Return( + value: Some(3), + ), + ], + ), + ( + name: Some("assign_through_ptr_fn"), + arguments: [ + ( + name: Some("p"), + ty: 27, + binding: None, + ), + ], + result: None, + local_variables: [], + expressions: [ + FunctionArgument(0), + Literal(U32(42)), + ], + named_expressions: { + 1: "p", + }, + body: [ + Store( + pointer: 1, + value: 2, + ), + Return( + value: None, + ), + ], + ), + ( + name: Some("assign_array_through_ptr_fn"), + arguments: [ + ( + name: Some("foo"), + ty: 29, + binding: None, + ), + ], + result: None, + local_variables: [], + expressions: [ + FunctionArgument(0), + Literal(F32(1.0)), + Splat( + size: Quad, + value: 2, + ), + Literal(F32(2.0)), + Splat( + size: Quad, + value: 4, + ), + Compose( + ty: 28, + components: [ + 3, + 5, + ], + ), + ], + named_expressions: { + 1: "foo", + }, + body: [ + Emit(( + start: 2, + end: 3, + )), + Emit(( + start: 4, + end: 6, + )), + Store( + pointer: 1, + value: 6, + ), + Return( + value: None, + ), + ], + ), + ], + entry_points: [ + ( + name: "foo_vert", + stage: Vertex, + early_depth_test: None, + workgroup_size: (0, 0, 0), + function: ( + name: Some("foo_vert"), + arguments: [ + ( + name: Some("vi"), + ty: 1, + binding: Some(BuiltIn(VertexIndex)), + ), + ], + result: Some(( + ty: 25, + binding: Some(BuiltIn(Position( + invariant: false, + ))), + )), + local_variables: [ + ( + name: Some("foo"), + ty: 21, + init: None, + ), + ( + name: Some("c2"), + ty: 26, + init: None, + ), + ], + expressions: [ + FunctionArgument(0), + Literal(F32(0.0)), + LocalVariable(1), + Load( + pointer: 3, + ), + Literal(F32(1.0)), + GlobalVariable(2), + AccessIndex( + base: 6, + index: 0, + ), + Load( + pointer: 7, + ), + GlobalVariable(2), + AccessIndex( + base: 9, + index: 4, + ), + Load( + pointer: 10, + ), + Literal(U32(3)), + GlobalVariable(2), + AccessIndex( + base: 13, + index: 0, + ), + AccessIndex( + base: 14, + index: 3, + ), + AccessIndex( + base: 15, + index: 0, + ), + Load( + pointer: 16, + ), + GlobalVariable(2), + AccessIndex( + base: 18, + index: 5, + ), + GlobalVariable(2), + AccessIndex( + base: 20, + index: 5, + ), + ArrayLength(21), + Literal(U32(2)), + Binary( + op: Subtract, + left: 22, + right: 23, + ), + Access( + base: 19, + index: 24, + ), + AccessIndex( + base: 25, + index: 0, + ), + Load( + pointer: 26, + ), + GlobalVariable(4), + Load( + pointer: 28, + ), + GlobalVariable(2), + AccessIndex( + base: 30, + index: 5, + ), + AccessIndex( + base: 31, + index: 0, + ), + AccessIndex( + base: 32, + index: 0, + ), + CallResult(3), + As( + expr: 17, + kind: Sint, + convert: Some(4), + ), + Literal(I32(3)), + Literal(I32(4)), + Literal(I32(5)), + Compose( + ty: 26, + components: [ + 27, + 35, + 36, + 37, + 38, + ], + ), + LocalVariable(2), + Literal(U32(1)), + Binary( + op: Add, + left: 1, + right: 41, + ), + Access( + base: 40, + index: 42, + ), + Literal(I32(42)), + Access( + base: 40, + index: 1, + ), + Load( + pointer: 45, + ), + ZeroValue(24), + CallResult(4), + Splat( + size: Quad, + value: 46, + ), + As( + expr: 49, + kind: Float, + convert: Some(4), + ), + Binary( + op: Multiply, + left: 8, + right: 50, + ), + Literal(F32(2.0)), + Compose( + ty: 25, + components: [ + 51, + 52, + ], + ), + ], + named_expressions: { + 1: "vi", + 4: "baz", + 8: "_matrix", + 11: "arr", + 12: "index", + 17: "b", + 27: "a", + 29: "c", + 33: "data_pointer", + 34: "foo_value", + 46: "value", + }, + body: [ + Store( + pointer: 3, + value: 2, + ), + Emit(( + start: 3, + end: 4, + )), + Store( + pointer: 3, + value: 5, + ), + Call( + function: 1, + arguments: [], + result: None, + ), + Call( + function: 2, + arguments: [], + result: None, + ), + Emit(( + start: 6, + end: 8, + )), + Emit(( + start: 9, + end: 11, + )), + Emit(( + start: 13, + end: 17, + )), + Emit(( + start: 18, + end: 19, + )), + Emit(( + start: 20, + end: 22, + )), + Emit(( + start: 23, + end: 27, + )), + Emit(( + start: 28, + end: 29, + )), + Emit(( + start: 30, + end: 31, + )), + Emit(( + start: 31, + end: 33, + )), + Call( + function: 3, + arguments: [ + 3, + ], + result: Some(34), + ), + Emit(( + start: 34, + end: 35, + )), + Emit(( + start: 38, + end: 39, + )), + Store( + pointer: 40, + value: 39, + ), + Emit(( + start: 41, + end: 43, + )), + Store( + pointer: 43, + value: 44, + ), + Emit(( + start: 44, + end: 46, + )), + Call( + function: 4, + arguments: [ + 47, + ], + result: Some(48), + ), + Emit(( + start: 48, + end: 51, + )), + Emit(( + start: 52, + end: 53, + )), + Return( + value: Some(53), + ), + ], + ), + ), + ( + name: "foo_frag", + stage: Fragment, + early_depth_test: None, + workgroup_size: (0, 0, 0), + function: ( + name: Some("foo_frag"), + arguments: [], + result: Some(( + ty: 25, + binding: Some(Location( + location: 0, + second_blend_source: false, + interpolation: Some(Perspective), + sampling: Some(Center), + )), + )), + local_variables: [], + expressions: [ + GlobalVariable(2), + AccessIndex( + base: 1, + index: 0, + ), + AccessIndex( + base: 2, + index: 1, + ), + AccessIndex( + base: 3, + index: 2, + ), + Literal(F32(1.0)), + GlobalVariable(2), + AccessIndex( + base: 6, + index: 0, + ), + Literal(F32(0.0)), + Splat( + size: Tri, + value: 8, + ), + Literal(F32(1.0)), + Splat( + size: Tri, + value: 10, + ), + Literal(F32(2.0)), + Splat( + size: Tri, + value: 12, + ), + Literal(F32(3.0)), + Splat( + size: Tri, + value: 14, + ), + Compose( + ty: 6, + components: [ + 9, + 11, + 13, + 15, + ], + ), + GlobalVariable(2), + AccessIndex( + base: 17, + index: 4, + ), + Literal(U32(0)), + Splat( + size: Bi, + value: 19, + ), + Literal(U32(1)), + Splat( + size: Bi, + value: 21, + ), + Compose( + ty: 12, + components: [ + 20, + 22, + ], + ), + GlobalVariable(2), + AccessIndex( + base: 24, + index: 5, + ), + AccessIndex( + base: 25, + index: 1, + ), + AccessIndex( + base: 26, + index: 0, + ), + Literal(I32(1)), + GlobalVariable(4), + ZeroValue(17), + Literal(F32(0.0)), + Splat( + size: Quad, + value: 31, + ), + ], + named_expressions: {}, + body: [ + Emit(( + start: 1, + end: 2, + )), + Emit(( + start: 2, + end: 4, + )), + Store( + pointer: 4, + value: 5, + ), + Emit(( + start: 6, + end: 7, + )), + Emit(( + start: 8, + end: 9, + )), + Emit(( + start: 10, + end: 11, + )), + Emit(( + start: 12, + end: 13, + )), + Emit(( + start: 14, + end: 16, + )), + Store( + pointer: 7, + value: 16, + ), + Emit(( + start: 17, + end: 18, + )), + Emit(( + start: 19, + end: 20, + )), + Emit(( + start: 21, + end: 23, + )), + Store( + pointer: 18, + value: 23, + ), + Emit(( + start: 24, + end: 25, + )), + Emit(( + start: 25, + end: 27, + )), + Store( + pointer: 27, + value: 28, + ), + Store( + pointer: 29, + value: 30, + ), + Emit(( + start: 31, + end: 32, + )), + Return( + value: Some(32), + ), + ], + ), + ), + ( + name: "assign_through_ptr", + stage: Compute, + early_depth_test: None, + workgroup_size: (1, 1, 1), + function: ( + name: Some("assign_through_ptr"), + arguments: [], + result: None, + local_variables: [ + ( + name: Some("arr"), + ty: 28, + init: None, + ), + ], + expressions: [ + Literal(F32(6.0)), + Splat( + size: Quad, + value: 1, + ), + Literal(F32(7.0)), + Splat( + size: Quad, + value: 3, + ), + Compose( + ty: 28, + components: [ + 2, + 4, + ], + ), + LocalVariable(1), + GlobalVariable(6), + ], + named_expressions: {}, + body: [ + Emit(( + start: 1, + end: 2, + )), + Emit(( + start: 3, + end: 5, + )), + Store( + pointer: 6, + value: 5, + ), + Call( + function: 5, + arguments: [ + 7, + ], + result: None, + ), + Call( + function: 6, + arguments: [ + 6, + ], + result: None, + ), + Return( + value: None, + ), + ], + ), + ), + ], +) \ No newline at end of file diff --git a/tests/out/ir/collatz.compact.ron b/tests/out/ir/collatz.compact.ron new file mode 100644 index 0000000000..fb8ff825e1 --- /dev/null +++ b/tests/out/ir/collatz.compact.ron @@ -0,0 +1,334 @@ +( + types: [ + ( + name: None, + inner: Scalar( + kind: Uint, + width: 4, + ), + ), + ( + name: None, + inner: Array( + base: 1, + size: Dynamic, + stride: 4, + ), + ), + ( + name: Some("PrimeIndices"), + inner: Struct( + members: [ + ( + name: Some("data"), + ty: 2, + binding: None, + offset: 0, + ), + ], + span: 4, + ), + ), + ( + name: None, + inner: Vector( + size: Tri, + kind: Uint, + width: 4, + ), + ), + ], + special_types: ( + ray_desc: None, + ray_intersection: None, + predeclared_types: {}, + ), + constants: [], + global_variables: [ + ( + name: Some("v_indices"), + space: Storage( + access: ("LOAD | STORE"), + ), + binding: Some(( + group: 0, + binding: 0, + )), + ty: 3, + init: None, + ), + ], + const_expressions: [], + functions: [ + ( + name: Some("collatz_iterations"), + arguments: [ + ( + name: Some("n_base"), + ty: 1, + binding: None, + ), + ], + result: Some(( + ty: 1, + binding: None, + )), + local_variables: [ + ( + name: Some("n"), + ty: 1, + init: None, + ), + ( + name: Some("i"), + ty: 1, + init: None, + ), + ], + expressions: [ + FunctionArgument(0), + LocalVariable(1), + Literal(U32(0)), + LocalVariable(2), + Load( + pointer: 2, + ), + Literal(U32(1)), + Binary( + op: Greater, + left: 5, + right: 6, + ), + Load( + pointer: 2, + ), + Literal(U32(2)), + Binary( + op: Modulo, + left: 8, + right: 9, + ), + Literal(U32(0)), + Binary( + op: Equal, + left: 10, + right: 11, + ), + Load( + pointer: 2, + ), + Literal(U32(2)), + Binary( + op: Divide, + left: 13, + right: 14, + ), + Literal(U32(3)), + Load( + pointer: 2, + ), + Binary( + op: Multiply, + left: 16, + right: 17, + ), + Literal(U32(1)), + Binary( + op: Add, + left: 18, + right: 19, + ), + Load( + pointer: 4, + ), + Literal(U32(1)), + Binary( + op: Add, + left: 21, + right: 22, + ), + Load( + pointer: 4, + ), + ], + named_expressions: { + 1: "n_base", + }, + body: [ + Store( + pointer: 2, + value: 1, + ), + Store( + pointer: 4, + value: 3, + ), + Loop( + body: [ + Emit(( + start: 4, + end: 5, + )), + Emit(( + start: 6, + end: 7, + )), + If( + condition: 7, + accept: [], + reject: [ + Break, + ], + ), + Block([ + Emit(( + start: 7, + end: 8, + )), + Emit(( + start: 9, + end: 10, + )), + Emit(( + start: 11, + end: 12, + )), + If( + condition: 12, + accept: [ + Emit(( + start: 12, + end: 13, + )), + Emit(( + start: 14, + end: 15, + )), + Store( + pointer: 2, + value: 15, + ), + ], + reject: [ + Emit(( + start: 16, + end: 18, + )), + Emit(( + start: 19, + end: 20, + )), + Store( + pointer: 2, + value: 20, + ), + ], + ), + Emit(( + start: 20, + end: 21, + )), + Emit(( + start: 22, + end: 23, + )), + Store( + pointer: 4, + value: 23, + ), + ]), + ], + continuing: [], + break_if: None, + ), + Emit(( + start: 23, + end: 24, + )), + Return( + value: Some(24), + ), + ], + ), + ], + entry_points: [ + ( + name: "main", + stage: Compute, + early_depth_test: None, + workgroup_size: (1, 1, 1), + function: ( + name: Some("main"), + arguments: [ + ( + name: Some("global_id"), + ty: 4, + binding: Some(BuiltIn(GlobalInvocationId)), + ), + ], + result: None, + local_variables: [], + expressions: [ + FunctionArgument(0), + GlobalVariable(1), + AccessIndex( + base: 2, + index: 0, + ), + AccessIndex( + base: 1, + index: 0, + ), + Access( + base: 3, + index: 4, + ), + GlobalVariable(1), + AccessIndex( + base: 6, + index: 0, + ), + AccessIndex( + base: 1, + index: 0, + ), + Access( + base: 7, + index: 8, + ), + Load( + pointer: 9, + ), + CallResult(1), + ], + named_expressions: { + 1: "global_id", + }, + body: [ + Emit(( + start: 2, + end: 5, + )), + Emit(( + start: 6, + end: 10, + )), + Call( + function: 1, + arguments: [ + 10, + ], + result: Some(11), + ), + Store( + pointer: 5, + value: 11, + ), + Return( + value: None, + ), + ], + ), + ), + ], +) \ No newline at end of file diff --git a/tests/out/ir/shadow.compact.ron b/tests/out/ir/shadow.compact.ron new file mode 100644 index 0000000000..313938997f --- /dev/null +++ b/tests/out/ir/shadow.compact.ron @@ -0,0 +1,1036 @@ +( + types: [ + ( + name: None, + inner: Scalar( + kind: Float, + width: 4, + ), + ), + ( + name: None, + inner: Vector( + size: Tri, + kind: Float, + width: 4, + ), + ), + ( + name: None, + inner: Scalar( + kind: Uint, + width: 4, + ), + ), + ( + name: None, + inner: Vector( + size: Quad, + kind: Float, + width: 4, + ), + ), + ( + name: None, + inner: Vector( + size: Bi, + kind: Float, + width: 4, + ), + ), + ( + name: None, + inner: Image( + dim: D2, + arrayed: true, + class: Depth( + multi: false, + ), + ), + ), + ( + name: None, + inner: Scalar( + kind: Sint, + width: 4, + ), + ), + ( + name: None, + inner: Vector( + size: Quad, + kind: Uint, + width: 4, + ), + ), + ( + name: Some("Globals"), + inner: Struct( + members: [ + ( + name: Some("num_lights"), + ty: 8, + binding: None, + offset: 0, + ), + ], + span: 16, + ), + ), + ( + name: None, + inner: Matrix( + columns: Quad, + rows: Quad, + width: 4, + ), + ), + ( + name: Some("Light"), + inner: Struct( + members: [ + ( + name: Some("proj"), + ty: 10, + binding: None, + offset: 0, + ), + ( + name: Some("pos"), + ty: 4, + binding: None, + offset: 64, + ), + ( + name: Some("color"), + ty: 4, + binding: None, + offset: 80, + ), + ], + span: 96, + ), + ), + ( + name: None, + inner: Array( + base: 11, + size: Dynamic, + stride: 96, + ), + ), + ( + name: Some("Lights"), + inner: Struct( + members: [ + ( + name: Some("data"), + ty: 12, + binding: None, + offset: 0, + ), + ], + span: 96, + ), + ), + ( + name: None, + inner: Sampler( + comparison: true, + ), + ), + ], + special_types: ( + ray_desc: None, + ray_intersection: None, + predeclared_types: {}, + ), + constants: [ + ( + name: None, + override: None, + ty: 1, + init: 1, + ), + ( + name: None, + override: None, + ty: 1, + init: 2, + ), + ( + name: None, + override: None, + ty: 1, + init: 3, + ), + ( + name: None, + override: None, + ty: 1, + init: 4, + ), + ( + name: None, + override: None, + ty: 1, + init: 5, + ), + ( + name: None, + override: None, + ty: 2, + init: 9, + ), + ( + name: None, + override: None, + ty: 3, + init: 10, + ), + ( + name: None, + override: None, + ty: 3, + init: 11, + ), + ( + name: None, + override: None, + ty: 3, + init: 12, + ), + ( + name: None, + override: None, + ty: 7, + init: 13, + ), + ( + name: None, + override: None, + ty: 7, + init: 14, + ), + ( + name: None, + override: None, + ty: 7, + init: 15, + ), + ( + name: None, + override: None, + ty: 7, + init: 16, + ), + ( + name: None, + override: None, + ty: 7, + init: 17, + ), + ( + name: None, + override: None, + ty: 7, + init: 18, + ), + ( + name: None, + override: None, + ty: 7, + init: 19, + ), + ( + name: None, + override: None, + ty: 7, + init: 20, + ), + ( + name: None, + override: None, + ty: 7, + init: 21, + ), + ( + name: None, + override: None, + ty: 7, + init: 22, + ), + ], + global_variables: [ + ( + name: Some("t_shadow"), + space: Handle, + binding: Some(( + group: 0, + binding: 2, + )), + ty: 6, + init: None, + ), + ( + name: Some("sampler_shadow"), + space: Handle, + binding: Some(( + group: 0, + binding: 3, + )), + ty: 14, + init: None, + ), + ( + name: Some("u_globals"), + space: Uniform, + binding: Some(( + group: 0, + binding: 0, + )), + ty: 9, + init: None, + ), + ( + name: Some("s_lights"), + space: Storage( + access: ("LOAD"), + ), + binding: Some(( + group: 0, + binding: 1, + )), + ty: 13, + init: None, + ), + ( + name: Some("in_position_fs"), + space: Private, + binding: None, + ty: 4, + init: None, + ), + ( + name: Some("in_normal_fs"), + space: Private, + binding: None, + ty: 2, + init: None, + ), + ( + name: Some("out_color_fs"), + space: Private, + binding: None, + ty: 4, + init: None, + ), + ], + const_expressions: [ + Literal(F32(0.0)), + Literal(F32(1.0)), + Literal(F32(0.5)), + Literal(F32(-0.5)), + Literal(F32(0.05)), + Constant(5), + Constant(5), + Constant(5), + Compose( + ty: 2, + components: [ + 6, + 7, + 8, + ], + ), + Literal(U32(10)), + Literal(U32(0)), + Literal(U32(1)), + Literal(I32(0)), + Literal(I32(0)), + Literal(I32(1)), + Literal(I32(2)), + Literal(I32(0)), + Literal(I32(1)), + Literal(I32(2)), + Literal(I32(0)), + Literal(I32(1)), + Literal(I32(2)), + Constant(6), + Constant(8), + ], + functions: [ + ( + name: None, + arguments: [ + ( + name: None, + ty: 3, + binding: None, + ), + ( + name: None, + ty: 4, + binding: None, + ), + ], + result: Some(( + ty: 1, + binding: None, + )), + local_variables: [], + expressions: [ + GlobalVariable(1), + GlobalVariable(2), + Constant(3), + Constant(4), + Constant(2), + Constant(1), + FunctionArgument(0), + FunctionArgument(1), + AccessIndex( + base: 8, + index: 3, + ), + Binary( + op: LessEqual, + left: 9, + right: 6, + ), + AccessIndex( + base: 8, + index: 0, + ), + AccessIndex( + base: 8, + index: 1, + ), + Compose( + ty: 5, + components: [ + 11, + 12, + ], + ), + Compose( + ty: 5, + components: [ + 3, + 4, + ], + ), + Binary( + op: Multiply, + left: 13, + right: 14, + ), + AccessIndex( + base: 8, + index: 3, + ), + Binary( + op: Divide, + left: 5, + right: 16, + ), + Binary( + op: Multiply, + left: 15, + right: 17, + ), + Splat( + size: Bi, + value: 3, + ), + Binary( + op: Add, + left: 18, + right: 19, + ), + AccessIndex( + base: 20, + index: 0, + ), + AccessIndex( + base: 20, + index: 1, + ), + As( + expr: 7, + kind: Sint, + convert: None, + ), + As( + expr: 23, + kind: Float, + convert: Some(4), + ), + Compose( + ty: 2, + components: [ + 21, + 22, + 24, + ], + ), + AccessIndex( + base: 8, + index: 2, + ), + AccessIndex( + base: 8, + index: 3, + ), + Binary( + op: Divide, + left: 5, + right: 27, + ), + Binary( + op: Multiply, + left: 26, + right: 28, + ), + AccessIndex( + base: 25, + index: 0, + ), + AccessIndex( + base: 25, + index: 1, + ), + Compose( + ty: 5, + components: [ + 30, + 31, + ], + ), + AccessIndex( + base: 25, + index: 2, + ), + As( + expr: 33, + kind: Sint, + convert: Some(4), + ), + ImageSample( + image: 1, + sampler: 2, + gather: None, + coordinate: 32, + array_index: Some(34), + offset: None, + level: Zero, + depth_ref: Some(29), + ), + ], + named_expressions: {}, + body: [ + Emit(( + start: 8, + end: 10, + )), + If( + condition: 10, + accept: [ + Return( + value: Some(5), + ), + ], + reject: [], + ), + Emit(( + start: 10, + end: 35, + )), + Return( + value: Some(35), + ), + ], + ), + ( + name: Some("fs_main"), + arguments: [], + result: None, + local_variables: [ + ( + name: Some("color"), + ty: 2, + init: Some(23), + ), + ( + name: Some("i"), + ty: 3, + init: Some(24), + ), + ], + expressions: [ + GlobalVariable(3), + GlobalVariable(6), + GlobalVariable(5), + GlobalVariable(4), + GlobalVariable(7), + Constant(17), + Constant(15), + Constant(13), + Constant(18), + Constant(16), + Constant(19), + Constant(9), + Constant(7), + Constant(2), + Constant(11), + Constant(14), + Constant(10), + Constant(12), + Constant(1), + LocalVariable(1), + LocalVariable(2), + Load( + pointer: 21, + ), + AccessIndex( + base: 1, + index: 0, + ), + Access( + base: 23, + index: 17, + ), + Load( + pointer: 24, + ), + Math( + fun: Min, + arg: 25, + arg1: Some(13), + arg2: None, + arg3: None, + ), + Binary( + op: GreaterEqual, + left: 22, + right: 26, + ), + Load( + pointer: 20, + ), + Load( + pointer: 21, + ), + AccessIndex( + base: 4, + index: 0, + ), + Load( + pointer: 21, + ), + Access( + base: 30, + index: 31, + ), + AccessIndex( + base: 32, + index: 0, + ), + Load( + pointer: 33, + ), + Load( + pointer: 3, + ), + Binary( + op: Multiply, + left: 34, + right: 35, + ), + CallResult(1), + Load( + pointer: 2, + ), + Math( + fun: Normalize, + arg: 38, + arg1: None, + arg2: None, + arg3: None, + ), + AccessIndex( + base: 4, + index: 0, + ), + Load( + pointer: 21, + ), + Access( + base: 40, + index: 41, + ), + AccessIndex( + base: 42, + index: 1, + ), + Access( + base: 43, + index: 15, + ), + Load( + pointer: 44, + ), + AccessIndex( + base: 4, + index: 0, + ), + Load( + pointer: 21, + ), + Access( + base: 46, + index: 47, + ), + AccessIndex( + base: 48, + index: 1, + ), + Access( + base: 49, + index: 18, + ), + Load( + pointer: 50, + ), + AccessIndex( + base: 4, + index: 0, + ), + Load( + pointer: 21, + ), + Access( + base: 52, + index: 53, + ), + AccessIndex( + base: 54, + index: 1, + ), + Access( + base: 55, + index: 8, + ), + Load( + pointer: 56, + ), + Compose( + ty: 2, + components: [ + 45, + 51, + 57, + ], + ), + Access( + base: 3, + index: 16, + ), + Load( + pointer: 59, + ), + Access( + base: 3, + index: 7, + ), + Load( + pointer: 61, + ), + Access( + base: 3, + index: 10, + ), + Load( + pointer: 63, + ), + Compose( + ty: 2, + components: [ + 60, + 62, + 64, + ], + ), + Binary( + op: Subtract, + left: 58, + right: 65, + ), + Math( + fun: Normalize, + arg: 66, + arg1: None, + arg2: None, + arg3: None, + ), + Math( + fun: Dot, + arg: 39, + arg1: Some(67), + arg2: None, + arg3: None, + ), + Math( + fun: Max, + arg: 19, + arg1: Some(68), + arg2: None, + arg3: None, + ), + Binary( + op: Multiply, + left: 37, + right: 69, + ), + AccessIndex( + base: 4, + index: 0, + ), + Load( + pointer: 21, + ), + Access( + base: 71, + index: 72, + ), + AccessIndex( + base: 73, + index: 2, + ), + Access( + base: 74, + index: 6, + ), + Load( + pointer: 75, + ), + AccessIndex( + base: 4, + index: 0, + ), + Load( + pointer: 21, + ), + Access( + base: 77, + index: 78, + ), + AccessIndex( + base: 79, + index: 2, + ), + Access( + base: 80, + index: 9, + ), + Load( + pointer: 81, + ), + AccessIndex( + base: 4, + index: 0, + ), + Load( + pointer: 21, + ), + Access( + base: 83, + index: 84, + ), + AccessIndex( + base: 85, + index: 2, + ), + Access( + base: 86, + index: 11, + ), + Load( + pointer: 87, + ), + Compose( + ty: 2, + components: [ + 76, + 82, + 88, + ], + ), + Binary( + op: Multiply, + left: 89, + right: 70, + ), + Binary( + op: Add, + left: 28, + right: 90, + ), + Load( + pointer: 21, + ), + Binary( + op: Add, + left: 92, + right: 12, + ), + Load( + pointer: 20, + ), + Compose( + ty: 4, + components: [ + 94, + 14, + ], + ), + ], + named_expressions: {}, + body: [ + Loop( + body: [ + Emit(( + start: 21, + end: 27, + )), + If( + condition: 27, + accept: [ + Break, + ], + reject: [], + ), + Emit(( + start: 27, + end: 36, + )), + Call( + function: 1, + arguments: [ + 29, + 36, + ], + result: Some(37), + ), + Emit(( + start: 37, + end: 91, + )), + Store( + pointer: 20, + value: 91, + ), + Continue, + ], + continuing: [ + Emit(( + start: 91, + end: 93, + )), + Store( + pointer: 21, + value: 93, + ), + ], + break_if: None, + ), + Emit(( + start: 93, + end: 95, + )), + Store( + pointer: 5, + value: 95, + ), + Return( + value: None, + ), + ], + ), + ], + entry_points: [ + ( + name: "fs_main", + stage: Fragment, + early_depth_test: None, + workgroup_size: (0, 0, 0), + function: ( + name: Some("fs_main_wrap"), + arguments: [ + ( + name: Some("in_normal_fs"), + ty: 2, + binding: Some(Location( + location: 0, + second_blend_source: false, + interpolation: Some(Perspective), + sampling: Some(Center), + )), + ), + ( + name: Some("in_position_fs"), + ty: 4, + binding: Some(Location( + location: 1, + second_blend_source: false, + interpolation: Some(Perspective), + sampling: Some(Center), + )), + ), + ], + result: Some(( + ty: 4, + binding: Some(Location( + location: 0, + second_blend_source: false, + interpolation: None, + sampling: None, + )), + )), + local_variables: [], + expressions: [ + FunctionArgument(0), + GlobalVariable(6), + FunctionArgument(1), + GlobalVariable(5), + GlobalVariable(7), + Load( + pointer: 5, + ), + ], + named_expressions: {}, + body: [ + Store( + pointer: 2, + value: 1, + ), + Store( + pointer: 4, + value: 3, + ), + Call( + function: 2, + arguments: [], + result: None, + ), + Emit(( + start: 5, + end: 6, + )), + Return( + value: Some(6), + ), + ], + ), + ), + ], +) \ No newline at end of file diff --git a/tests/out/msl/access.msl b/tests/out/msl/access.msl index e5d875dd19..c35139a8cf 100644 --- a/tests/out/msl/access.msl +++ b/tests/out/msl/access.msl @@ -39,22 +39,22 @@ struct Bar { struct Baz { metal::float3x2 m; }; -struct type_15 { +struct type_14 { metal::float4x2 inner[2]; }; struct MatCx2InArray { - type_15 am; + type_14 am; }; -struct type_18 { +struct type_17 { float inner[10]; }; -struct type_19 { - type_18 inner[5]; +struct type_18 { + type_17 inner[5]; }; -struct type_22 { +struct type_20 { int inner[5]; }; -struct type_26 { +struct type_22 { metal::float4 inner[2]; }; @@ -68,31 +68,31 @@ void test_matrix_within_struct_accesses( idx = _e3 - 1; metal::float3x2 l0_ = baz.m; metal::float2 l1_ = baz.m[0]; - int _e15 = idx; - metal::float2 l2_ = baz.m[_e15]; + int _e14 = idx; + metal::float2 l2_ = baz.m[_e14]; float l3_ = baz.m[0].y; - int _e29 = idx; - float l4_ = baz.m[0][_e29]; - int _e34 = idx; - float l5_ = baz.m[_e34].y; - int _e41 = idx; - int _e43 = idx; - float l6_ = baz.m[_e41][_e43]; + int _e25 = idx; + float l4_ = baz.m[0][_e25]; + int _e30 = idx; + float l5_ = baz.m[_e30].y; + int _e36 = idx; + int _e38 = idx; + float l6_ = baz.m[_e36][_e38]; t = Baz {metal::float3x2(metal::float2(1.0), metal::float2(2.0), metal::float2(3.0))}; - int _e56 = idx; - idx = _e56 + 1; + int _e51 = idx; + idx = _e51 + 1; t.m = metal::float3x2(metal::float2(6.0), metal::float2(5.0), metal::float2(4.0)); t.m[0] = metal::float2(9.0); - int _e72 = idx; - t.m[_e72] = metal::float2(90.0); + int _e66 = idx; + t.m[_e66] = metal::float2(90.0); t.m[0].y = 10.0; + int _e76 = idx; + t.m[0][_e76] = 20.0; + int _e80 = idx; + t.m[_e80].y = 30.0; int _e85 = idx; - t.m[0][_e85] = 20.0; - int _e89 = idx; - t.m[_e89].y = 30.0; - int _e95 = idx; - int _e97 = idx; - t.m[_e95][_e97] = 40.0; + int _e87 = idx; + t.m[_e85][_e87] = 40.0; return; } @@ -104,35 +104,35 @@ void test_matrix_within_array_within_struct_accesses( idx_1 = 1; int _e3 = idx_1; idx_1 = _e3 - 1; - type_15 l0_1 = nested_mat_cx2_.am; + type_14 l0_1 = nested_mat_cx2_.am; metal::float4x2 l1_1 = nested_mat_cx2_.am.inner[0]; metal::float2 l2_1 = nested_mat_cx2_.am.inner[0][0]; - int _e24 = idx_1; - metal::float2 l3_1 = nested_mat_cx2_.am.inner[0][_e24]; + int _e20 = idx_1; + metal::float2 l3_1 = nested_mat_cx2_.am.inner[0][_e20]; float l4_1 = nested_mat_cx2_.am.inner[0][0].y; - int _e42 = idx_1; - float l5_1 = nested_mat_cx2_.am.inner[0][0][_e42]; - int _e49 = idx_1; - float l6_1 = nested_mat_cx2_.am.inner[0][_e49].y; - int _e58 = idx_1; - int _e60 = idx_1; - float l7_ = nested_mat_cx2_.am.inner[0][_e58][_e60]; - t_1 = MatCx2InArray {type_15 {}}; - int _e67 = idx_1; - idx_1 = _e67 + 1; - t_1.am = type_15 {}; + int _e33 = idx_1; + float l5_1 = nested_mat_cx2_.am.inner[0][0][_e33]; + int _e39 = idx_1; + float l6_1 = nested_mat_cx2_.am.inner[0][_e39].y; + int _e46 = idx_1; + int _e48 = idx_1; + float l7_ = nested_mat_cx2_.am.inner[0][_e46][_e48]; + t_1 = MatCx2InArray {type_14 {}}; + int _e55 = idx_1; + idx_1 = _e55 + 1; + t_1.am = type_14 {}; t_1.am.inner[0] = metal::float4x2(metal::float2(8.0), metal::float2(7.0), metal::float2(6.0), metal::float2(5.0)); t_1.am.inner[0][0] = metal::float2(9.0); - int _e93 = idx_1; - t_1.am.inner[0][_e93] = metal::float2(90.0); + int _e77 = idx_1; + t_1.am.inner[0][_e77] = metal::float2(90.0); t_1.am.inner[0][0].y = 10.0; - int _e110 = idx_1; - t_1.am.inner[0][0][_e110] = 20.0; - int _e116 = idx_1; - t_1.am.inner[0][_e116].y = 30.0; - int _e124 = idx_1; - int _e126 = idx_1; - t_1.am.inner[0][_e124][_e126] = 40.0; + int _e89 = idx_1; + t_1.am.inner[0][0][_e89] = 20.0; + int _e94 = idx_1; + t_1.am.inner[0][_e94].y = 30.0; + int _e100 = idx_1; + int _e102 = idx_1; + t_1.am.inner[0][_e100][_e102] = 40.0; return; } @@ -144,7 +144,7 @@ float read_from_private( } float test_arr_as_arg( - type_19 a + type_18 a ) { return a.inner[4].inner[9]; } @@ -157,9 +157,9 @@ void assign_through_ptr_fn( } void assign_array_through_ptr_fn( - thread type_26& foo_2 + thread type_22& foo_2 ) { - foo_2 = type_26 {metal::float4(1.0), metal::float4(2.0)}; + foo_2 = type_22 {metal::float4(1.0), metal::float4(2.0)}; return; } @@ -177,7 +177,7 @@ vertex foo_vertOutput foo_vert( , constant _mslBufferSizes& _buffer_sizes [[buffer(24)]] ) { float foo = {}; - type_22 c2_ = {}; + type_20 c2_ = {}; foo = 0.0; float baz_1 = foo; foo = 1.0; @@ -188,11 +188,11 @@ vertex foo_vertOutput foo_vert( float b = bar._matrix[3].x; int a_1 = bar.data[(1 + (_buffer_sizes.size1 - 160 - 8) / 8) - 2u].value; metal::int2 c = qux; - float _e34 = read_from_private(foo); - c2_ = type_22 {a_1, static_cast(b), 3, 4, 5}; + float _e33 = read_from_private(foo); + c2_ = type_20 {a_1, static_cast(b), 3, 4, 5}; c2_.inner[vi + 1u] = 42; int value = c2_.inner[vi]; - float _e48 = test_arr_as_arg(type_19 {}); + float _e47 = test_arr_as_arg(type_18 {}); return foo_vertOutput { metal::float4(_matrix * static_cast(metal::int4(value)), 2.0) }; } @@ -222,8 +222,8 @@ kernel void assign_through_ptr( val = {}; } metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup); - type_26 arr = {}; - arr = type_26 {metal::float4(6.0), metal::float4(7.0)}; + type_22 arr = {}; + arr = type_22 {metal::float4(6.0), metal::float4(7.0)}; assign_through_ptr_fn(val); assign_array_through_ptr_fn(arr); return; diff --git a/tests/out/msl/atomicOps.msl b/tests/out/msl/atomicOps.msl index b7264e883d..3a34cc3072 100644 --- a/tests/out/msl/atomicOps.msl +++ b/tests/out/msl/atomicOps.msl @@ -52,75 +52,75 @@ kernel void cs_main( uint l6_ = metal::atomic_load_explicit(&workgroup_struct.atomic_scalar, metal::memory_order_relaxed); int l7_ = metal::atomic_load_explicit(&workgroup_struct.atomic_arr.inner[1], metal::memory_order_relaxed); metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup); - uint _e59 = metal::atomic_fetch_add_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e64 = metal::atomic_fetch_add_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e68 = metal::atomic_fetch_add_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e74 = metal::atomic_fetch_add_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e77 = metal::atomic_fetch_add_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e82 = metal::atomic_fetch_add_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e86 = metal::atomic_fetch_add_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e92 = metal::atomic_fetch_add_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e51 = metal::atomic_fetch_add_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e55 = metal::atomic_fetch_add_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e59 = metal::atomic_fetch_add_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e64 = metal::atomic_fetch_add_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e67 = metal::atomic_fetch_add_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e71 = metal::atomic_fetch_add_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e75 = metal::atomic_fetch_add_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e80 = metal::atomic_fetch_add_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup); - uint _e95 = metal::atomic_fetch_sub_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e100 = metal::atomic_fetch_sub_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e104 = metal::atomic_fetch_sub_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e110 = metal::atomic_fetch_sub_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e113 = metal::atomic_fetch_sub_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e118 = metal::atomic_fetch_sub_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e122 = metal::atomic_fetch_sub_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e128 = metal::atomic_fetch_sub_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e83 = metal::atomic_fetch_sub_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e87 = metal::atomic_fetch_sub_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e91 = metal::atomic_fetch_sub_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e96 = metal::atomic_fetch_sub_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e99 = metal::atomic_fetch_sub_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e103 = metal::atomic_fetch_sub_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e107 = metal::atomic_fetch_sub_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e112 = metal::atomic_fetch_sub_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup); - uint _e131 = metal::atomic_fetch_max_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e136 = metal::atomic_fetch_max_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e140 = metal::atomic_fetch_max_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e146 = metal::atomic_fetch_max_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e149 = metal::atomic_fetch_max_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e154 = metal::atomic_fetch_max_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e158 = metal::atomic_fetch_max_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e164 = metal::atomic_fetch_max_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e115 = metal::atomic_fetch_max_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e119 = metal::atomic_fetch_max_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e123 = metal::atomic_fetch_max_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e128 = metal::atomic_fetch_max_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e131 = metal::atomic_fetch_max_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e135 = metal::atomic_fetch_max_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e139 = metal::atomic_fetch_max_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e144 = metal::atomic_fetch_max_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup); - uint _e167 = metal::atomic_fetch_min_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e172 = metal::atomic_fetch_min_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e176 = metal::atomic_fetch_min_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e182 = metal::atomic_fetch_min_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e185 = metal::atomic_fetch_min_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e190 = metal::atomic_fetch_min_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e194 = metal::atomic_fetch_min_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e200 = metal::atomic_fetch_min_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e147 = metal::atomic_fetch_min_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e151 = metal::atomic_fetch_min_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e155 = metal::atomic_fetch_min_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e160 = metal::atomic_fetch_min_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e163 = metal::atomic_fetch_min_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e167 = metal::atomic_fetch_min_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e171 = metal::atomic_fetch_min_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e176 = metal::atomic_fetch_min_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup); - uint _e203 = metal::atomic_fetch_and_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e208 = metal::atomic_fetch_and_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e212 = metal::atomic_fetch_and_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e218 = metal::atomic_fetch_and_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e221 = metal::atomic_fetch_and_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e226 = metal::atomic_fetch_and_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e230 = metal::atomic_fetch_and_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e236 = metal::atomic_fetch_and_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e179 = metal::atomic_fetch_and_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e183 = metal::atomic_fetch_and_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e187 = metal::atomic_fetch_and_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e192 = metal::atomic_fetch_and_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e195 = metal::atomic_fetch_and_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e199 = metal::atomic_fetch_and_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e203 = metal::atomic_fetch_and_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e208 = metal::atomic_fetch_and_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup); - uint _e239 = metal::atomic_fetch_or_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e244 = metal::atomic_fetch_or_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e248 = metal::atomic_fetch_or_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e254 = metal::atomic_fetch_or_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e257 = metal::atomic_fetch_or_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e262 = metal::atomic_fetch_or_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e266 = metal::atomic_fetch_or_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e272 = metal::atomic_fetch_or_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e211 = metal::atomic_fetch_or_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e215 = metal::atomic_fetch_or_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e219 = metal::atomic_fetch_or_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e224 = metal::atomic_fetch_or_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e227 = metal::atomic_fetch_or_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e231 = metal::atomic_fetch_or_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e235 = metal::atomic_fetch_or_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e240 = metal::atomic_fetch_or_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup); - uint _e275 = metal::atomic_fetch_xor_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e280 = metal::atomic_fetch_xor_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e284 = metal::atomic_fetch_xor_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e290 = metal::atomic_fetch_xor_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e293 = metal::atomic_fetch_xor_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e298 = metal::atomic_fetch_xor_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e302 = metal::atomic_fetch_xor_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e308 = metal::atomic_fetch_xor_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e311 = metal::atomic_exchange_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e316 = metal::atomic_exchange_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e320 = metal::atomic_exchange_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e326 = metal::atomic_exchange_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e329 = metal::atomic_exchange_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); - int _e334 = metal::atomic_exchange_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); - uint _e338 = metal::atomic_exchange_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); - int _e344 = metal::atomic_exchange_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e243 = metal::atomic_fetch_xor_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e247 = metal::atomic_fetch_xor_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e251 = metal::atomic_fetch_xor_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e256 = metal::atomic_fetch_xor_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e259 = metal::atomic_fetch_xor_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e263 = metal::atomic_fetch_xor_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e267 = metal::atomic_fetch_xor_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e272 = metal::atomic_fetch_xor_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e275 = metal::atomic_exchange_explicit(&storage_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e279 = metal::atomic_exchange_explicit(&storage_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e283 = metal::atomic_exchange_explicit(&storage_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e288 = metal::atomic_exchange_explicit(&storage_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e291 = metal::atomic_exchange_explicit(&workgroup_atomic_scalar, 1u, metal::memory_order_relaxed); + int _e295 = metal::atomic_exchange_explicit(&workgroup_atomic_arr.inner[1], 1, metal::memory_order_relaxed); + uint _e299 = metal::atomic_exchange_explicit(&workgroup_struct.atomic_scalar, 1u, metal::memory_order_relaxed); + int _e304 = metal::atomic_exchange_explicit(&workgroup_struct.atomic_arr.inner[1], 1, metal::memory_order_relaxed); return; } diff --git a/tests/out/msl/binding-arrays.msl b/tests/out/msl/binding-arrays.msl index 10a5397910..f7597b5c76 100644 --- a/tests/out/msl/binding-arrays.msl +++ b/tests/out/msl/binding-arrays.msl @@ -48,127 +48,127 @@ fragment main_Output main_( v4_ = metal::float4(0.0); metal::float2 uv = metal::float2(0.0); metal::int2 pix = metal::int2(0); - metal::uint2 _e23 = u2_; - u2_ = _e23 + metal::uint2(texture_array_unbounded[0].get_width(), texture_array_unbounded[0].get_height()); - metal::uint2 _e28 = u2_; - u2_ = _e28 + metal::uint2(texture_array_unbounded[uniform_index].get_width(), texture_array_unbounded[uniform_index].get_height()); - metal::uint2 _e33 = u2_; - u2_ = _e33 + metal::uint2(texture_array_unbounded[non_uniform_index].get_width(), texture_array_unbounded[non_uniform_index].get_height()); - metal::float4 _e42 = texture_array_bounded[0].gather(samp[0], uv); - metal::float4 _e43 = v4_; - v4_ = _e43 + _e42; - metal::float4 _e50 = texture_array_bounded[uniform_index].gather(samp[uniform_index], uv); - metal::float4 _e51 = v4_; - v4_ = _e51 + _e50; - metal::float4 _e58 = texture_array_bounded[non_uniform_index].gather(samp[non_uniform_index], uv); - metal::float4 _e59 = v4_; - v4_ = _e59 + _e58; - metal::float4 _e68 = texture_array_depth[0].gather_compare(samp_comp[0], uv, 0.0); + metal::uint2 _e22 = u2_; + u2_ = _e22 + metal::uint2(texture_array_unbounded[0].get_width(), texture_array_unbounded[0].get_height()); + metal::uint2 _e27 = u2_; + u2_ = _e27 + metal::uint2(texture_array_unbounded[uniform_index].get_width(), texture_array_unbounded[uniform_index].get_height()); + metal::uint2 _e32 = u2_; + u2_ = _e32 + metal::uint2(texture_array_unbounded[non_uniform_index].get_width(), texture_array_unbounded[non_uniform_index].get_height()); + metal::float4 _e38 = texture_array_bounded[0].gather(samp[0], uv); + metal::float4 _e39 = v4_; + v4_ = _e39 + _e38; + metal::float4 _e45 = texture_array_bounded[uniform_index].gather(samp[uniform_index], uv); + metal::float4 _e46 = v4_; + v4_ = _e46 + _e45; + metal::float4 _e52 = texture_array_bounded[non_uniform_index].gather(samp[non_uniform_index], uv); + metal::float4 _e53 = v4_; + v4_ = _e53 + _e52; + metal::float4 _e60 = texture_array_depth[0].gather_compare(samp_comp[0], uv, 0.0); + metal::float4 _e61 = v4_; + v4_ = _e61 + _e60; + metal::float4 _e68 = texture_array_depth[uniform_index].gather_compare(samp_comp[uniform_index], uv, 0.0); metal::float4 _e69 = v4_; v4_ = _e69 + _e68; - metal::float4 _e76 = texture_array_depth[uniform_index].gather_compare(samp_comp[uniform_index], uv, 0.0); + metal::float4 _e76 = texture_array_depth[non_uniform_index].gather_compare(samp_comp[non_uniform_index], uv, 0.0); metal::float4 _e77 = v4_; v4_ = _e77 + _e76; - metal::float4 _e84 = texture_array_depth[non_uniform_index].gather_compare(samp_comp[non_uniform_index], uv, 0.0); - metal::float4 _e85 = v4_; - v4_ = _e85 + _e84; - metal::float4 _e91 = (uint(0) < texture_array_unbounded[0].get_num_mip_levels() && metal::all(metal::uint2(pix) < metal::uint2(texture_array_unbounded[0].get_width(0), texture_array_unbounded[0].get_height(0))) ? texture_array_unbounded[0].read(metal::uint2(pix), 0): DefaultConstructible()); - metal::float4 _e92 = v4_; - v4_ = _e92 + _e91; - metal::float4 _e97 = (uint(0) < texture_array_unbounded[uniform_index].get_num_mip_levels() && metal::all(metal::uint2(pix) < metal::uint2(texture_array_unbounded[uniform_index].get_width(0), texture_array_unbounded[uniform_index].get_height(0))) ? texture_array_unbounded[uniform_index].read(metal::uint2(pix), 0): DefaultConstructible()); - metal::float4 _e98 = v4_; - v4_ = _e98 + _e97; - metal::float4 _e103 = (uint(0) < texture_array_unbounded[non_uniform_index].get_num_mip_levels() && metal::all(metal::uint2(pix) < metal::uint2(texture_array_unbounded[non_uniform_index].get_width(0), texture_array_unbounded[non_uniform_index].get_height(0))) ? texture_array_unbounded[non_uniform_index].read(metal::uint2(pix), 0): DefaultConstructible()); - metal::float4 _e104 = v4_; - v4_ = _e104 + _e103; + metal::float4 _e82 = (uint(0) < texture_array_unbounded[0].get_num_mip_levels() && metal::all(metal::uint2(pix) < metal::uint2(texture_array_unbounded[0].get_width(0), texture_array_unbounded[0].get_height(0))) ? texture_array_unbounded[0].read(metal::uint2(pix), 0): DefaultConstructible()); + metal::float4 _e83 = v4_; + v4_ = _e83 + _e82; + metal::float4 _e88 = (uint(0) < texture_array_unbounded[uniform_index].get_num_mip_levels() && metal::all(metal::uint2(pix) < metal::uint2(texture_array_unbounded[uniform_index].get_width(0), texture_array_unbounded[uniform_index].get_height(0))) ? texture_array_unbounded[uniform_index].read(metal::uint2(pix), 0): DefaultConstructible()); + metal::float4 _e89 = v4_; + v4_ = _e89 + _e88; + metal::float4 _e94 = (uint(0) < texture_array_unbounded[non_uniform_index].get_num_mip_levels() && metal::all(metal::uint2(pix) < metal::uint2(texture_array_unbounded[non_uniform_index].get_width(0), texture_array_unbounded[non_uniform_index].get_height(0))) ? texture_array_unbounded[non_uniform_index].read(metal::uint2(pix), 0): DefaultConstructible()); + metal::float4 _e95 = v4_; + v4_ = _e95 + _e94; + uint _e100 = u1_; + u1_ = _e100 + texture_array_2darray[0].get_array_size(); + uint _e105 = u1_; + u1_ = _e105 + texture_array_2darray[uniform_index].get_array_size(); uint _e110 = u1_; - u1_ = _e110 + texture_array_2darray[0].get_array_size(); + u1_ = _e110 + texture_array_2darray[non_uniform_index].get_array_size(); uint _e115 = u1_; - u1_ = _e115 + texture_array_2darray[uniform_index].get_array_size(); + u1_ = _e115 + texture_array_bounded[0].get_num_mip_levels(); uint _e120 = u1_; - u1_ = _e120 + texture_array_2darray[non_uniform_index].get_array_size(); - uint _e126 = u1_; - u1_ = _e126 + texture_array_bounded[0].get_num_mip_levels(); - uint _e131 = u1_; - u1_ = _e131 + texture_array_bounded[uniform_index].get_num_mip_levels(); - uint _e136 = u1_; - u1_ = _e136 + texture_array_bounded[non_uniform_index].get_num_mip_levels(); - uint _e142 = u1_; - u1_ = _e142 + texture_array_multisampled[0].get_num_samples(); - uint _e147 = u1_; - u1_ = _e147 + texture_array_multisampled[uniform_index].get_num_samples(); - uint _e152 = u1_; - u1_ = _e152 + texture_array_multisampled[non_uniform_index].get_num_samples(); - metal::float4 _e160 = texture_array_bounded[0].sample(samp[0], uv); + u1_ = _e120 + texture_array_bounded[uniform_index].get_num_mip_levels(); + uint _e125 = u1_; + u1_ = _e125 + texture_array_bounded[non_uniform_index].get_num_mip_levels(); + uint _e130 = u1_; + u1_ = _e130 + texture_array_multisampled[0].get_num_samples(); + uint _e135 = u1_; + u1_ = _e135 + texture_array_multisampled[uniform_index].get_num_samples(); + uint _e140 = u1_; + u1_ = _e140 + texture_array_multisampled[non_uniform_index].get_num_samples(); + metal::float4 _e146 = texture_array_bounded[0].sample(samp[0], uv); + metal::float4 _e147 = v4_; + v4_ = _e147 + _e146; + metal::float4 _e153 = texture_array_bounded[uniform_index].sample(samp[uniform_index], uv); + metal::float4 _e154 = v4_; + v4_ = _e154 + _e153; + metal::float4 _e160 = texture_array_bounded[non_uniform_index].sample(samp[non_uniform_index], uv); metal::float4 _e161 = v4_; v4_ = _e161 + _e160; - metal::float4 _e167 = texture_array_bounded[uniform_index].sample(samp[uniform_index], uv); - metal::float4 _e168 = v4_; - v4_ = _e168 + _e167; - metal::float4 _e174 = texture_array_bounded[non_uniform_index].sample(samp[non_uniform_index], uv); - metal::float4 _e175 = v4_; - v4_ = _e175 + _e174; - metal::float4 _e184 = texture_array_bounded[0].sample(samp[0], uv, metal::bias(0.0)); + metal::float4 _e168 = texture_array_bounded[0].sample(samp[0], uv, metal::bias(0.0)); + metal::float4 _e169 = v4_; + v4_ = _e169 + _e168; + metal::float4 _e176 = texture_array_bounded[uniform_index].sample(samp[uniform_index], uv, metal::bias(0.0)); + metal::float4 _e177 = v4_; + v4_ = _e177 + _e176; + metal::float4 _e184 = texture_array_bounded[non_uniform_index].sample(samp[non_uniform_index], uv, metal::bias(0.0)); metal::float4 _e185 = v4_; v4_ = _e185 + _e184; - metal::float4 _e192 = texture_array_bounded[uniform_index].sample(samp[uniform_index], uv, metal::bias(0.0)); - metal::float4 _e193 = v4_; - v4_ = _e193 + _e192; - metal::float4 _e200 = texture_array_bounded[non_uniform_index].sample(samp[non_uniform_index], uv, metal::bias(0.0)); - metal::float4 _e201 = v4_; - v4_ = _e201 + _e200; - float _e210 = texture_array_depth[0].sample_compare(samp_comp[0], uv, 0.0); - float _e211 = v1_; - v1_ = _e211 + _e210; - float _e218 = texture_array_depth[uniform_index].sample_compare(samp_comp[uniform_index], uv, 0.0); - float _e219 = v1_; - v1_ = _e219 + _e218; - float _e226 = texture_array_depth[non_uniform_index].sample_compare(samp_comp[non_uniform_index], uv, 0.0); - float _e227 = v1_; - v1_ = _e227 + _e226; - float _e236 = texture_array_depth[0].sample_compare(samp_comp[0], uv, 0.0); - float _e237 = v1_; - v1_ = _e237 + _e236; - float _e244 = texture_array_depth[uniform_index].sample_compare(samp_comp[uniform_index], uv, 0.0); - float _e245 = v1_; - v1_ = _e245 + _e244; - float _e252 = texture_array_depth[non_uniform_index].sample_compare(samp_comp[non_uniform_index], uv, 0.0); - float _e253 = v1_; - v1_ = _e253 + _e252; - metal::float4 _e261 = texture_array_bounded[0].sample(samp[0], uv, metal::gradient2d(uv, uv)); + float _e192 = texture_array_depth[0].sample_compare(samp_comp[0], uv, 0.0); + float _e193 = v1_; + v1_ = _e193 + _e192; + float _e200 = texture_array_depth[uniform_index].sample_compare(samp_comp[uniform_index], uv, 0.0); + float _e201 = v1_; + v1_ = _e201 + _e200; + float _e208 = texture_array_depth[non_uniform_index].sample_compare(samp_comp[non_uniform_index], uv, 0.0); + float _e209 = v1_; + v1_ = _e209 + _e208; + float _e216 = texture_array_depth[0].sample_compare(samp_comp[0], uv, 0.0); + float _e217 = v1_; + v1_ = _e217 + _e216; + float _e224 = texture_array_depth[uniform_index].sample_compare(samp_comp[uniform_index], uv, 0.0); + float _e225 = v1_; + v1_ = _e225 + _e224; + float _e232 = texture_array_depth[non_uniform_index].sample_compare(samp_comp[non_uniform_index], uv, 0.0); + float _e233 = v1_; + v1_ = _e233 + _e232; + metal::float4 _e239 = texture_array_bounded[0].sample(samp[0], uv, metal::gradient2d(uv, uv)); + metal::float4 _e240 = v4_; + v4_ = _e240 + _e239; + metal::float4 _e246 = texture_array_bounded[uniform_index].sample(samp[uniform_index], uv, metal::gradient2d(uv, uv)); + metal::float4 _e247 = v4_; + v4_ = _e247 + _e246; + metal::float4 _e253 = texture_array_bounded[non_uniform_index].sample(samp[non_uniform_index], uv, metal::gradient2d(uv, uv)); + metal::float4 _e254 = v4_; + v4_ = _e254 + _e253; + metal::float4 _e261 = texture_array_bounded[0].sample(samp[0], uv, metal::level(0.0)); metal::float4 _e262 = v4_; v4_ = _e262 + _e261; - metal::float4 _e268 = texture_array_bounded[uniform_index].sample(samp[uniform_index], uv, metal::gradient2d(uv, uv)); - metal::float4 _e269 = v4_; - v4_ = _e269 + _e268; - metal::float4 _e275 = texture_array_bounded[non_uniform_index].sample(samp[non_uniform_index], uv, metal::gradient2d(uv, uv)); - metal::float4 _e276 = v4_; - v4_ = _e276 + _e275; - metal::float4 _e285 = texture_array_bounded[0].sample(samp[0], uv, metal::level(0.0)); - metal::float4 _e286 = v4_; - v4_ = _e286 + _e285; - metal::float4 _e293 = texture_array_bounded[uniform_index].sample(samp[uniform_index], uv, metal::level(0.0)); - metal::float4 _e294 = v4_; - v4_ = _e294 + _e293; - metal::float4 _e301 = texture_array_bounded[non_uniform_index].sample(samp[non_uniform_index], uv, metal::level(0.0)); - metal::float4 _e302 = v4_; - v4_ = _e302 + _e301; - metal::float4 _e307 = v4_; + metal::float4 _e269 = texture_array_bounded[uniform_index].sample(samp[uniform_index], uv, metal::level(0.0)); + metal::float4 _e270 = v4_; + v4_ = _e270 + _e269; + metal::float4 _e277 = texture_array_bounded[non_uniform_index].sample(samp[non_uniform_index], uv, metal::level(0.0)); + metal::float4 _e278 = v4_; + v4_ = _e278 + _e277; + metal::float4 _e282 = v4_; if (metal::all(metal::uint2(pix) < metal::uint2(texture_array_storage[0].get_width(), texture_array_storage[0].get_height()))) { - texture_array_storage[0].write(_e307, metal::uint2(pix)); + texture_array_storage[0].write(_e282, metal::uint2(pix)); } - metal::float4 _e310 = v4_; + metal::float4 _e285 = v4_; if (metal::all(metal::uint2(pix) < metal::uint2(texture_array_storage[uniform_index].get_width(), texture_array_storage[uniform_index].get_height()))) { - texture_array_storage[uniform_index].write(_e310, metal::uint2(pix)); + texture_array_storage[uniform_index].write(_e285, metal::uint2(pix)); } - metal::float4 _e313 = v4_; + metal::float4 _e288 = v4_; if (metal::all(metal::uint2(pix) < metal::uint2(texture_array_storage[non_uniform_index].get_width(), texture_array_storage[non_uniform_index].get_height()))) { - texture_array_storage[non_uniform_index].write(_e313, metal::uint2(pix)); + texture_array_storage[non_uniform_index].write(_e288, metal::uint2(pix)); } - metal::uint2 _e314 = u2_; - uint _e315 = u1_; - metal::float2 v2_ = static_cast(_e314 + metal::uint2(_e315)); - metal::float4 _e319 = v4_; - float _e326 = v1_; - return main_Output { (_e319 + metal::float4(v2_.x, v2_.y, v2_.x, v2_.y)) + metal::float4(_e326) }; + metal::uint2 _e289 = u2_; + uint _e290 = u1_; + metal::float2 v2_ = static_cast(_e289 + metal::uint2(_e290)); + metal::float4 _e294 = v4_; + float _e301 = v1_; + return main_Output { (_e294 + metal::float4(v2_.x, v2_.y, v2_.x, v2_.y)) + metal::float4(_e301) }; } diff --git a/tests/out/msl/bounds-check-restrict.msl b/tests/out/msl/bounds-check-restrict.msl index 49a232e706..4191fd2765 100644 --- a/tests/out/msl/bounds-check-restrict.msl +++ b/tests/out/msl/bounds-check-restrict.msl @@ -86,10 +86,10 @@ float index_in_bounds( device Globals const& globals, constant _mslBufferSizes& _buffer_sizes ) { - float _e4 = globals.a.inner[9]; - float _e9 = globals.v.w; - float _e17 = globals.m[2].w; - return (_e4 + _e9) + _e17; + float _e3 = globals.a.inner[9]; + float _e7 = globals.v.w; + float _e13 = globals.m[2].w; + return (_e3 + _e7) + _e13; } void set_array( diff --git a/tests/out/msl/bounds-check-zero.msl b/tests/out/msl/bounds-check-zero.msl index 816983d98b..c83f25b311 100644 --- a/tests/out/msl/bounds-check-zero.msl +++ b/tests/out/msl/bounds-check-zero.msl @@ -93,10 +93,10 @@ float index_in_bounds( device Globals const& globals, constant _mslBufferSizes& _buffer_sizes ) { - float _e4 = globals.a.inner[9]; - float _e9 = globals.v.w; - float _e17 = globals.m[2].w; - return (_e4 + _e9) + _e17; + float _e3 = globals.a.inner[9]; + float _e7 = globals.v.w; + float _e13 = globals.m[2].w; + return (_e3 + _e7) + _e13; } void set_array( diff --git a/tests/out/msl/do-while.msl b/tests/out/msl/do-while.msl index 4f928d1f3c..6ddd59dab5 100644 --- a/tests/out/msl/do-while.msl +++ b/tests/out/msl/do-while.msl @@ -11,7 +11,7 @@ void fb1_( bool loop_init = true; while(true) { if (!loop_init) { - bool _e2 = cond; + bool _e1 = cond; if (!(cond)) { break; } diff --git a/tests/out/msl/empty-global-name.msl b/tests/out/msl/empty-global-name.msl index f456649bc6..1cbf9adf43 100644 --- a/tests/out/msl/empty-global-name.msl +++ b/tests/out/msl/empty-global-name.msl @@ -11,8 +11,8 @@ struct type_1 { void function( device type_1& unnamed ) { - int _e4 = unnamed.member; - unnamed.member = _e4 + 1; + int _e3 = unnamed.member; + unnamed.member = _e3 + 1; return; } diff --git a/tests/out/msl/globals.msl b/tests/out/msl/globals.msl index d9142c1990..9e964d6c1e 100644 --- a/tests/out/msl/globals.msl +++ b/tests/out/msl/globals.msl @@ -47,8 +47,8 @@ void test_msl_packed_vec3_( idx = 1; alignment.v3_[0] = 1.0; alignment.v3_[0] = 2.0; - int _e17 = idx; - alignment.v3_[_e17] = 3.0; + int _e16 = idx; + alignment.v3_[_e16] = 3.0; FooStruct data = alignment; metal::float3 l0_ = data.v3_; metal::float2 l1_ = metal::float3(data.v3_).zx; @@ -80,20 +80,20 @@ kernel void main_( float Foo = {}; bool at = {}; test_msl_packed_vec3_(alignment); - metal::float4x2 _e8 = global_nested_arrays_of_matrices_4x2_.inner[0].inner[0]; - metal::float4 _e16 = global_nested_arrays_of_matrices_2x4_.inner[0].inner[0][0]; - wg.inner[7] = (_e8 * _e16).x; - metal::float3x2 _e23 = global_mat; - metal::float3 _e25 = global_vec; - wg.inner[6] = (_e23 * _e25).x; - float _e35 = dummy[1].y; - wg.inner[5] = _e35; - float _e43 = float_vecs.inner[0].w; - wg.inner[4] = _e43; - float _e49 = alignment.v1_; - wg.inner[3] = _e49; - float _e56 = alignment.v3_[0]; - wg.inner[2] = _e56; + metal::float4x2 _e5 = global_nested_arrays_of_matrices_4x2_.inner[0].inner[0]; + metal::float4 _e10 = global_nested_arrays_of_matrices_2x4_.inner[0].inner[0][0]; + wg.inner[7] = (_e5 * _e10).x; + metal::float3x2 _e16 = global_mat; + metal::float3 _e18 = global_vec; + wg.inner[6] = (_e16 * _e18).x; + float _e26 = dummy[1].y; + wg.inner[5] = _e26; + float _e32 = float_vecs.inner[0].w; + wg.inner[4] = _e32; + float _e37 = alignment.v1_; + wg.inner[3] = _e37; + float _e43 = alignment.v3_[0]; + wg.inner[2] = _e43; alignment.v1_ = 4.0; wg.inner[1] = static_cast(1 + (_buffer_sizes.size3 - 0 - 8) / 8); metal::atomic_store_explicit(&at_1, 2u, metal::memory_order_relaxed); diff --git a/tests/out/msl/operators.msl b/tests/out/msl/operators.msl index de3e990db2..a80c71bef9 100644 --- a/tests/out/msl/operators.msl +++ b/tests/out/msl/operators.msl @@ -237,10 +237,10 @@ void assignment( int _e36 = a_1; a_1 = _e36 - 1; vec0_ = metal::int3 {}; - int _e43 = vec0_.y; - vec0_.y = _e43 + 1; - int _e48 = vec0_.y; - vec0_.y = _e48 - 1; + int _e42 = vec0_.y; + vec0_.y = _e42 + 1; + int _e46 = vec0_.y; + vec0_.y = _e46 - 1; return; } diff --git a/tests/out/msl/quad-vert.msl b/tests/out/msl/quad-vert.msl index d322cbcb9b..718d7aafa8 100644 --- a/tests/out/msl/quad-vert.msl +++ b/tests/out/msl/quad-vert.msl @@ -4,16 +4,16 @@ using metal::uint; -struct type_5 { +struct type_3 { float inner[1]; }; struct gl_PerVertex { metal::float4 gl_Position; float gl_PointSize; - type_5 gl_ClipDistance; - type_5 gl_CullDistance; + type_3 gl_ClipDistance; + type_3 gl_CullDistance; }; -struct type_9 { +struct type_4 { metal::float2 member; metal::float4 gl_Position; }; @@ -24,10 +24,10 @@ void main_1( thread gl_PerVertex& perVertexStruct, thread metal::float2& a_pos_1 ) { - metal::float2 _e8 = a_uv_1; - v_uv = _e8; - metal::float2 _e9 = a_pos_1; - perVertexStruct.gl_Position = metal::float4(_e9.x, _e9.y, 0.0, 1.0); + metal::float2 _e6 = a_uv_1; + v_uv = _e6; + metal::float2 _e7 = a_pos_1; + perVertexStruct.gl_Position = metal::float4(_e7.x, _e7.y, 0.0, 1.0); return; } @@ -44,7 +44,7 @@ vertex main_Output main_( ) { metal::float2 v_uv = {}; metal::float2 a_uv_1 = {}; - gl_PerVertex perVertexStruct = gl_PerVertex {metal::float4(0.0, 0.0, 0.0, 1.0), 1.0, type_5 {}, type_5 {}}; + gl_PerVertex perVertexStruct = gl_PerVertex {metal::float4(0.0, 0.0, 0.0, 1.0), 1.0, type_3 {}, type_3 {}}; metal::float2 a_pos_1 = {}; const auto a_uv = varyings.a_uv; const auto a_pos = varyings.a_pos; @@ -53,6 +53,6 @@ vertex main_Output main_( main_1(v_uv, a_uv_1, perVertexStruct, a_pos_1); metal::float2 _e7 = v_uv; metal::float4 _e8 = perVertexStruct.gl_Position; - const auto _tmp = type_9 {_e7, _e8}; + const auto _tmp = type_4 {_e7, _e8}; return main_Output { _tmp.member, _tmp.gl_Position }; } diff --git a/tests/out/spv/access.spvasm b/tests/out/spv/access.spvasm index cb0cdeda27..d5b6524ee7 100644 --- a/tests/out/spv/access.spvasm +++ b/tests/out/spv/access.spvasm @@ -1,16 +1,16 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 324 +; Bound: 322 OpCapability Shader OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %237 "foo_vert" %232 %235 -OpEntryPoint Fragment %284 "foo_frag" %283 -OpEntryPoint GLCompute %304 "assign_through_ptr" %307 -OpExecutionMode %284 OriginUpperLeft -OpExecutionMode %304 LocalSize 1 1 1 +OpEntryPoint Vertex %232 "foo_vert" %227 %230 +OpEntryPoint Fragment %282 "foo_frag" %281 +OpEntryPoint GLCompute %302 "assign_through_ptr" %305 +OpExecutionMode %282 OriginUpperLeft +OpExecutionMode %302 LocalSize 1 1 1 OpMemberName %6 0 "a" OpMemberName %6 1 "b" OpMemberName %6 2 "c" @@ -28,33 +28,33 @@ OpMemberName %22 0 "m" OpName %22 "Baz" OpMemberName %26 0 "am" OpName %26 "MatCx2InArray" -OpName %45 "global_const" -OpName %47 "bar" -OpName %49 "baz" -OpName %52 "qux" -OpName %55 "nested_mat_cx2" -OpName %58 "val" -OpName %59 "idx" -OpName %62 "t" -OpName %66 "test_matrix_within_struct_accesses" -OpName %137 "idx" -OpName %138 "t" -OpName %142 "test_matrix_within_array_within_struct_accesses" -OpName %200 "foo" -OpName %201 "read_from_private" -OpName %206 "a" -OpName %207 "test_arr_as_arg" -OpName %213 "p" -OpName %214 "assign_through_ptr_fn" -OpName %219 "foo" -OpName %220 "assign_array_through_ptr_fn" -OpName %226 "foo" -OpName %228 "c2" -OpName %232 "vi" -OpName %237 "foo_vert" -OpName %284 "foo_frag" -OpName %301 "arr" -OpName %304 "assign_through_ptr" +OpName %40 "global_const" +OpName %42 "bar" +OpName %44 "baz" +OpName %47 "qux" +OpName %50 "nested_mat_cx2" +OpName %53 "val" +OpName %54 "idx" +OpName %57 "t" +OpName %61 "test_matrix_within_struct_accesses" +OpName %132 "idx" +OpName %133 "t" +OpName %137 "test_matrix_within_array_within_struct_accesses" +OpName %195 "foo" +OpName %196 "read_from_private" +OpName %201 "a" +OpName %202 "test_arr_as_arg" +OpName %208 "p" +OpName %209 "assign_through_ptr_fn" +OpName %214 "foo" +OpName %215 "assign_array_through_ptr_fn" +OpName %221 "foo" +OpName %223 "c2" +OpName %227 "vi" +OpName %232 "foo_vert" +OpName %282 "foo_frag" +OpName %299 "arr" +OpName %302 "assign_through_ptr" OpMemberDecorate %6 0 Offset 0 OpMemberDecorate %6 1 Offset 16 OpMemberDecorate %6 2 Offset 28 @@ -83,26 +83,26 @@ OpMemberDecorate %26 0 ColMajor OpMemberDecorate %26 0 MatrixStride 8 OpDecorate %28 ArrayStride 4 OpDecorate %29 ArrayStride 40 -OpDecorate %33 ArrayStride 4 -OpDecorate %36 ArrayStride 16 +OpDecorate %32 ArrayStride 4 +OpDecorate %34 ArrayStride 16 +OpDecorate %42 DescriptorSet 0 +OpDecorate %42 Binding 0 +OpDecorate %44 DescriptorSet 0 +OpDecorate %44 Binding 1 +OpDecorate %45 Block +OpMemberDecorate %45 0 Offset 0 OpDecorate %47 DescriptorSet 0 -OpDecorate %47 Binding 0 -OpDecorate %49 DescriptorSet 0 -OpDecorate %49 Binding 1 -OpDecorate %50 Block -OpMemberDecorate %50 0 Offset 0 -OpDecorate %52 DescriptorSet 0 -OpDecorate %52 Binding 2 -OpDecorate %53 Block -OpMemberDecorate %53 0 Offset 0 -OpDecorate %55 DescriptorSet 0 -OpDecorate %55 Binding 3 -OpDecorate %56 Block -OpMemberDecorate %56 0 Offset 0 -OpDecorate %232 BuiltIn VertexIndex -OpDecorate %235 BuiltIn Position -OpDecorate %283 Location 0 -OpDecorate %307 BuiltIn LocalInvocationId +OpDecorate %47 Binding 2 +OpDecorate %48 Block +OpMemberDecorate %48 0 Offset 0 +OpDecorate %50 DescriptorSet 0 +OpDecorate %50 Binding 3 +OpDecorate %51 Block +OpMemberDecorate %51 0 Offset 0 +OpDecorate %227 BuiltIn VertexIndex +OpDecorate %230 BuiltIn Position +OpDecorate %281 Location 0 +OpDecorate %305 BuiltIn LocalInvocationId %2 = OpTypeVoid %3 = OpTypeInt 32 0 %4 = OpTypeVector %3 3 @@ -133,365 +133,363 @@ OpDecorate %307 BuiltIn LocalInvocationId %30 = OpConstant %3 5 %29 = OpTypeArray %28 %30 %31 = OpTypeVector %10 4 -%32 = OpTypePointer StorageBuffer %5 -%33 = OpTypeArray %5 %30 -%34 = OpTypeVector %5 4 -%35 = OpTypePointer Workgroup %3 -%36 = OpTypeArray %31 %14 -%37 = OpTypePointer Function %36 -%38 = OpConstant %3 0 -%39 = OpConstantComposite %4 %38 %38 %38 -%40 = OpConstant %5 0 -%41 = OpConstantComposite %6 %38 %39 %40 -%42 = OpConstant %5 2 -%43 = OpConstant %5 10 -%44 = OpConstant %5 5 -%46 = OpTypePointer Private %6 -%45 = OpVariable %46 Private %41 -%48 = OpTypePointer StorageBuffer %20 -%47 = OpVariable %48 StorageBuffer -%50 = OpTypeStruct %22 -%51 = OpTypePointer Uniform %50 -%49 = OpVariable %51 Uniform -%53 = OpTypeStruct %23 -%54 = OpTypePointer StorageBuffer %53 -%52 = OpVariable %54 StorageBuffer -%56 = OpTypeStruct %26 -%57 = OpTypePointer Uniform %56 -%55 = OpVariable %57 Uniform -%58 = OpVariable %35 Workgroup -%60 = OpTypePointer Function %5 -%61 = OpConstantNull %5 -%63 = OpTypePointer Function %22 -%64 = OpConstantNull %22 -%67 = OpTypeFunction %2 -%68 = OpTypePointer Uniform %22 -%70 = OpConstant %5 1 -%71 = OpConstant %10 1.0 -%72 = OpConstant %10 2.0 -%73 = OpConstant %10 3.0 -%74 = OpConstant %10 6.0 -%75 = OpConstant %10 5.0 -%76 = OpConstant %10 4.0 -%77 = OpConstant %10 9.0 -%78 = OpConstant %10 90.0 -%79 = OpConstant %10 10.0 -%80 = OpConstant %10 20.0 -%81 = OpConstant %10 30.0 -%82 = OpConstant %10 40.0 -%86 = OpTypePointer Uniform %21 -%89 = OpTypePointer Uniform %12 -%95 = OpTypePointer Uniform %10 -%96 = OpConstant %3 1 -%116 = OpTypePointer Function %21 -%122 = OpTypePointer Function %12 -%128 = OpTypePointer Function %10 -%139 = OpTypePointer Function %26 -%140 = OpConstantNull %26 -%143 = OpTypePointer Uniform %26 -%145 = OpConstantNull %25 -%146 = OpConstant %10 8.0 -%147 = OpConstant %10 7.0 -%151 = OpTypePointer Uniform %25 -%154 = OpTypePointer Uniform %24 -%177 = OpTypePointer Function %25 -%179 = OpTypePointer Function %24 -%202 = OpTypeFunction %10 %27 -%208 = OpTypeFunction %10 %29 -%215 = OpTypeFunction %2 %35 -%216 = OpConstant %3 42 -%221 = OpTypeFunction %2 %37 -%227 = OpConstantNull %10 -%229 = OpTypePointer Function %33 -%230 = OpConstantNull %33 -%233 = OpTypePointer Input %3 -%232 = OpVariable %233 Input -%236 = OpTypePointer Output %31 -%235 = OpVariable %236 Output -%239 = OpTypePointer StorageBuffer %23 -%242 = OpConstant %10 0.0 -%243 = OpConstant %3 3 -%244 = OpConstant %5 3 -%245 = OpConstant %5 4 -%246 = OpConstant %5 42 -%247 = OpConstantNull %29 -%252 = OpTypePointer StorageBuffer %8 -%255 = OpTypePointer StorageBuffer %18 -%256 = OpConstant %3 4 -%259 = OpTypePointer StorageBuffer %9 -%260 = OpTypePointer StorageBuffer %10 -%263 = OpTypePointer StorageBuffer %19 -%266 = OpTypePointer StorageBuffer %7 -%283 = OpVariable %236 Output -%286 = OpConstantNull %23 -%302 = OpConstantNull %36 -%306 = OpConstantNull %3 -%308 = OpTypePointer Input %4 -%307 = OpVariable %308 Input -%310 = OpConstantNull %4 -%312 = OpTypeBool -%311 = OpTypeVector %312 3 -%317 = OpConstant %3 264 -%66 = OpFunction %2 None %67 -%65 = OpLabel -%59 = OpVariable %60 Function %61 -%62 = OpVariable %63 Function %64 -%69 = OpAccessChain %68 %49 %38 -OpBranch %83 -%83 = OpLabel -OpStore %59 %70 -%84 = OpLoad %5 %59 -%85 = OpISub %5 %84 %70 -OpStore %59 %85 -%87 = OpAccessChain %86 %69 %38 -%88 = OpLoad %21 %87 -%90 = OpAccessChain %89 %69 %38 %38 -%91 = OpLoad %12 %90 -%92 = OpLoad %5 %59 -%93 = OpAccessChain %89 %69 %38 %92 -%94 = OpLoad %12 %93 -%97 = OpAccessChain %95 %69 %38 %38 %96 -%98 = OpLoad %10 %97 -%99 = OpLoad %5 %59 -%100 = OpAccessChain %95 %69 %38 %38 %99 -%101 = OpLoad %10 %100 -%102 = OpLoad %5 %59 -%103 = OpAccessChain %95 %69 %38 %102 %96 -%104 = OpLoad %10 %103 -%105 = OpLoad %5 %59 -%106 = OpLoad %5 %59 -%107 = OpAccessChain %95 %69 %38 %105 %106 -%108 = OpLoad %10 %107 -%109 = OpCompositeConstruct %12 %71 %71 -%110 = OpCompositeConstruct %12 %72 %72 -%111 = OpCompositeConstruct %12 %73 %73 -%112 = OpCompositeConstruct %21 %109 %110 %111 -%113 = OpCompositeConstruct %22 %112 -OpStore %62 %113 -%114 = OpLoad %5 %59 -%115 = OpIAdd %5 %114 %70 -OpStore %59 %115 -%117 = OpCompositeConstruct %12 %74 %74 -%118 = OpCompositeConstruct %12 %75 %75 -%119 = OpCompositeConstruct %12 %76 %76 -%120 = OpCompositeConstruct %21 %117 %118 %119 -%121 = OpAccessChain %116 %62 %38 -OpStore %121 %120 -%123 = OpCompositeConstruct %12 %77 %77 -%124 = OpAccessChain %122 %62 %38 %38 -OpStore %124 %123 -%125 = OpLoad %5 %59 -%126 = OpCompositeConstruct %12 %78 %78 -%127 = OpAccessChain %122 %62 %38 %125 -OpStore %127 %126 -%129 = OpAccessChain %128 %62 %38 %38 %96 -OpStore %129 %79 -%130 = OpLoad %5 %59 -%131 = OpAccessChain %128 %62 %38 %38 %130 -OpStore %131 %80 -%132 = OpLoad %5 %59 -%133 = OpAccessChain %128 %62 %38 %132 %96 -OpStore %133 %81 -%134 = OpLoad %5 %59 -%135 = OpLoad %5 %59 -%136 = OpAccessChain %128 %62 %38 %134 %135 -OpStore %136 %82 +%32 = OpTypeArray %5 %30 +%33 = OpTypePointer Workgroup %3 +%34 = OpTypeArray %31 %14 +%35 = OpTypePointer Function %34 +%36 = OpConstant %3 0 +%37 = OpConstantComposite %4 %36 %36 %36 +%38 = OpConstant %5 0 +%39 = OpConstantComposite %6 %36 %37 %38 +%41 = OpTypePointer Private %6 +%40 = OpVariable %41 Private %39 +%43 = OpTypePointer StorageBuffer %20 +%42 = OpVariable %43 StorageBuffer +%45 = OpTypeStruct %22 +%46 = OpTypePointer Uniform %45 +%44 = OpVariable %46 Uniform +%48 = OpTypeStruct %23 +%49 = OpTypePointer StorageBuffer %48 +%47 = OpVariable %49 StorageBuffer +%51 = OpTypeStruct %26 +%52 = OpTypePointer Uniform %51 +%50 = OpVariable %52 Uniform +%53 = OpVariable %33 Workgroup +%55 = OpTypePointer Function %5 +%56 = OpConstantNull %5 +%58 = OpTypePointer Function %22 +%59 = OpConstantNull %22 +%62 = OpTypeFunction %2 +%63 = OpTypePointer Uniform %22 +%65 = OpConstant %5 1 +%66 = OpConstant %10 1.0 +%67 = OpConstant %10 2.0 +%68 = OpConstant %10 3.0 +%69 = OpConstant %10 6.0 +%70 = OpConstant %10 5.0 +%71 = OpConstant %10 4.0 +%72 = OpConstant %10 9.0 +%73 = OpConstant %10 90.0 +%74 = OpConstant %10 10.0 +%75 = OpConstant %10 20.0 +%76 = OpConstant %10 30.0 +%77 = OpConstant %10 40.0 +%81 = OpTypePointer Uniform %21 +%84 = OpTypePointer Uniform %12 +%90 = OpTypePointer Uniform %10 +%91 = OpConstant %3 1 +%111 = OpTypePointer Function %21 +%117 = OpTypePointer Function %12 +%123 = OpTypePointer Function %10 +%134 = OpTypePointer Function %26 +%135 = OpConstantNull %26 +%138 = OpTypePointer Uniform %26 +%140 = OpConstantNull %25 +%141 = OpConstant %10 8.0 +%142 = OpConstant %10 7.0 +%146 = OpTypePointer Uniform %25 +%149 = OpTypePointer Uniform %24 +%172 = OpTypePointer Function %25 +%174 = OpTypePointer Function %24 +%197 = OpTypeFunction %10 %27 +%203 = OpTypeFunction %10 %29 +%210 = OpTypeFunction %2 %33 +%211 = OpConstant %3 42 +%216 = OpTypeFunction %2 %35 +%222 = OpConstantNull %10 +%224 = OpTypePointer Function %32 +%225 = OpConstantNull %32 +%228 = OpTypePointer Input %3 +%227 = OpVariable %228 Input +%231 = OpTypePointer Output %31 +%230 = OpVariable %231 Output +%234 = OpTypePointer StorageBuffer %23 +%237 = OpConstant %10 0.0 +%238 = OpConstant %3 3 +%239 = OpConstant %5 3 +%240 = OpConstant %5 4 +%241 = OpConstant %5 5 +%242 = OpConstant %5 42 +%243 = OpConstantNull %29 +%248 = OpTypePointer StorageBuffer %8 +%251 = OpTypePointer StorageBuffer %18 +%252 = OpConstant %3 4 +%255 = OpTypePointer StorageBuffer %9 +%256 = OpTypePointer StorageBuffer %10 +%259 = OpTypePointer StorageBuffer %19 +%262 = OpTypePointer StorageBuffer %7 +%263 = OpTypePointer StorageBuffer %5 +%275 = OpTypeVector %5 4 +%281 = OpVariable %231 Output +%284 = OpConstantNull %23 +%300 = OpConstantNull %34 +%304 = OpConstantNull %3 +%306 = OpTypePointer Input %4 +%305 = OpVariable %306 Input +%308 = OpConstantNull %4 +%310 = OpTypeBool +%309 = OpTypeVector %310 3 +%315 = OpConstant %3 264 +%61 = OpFunction %2 None %62 +%60 = OpLabel +%54 = OpVariable %55 Function %56 +%57 = OpVariable %58 Function %59 +%64 = OpAccessChain %63 %44 %36 +OpBranch %78 +%78 = OpLabel +OpStore %54 %65 +%79 = OpLoad %5 %54 +%80 = OpISub %5 %79 %65 +OpStore %54 %80 +%82 = OpAccessChain %81 %64 %36 +%83 = OpLoad %21 %82 +%85 = OpAccessChain %84 %64 %36 %36 +%86 = OpLoad %12 %85 +%87 = OpLoad %5 %54 +%88 = OpAccessChain %84 %64 %36 %87 +%89 = OpLoad %12 %88 +%92 = OpAccessChain %90 %64 %36 %36 %91 +%93 = OpLoad %10 %92 +%94 = OpLoad %5 %54 +%95 = OpAccessChain %90 %64 %36 %36 %94 +%96 = OpLoad %10 %95 +%97 = OpLoad %5 %54 +%98 = OpAccessChain %90 %64 %36 %97 %91 +%99 = OpLoad %10 %98 +%100 = OpLoad %5 %54 +%101 = OpLoad %5 %54 +%102 = OpAccessChain %90 %64 %36 %100 %101 +%103 = OpLoad %10 %102 +%104 = OpCompositeConstruct %12 %66 %66 +%105 = OpCompositeConstruct %12 %67 %67 +%106 = OpCompositeConstruct %12 %68 %68 +%107 = OpCompositeConstruct %21 %104 %105 %106 +%108 = OpCompositeConstruct %22 %107 +OpStore %57 %108 +%109 = OpLoad %5 %54 +%110 = OpIAdd %5 %109 %65 +OpStore %54 %110 +%112 = OpCompositeConstruct %12 %69 %69 +%113 = OpCompositeConstruct %12 %70 %70 +%114 = OpCompositeConstruct %12 %71 %71 +%115 = OpCompositeConstruct %21 %112 %113 %114 +%116 = OpAccessChain %111 %57 %36 +OpStore %116 %115 +%118 = OpCompositeConstruct %12 %72 %72 +%119 = OpAccessChain %117 %57 %36 %36 +OpStore %119 %118 +%120 = OpLoad %5 %54 +%121 = OpCompositeConstruct %12 %73 %73 +%122 = OpAccessChain %117 %57 %36 %120 +OpStore %122 %121 +%124 = OpAccessChain %123 %57 %36 %36 %91 +OpStore %124 %74 +%125 = OpLoad %5 %54 +%126 = OpAccessChain %123 %57 %36 %36 %125 +OpStore %126 %75 +%127 = OpLoad %5 %54 +%128 = OpAccessChain %123 %57 %36 %127 %91 +OpStore %128 %76 +%129 = OpLoad %5 %54 +%130 = OpLoad %5 %54 +%131 = OpAccessChain %123 %57 %36 %129 %130 +OpStore %131 %77 OpReturn OpFunctionEnd -%142 = OpFunction %2 None %67 -%141 = OpLabel -%137 = OpVariable %60 Function %61 -%138 = OpVariable %139 Function %140 -%144 = OpAccessChain %143 %55 %38 -OpBranch %148 -%148 = OpLabel -OpStore %137 %70 -%149 = OpLoad %5 %137 -%150 = OpISub %5 %149 %70 -OpStore %137 %150 -%152 = OpAccessChain %151 %144 %38 -%153 = OpLoad %25 %152 -%155 = OpAccessChain %154 %144 %38 %38 -%156 = OpLoad %24 %155 -%157 = OpAccessChain %89 %144 %38 %38 %38 -%158 = OpLoad %12 %157 -%159 = OpLoad %5 %137 -%160 = OpAccessChain %89 %144 %38 %38 %159 -%161 = OpLoad %12 %160 -%162 = OpAccessChain %95 %144 %38 %38 %38 %96 -%163 = OpLoad %10 %162 -%164 = OpLoad %5 %137 -%165 = OpAccessChain %95 %144 %38 %38 %38 %164 -%166 = OpLoad %10 %165 -%167 = OpLoad %5 %137 -%168 = OpAccessChain %95 %144 %38 %38 %167 %96 -%169 = OpLoad %10 %168 -%170 = OpLoad %5 %137 -%171 = OpLoad %5 %137 -%172 = OpAccessChain %95 %144 %38 %38 %170 %171 -%173 = OpLoad %10 %172 -%174 = OpCompositeConstruct %26 %145 -OpStore %138 %174 -%175 = OpLoad %5 %137 -%176 = OpIAdd %5 %175 %70 -OpStore %137 %176 -%178 = OpAccessChain %177 %138 %38 -OpStore %178 %145 -%180 = OpCompositeConstruct %12 %146 %146 -%181 = OpCompositeConstruct %12 %147 %147 -%182 = OpCompositeConstruct %12 %74 %74 -%183 = OpCompositeConstruct %12 %75 %75 -%184 = OpCompositeConstruct %24 %180 %181 %182 %183 -%185 = OpAccessChain %179 %138 %38 %38 +%137 = OpFunction %2 None %62 +%136 = OpLabel +%132 = OpVariable %55 Function %56 +%133 = OpVariable %134 Function %135 +%139 = OpAccessChain %138 %50 %36 +OpBranch %143 +%143 = OpLabel +OpStore %132 %65 +%144 = OpLoad %5 %132 +%145 = OpISub %5 %144 %65 +OpStore %132 %145 +%147 = OpAccessChain %146 %139 %36 +%148 = OpLoad %25 %147 +%150 = OpAccessChain %149 %139 %36 %36 +%151 = OpLoad %24 %150 +%152 = OpAccessChain %84 %139 %36 %36 %36 +%153 = OpLoad %12 %152 +%154 = OpLoad %5 %132 +%155 = OpAccessChain %84 %139 %36 %36 %154 +%156 = OpLoad %12 %155 +%157 = OpAccessChain %90 %139 %36 %36 %36 %91 +%158 = OpLoad %10 %157 +%159 = OpLoad %5 %132 +%160 = OpAccessChain %90 %139 %36 %36 %36 %159 +%161 = OpLoad %10 %160 +%162 = OpLoad %5 %132 +%163 = OpAccessChain %90 %139 %36 %36 %162 %91 +%164 = OpLoad %10 %163 +%165 = OpLoad %5 %132 +%166 = OpLoad %5 %132 +%167 = OpAccessChain %90 %139 %36 %36 %165 %166 +%168 = OpLoad %10 %167 +%169 = OpCompositeConstruct %26 %140 +OpStore %133 %169 +%170 = OpLoad %5 %132 +%171 = OpIAdd %5 %170 %65 +OpStore %132 %171 +%173 = OpAccessChain %172 %133 %36 +OpStore %173 %140 +%175 = OpCompositeConstruct %12 %141 %141 +%176 = OpCompositeConstruct %12 %142 %142 +%177 = OpCompositeConstruct %12 %69 %69 +%178 = OpCompositeConstruct %12 %70 %70 +%179 = OpCompositeConstruct %24 %175 %176 %177 %178 +%180 = OpAccessChain %174 %133 %36 %36 +OpStore %180 %179 +%181 = OpCompositeConstruct %12 %72 %72 +%182 = OpAccessChain %117 %133 %36 %36 %36 +OpStore %182 %181 +%183 = OpLoad %5 %132 +%184 = OpCompositeConstruct %12 %73 %73 +%185 = OpAccessChain %117 %133 %36 %36 %183 OpStore %185 %184 -%186 = OpCompositeConstruct %12 %77 %77 -%187 = OpAccessChain %122 %138 %38 %38 %38 -OpStore %187 %186 -%188 = OpLoad %5 %137 -%189 = OpCompositeConstruct %12 %78 %78 -%190 = OpAccessChain %122 %138 %38 %38 %188 -OpStore %190 %189 -%191 = OpAccessChain %128 %138 %38 %38 %38 %96 -OpStore %191 %79 -%192 = OpLoad %5 %137 -%193 = OpAccessChain %128 %138 %38 %38 %38 %192 -OpStore %193 %80 -%194 = OpLoad %5 %137 -%195 = OpAccessChain %128 %138 %38 %38 %194 %96 -OpStore %195 %81 -%196 = OpLoad %5 %137 -%197 = OpLoad %5 %137 -%198 = OpAccessChain %128 %138 %38 %38 %196 %197 -OpStore %198 %82 +%186 = OpAccessChain %123 %133 %36 %36 %36 %91 +OpStore %186 %74 +%187 = OpLoad %5 %132 +%188 = OpAccessChain %123 %133 %36 %36 %36 %187 +OpStore %188 %75 +%189 = OpLoad %5 %132 +%190 = OpAccessChain %123 %133 %36 %36 %189 %91 +OpStore %190 %76 +%191 = OpLoad %5 %132 +%192 = OpLoad %5 %132 +%193 = OpAccessChain %123 %133 %36 %36 %191 %192 +OpStore %193 %77 OpReturn OpFunctionEnd -%201 = OpFunction %10 None %202 -%200 = OpFunctionParameter %27 -%199 = OpLabel -OpBranch %203 -%203 = OpLabel -%204 = OpLoad %10 %200 -OpReturnValue %204 +%196 = OpFunction %10 None %197 +%195 = OpFunctionParameter %27 +%194 = OpLabel +OpBranch %198 +%198 = OpLabel +%199 = OpLoad %10 %195 +OpReturnValue %199 OpFunctionEnd -%207 = OpFunction %10 None %208 -%206 = OpFunctionParameter %29 -%205 = OpLabel -OpBranch %209 -%209 = OpLabel -%210 = OpCompositeExtract %28 %206 4 -%211 = OpCompositeExtract %10 %210 9 -OpReturnValue %211 +%202 = OpFunction %10 None %203 +%201 = OpFunctionParameter %29 +%200 = OpLabel +OpBranch %204 +%204 = OpLabel +%205 = OpCompositeExtract %28 %201 4 +%206 = OpCompositeExtract %10 %205 9 +OpReturnValue %206 OpFunctionEnd -%214 = OpFunction %2 None %215 -%213 = OpFunctionParameter %35 +%209 = OpFunction %2 None %210 +%208 = OpFunctionParameter %33 +%207 = OpLabel +OpBranch %212 %212 = OpLabel -OpBranch %217 -%217 = OpLabel -OpStore %213 %216 +OpStore %208 %211 OpReturn OpFunctionEnd -%220 = OpFunction %2 None %221 -%219 = OpFunctionParameter %37 -%218 = OpLabel -OpBranch %222 -%222 = OpLabel -%223 = OpCompositeConstruct %31 %71 %71 %71 %71 -%224 = OpCompositeConstruct %31 %72 %72 %72 %72 -%225 = OpCompositeConstruct %36 %223 %224 -OpStore %219 %225 +%215 = OpFunction %2 None %216 +%214 = OpFunctionParameter %35 +%213 = OpLabel +OpBranch %217 +%217 = OpLabel +%218 = OpCompositeConstruct %31 %66 %66 %66 %66 +%219 = OpCompositeConstruct %31 %67 %67 %67 %67 +%220 = OpCompositeConstruct %34 %218 %219 +OpStore %214 %220 OpReturn OpFunctionEnd -%237 = OpFunction %2 None %67 -%231 = OpLabel -%226 = OpVariable %27 Function %227 -%228 = OpVariable %229 Function %230 -%234 = OpLoad %3 %232 -%238 = OpAccessChain %68 %49 %38 -%240 = OpAccessChain %239 %52 %38 -%241 = OpAccessChain %143 %55 %38 -OpBranch %248 -%248 = OpLabel -OpStore %226 %242 -%249 = OpLoad %10 %226 -OpStore %226 %71 -%250 = OpFunctionCall %2 %66 -%251 = OpFunctionCall %2 %142 -%253 = OpAccessChain %252 %47 %38 -%254 = OpLoad %8 %253 -%257 = OpAccessChain %255 %47 %256 -%258 = OpLoad %18 %257 -%261 = OpAccessChain %260 %47 %38 %243 %38 -%262 = OpLoad %10 %261 -%264 = OpArrayLength %3 %47 5 -%265 = OpISub %3 %264 %14 -%267 = OpAccessChain %32 %47 %30 %265 %38 -%268 = OpLoad %5 %267 -%269 = OpLoad %23 %240 -%270 = OpFunctionCall %10 %201 %226 -%271 = OpConvertFToS %5 %262 -%272 = OpCompositeConstruct %33 %268 %271 %244 %245 %44 -OpStore %228 %272 -%273 = OpIAdd %3 %234 %96 -%274 = OpAccessChain %60 %228 %273 -OpStore %274 %246 -%275 = OpAccessChain %60 %228 %234 -%276 = OpLoad %5 %275 -%277 = OpFunctionCall %10 %207 %247 -%278 = OpCompositeConstruct %34 %276 %276 %276 %276 -%279 = OpConvertSToF %31 %278 -%280 = OpMatrixTimesVector %9 %254 %279 -%281 = OpCompositeConstruct %31 %280 %72 -OpStore %235 %281 +%232 = OpFunction %2 None %62 +%226 = OpLabel +%221 = OpVariable %27 Function %222 +%223 = OpVariable %224 Function %225 +%229 = OpLoad %3 %227 +%233 = OpAccessChain %63 %44 %36 +%235 = OpAccessChain %234 %47 %36 +%236 = OpAccessChain %138 %50 %36 +OpBranch %244 +%244 = OpLabel +OpStore %221 %237 +%245 = OpLoad %10 %221 +OpStore %221 %66 +%246 = OpFunctionCall %2 %61 +%247 = OpFunctionCall %2 %137 +%249 = OpAccessChain %248 %42 %36 +%250 = OpLoad %8 %249 +%253 = OpAccessChain %251 %42 %252 +%254 = OpLoad %18 %253 +%257 = OpAccessChain %256 %42 %36 %238 %36 +%258 = OpLoad %10 %257 +%260 = OpArrayLength %3 %42 5 +%261 = OpISub %3 %260 %14 +%264 = OpAccessChain %263 %42 %30 %261 %36 +%265 = OpLoad %5 %264 +%266 = OpLoad %23 %235 +%267 = OpFunctionCall %10 %196 %221 +%268 = OpConvertFToS %5 %258 +%269 = OpCompositeConstruct %32 %265 %268 %239 %240 %241 +OpStore %223 %269 +%270 = OpIAdd %3 %229 %91 +%271 = OpAccessChain %55 %223 %270 +OpStore %271 %242 +%272 = OpAccessChain %55 %223 %229 +%273 = OpLoad %5 %272 +%274 = OpFunctionCall %10 %202 %243 +%276 = OpCompositeConstruct %275 %273 %273 %273 %273 +%277 = OpConvertSToF %31 %276 +%278 = OpMatrixTimesVector %9 %250 %277 +%279 = OpCompositeConstruct %31 %278 %67 +OpStore %230 %279 OpReturn OpFunctionEnd -%284 = OpFunction %2 None %67 -%282 = OpLabel -%285 = OpAccessChain %239 %52 %38 -OpBranch %287 -%287 = OpLabel -%288 = OpAccessChain %260 %47 %38 %96 %14 -OpStore %288 %71 -%289 = OpCompositeConstruct %9 %242 %242 %242 -%290 = OpCompositeConstruct %9 %71 %71 %71 -%291 = OpCompositeConstruct %9 %72 %72 %72 -%292 = OpCompositeConstruct %9 %73 %73 %73 -%293 = OpCompositeConstruct %8 %289 %290 %291 %292 -%294 = OpAccessChain %252 %47 %38 -OpStore %294 %293 -%295 = OpCompositeConstruct %17 %38 %38 -%296 = OpCompositeConstruct %17 %96 %96 -%297 = OpCompositeConstruct %18 %295 %296 -%298 = OpAccessChain %255 %47 %256 -OpStore %298 %297 -%299 = OpAccessChain %32 %47 %30 %96 %38 -OpStore %299 %70 -OpStore %285 %286 -%300 = OpCompositeConstruct %31 %242 %242 %242 %242 -OpStore %283 %300 +%282 = OpFunction %2 None %62 +%280 = OpLabel +%283 = OpAccessChain %234 %47 %36 +OpBranch %285 +%285 = OpLabel +%286 = OpAccessChain %256 %42 %36 %91 %14 +OpStore %286 %66 +%287 = OpCompositeConstruct %9 %237 %237 %237 +%288 = OpCompositeConstruct %9 %66 %66 %66 +%289 = OpCompositeConstruct %9 %67 %67 %67 +%290 = OpCompositeConstruct %9 %68 %68 %68 +%291 = OpCompositeConstruct %8 %287 %288 %289 %290 +%292 = OpAccessChain %248 %42 %36 +OpStore %292 %291 +%293 = OpCompositeConstruct %17 %36 %36 +%294 = OpCompositeConstruct %17 %91 %91 +%295 = OpCompositeConstruct %18 %293 %294 +%296 = OpAccessChain %251 %42 %252 +OpStore %296 %295 +%297 = OpAccessChain %263 %42 %30 %91 %36 +OpStore %297 %65 +OpStore %283 %284 +%298 = OpCompositeConstruct %31 %237 %237 %237 %237 +OpStore %281 %298 OpReturn OpFunctionEnd -%304 = OpFunction %2 None %67 +%302 = OpFunction %2 None %62 +%301 = OpLabel +%299 = OpVariable %35 Function %300 +OpBranch %303 %303 = OpLabel -%301 = OpVariable %37 Function %302 -OpBranch %305 -%305 = OpLabel -%309 = OpLoad %4 %307 -%313 = OpIEqual %311 %309 %310 -%314 = OpAll %312 %313 -OpSelectionMerge %315 None -OpBranchConditional %314 %316 %315 +%307 = OpLoad %4 %305 +%311 = OpIEqual %309 %307 %308 +%312 = OpAll %310 %311 +OpSelectionMerge %313 None +OpBranchConditional %312 %314 %313 +%314 = OpLabel +OpStore %53 %304 +OpBranch %313 +%313 = OpLabel +OpControlBarrier %14 %14 %315 +OpBranch %316 %316 = OpLabel -OpStore %58 %306 -OpBranch %315 -%315 = OpLabel -OpControlBarrier %14 %14 %317 -OpBranch %318 -%318 = OpLabel -%319 = OpCompositeConstruct %31 %74 %74 %74 %74 -%320 = OpCompositeConstruct %31 %147 %147 %147 %147 -%321 = OpCompositeConstruct %36 %319 %320 -OpStore %301 %321 -%322 = OpFunctionCall %2 %214 %58 -%323 = OpFunctionCall %2 %220 %301 +%317 = OpCompositeConstruct %31 %69 %69 %69 %69 +%318 = OpCompositeConstruct %31 %142 %142 %142 %142 +%319 = OpCompositeConstruct %34 %317 %318 +OpStore %299 %319 +%320 = OpFunctionCall %2 %209 %53 +%321 = OpFunctionCall %2 %215 %299 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/array-in-ctor.spvasm b/tests/out/spv/array-in-ctor.spvasm index 61d1bd48df..aca4ee6824 100644 --- a/tests/out/spv/array-in-ctor.spvasm +++ b/tests/out/spv/array-in-ctor.spvasm @@ -1,39 +1,37 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 21 +; Bound: 19 OpCapability Shader OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %14 "cs_main" -OpExecutionMode %14 LocalSize 1 1 1 +OpEntryPoint GLCompute %12 "cs_main" +OpExecutionMode %12 LocalSize 1 1 1 OpDecorate %4 ArrayStride 4 OpMemberDecorate %7 0 Offset 0 -OpDecorate %10 NonWritable -OpDecorate %10 DescriptorSet 0 -OpDecorate %10 Binding 0 -OpDecorate %11 Block -OpMemberDecorate %11 0 Offset 0 +OpDecorate %8 NonWritable +OpDecorate %8 DescriptorSet 0 +OpDecorate %8 Binding 0 +OpDecorate %9 Block +OpMemberDecorate %9 0 Offset 0 %2 = OpTypeVoid %3 = OpTypeFloat 32 %6 = OpTypeInt 32 0 %5 = OpConstant %6 2 %4 = OpTypeArray %3 %5 %7 = OpTypeStruct %4 -%9 = OpTypeInt 32 1 -%8 = OpConstant %9 2 -%11 = OpTypeStruct %7 -%12 = OpTypePointer StorageBuffer %11 -%10 = OpVariable %12 StorageBuffer -%15 = OpTypeFunction %2 -%16 = OpTypePointer StorageBuffer %7 -%17 = OpConstant %6 0 -%14 = OpFunction %2 None %15 -%13 = OpLabel -%18 = OpAccessChain %16 %10 %17 -OpBranch %19 -%19 = OpLabel -%20 = OpLoad %7 %18 +%9 = OpTypeStruct %7 +%10 = OpTypePointer StorageBuffer %9 +%8 = OpVariable %10 StorageBuffer +%13 = OpTypeFunction %2 +%14 = OpTypePointer StorageBuffer %7 +%15 = OpConstant %6 0 +%12 = OpFunction %2 None %13 +%11 = OpLabel +%16 = OpAccessChain %14 %8 %15 +OpBranch %17 +%17 = OpLabel +%18 = OpLoad %7 %16 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/array-in-function-return-type.spvasm b/tests/out/spv/array-in-function-return-type.spvasm index 71e1cd6f1d..e68f6ad835 100644 --- a/tests/out/spv/array-in-function-return-type.spvasm +++ b/tests/out/spv/array-in-function-return-type.spvasm @@ -1,44 +1,42 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 28 +; Bound: 26 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %20 "main" %18 -OpExecutionMode %20 OriginUpperLeft +OpEntryPoint Fragment %18 "main" %16 +OpExecutionMode %18 OriginUpperLeft OpDecorate %4 ArrayStride 4 -OpDecorate %18 Location 0 +OpDecorate %16 Location 0 %2 = OpTypeVoid %3 = OpTypeFloat 32 %6 = OpTypeInt 32 0 %5 = OpConstant %6 2 %4 = OpTypeArray %3 %5 %7 = OpTypeVector %3 4 -%9 = OpTypeInt 32 1 -%8 = OpConstant %9 2 -%12 = OpTypeFunction %4 -%13 = OpConstant %3 1.0 -%14 = OpConstant %3 2.0 -%19 = OpTypePointer Output %7 -%18 = OpVariable %19 Output -%21 = OpTypeFunction %2 -%22 = OpConstant %3 0.0 -%11 = OpFunction %4 None %12 -%10 = OpLabel -OpBranch %15 -%15 = OpLabel -%16 = OpCompositeConstruct %4 %13 %14 -OpReturnValue %16 +%10 = OpTypeFunction %4 +%11 = OpConstant %3 1.0 +%12 = OpConstant %3 2.0 +%17 = OpTypePointer Output %7 +%16 = OpVariable %17 Output +%19 = OpTypeFunction %2 +%20 = OpConstant %3 0.0 +%9 = OpFunction %4 None %10 +%8 = OpLabel +OpBranch %13 +%13 = OpLabel +%14 = OpCompositeConstruct %4 %11 %12 +OpReturnValue %14 OpFunctionEnd -%20 = OpFunction %2 None %21 -%17 = OpLabel -OpBranch %23 -%23 = OpLabel -%24 = OpFunctionCall %4 %11 -%25 = OpCompositeExtract %3 %24 0 -%26 = OpCompositeExtract %3 %24 1 -%27 = OpCompositeConstruct %7 %25 %26 %22 %13 -OpStore %18 %27 +%18 = OpFunction %2 None %19 +%15 = OpLabel +OpBranch %21 +%21 = OpLabel +%22 = OpFunctionCall %4 %9 +%23 = OpCompositeExtract %3 %22 0 +%24 = OpCompositeExtract %3 %22 1 +%25 = OpCompositeConstruct %7 %23 %24 %20 %11 +OpStore %16 %25 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/atomicCompareExchange.spvasm b/tests/out/spv/atomicCompareExchange.spvasm index 05472b7507..c73c159ea2 100644 --- a/tests/out/spv/atomicCompareExchange.spvasm +++ b/tests/out/spv/atomicCompareExchange.spvasm @@ -6,24 +6,24 @@ OpCapability Shader OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %28 "test_atomic_compare_exchange_i32" +OpEntryPoint GLCompute %27 "test_atomic_compare_exchange_i32" OpEntryPoint GLCompute %81 "test_atomic_compare_exchange_u32" -OpExecutionMode %28 LocalSize 1 1 1 +OpExecutionMode %27 LocalSize 1 1 1 OpExecutionMode %81 LocalSize 1 1 1 OpDecorate %5 ArrayStride 4 OpDecorate %7 ArrayStride 4 +OpMemberDecorate %9 0 Offset 0 +OpMemberDecorate %9 1 Offset 4 OpMemberDecorate %10 0 Offset 0 OpMemberDecorate %10 1 Offset 4 -OpMemberDecorate %11 0 Offset 0 -OpMemberDecorate %11 1 Offset 4 -OpDecorate %12 DescriptorSet 0 -OpDecorate %12 Binding 0 -OpDecorate %13 Block -OpMemberDecorate %13 0 Offset 0 -OpDecorate %15 DescriptorSet 0 -OpDecorate %15 Binding 1 -OpDecorate %16 Block -OpMemberDecorate %16 0 Offset 0 +OpDecorate %11 DescriptorSet 0 +OpDecorate %11 Binding 0 +OpDecorate %12 Block +OpMemberDecorate %12 0 Offset 0 +OpDecorate %14 DescriptorSet 0 +OpDecorate %14 Binding 1 +OpDecorate %15 Block +OpMemberDecorate %15 0 Offset 0 %2 = OpTypeVoid %3 = OpTypeInt 32 0 %4 = OpTypeInt 32 1 @@ -31,47 +31,47 @@ OpMemberDecorate %16 0 Offset 0 %5 = OpTypeArray %4 %6 %7 = OpTypeArray %3 %6 %8 = OpTypeBool -%9 = OpTypeFloat 32 -%10 = OpTypeStruct %4 %8 -%11 = OpTypeStruct %3 %8 -%13 = OpTypeStruct %5 -%14 = OpTypePointer StorageBuffer %13 -%12 = OpVariable %14 StorageBuffer -%16 = OpTypeStruct %7 -%17 = OpTypePointer StorageBuffer %16 -%15 = OpVariable %17 StorageBuffer -%19 = OpTypePointer Function %3 -%20 = OpConstantNull %3 -%22 = OpTypePointer Function %4 -%23 = OpConstantNull %4 -%25 = OpTypePointer Function %8 -%26 = OpConstantNull %8 -%29 = OpTypeFunction %2 -%30 = OpTypePointer StorageBuffer %5 -%31 = OpConstant %3 0 -%33 = OpConstantFalse %8 -%34 = OpConstant %9 1.0 +%9 = OpTypeStruct %4 %8 +%10 = OpTypeStruct %3 %8 +%12 = OpTypeStruct %5 +%13 = OpTypePointer StorageBuffer %12 +%11 = OpVariable %13 StorageBuffer +%15 = OpTypeStruct %7 +%16 = OpTypePointer StorageBuffer %15 +%14 = OpVariable %16 StorageBuffer +%18 = OpTypePointer Function %3 +%19 = OpConstantNull %3 +%21 = OpTypePointer Function %4 +%22 = OpConstantNull %4 +%24 = OpTypePointer Function %8 +%25 = OpConstantNull %8 +%28 = OpTypeFunction %2 +%29 = OpTypePointer StorageBuffer %5 +%30 = OpConstant %3 0 +%32 = OpConstantFalse %8 +%33 = OpTypeFloat 32 +%34 = OpConstant %33 1.0 %35 = OpConstant %3 1 %48 = OpTypePointer StorageBuffer %4 %51 = OpConstant %4 1 %52 = OpConstant %3 64 %82 = OpTypePointer StorageBuffer %7 %96 = OpTypePointer StorageBuffer %3 -%28 = OpFunction %2 None %29 -%27 = OpLabel -%18 = OpVariable %19 Function %20 -%21 = OpVariable %22 Function %23 -%24 = OpVariable %25 Function %26 -%32 = OpAccessChain %30 %12 %31 +%27 = OpFunction %2 None %28 +%26 = OpLabel +%17 = OpVariable %18 Function %19 +%20 = OpVariable %21 Function %22 +%23 = OpVariable %24 Function %25 +%31 = OpAccessChain %29 %11 %30 OpBranch %36 %36 = OpLabel -OpStore %18 %31 +OpStore %17 %30 OpBranch %37 %37 = OpLabel OpLoopMerge %38 %40 None OpBranch %39 %39 = OpLabel -%41 = OpLoad %3 %18 +%41 = OpLoad %3 %17 %42 = OpULessThan %8 %41 %6 OpSelectionMerge %43 None OpBranchConditional %42 %43 %44 @@ -80,17 +80,17 @@ OpBranch %38 %43 = OpLabel OpBranch %45 %45 = OpLabel -%47 = OpLoad %3 %18 -%49 = OpAccessChain %48 %32 %47 +%47 = OpLoad %3 %17 +%49 = OpAccessChain %48 %31 %47 %50 = OpAtomicLoad %4 %49 %51 %52 -OpStore %21 %50 -OpStore %24 %33 +OpStore %20 %50 +OpStore %23 %32 OpBranch %53 %53 = OpLabel OpLoopMerge %54 %56 None OpBranch %55 %55 = OpLabel -%57 = OpLoad %8 %24 +%57 = OpLoad %8 %23 %58 = OpLogicalNot %8 %57 OpSelectionMerge %59 None OpBranchConditional %58 %59 %60 @@ -99,20 +99,20 @@ OpBranch %54 %59 = OpLabel OpBranch %61 %61 = OpLabel -%63 = OpLoad %4 %21 -%64 = OpBitcast %9 %63 -%65 = OpFAdd %9 %64 %34 +%63 = OpLoad %4 %20 +%64 = OpBitcast %33 %63 +%65 = OpFAdd %33 %64 %34 %66 = OpBitcast %4 %65 -%67 = OpLoad %3 %18 -%68 = OpLoad %4 %21 -%70 = OpAccessChain %48 %32 %67 +%67 = OpLoad %3 %17 +%68 = OpLoad %4 %20 +%70 = OpAccessChain %48 %31 %67 %71 = OpAtomicCompareExchange %4 %70 %51 %52 %52 %66 %68 %72 = OpIEqual %8 %71 %68 -%69 = OpCompositeConstruct %10 %71 %72 +%69 = OpCompositeConstruct %9 %71 %72 %73 = OpCompositeExtract %4 %69 0 -OpStore %21 %73 +OpStore %20 %73 %74 = OpCompositeExtract %8 %69 1 -OpStore %24 %74 +OpStore %23 %74 OpBranch %62 %62 = OpLabel OpBranch %56 @@ -123,22 +123,22 @@ OpBranch %46 %46 = OpLabel OpBranch %40 %40 = OpLabel -%75 = OpLoad %3 %18 +%75 = OpLoad %3 %17 %76 = OpIAdd %3 %75 %35 -OpStore %18 %76 +OpStore %17 %76 OpBranch %37 %38 = OpLabel OpReturn OpFunctionEnd -%81 = OpFunction %2 None %29 +%81 = OpFunction %2 None %28 %80 = OpLabel -%77 = OpVariable %19 Function %20 -%78 = OpVariable %19 Function %20 -%79 = OpVariable %25 Function %26 -%83 = OpAccessChain %82 %15 %31 +%77 = OpVariable %18 Function %19 +%78 = OpVariable %18 Function %19 +%79 = OpVariable %24 Function %25 +%83 = OpAccessChain %82 %14 %30 OpBranch %84 %84 = OpLabel -OpStore %77 %31 +OpStore %77 %30 OpBranch %85 %85 = OpLabel OpLoopMerge %86 %88 None @@ -157,7 +157,7 @@ OpBranch %93 %97 = OpAccessChain %96 %83 %95 %98 = OpAtomicLoad %3 %97 %51 %52 OpStore %78 %98 -OpStore %79 %33 +OpStore %79 %32 OpBranch %99 %99 = OpLabel OpLoopMerge %100 %102 None @@ -173,15 +173,15 @@ OpBranch %100 OpBranch %107 %107 = OpLabel %109 = OpLoad %3 %78 -%110 = OpBitcast %9 %109 -%111 = OpFAdd %9 %110 %34 +%110 = OpBitcast %33 %109 +%111 = OpFAdd %33 %110 %34 %112 = OpBitcast %3 %111 %113 = OpLoad %3 %77 %114 = OpLoad %3 %78 %116 = OpAccessChain %96 %83 %113 %117 = OpAtomicCompareExchange %3 %116 %51 %52 %52 %112 %114 %118 = OpIEqual %8 %117 %114 -%115 = OpCompositeConstruct %11 %117 %118 +%115 = OpCompositeConstruct %10 %117 %118 %119 = OpCompositeExtract %3 %115 0 OpStore %78 %119 %120 = OpCompositeExtract %8 %115 1 diff --git a/tests/out/spv/atomicOps.spvasm b/tests/out/spv/atomicOps.spvasm index 65d078ad93..de4d687824 100644 --- a/tests/out/spv/atomicOps.spvasm +++ b/tests/out/spv/atomicOps.spvasm @@ -6,24 +6,24 @@ OpCapability Shader OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %29 "cs_main" %26 -OpExecutionMode %29 LocalSize 2 1 1 +OpEntryPoint GLCompute %28 "cs_main" %25 +OpExecutionMode %28 LocalSize 2 1 1 OpDecorate %5 ArrayStride 4 OpMemberDecorate %7 0 Offset 0 OpMemberDecorate %7 1 Offset 4 -OpDecorate %10 DescriptorSet 0 -OpDecorate %10 Binding 0 -OpDecorate %11 Block -OpMemberDecorate %11 0 Offset 0 -OpDecorate %13 DescriptorSet 0 -OpDecorate %13 Binding 1 -OpDecorate %14 Block -OpMemberDecorate %14 0 Offset 0 -OpDecorate %16 DescriptorSet 0 -OpDecorate %16 Binding 2 -OpDecorate %17 Block -OpMemberDecorate %17 0 Offset 0 -OpDecorate %26 BuiltIn LocalInvocationId +OpDecorate %9 DescriptorSet 0 +OpDecorate %9 Binding 0 +OpDecorate %10 Block +OpMemberDecorate %10 0 Offset 0 +OpDecorate %12 DescriptorSet 0 +OpDecorate %12 Binding 1 +OpDecorate %13 Block +OpMemberDecorate %13 0 Offset 0 +OpDecorate %15 DescriptorSet 0 +OpDecorate %15 Binding 2 +OpDecorate %16 Block +OpMemberDecorate %16 0 Offset 0 +OpDecorate %25 BuiltIn LocalInvocationId %2 = OpTypeVoid %3 = OpTypeInt 32 0 %4 = OpTypeInt 32 1 @@ -31,210 +31,210 @@ OpDecorate %26 BuiltIn LocalInvocationId %5 = OpTypeArray %4 %6 %7 = OpTypeStruct %3 %5 %8 = OpTypeVector %3 3 -%9 = OpConstant %4 2 -%11 = OpTypeStruct %3 -%12 = OpTypePointer StorageBuffer %11 -%10 = OpVariable %12 StorageBuffer -%14 = OpTypeStruct %5 -%15 = OpTypePointer StorageBuffer %14 -%13 = OpVariable %15 StorageBuffer -%17 = OpTypeStruct %7 -%18 = OpTypePointer StorageBuffer %17 -%16 = OpVariable %18 StorageBuffer -%20 = OpTypePointer Workgroup %3 -%19 = OpVariable %20 Workgroup -%22 = OpTypePointer Workgroup %5 -%21 = OpVariable %22 Workgroup -%24 = OpTypePointer Workgroup %7 -%23 = OpVariable %24 Workgroup -%27 = OpTypePointer Input %8 -%26 = OpVariable %27 Input -%30 = OpTypeFunction %2 -%31 = OpTypePointer StorageBuffer %3 -%32 = OpConstant %3 0 -%34 = OpTypePointer StorageBuffer %5 -%36 = OpTypePointer StorageBuffer %7 -%38 = OpConstant %3 1 -%39 = OpConstant %4 1 -%41 = OpConstantNull %3 -%42 = OpConstantNull %5 -%43 = OpConstantNull %7 -%44 = OpConstantNull %8 -%46 = OpTypeBool -%45 = OpTypeVector %46 3 -%51 = OpConstant %3 264 -%53 = OpConstant %3 64 -%54 = OpTypePointer StorageBuffer %4 +%10 = OpTypeStruct %3 +%11 = OpTypePointer StorageBuffer %10 +%9 = OpVariable %11 StorageBuffer +%13 = OpTypeStruct %5 +%14 = OpTypePointer StorageBuffer %13 +%12 = OpVariable %14 StorageBuffer +%16 = OpTypeStruct %7 +%17 = OpTypePointer StorageBuffer %16 +%15 = OpVariable %17 StorageBuffer +%19 = OpTypePointer Workgroup %3 +%18 = OpVariable %19 Workgroup +%21 = OpTypePointer Workgroup %5 +%20 = OpVariable %21 Workgroup +%23 = OpTypePointer Workgroup %7 +%22 = OpVariable %23 Workgroup +%26 = OpTypePointer Input %8 +%25 = OpVariable %26 Input +%29 = OpTypeFunction %2 +%30 = OpTypePointer StorageBuffer %3 +%31 = OpConstant %3 0 +%33 = OpTypePointer StorageBuffer %5 +%35 = OpTypePointer StorageBuffer %7 +%37 = OpConstant %3 1 +%38 = OpConstant %4 1 +%40 = OpConstantNull %3 +%41 = OpConstantNull %5 +%42 = OpConstantNull %7 +%43 = OpConstantNull %8 +%45 = OpTypeBool +%44 = OpTypeVector %45 3 +%50 = OpConstant %3 264 +%52 = OpConstant %3 64 +%53 = OpTypePointer StorageBuffer %4 +%57 = OpConstant %4 2 %58 = OpConstant %3 256 %59 = OpTypePointer Workgroup %4 -%29 = OpFunction %2 None %30 -%25 = OpLabel -%28 = OpLoad %8 %26 -%33 = OpAccessChain %31 %10 %32 -%35 = OpAccessChain %34 %13 %32 -%37 = OpAccessChain %36 %16 %32 -OpBranch %40 -%40 = OpLabel -%47 = OpIEqual %45 %28 %44 -%48 = OpAll %46 %47 -OpSelectionMerge %49 None -OpBranchConditional %48 %50 %49 -%50 = OpLabel -OpStore %19 %41 -OpStore %21 %42 -OpStore %23 %43 -OpBranch %49 +%28 = OpFunction %2 None %29 +%24 = OpLabel +%27 = OpLoad %8 %25 +%32 = OpAccessChain %30 %9 %31 +%34 = OpAccessChain %33 %12 %31 +%36 = OpAccessChain %35 %15 %31 +OpBranch %39 +%39 = OpLabel +%46 = OpIEqual %44 %27 %43 +%47 = OpAll %45 %46 +OpSelectionMerge %48 None +OpBranchConditional %47 %49 %48 %49 = OpLabel -OpControlBarrier %6 %6 %51 -OpBranch %52 -%52 = OpLabel -OpAtomicStore %33 %39 %53 %38 -%55 = OpAccessChain %54 %35 %38 -OpAtomicStore %55 %39 %53 %39 -%56 = OpAccessChain %31 %37 %32 -OpAtomicStore %56 %39 %53 %38 -%57 = OpAccessChain %54 %37 %38 %38 -OpAtomicStore %57 %39 %53 %39 -OpAtomicStore %19 %9 %58 %38 -%60 = OpAccessChain %59 %21 %38 -OpAtomicStore %60 %9 %58 %39 -%61 = OpAccessChain %20 %23 %32 -OpAtomicStore %61 %9 %58 %38 -%62 = OpAccessChain %59 %23 %38 %38 -OpAtomicStore %62 %9 %58 %39 -OpControlBarrier %6 %6 %51 -%63 = OpAtomicLoad %3 %33 %39 %53 -%64 = OpAccessChain %54 %35 %38 -%65 = OpAtomicLoad %4 %64 %39 %53 -%66 = OpAccessChain %31 %37 %32 -%67 = OpAtomicLoad %3 %66 %39 %53 -%68 = OpAccessChain %54 %37 %38 %38 -%69 = OpAtomicLoad %4 %68 %39 %53 -%70 = OpAtomicLoad %3 %19 %9 %58 -%71 = OpAccessChain %59 %21 %38 -%72 = OpAtomicLoad %4 %71 %9 %58 -%73 = OpAccessChain %20 %23 %32 -%74 = OpAtomicLoad %3 %73 %9 %58 -%75 = OpAccessChain %59 %23 %38 %38 -%76 = OpAtomicLoad %4 %75 %9 %58 -OpControlBarrier %6 %6 %51 -%77 = OpAtomicIAdd %3 %33 %39 %53 %38 -%79 = OpAccessChain %54 %35 %38 -%78 = OpAtomicIAdd %4 %79 %39 %53 %39 -%81 = OpAccessChain %31 %37 %32 -%80 = OpAtomicIAdd %3 %81 %39 %53 %38 -%83 = OpAccessChain %54 %37 %38 %38 -%82 = OpAtomicIAdd %4 %83 %39 %53 %39 -%84 = OpAtomicIAdd %3 %19 %9 %58 %38 -%86 = OpAccessChain %59 %21 %38 -%85 = OpAtomicIAdd %4 %86 %9 %58 %39 -%88 = OpAccessChain %20 %23 %32 -%87 = OpAtomicIAdd %3 %88 %9 %58 %38 -%90 = OpAccessChain %59 %23 %38 %38 -%89 = OpAtomicIAdd %4 %90 %9 %58 %39 -OpControlBarrier %6 %6 %51 -%91 = OpAtomicISub %3 %33 %39 %53 %38 -%93 = OpAccessChain %54 %35 %38 -%92 = OpAtomicISub %4 %93 %39 %53 %39 -%95 = OpAccessChain %31 %37 %32 -%94 = OpAtomicISub %3 %95 %39 %53 %38 -%97 = OpAccessChain %54 %37 %38 %38 -%96 = OpAtomicISub %4 %97 %39 %53 %39 -%98 = OpAtomicISub %3 %19 %9 %58 %38 -%100 = OpAccessChain %59 %21 %38 -%99 = OpAtomicISub %4 %100 %9 %58 %39 -%102 = OpAccessChain %20 %23 %32 -%101 = OpAtomicISub %3 %102 %9 %58 %38 -%104 = OpAccessChain %59 %23 %38 %38 -%103 = OpAtomicISub %4 %104 %9 %58 %39 -OpControlBarrier %6 %6 %51 -%105 = OpAtomicUMax %3 %33 %39 %53 %38 -%107 = OpAccessChain %54 %35 %38 -%106 = OpAtomicSMax %4 %107 %39 %53 %39 -%109 = OpAccessChain %31 %37 %32 -%108 = OpAtomicUMax %3 %109 %39 %53 %38 -%111 = OpAccessChain %54 %37 %38 %38 -%110 = OpAtomicSMax %4 %111 %39 %53 %39 -%112 = OpAtomicUMax %3 %19 %9 %58 %38 -%114 = OpAccessChain %59 %21 %38 -%113 = OpAtomicSMax %4 %114 %9 %58 %39 -%116 = OpAccessChain %20 %23 %32 -%115 = OpAtomicUMax %3 %116 %9 %58 %38 -%118 = OpAccessChain %59 %23 %38 %38 -%117 = OpAtomicSMax %4 %118 %9 %58 %39 -OpControlBarrier %6 %6 %51 -%119 = OpAtomicUMin %3 %33 %39 %53 %38 -%121 = OpAccessChain %54 %35 %38 -%120 = OpAtomicSMin %4 %121 %39 %53 %39 -%123 = OpAccessChain %31 %37 %32 -%122 = OpAtomicUMin %3 %123 %39 %53 %38 -%125 = OpAccessChain %54 %37 %38 %38 -%124 = OpAtomicSMin %4 %125 %39 %53 %39 -%126 = OpAtomicUMin %3 %19 %9 %58 %38 -%128 = OpAccessChain %59 %21 %38 -%127 = OpAtomicSMin %4 %128 %9 %58 %39 -%130 = OpAccessChain %20 %23 %32 -%129 = OpAtomicUMin %3 %130 %9 %58 %38 -%132 = OpAccessChain %59 %23 %38 %38 -%131 = OpAtomicSMin %4 %132 %9 %58 %39 -OpControlBarrier %6 %6 %51 -%133 = OpAtomicAnd %3 %33 %39 %53 %38 -%135 = OpAccessChain %54 %35 %38 -%134 = OpAtomicAnd %4 %135 %39 %53 %39 -%137 = OpAccessChain %31 %37 %32 -%136 = OpAtomicAnd %3 %137 %39 %53 %38 -%139 = OpAccessChain %54 %37 %38 %38 -%138 = OpAtomicAnd %4 %139 %39 %53 %39 -%140 = OpAtomicAnd %3 %19 %9 %58 %38 -%142 = OpAccessChain %59 %21 %38 -%141 = OpAtomicAnd %4 %142 %9 %58 %39 -%144 = OpAccessChain %20 %23 %32 -%143 = OpAtomicAnd %3 %144 %9 %58 %38 -%146 = OpAccessChain %59 %23 %38 %38 -%145 = OpAtomicAnd %4 %146 %9 %58 %39 -OpControlBarrier %6 %6 %51 -%147 = OpAtomicOr %3 %33 %39 %53 %38 -%149 = OpAccessChain %54 %35 %38 -%148 = OpAtomicOr %4 %149 %39 %53 %39 -%151 = OpAccessChain %31 %37 %32 -%150 = OpAtomicOr %3 %151 %39 %53 %38 -%153 = OpAccessChain %54 %37 %38 %38 -%152 = OpAtomicOr %4 %153 %39 %53 %39 -%154 = OpAtomicOr %3 %19 %9 %58 %38 -%156 = OpAccessChain %59 %21 %38 -%155 = OpAtomicOr %4 %156 %9 %58 %39 -%158 = OpAccessChain %20 %23 %32 -%157 = OpAtomicOr %3 %158 %9 %58 %38 -%160 = OpAccessChain %59 %23 %38 %38 -%159 = OpAtomicOr %4 %160 %9 %58 %39 -OpControlBarrier %6 %6 %51 -%161 = OpAtomicXor %3 %33 %39 %53 %38 -%163 = OpAccessChain %54 %35 %38 -%162 = OpAtomicXor %4 %163 %39 %53 %39 -%165 = OpAccessChain %31 %37 %32 -%164 = OpAtomicXor %3 %165 %39 %53 %38 -%167 = OpAccessChain %54 %37 %38 %38 -%166 = OpAtomicXor %4 %167 %39 %53 %39 -%168 = OpAtomicXor %3 %19 %9 %58 %38 -%170 = OpAccessChain %59 %21 %38 -%169 = OpAtomicXor %4 %170 %9 %58 %39 -%172 = OpAccessChain %20 %23 %32 -%171 = OpAtomicXor %3 %172 %9 %58 %38 -%174 = OpAccessChain %59 %23 %38 %38 -%173 = OpAtomicXor %4 %174 %9 %58 %39 -%175 = OpAtomicExchange %3 %33 %39 %53 %38 -%177 = OpAccessChain %54 %35 %38 -%176 = OpAtomicExchange %4 %177 %39 %53 %39 -%179 = OpAccessChain %31 %37 %32 -%178 = OpAtomicExchange %3 %179 %39 %53 %38 -%181 = OpAccessChain %54 %37 %38 %38 -%180 = OpAtomicExchange %4 %181 %39 %53 %39 -%182 = OpAtomicExchange %3 %19 %9 %58 %38 -%184 = OpAccessChain %59 %21 %38 -%183 = OpAtomicExchange %4 %184 %9 %58 %39 -%186 = OpAccessChain %20 %23 %32 -%185 = OpAtomicExchange %3 %186 %9 %58 %38 -%188 = OpAccessChain %59 %23 %38 %38 -%187 = OpAtomicExchange %4 %188 %9 %58 %39 +OpStore %18 %40 +OpStore %20 %41 +OpStore %22 %42 +OpBranch %48 +%48 = OpLabel +OpControlBarrier %6 %6 %50 +OpBranch %51 +%51 = OpLabel +OpAtomicStore %32 %38 %52 %37 +%54 = OpAccessChain %53 %34 %37 +OpAtomicStore %54 %38 %52 %38 +%55 = OpAccessChain %30 %36 %31 +OpAtomicStore %55 %38 %52 %37 +%56 = OpAccessChain %53 %36 %37 %37 +OpAtomicStore %56 %38 %52 %38 +OpAtomicStore %18 %57 %58 %37 +%60 = OpAccessChain %59 %20 %37 +OpAtomicStore %60 %57 %58 %38 +%61 = OpAccessChain %19 %22 %31 +OpAtomicStore %61 %57 %58 %37 +%62 = OpAccessChain %59 %22 %37 %37 +OpAtomicStore %62 %57 %58 %38 +OpControlBarrier %6 %6 %50 +%63 = OpAtomicLoad %3 %32 %38 %52 +%64 = OpAccessChain %53 %34 %37 +%65 = OpAtomicLoad %4 %64 %38 %52 +%66 = OpAccessChain %30 %36 %31 +%67 = OpAtomicLoad %3 %66 %38 %52 +%68 = OpAccessChain %53 %36 %37 %37 +%69 = OpAtomicLoad %4 %68 %38 %52 +%70 = OpAtomicLoad %3 %18 %57 %58 +%71 = OpAccessChain %59 %20 %37 +%72 = OpAtomicLoad %4 %71 %57 %58 +%73 = OpAccessChain %19 %22 %31 +%74 = OpAtomicLoad %3 %73 %57 %58 +%75 = OpAccessChain %59 %22 %37 %37 +%76 = OpAtomicLoad %4 %75 %57 %58 +OpControlBarrier %6 %6 %50 +%77 = OpAtomicIAdd %3 %32 %38 %52 %37 +%79 = OpAccessChain %53 %34 %37 +%78 = OpAtomicIAdd %4 %79 %38 %52 %38 +%81 = OpAccessChain %30 %36 %31 +%80 = OpAtomicIAdd %3 %81 %38 %52 %37 +%83 = OpAccessChain %53 %36 %37 %37 +%82 = OpAtomicIAdd %4 %83 %38 %52 %38 +%84 = OpAtomicIAdd %3 %18 %57 %58 %37 +%86 = OpAccessChain %59 %20 %37 +%85 = OpAtomicIAdd %4 %86 %57 %58 %38 +%88 = OpAccessChain %19 %22 %31 +%87 = OpAtomicIAdd %3 %88 %57 %58 %37 +%90 = OpAccessChain %59 %22 %37 %37 +%89 = OpAtomicIAdd %4 %90 %57 %58 %38 +OpControlBarrier %6 %6 %50 +%91 = OpAtomicISub %3 %32 %38 %52 %37 +%93 = OpAccessChain %53 %34 %37 +%92 = OpAtomicISub %4 %93 %38 %52 %38 +%95 = OpAccessChain %30 %36 %31 +%94 = OpAtomicISub %3 %95 %38 %52 %37 +%97 = OpAccessChain %53 %36 %37 %37 +%96 = OpAtomicISub %4 %97 %38 %52 %38 +%98 = OpAtomicISub %3 %18 %57 %58 %37 +%100 = OpAccessChain %59 %20 %37 +%99 = OpAtomicISub %4 %100 %57 %58 %38 +%102 = OpAccessChain %19 %22 %31 +%101 = OpAtomicISub %3 %102 %57 %58 %37 +%104 = OpAccessChain %59 %22 %37 %37 +%103 = OpAtomicISub %4 %104 %57 %58 %38 +OpControlBarrier %6 %6 %50 +%105 = OpAtomicUMax %3 %32 %38 %52 %37 +%107 = OpAccessChain %53 %34 %37 +%106 = OpAtomicSMax %4 %107 %38 %52 %38 +%109 = OpAccessChain %30 %36 %31 +%108 = OpAtomicUMax %3 %109 %38 %52 %37 +%111 = OpAccessChain %53 %36 %37 %37 +%110 = OpAtomicSMax %4 %111 %38 %52 %38 +%112 = OpAtomicUMax %3 %18 %57 %58 %37 +%114 = OpAccessChain %59 %20 %37 +%113 = OpAtomicSMax %4 %114 %57 %58 %38 +%116 = OpAccessChain %19 %22 %31 +%115 = OpAtomicUMax %3 %116 %57 %58 %37 +%118 = OpAccessChain %59 %22 %37 %37 +%117 = OpAtomicSMax %4 %118 %57 %58 %38 +OpControlBarrier %6 %6 %50 +%119 = OpAtomicUMin %3 %32 %38 %52 %37 +%121 = OpAccessChain %53 %34 %37 +%120 = OpAtomicSMin %4 %121 %38 %52 %38 +%123 = OpAccessChain %30 %36 %31 +%122 = OpAtomicUMin %3 %123 %38 %52 %37 +%125 = OpAccessChain %53 %36 %37 %37 +%124 = OpAtomicSMin %4 %125 %38 %52 %38 +%126 = OpAtomicUMin %3 %18 %57 %58 %37 +%128 = OpAccessChain %59 %20 %37 +%127 = OpAtomicSMin %4 %128 %57 %58 %38 +%130 = OpAccessChain %19 %22 %31 +%129 = OpAtomicUMin %3 %130 %57 %58 %37 +%132 = OpAccessChain %59 %22 %37 %37 +%131 = OpAtomicSMin %4 %132 %57 %58 %38 +OpControlBarrier %6 %6 %50 +%133 = OpAtomicAnd %3 %32 %38 %52 %37 +%135 = OpAccessChain %53 %34 %37 +%134 = OpAtomicAnd %4 %135 %38 %52 %38 +%137 = OpAccessChain %30 %36 %31 +%136 = OpAtomicAnd %3 %137 %38 %52 %37 +%139 = OpAccessChain %53 %36 %37 %37 +%138 = OpAtomicAnd %4 %139 %38 %52 %38 +%140 = OpAtomicAnd %3 %18 %57 %58 %37 +%142 = OpAccessChain %59 %20 %37 +%141 = OpAtomicAnd %4 %142 %57 %58 %38 +%144 = OpAccessChain %19 %22 %31 +%143 = OpAtomicAnd %3 %144 %57 %58 %37 +%146 = OpAccessChain %59 %22 %37 %37 +%145 = OpAtomicAnd %4 %146 %57 %58 %38 +OpControlBarrier %6 %6 %50 +%147 = OpAtomicOr %3 %32 %38 %52 %37 +%149 = OpAccessChain %53 %34 %37 +%148 = OpAtomicOr %4 %149 %38 %52 %38 +%151 = OpAccessChain %30 %36 %31 +%150 = OpAtomicOr %3 %151 %38 %52 %37 +%153 = OpAccessChain %53 %36 %37 %37 +%152 = OpAtomicOr %4 %153 %38 %52 %38 +%154 = OpAtomicOr %3 %18 %57 %58 %37 +%156 = OpAccessChain %59 %20 %37 +%155 = OpAtomicOr %4 %156 %57 %58 %38 +%158 = OpAccessChain %19 %22 %31 +%157 = OpAtomicOr %3 %158 %57 %58 %37 +%160 = OpAccessChain %59 %22 %37 %37 +%159 = OpAtomicOr %4 %160 %57 %58 %38 +OpControlBarrier %6 %6 %50 +%161 = OpAtomicXor %3 %32 %38 %52 %37 +%163 = OpAccessChain %53 %34 %37 +%162 = OpAtomicXor %4 %163 %38 %52 %38 +%165 = OpAccessChain %30 %36 %31 +%164 = OpAtomicXor %3 %165 %38 %52 %37 +%167 = OpAccessChain %53 %36 %37 %37 +%166 = OpAtomicXor %4 %167 %38 %52 %38 +%168 = OpAtomicXor %3 %18 %57 %58 %37 +%170 = OpAccessChain %59 %20 %37 +%169 = OpAtomicXor %4 %170 %57 %58 %38 +%172 = OpAccessChain %19 %22 %31 +%171 = OpAtomicXor %3 %172 %57 %58 %37 +%174 = OpAccessChain %59 %22 %37 %37 +%173 = OpAtomicXor %4 %174 %57 %58 %38 +%175 = OpAtomicExchange %3 %32 %38 %52 %37 +%177 = OpAccessChain %53 %34 %37 +%176 = OpAtomicExchange %4 %177 %38 %52 %38 +%179 = OpAccessChain %30 %36 %31 +%178 = OpAtomicExchange %3 %179 %38 %52 %37 +%181 = OpAccessChain %53 %36 %37 %37 +%180 = OpAtomicExchange %4 %181 %38 %52 %38 +%182 = OpAtomicExchange %3 %18 %57 %58 %37 +%184 = OpAccessChain %59 %20 %37 +%183 = OpAtomicExchange %4 %184 %57 %58 %38 +%186 = OpAccessChain %19 %22 %31 +%185 = OpAtomicExchange %3 %186 %57 %58 %37 +%188 = OpAccessChain %59 %22 %37 %37 +%187 = OpAtomicExchange %4 %188 %57 %58 %38 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/binding-arrays.spvasm b/tests/out/spv/binding-arrays.spvasm index 0901731005..57636775f0 100644 --- a/tests/out/spv/binding-arrays.spvasm +++ b/tests/out/spv/binding-arrays.spvasm @@ -1,62 +1,62 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 432 +; Bound: 431 OpCapability Shader OpCapability ImageQuery OpCapability ShaderNonUniform OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %68 "main" %63 %66 -OpExecutionMode %68 OriginUpperLeft +OpEntryPoint Fragment %64 "main" %59 %62 +OpExecutionMode %64 OriginUpperLeft OpMemberDecorate %4 0 Offset 0 OpMemberDecorate %21 0 Offset 0 +OpDecorate %24 DescriptorSet 0 +OpDecorate %24 Binding 0 OpDecorate %28 DescriptorSet 0 -OpDecorate %28 Binding 0 +OpDecorate %28 Binding 1 +OpDecorate %30 DescriptorSet 0 +OpDecorate %30 Binding 2 OpDecorate %32 DescriptorSet 0 -OpDecorate %32 Binding 1 +OpDecorate %32 Binding 3 OpDecorate %34 DescriptorSet 0 -OpDecorate %34 Binding 2 +OpDecorate %34 Binding 4 OpDecorate %36 DescriptorSet 0 -OpDecorate %36 Binding 3 +OpDecorate %36 Binding 5 OpDecorate %38 DescriptorSet 0 -OpDecorate %38 Binding 4 +OpDecorate %38 Binding 6 OpDecorate %40 DescriptorSet 0 -OpDecorate %40 Binding 5 +OpDecorate %40 Binding 7 OpDecorate %42 DescriptorSet 0 -OpDecorate %42 Binding 6 -OpDecorate %44 DescriptorSet 0 -OpDecorate %44 Binding 7 -OpDecorate %46 DescriptorSet 0 -OpDecorate %46 Binding 8 -OpDecorate %47 Block -OpMemberDecorate %47 0 Offset 0 -OpDecorate %63 Location 0 -OpDecorate %63 Flat -OpDecorate %66 Location 0 -OpDecorate %96 NonUniform -OpDecorate %119 NonUniform -OpDecorate %121 NonUniform -OpDecorate %146 NonUniform -OpDecorate %148 NonUniform -OpDecorate %184 NonUniform -OpDecorate %212 NonUniform -OpDecorate %228 NonUniform -OpDecorate %244 NonUniform -OpDecorate %265 NonUniform -OpDecorate %267 NonUniform -OpDecorate %289 NonUniform -OpDecorate %291 NonUniform -OpDecorate %313 NonUniform -OpDecorate %315 NonUniform -OpDecorate %337 NonUniform -OpDecorate %339 NonUniform -OpDecorate %361 NonUniform -OpDecorate %363 NonUniform -OpDecorate %385 NonUniform -OpDecorate %387 NonUniform -OpDecorate %410 NonUniform +OpDecorate %42 Binding 8 +OpDecorate %43 Block +OpMemberDecorate %43 0 Offset 0 +OpDecorate %59 Location 0 +OpDecorate %59 Flat +OpDecorate %62 Location 0 +OpDecorate %95 NonUniform +OpDecorate %118 NonUniform +OpDecorate %120 NonUniform +OpDecorate %145 NonUniform +OpDecorate %147 NonUniform +OpDecorate %183 NonUniform +OpDecorate %211 NonUniform +OpDecorate %227 NonUniform +OpDecorate %243 NonUniform +OpDecorate %264 NonUniform +OpDecorate %266 NonUniform +OpDecorate %288 NonUniform +OpDecorate %290 NonUniform +OpDecorate %312 NonUniform +OpDecorate %314 NonUniform +OpDecorate %336 NonUniform +OpDecorate %338 NonUniform +OpDecorate %360 NonUniform +OpDecorate %362 NonUniform +OpDecorate %384 NonUniform +OpDecorate %386 NonUniform +OpDecorate %409 NonUniform %2 = OpTypeVoid %3 = OpTypeInt 32 0 %4 = OpTypeStruct %3 @@ -79,482 +79,481 @@ OpDecorate %410 NonUniform %21 = OpTypeStruct %3 %22 = OpTypeVector %6 4 %23 = OpTypeVector %3 2 -%24 = OpTypeVector %6 2 -%26 = OpTypeInt 32 1 -%25 = OpTypeVector %26 2 -%27 = OpConstant %26 5 -%31 = OpConstant %3 10 -%30 = OpTypeArray %5 %31 -%29 = OpTypePointer UniformConstant %30 +%27 = OpConstant %3 10 +%26 = OpTypeArray %5 %27 +%25 = OpTypePointer UniformConstant %26 +%24 = OpVariable %25 UniformConstant +%29 = OpTypePointer UniformConstant %8 %28 = OpVariable %29 UniformConstant -%33 = OpTypePointer UniformConstant %8 +%31 = OpTypePointer UniformConstant %11 +%30 = OpVariable %31 UniformConstant +%33 = OpTypePointer UniformConstant %13 %32 = OpVariable %33 UniformConstant -%35 = OpTypePointer UniformConstant %11 +%35 = OpTypePointer UniformConstant %15 %34 = OpVariable %35 UniformConstant -%37 = OpTypePointer UniformConstant %13 +%37 = OpTypePointer UniformConstant %17 %36 = OpVariable %37 UniformConstant -%39 = OpTypePointer UniformConstant %15 +%39 = OpTypePointer UniformConstant %19 %38 = OpVariable %39 UniformConstant -%41 = OpTypePointer UniformConstant %17 +%41 = OpTypePointer UniformConstant %20 %40 = OpVariable %41 UniformConstant -%43 = OpTypePointer UniformConstant %19 -%42 = OpVariable %43 UniformConstant -%45 = OpTypePointer UniformConstant %20 -%44 = OpVariable %45 UniformConstant -%47 = OpTypeStruct %4 -%48 = OpTypePointer Uniform %47 -%46 = OpVariable %48 Uniform -%50 = OpTypePointer Function %3 -%51 = OpConstantNull %3 -%53 = OpTypePointer Function %23 -%54 = OpConstantNull %23 -%56 = OpTypePointer Function %6 -%57 = OpConstantNull %6 -%59 = OpTypePointer Function %22 -%60 = OpConstantNull %22 -%64 = OpTypePointer Input %3 -%63 = OpVariable %64 Input -%67 = OpTypePointer Output %22 -%66 = OpVariable %67 Output -%69 = OpTypeFunction %2 -%70 = OpTypePointer Uniform %4 -%71 = OpConstant %3 0 -%73 = OpConstant %6 0.0 -%74 = OpConstant %26 0 -%76 = OpTypePointer Uniform %3 -%84 = OpTypePointer UniformConstant %5 -%102 = OpTypePointer UniformConstant %18 -%105 = OpTypeSampledImage %5 -%126 = OpTypePointer UniformConstant %14 -%129 = OpTypePointer UniformConstant %18 -%132 = OpTypeSampledImage %14 -%155 = OpTypeBool -%161 = OpTypeVector %155 2 -%197 = OpTypePointer UniformConstant %10 -%200 = OpTypeVector %3 3 -%232 = OpTypePointer UniformConstant %12 -%392 = OpTypePointer UniformConstant %16 -%68 = OpFunction %2 None %69 -%61 = OpLabel -%52 = OpVariable %53 Function %54 -%58 = OpVariable %59 Function %60 -%49 = OpVariable %50 Function %51 -%55 = OpVariable %56 Function %57 -%65 = OpLoad %3 %63 -%62 = OpCompositeConstruct %21 %65 -%72 = OpAccessChain %70 %46 %71 -OpBranch %75 -%75 = OpLabel -%77 = OpAccessChain %76 %72 %71 -%78 = OpLoad %3 %77 -%79 = OpCompositeExtract %3 %62 0 -OpStore %49 %71 -%80 = OpCompositeConstruct %23 %71 %71 -OpStore %52 %80 -OpStore %55 %73 -%81 = OpCompositeConstruct %22 %73 %73 %73 %73 -OpStore %58 %81 -%82 = OpCompositeConstruct %24 %73 %73 -%83 = OpCompositeConstruct %25 %74 %74 -%85 = OpAccessChain %84 %28 %71 -%86 = OpLoad %5 %85 -%87 = OpImageQuerySizeLod %23 %86 %71 -%88 = OpLoad %23 %52 -%89 = OpIAdd %23 %88 %87 -OpStore %52 %89 -%90 = OpAccessChain %84 %28 %78 -%91 = OpLoad %5 %90 -%92 = OpImageQuerySizeLod %23 %91 %71 -%93 = OpLoad %23 %52 -%94 = OpIAdd %23 %93 %92 -OpStore %52 %94 -%95 = OpAccessChain %84 %28 %79 -%96 = OpLoad %5 %95 -%97 = OpImageQuerySizeLod %23 %96 %71 -%98 = OpLoad %23 %52 -%99 = OpIAdd %23 %98 %97 -OpStore %52 %99 -%100 = OpAccessChain %84 %32 %71 -%101 = OpLoad %5 %100 -%103 = OpAccessChain %102 %42 %71 -%104 = OpLoad %18 %103 -%106 = OpSampledImage %105 %101 %104 -%107 = OpImageGather %22 %106 %82 %71 -%108 = OpLoad %22 %58 -%109 = OpFAdd %22 %108 %107 -OpStore %58 %109 -%110 = OpAccessChain %84 %32 %78 -%111 = OpLoad %5 %110 -%112 = OpAccessChain %102 %42 %78 -%113 = OpLoad %18 %112 -%114 = OpSampledImage %105 %111 %113 -%115 = OpImageGather %22 %114 %82 %71 -%116 = OpLoad %22 %58 -%117 = OpFAdd %22 %116 %115 -OpStore %58 %117 -%118 = OpAccessChain %84 %32 %79 -%119 = OpLoad %5 %118 -%120 = OpAccessChain %102 %42 %79 -%121 = OpLoad %18 %120 -%122 = OpSampledImage %105 %119 %121 -%123 = OpImageGather %22 %122 %82 %71 -%124 = OpLoad %22 %58 -%125 = OpFAdd %22 %124 %123 -OpStore %58 %125 -%127 = OpAccessChain %126 %38 %71 -%128 = OpLoad %14 %127 -%130 = OpAccessChain %129 %44 %71 -%131 = OpLoad %18 %130 -%133 = OpSampledImage %132 %128 %131 -%134 = OpImageDrefGather %22 %133 %82 %73 -%135 = OpLoad %22 %58 -%136 = OpFAdd %22 %135 %134 -OpStore %58 %136 -%137 = OpAccessChain %126 %38 %78 -%138 = OpLoad %14 %137 -%139 = OpAccessChain %129 %44 %78 -%140 = OpLoad %18 %139 -%141 = OpSampledImage %132 %138 %140 -%142 = OpImageDrefGather %22 %141 %82 %73 -%143 = OpLoad %22 %58 -%144 = OpFAdd %22 %143 %142 -OpStore %58 %144 -%145 = OpAccessChain %126 %38 %79 -%146 = OpLoad %14 %145 -%147 = OpAccessChain %129 %44 %79 -%148 = OpLoad %18 %147 -%149 = OpSampledImage %132 %146 %148 -%150 = OpImageDrefGather %22 %149 %82 %73 -%151 = OpLoad %22 %58 -%152 = OpFAdd %22 %151 %150 -OpStore %58 %152 -%153 = OpAccessChain %84 %28 %71 -%154 = OpLoad %5 %153 -%156 = OpImageQueryLevels %26 %154 -%157 = OpULessThan %155 %74 %156 -OpSelectionMerge %158 None -OpBranchConditional %157 %159 %158 -%159 = OpLabel -%160 = OpImageQuerySizeLod %25 %154 %74 -%162 = OpULessThan %161 %83 %160 -%163 = OpAll %155 %162 -OpBranchConditional %163 %164 %158 -%164 = OpLabel -%165 = OpImageFetch %22 %154 %83 Lod %74 -OpBranch %158 +%43 = OpTypeStruct %4 +%44 = OpTypePointer Uniform %43 +%42 = OpVariable %44 Uniform +%46 = OpTypePointer Function %3 +%47 = OpConstantNull %3 +%49 = OpTypePointer Function %23 +%50 = OpConstantNull %23 +%52 = OpTypePointer Function %6 +%53 = OpConstantNull %6 +%55 = OpTypePointer Function %22 +%56 = OpConstantNull %22 +%60 = OpTypePointer Input %3 +%59 = OpVariable %60 Input +%63 = OpTypePointer Output %22 +%62 = OpVariable %63 Output +%65 = OpTypeFunction %2 +%66 = OpTypePointer Uniform %4 +%67 = OpConstant %3 0 +%69 = OpConstant %6 0.0 +%70 = OpTypeInt 32 1 +%71 = OpConstant %70 0 +%73 = OpTypePointer Uniform %3 +%79 = OpTypeVector %6 2 +%81 = OpTypeVector %70 2 +%83 = OpTypePointer UniformConstant %5 +%101 = OpTypePointer UniformConstant %18 +%104 = OpTypeSampledImage %5 +%125 = OpTypePointer UniformConstant %14 +%128 = OpTypePointer UniformConstant %18 +%131 = OpTypeSampledImage %14 +%154 = OpTypeBool +%160 = OpTypeVector %154 2 +%196 = OpTypePointer UniformConstant %10 +%199 = OpTypeVector %3 3 +%231 = OpTypePointer UniformConstant %12 +%391 = OpTypePointer UniformConstant %16 +%64 = OpFunction %2 None %65 +%57 = OpLabel +%48 = OpVariable %49 Function %50 +%54 = OpVariable %55 Function %56 +%45 = OpVariable %46 Function %47 +%51 = OpVariable %52 Function %53 +%61 = OpLoad %3 %59 +%58 = OpCompositeConstruct %21 %61 +%68 = OpAccessChain %66 %42 %67 +OpBranch %72 +%72 = OpLabel +%74 = OpAccessChain %73 %68 %67 +%75 = OpLoad %3 %74 +%76 = OpCompositeExtract %3 %58 0 +OpStore %45 %67 +%77 = OpCompositeConstruct %23 %67 %67 +OpStore %48 %77 +OpStore %51 %69 +%78 = OpCompositeConstruct %22 %69 %69 %69 %69 +OpStore %54 %78 +%80 = OpCompositeConstruct %79 %69 %69 +%82 = OpCompositeConstruct %81 %71 %71 +%84 = OpAccessChain %83 %24 %67 +%85 = OpLoad %5 %84 +%86 = OpImageQuerySizeLod %23 %85 %67 +%87 = OpLoad %23 %48 +%88 = OpIAdd %23 %87 %86 +OpStore %48 %88 +%89 = OpAccessChain %83 %24 %75 +%90 = OpLoad %5 %89 +%91 = OpImageQuerySizeLod %23 %90 %67 +%92 = OpLoad %23 %48 +%93 = OpIAdd %23 %92 %91 +OpStore %48 %93 +%94 = OpAccessChain %83 %24 %76 +%95 = OpLoad %5 %94 +%96 = OpImageQuerySizeLod %23 %95 %67 +%97 = OpLoad %23 %48 +%98 = OpIAdd %23 %97 %96 +OpStore %48 %98 +%99 = OpAccessChain %83 %28 %67 +%100 = OpLoad %5 %99 +%102 = OpAccessChain %101 %38 %67 +%103 = OpLoad %18 %102 +%105 = OpSampledImage %104 %100 %103 +%106 = OpImageGather %22 %105 %80 %67 +%107 = OpLoad %22 %54 +%108 = OpFAdd %22 %107 %106 +OpStore %54 %108 +%109 = OpAccessChain %83 %28 %75 +%110 = OpLoad %5 %109 +%111 = OpAccessChain %101 %38 %75 +%112 = OpLoad %18 %111 +%113 = OpSampledImage %104 %110 %112 +%114 = OpImageGather %22 %113 %80 %67 +%115 = OpLoad %22 %54 +%116 = OpFAdd %22 %115 %114 +OpStore %54 %116 +%117 = OpAccessChain %83 %28 %76 +%118 = OpLoad %5 %117 +%119 = OpAccessChain %101 %38 %76 +%120 = OpLoad %18 %119 +%121 = OpSampledImage %104 %118 %120 +%122 = OpImageGather %22 %121 %80 %67 +%123 = OpLoad %22 %54 +%124 = OpFAdd %22 %123 %122 +OpStore %54 %124 +%126 = OpAccessChain %125 %34 %67 +%127 = OpLoad %14 %126 +%129 = OpAccessChain %128 %40 %67 +%130 = OpLoad %18 %129 +%132 = OpSampledImage %131 %127 %130 +%133 = OpImageDrefGather %22 %132 %80 %69 +%134 = OpLoad %22 %54 +%135 = OpFAdd %22 %134 %133 +OpStore %54 %135 +%136 = OpAccessChain %125 %34 %75 +%137 = OpLoad %14 %136 +%138 = OpAccessChain %128 %40 %75 +%139 = OpLoad %18 %138 +%140 = OpSampledImage %131 %137 %139 +%141 = OpImageDrefGather %22 %140 %80 %69 +%142 = OpLoad %22 %54 +%143 = OpFAdd %22 %142 %141 +OpStore %54 %143 +%144 = OpAccessChain %125 %34 %76 +%145 = OpLoad %14 %144 +%146 = OpAccessChain %128 %40 %76 +%147 = OpLoad %18 %146 +%148 = OpSampledImage %131 %145 %147 +%149 = OpImageDrefGather %22 %148 %80 %69 +%150 = OpLoad %22 %54 +%151 = OpFAdd %22 %150 %149 +OpStore %54 %151 +%152 = OpAccessChain %83 %24 %67 +%153 = OpLoad %5 %152 +%155 = OpImageQueryLevels %70 %153 +%156 = OpULessThan %154 %71 %155 +OpSelectionMerge %157 None +OpBranchConditional %156 %158 %157 %158 = OpLabel -%166 = OpPhi %22 %60 %75 %60 %159 %165 %164 -%167 = OpLoad %22 %58 -%168 = OpFAdd %22 %167 %166 -OpStore %58 %168 -%169 = OpAccessChain %84 %28 %78 -%170 = OpLoad %5 %169 -%171 = OpImageQueryLevels %26 %170 -%172 = OpULessThan %155 %74 %171 -OpSelectionMerge %173 None -OpBranchConditional %172 %174 %173 -%174 = OpLabel -%175 = OpImageQuerySizeLod %25 %170 %74 -%176 = OpULessThan %161 %83 %175 -%177 = OpAll %155 %176 -OpBranchConditional %177 %178 %173 -%178 = OpLabel -%179 = OpImageFetch %22 %170 %83 Lod %74 -OpBranch %173 +%159 = OpImageQuerySizeLod %81 %153 %71 +%161 = OpULessThan %160 %82 %159 +%162 = OpAll %154 %161 +OpBranchConditional %162 %163 %157 +%163 = OpLabel +%164 = OpImageFetch %22 %153 %82 Lod %71 +OpBranch %157 +%157 = OpLabel +%165 = OpPhi %22 %56 %72 %56 %158 %164 %163 +%166 = OpLoad %22 %54 +%167 = OpFAdd %22 %166 %165 +OpStore %54 %167 +%168 = OpAccessChain %83 %24 %75 +%169 = OpLoad %5 %168 +%170 = OpImageQueryLevels %70 %169 +%171 = OpULessThan %154 %71 %170 +OpSelectionMerge %172 None +OpBranchConditional %171 %173 %172 %173 = OpLabel -%180 = OpPhi %22 %60 %158 %60 %174 %179 %178 -%181 = OpLoad %22 %58 -%182 = OpFAdd %22 %181 %180 -OpStore %58 %182 -%183 = OpAccessChain %84 %28 %79 -%184 = OpLoad %5 %183 -%185 = OpImageQueryLevels %26 %184 -%186 = OpULessThan %155 %74 %185 -OpSelectionMerge %187 None -OpBranchConditional %186 %188 %187 -%188 = OpLabel -%189 = OpImageQuerySizeLod %25 %184 %74 -%190 = OpULessThan %161 %83 %189 -%191 = OpAll %155 %190 -OpBranchConditional %191 %192 %187 -%192 = OpLabel -%193 = OpImageFetch %22 %184 %83 Lod %74 -OpBranch %187 +%174 = OpImageQuerySizeLod %81 %169 %71 +%175 = OpULessThan %160 %82 %174 +%176 = OpAll %154 %175 +OpBranchConditional %176 %177 %172 +%177 = OpLabel +%178 = OpImageFetch %22 %169 %82 Lod %71 +OpBranch %172 +%172 = OpLabel +%179 = OpPhi %22 %56 %157 %56 %173 %178 %177 +%180 = OpLoad %22 %54 +%181 = OpFAdd %22 %180 %179 +OpStore %54 %181 +%182 = OpAccessChain %83 %24 %76 +%183 = OpLoad %5 %182 +%184 = OpImageQueryLevels %70 %183 +%185 = OpULessThan %154 %71 %184 +OpSelectionMerge %186 None +OpBranchConditional %185 %187 %186 %187 = OpLabel -%194 = OpPhi %22 %60 %173 %60 %188 %193 %192 -%195 = OpLoad %22 %58 -%196 = OpFAdd %22 %195 %194 -OpStore %58 %196 -%198 = OpAccessChain %197 %34 %71 -%199 = OpLoad %10 %198 -%201 = OpImageQuerySizeLod %200 %199 %71 -%202 = OpCompositeExtract %3 %201 2 -%203 = OpLoad %3 %49 -%204 = OpIAdd %3 %203 %202 -OpStore %49 %204 -%205 = OpAccessChain %197 %34 %78 -%206 = OpLoad %10 %205 -%207 = OpImageQuerySizeLod %200 %206 %71 -%208 = OpCompositeExtract %3 %207 2 -%209 = OpLoad %3 %49 -%210 = OpIAdd %3 %209 %208 -OpStore %49 %210 -%211 = OpAccessChain %197 %34 %79 -%212 = OpLoad %10 %211 -%213 = OpImageQuerySizeLod %200 %212 %71 -%214 = OpCompositeExtract %3 %213 2 -%215 = OpLoad %3 %49 -%216 = OpIAdd %3 %215 %214 -OpStore %49 %216 -%217 = OpAccessChain %84 %32 %71 -%218 = OpLoad %5 %217 -%219 = OpImageQueryLevels %3 %218 -%220 = OpLoad %3 %49 -%221 = OpIAdd %3 %220 %219 -OpStore %49 %221 -%222 = OpAccessChain %84 %32 %78 -%223 = OpLoad %5 %222 -%224 = OpImageQueryLevels %3 %223 -%225 = OpLoad %3 %49 -%226 = OpIAdd %3 %225 %224 -OpStore %49 %226 -%227 = OpAccessChain %84 %32 %79 -%228 = OpLoad %5 %227 -%229 = OpImageQueryLevels %3 %228 -%230 = OpLoad %3 %49 -%231 = OpIAdd %3 %230 %229 -OpStore %49 %231 -%233 = OpAccessChain %232 %36 %71 -%234 = OpLoad %12 %233 -%235 = OpImageQuerySamples %3 %234 -%236 = OpLoad %3 %49 -%237 = OpIAdd %3 %236 %235 -OpStore %49 %237 -%238 = OpAccessChain %232 %36 %78 -%239 = OpLoad %12 %238 -%240 = OpImageQuerySamples %3 %239 -%241 = OpLoad %3 %49 -%242 = OpIAdd %3 %241 %240 -OpStore %49 %242 -%243 = OpAccessChain %232 %36 %79 -%244 = OpLoad %12 %243 -%245 = OpImageQuerySamples %3 %244 -%246 = OpLoad %3 %49 -%247 = OpIAdd %3 %246 %245 -OpStore %49 %247 -%248 = OpAccessChain %84 %32 %71 -%249 = OpLoad %5 %248 -%250 = OpAccessChain %102 %42 %71 -%251 = OpLoad %18 %250 -%252 = OpSampledImage %105 %249 %251 -%253 = OpImageSampleImplicitLod %22 %252 %82 -%254 = OpLoad %22 %58 -%255 = OpFAdd %22 %254 %253 -OpStore %58 %255 -%256 = OpAccessChain %84 %32 %78 -%257 = OpLoad %5 %256 -%258 = OpAccessChain %102 %42 %78 -%259 = OpLoad %18 %258 -%260 = OpSampledImage %105 %257 %259 -%261 = OpImageSampleImplicitLod %22 %260 %82 -%262 = OpLoad %22 %58 -%263 = OpFAdd %22 %262 %261 -OpStore %58 %263 -%264 = OpAccessChain %84 %32 %79 -%265 = OpLoad %5 %264 -%266 = OpAccessChain %102 %42 %79 -%267 = OpLoad %18 %266 -%268 = OpSampledImage %105 %265 %267 -%269 = OpImageSampleImplicitLod %22 %268 %82 -%270 = OpLoad %22 %58 -%271 = OpFAdd %22 %270 %269 -OpStore %58 %271 -%272 = OpAccessChain %84 %32 %71 -%273 = OpLoad %5 %272 -%274 = OpAccessChain %102 %42 %71 -%275 = OpLoad %18 %274 -%276 = OpSampledImage %105 %273 %275 -%277 = OpImageSampleImplicitLod %22 %276 %82 Bias %73 -%278 = OpLoad %22 %58 -%279 = OpFAdd %22 %278 %277 -OpStore %58 %279 -%280 = OpAccessChain %84 %32 %78 -%281 = OpLoad %5 %280 -%282 = OpAccessChain %102 %42 %78 -%283 = OpLoad %18 %282 -%284 = OpSampledImage %105 %281 %283 -%285 = OpImageSampleImplicitLod %22 %284 %82 Bias %73 -%286 = OpLoad %22 %58 -%287 = OpFAdd %22 %286 %285 -OpStore %58 %287 -%288 = OpAccessChain %84 %32 %79 -%289 = OpLoad %5 %288 -%290 = OpAccessChain %102 %42 %79 -%291 = OpLoad %18 %290 -%292 = OpSampledImage %105 %289 %291 -%293 = OpImageSampleImplicitLod %22 %292 %82 Bias %73 -%294 = OpLoad %22 %58 -%295 = OpFAdd %22 %294 %293 -OpStore %58 %295 -%296 = OpAccessChain %126 %38 %71 -%297 = OpLoad %14 %296 -%298 = OpAccessChain %129 %44 %71 -%299 = OpLoad %18 %298 -%300 = OpSampledImage %132 %297 %299 -%301 = OpImageSampleDrefImplicitLod %6 %300 %82 %73 -%302 = OpLoad %6 %55 -%303 = OpFAdd %6 %302 %301 -OpStore %55 %303 -%304 = OpAccessChain %126 %38 %78 -%305 = OpLoad %14 %304 -%306 = OpAccessChain %129 %44 %78 -%307 = OpLoad %18 %306 -%308 = OpSampledImage %132 %305 %307 -%309 = OpImageSampleDrefImplicitLod %6 %308 %82 %73 -%310 = OpLoad %6 %55 -%311 = OpFAdd %6 %310 %309 -OpStore %55 %311 -%312 = OpAccessChain %126 %38 %79 -%313 = OpLoad %14 %312 -%314 = OpAccessChain %129 %44 %79 -%315 = OpLoad %18 %314 -%316 = OpSampledImage %132 %313 %315 -%317 = OpImageSampleDrefImplicitLod %6 %316 %82 %73 -%318 = OpLoad %6 %55 -%319 = OpFAdd %6 %318 %317 -OpStore %55 %319 -%320 = OpAccessChain %126 %38 %71 -%321 = OpLoad %14 %320 -%322 = OpAccessChain %129 %44 %71 -%323 = OpLoad %18 %322 -%324 = OpSampledImage %132 %321 %323 -%325 = OpImageSampleDrefExplicitLod %6 %324 %82 %73 Lod %73 -%326 = OpLoad %6 %55 -%327 = OpFAdd %6 %326 %325 -OpStore %55 %327 -%328 = OpAccessChain %126 %38 %78 -%329 = OpLoad %14 %328 -%330 = OpAccessChain %129 %44 %78 -%331 = OpLoad %18 %330 -%332 = OpSampledImage %132 %329 %331 -%333 = OpImageSampleDrefExplicitLod %6 %332 %82 %73 Lod %73 -%334 = OpLoad %6 %55 -%335 = OpFAdd %6 %334 %333 -OpStore %55 %335 -%336 = OpAccessChain %126 %38 %79 -%337 = OpLoad %14 %336 -%338 = OpAccessChain %129 %44 %79 -%339 = OpLoad %18 %338 -%340 = OpSampledImage %132 %337 %339 -%341 = OpImageSampleDrefExplicitLod %6 %340 %82 %73 Lod %73 -%342 = OpLoad %6 %55 -%343 = OpFAdd %6 %342 %341 -OpStore %55 %343 -%344 = OpAccessChain %84 %32 %71 -%345 = OpLoad %5 %344 -%346 = OpAccessChain %102 %42 %71 -%347 = OpLoad %18 %346 -%348 = OpSampledImage %105 %345 %347 -%349 = OpImageSampleExplicitLod %22 %348 %82 Grad %82 %82 -%350 = OpLoad %22 %58 -%351 = OpFAdd %22 %350 %349 -OpStore %58 %351 -%352 = OpAccessChain %84 %32 %78 -%353 = OpLoad %5 %352 -%354 = OpAccessChain %102 %42 %78 -%355 = OpLoad %18 %354 -%356 = OpSampledImage %105 %353 %355 -%357 = OpImageSampleExplicitLod %22 %356 %82 Grad %82 %82 -%358 = OpLoad %22 %58 -%359 = OpFAdd %22 %358 %357 -OpStore %58 %359 -%360 = OpAccessChain %84 %32 %79 -%361 = OpLoad %5 %360 -%362 = OpAccessChain %102 %42 %79 -%363 = OpLoad %18 %362 -%364 = OpSampledImage %105 %361 %363 -%365 = OpImageSampleExplicitLod %22 %364 %82 Grad %82 %82 -%366 = OpLoad %22 %58 -%367 = OpFAdd %22 %366 %365 -OpStore %58 %367 -%368 = OpAccessChain %84 %32 %71 -%369 = OpLoad %5 %368 -%370 = OpAccessChain %102 %42 %71 -%371 = OpLoad %18 %370 -%372 = OpSampledImage %105 %369 %371 -%373 = OpImageSampleExplicitLod %22 %372 %82 Lod %73 -%374 = OpLoad %22 %58 -%375 = OpFAdd %22 %374 %373 -OpStore %58 %375 -%376 = OpAccessChain %84 %32 %78 -%377 = OpLoad %5 %376 -%378 = OpAccessChain %102 %42 %78 -%379 = OpLoad %18 %378 -%380 = OpSampledImage %105 %377 %379 -%381 = OpImageSampleExplicitLod %22 %380 %82 Lod %73 -%382 = OpLoad %22 %58 -%383 = OpFAdd %22 %382 %381 -OpStore %58 %383 -%384 = OpAccessChain %84 %32 %79 -%385 = OpLoad %5 %384 -%386 = OpAccessChain %102 %42 %79 -%387 = OpLoad %18 %386 -%388 = OpSampledImage %105 %385 %387 -%389 = OpImageSampleExplicitLod %22 %388 %82 Lod %73 -%390 = OpLoad %22 %58 -%391 = OpFAdd %22 %390 %389 -OpStore %58 %391 -%393 = OpAccessChain %392 %40 %71 -%394 = OpLoad %16 %393 -%395 = OpLoad %22 %58 -%396 = OpImageQuerySize %25 %394 -%397 = OpULessThan %161 %83 %396 -%398 = OpAll %155 %397 -OpSelectionMerge %399 None -OpBranchConditional %398 %400 %399 -%400 = OpLabel -OpImageWrite %394 %83 %395 -OpBranch %399 +%188 = OpImageQuerySizeLod %81 %183 %71 +%189 = OpULessThan %160 %82 %188 +%190 = OpAll %154 %189 +OpBranchConditional %190 %191 %186 +%191 = OpLabel +%192 = OpImageFetch %22 %183 %82 Lod %71 +OpBranch %186 +%186 = OpLabel +%193 = OpPhi %22 %56 %172 %56 %187 %192 %191 +%194 = OpLoad %22 %54 +%195 = OpFAdd %22 %194 %193 +OpStore %54 %195 +%197 = OpAccessChain %196 %30 %67 +%198 = OpLoad %10 %197 +%200 = OpImageQuerySizeLod %199 %198 %67 +%201 = OpCompositeExtract %3 %200 2 +%202 = OpLoad %3 %45 +%203 = OpIAdd %3 %202 %201 +OpStore %45 %203 +%204 = OpAccessChain %196 %30 %75 +%205 = OpLoad %10 %204 +%206 = OpImageQuerySizeLod %199 %205 %67 +%207 = OpCompositeExtract %3 %206 2 +%208 = OpLoad %3 %45 +%209 = OpIAdd %3 %208 %207 +OpStore %45 %209 +%210 = OpAccessChain %196 %30 %76 +%211 = OpLoad %10 %210 +%212 = OpImageQuerySizeLod %199 %211 %67 +%213 = OpCompositeExtract %3 %212 2 +%214 = OpLoad %3 %45 +%215 = OpIAdd %3 %214 %213 +OpStore %45 %215 +%216 = OpAccessChain %83 %28 %67 +%217 = OpLoad %5 %216 +%218 = OpImageQueryLevels %3 %217 +%219 = OpLoad %3 %45 +%220 = OpIAdd %3 %219 %218 +OpStore %45 %220 +%221 = OpAccessChain %83 %28 %75 +%222 = OpLoad %5 %221 +%223 = OpImageQueryLevels %3 %222 +%224 = OpLoad %3 %45 +%225 = OpIAdd %3 %224 %223 +OpStore %45 %225 +%226 = OpAccessChain %83 %28 %76 +%227 = OpLoad %5 %226 +%228 = OpImageQueryLevels %3 %227 +%229 = OpLoad %3 %45 +%230 = OpIAdd %3 %229 %228 +OpStore %45 %230 +%232 = OpAccessChain %231 %32 %67 +%233 = OpLoad %12 %232 +%234 = OpImageQuerySamples %3 %233 +%235 = OpLoad %3 %45 +%236 = OpIAdd %3 %235 %234 +OpStore %45 %236 +%237 = OpAccessChain %231 %32 %75 +%238 = OpLoad %12 %237 +%239 = OpImageQuerySamples %3 %238 +%240 = OpLoad %3 %45 +%241 = OpIAdd %3 %240 %239 +OpStore %45 %241 +%242 = OpAccessChain %231 %32 %76 +%243 = OpLoad %12 %242 +%244 = OpImageQuerySamples %3 %243 +%245 = OpLoad %3 %45 +%246 = OpIAdd %3 %245 %244 +OpStore %45 %246 +%247 = OpAccessChain %83 %28 %67 +%248 = OpLoad %5 %247 +%249 = OpAccessChain %101 %38 %67 +%250 = OpLoad %18 %249 +%251 = OpSampledImage %104 %248 %250 +%252 = OpImageSampleImplicitLod %22 %251 %80 +%253 = OpLoad %22 %54 +%254 = OpFAdd %22 %253 %252 +OpStore %54 %254 +%255 = OpAccessChain %83 %28 %75 +%256 = OpLoad %5 %255 +%257 = OpAccessChain %101 %38 %75 +%258 = OpLoad %18 %257 +%259 = OpSampledImage %104 %256 %258 +%260 = OpImageSampleImplicitLod %22 %259 %80 +%261 = OpLoad %22 %54 +%262 = OpFAdd %22 %261 %260 +OpStore %54 %262 +%263 = OpAccessChain %83 %28 %76 +%264 = OpLoad %5 %263 +%265 = OpAccessChain %101 %38 %76 +%266 = OpLoad %18 %265 +%267 = OpSampledImage %104 %264 %266 +%268 = OpImageSampleImplicitLod %22 %267 %80 +%269 = OpLoad %22 %54 +%270 = OpFAdd %22 %269 %268 +OpStore %54 %270 +%271 = OpAccessChain %83 %28 %67 +%272 = OpLoad %5 %271 +%273 = OpAccessChain %101 %38 %67 +%274 = OpLoad %18 %273 +%275 = OpSampledImage %104 %272 %274 +%276 = OpImageSampleImplicitLod %22 %275 %80 Bias %69 +%277 = OpLoad %22 %54 +%278 = OpFAdd %22 %277 %276 +OpStore %54 %278 +%279 = OpAccessChain %83 %28 %75 +%280 = OpLoad %5 %279 +%281 = OpAccessChain %101 %38 %75 +%282 = OpLoad %18 %281 +%283 = OpSampledImage %104 %280 %282 +%284 = OpImageSampleImplicitLod %22 %283 %80 Bias %69 +%285 = OpLoad %22 %54 +%286 = OpFAdd %22 %285 %284 +OpStore %54 %286 +%287 = OpAccessChain %83 %28 %76 +%288 = OpLoad %5 %287 +%289 = OpAccessChain %101 %38 %76 +%290 = OpLoad %18 %289 +%291 = OpSampledImage %104 %288 %290 +%292 = OpImageSampleImplicitLod %22 %291 %80 Bias %69 +%293 = OpLoad %22 %54 +%294 = OpFAdd %22 %293 %292 +OpStore %54 %294 +%295 = OpAccessChain %125 %34 %67 +%296 = OpLoad %14 %295 +%297 = OpAccessChain %128 %40 %67 +%298 = OpLoad %18 %297 +%299 = OpSampledImage %131 %296 %298 +%300 = OpImageSampleDrefImplicitLod %6 %299 %80 %69 +%301 = OpLoad %6 %51 +%302 = OpFAdd %6 %301 %300 +OpStore %51 %302 +%303 = OpAccessChain %125 %34 %75 +%304 = OpLoad %14 %303 +%305 = OpAccessChain %128 %40 %75 +%306 = OpLoad %18 %305 +%307 = OpSampledImage %131 %304 %306 +%308 = OpImageSampleDrefImplicitLod %6 %307 %80 %69 +%309 = OpLoad %6 %51 +%310 = OpFAdd %6 %309 %308 +OpStore %51 %310 +%311 = OpAccessChain %125 %34 %76 +%312 = OpLoad %14 %311 +%313 = OpAccessChain %128 %40 %76 +%314 = OpLoad %18 %313 +%315 = OpSampledImage %131 %312 %314 +%316 = OpImageSampleDrefImplicitLod %6 %315 %80 %69 +%317 = OpLoad %6 %51 +%318 = OpFAdd %6 %317 %316 +OpStore %51 %318 +%319 = OpAccessChain %125 %34 %67 +%320 = OpLoad %14 %319 +%321 = OpAccessChain %128 %40 %67 +%322 = OpLoad %18 %321 +%323 = OpSampledImage %131 %320 %322 +%324 = OpImageSampleDrefExplicitLod %6 %323 %80 %69 Lod %69 +%325 = OpLoad %6 %51 +%326 = OpFAdd %6 %325 %324 +OpStore %51 %326 +%327 = OpAccessChain %125 %34 %75 +%328 = OpLoad %14 %327 +%329 = OpAccessChain %128 %40 %75 +%330 = OpLoad %18 %329 +%331 = OpSampledImage %131 %328 %330 +%332 = OpImageSampleDrefExplicitLod %6 %331 %80 %69 Lod %69 +%333 = OpLoad %6 %51 +%334 = OpFAdd %6 %333 %332 +OpStore %51 %334 +%335 = OpAccessChain %125 %34 %76 +%336 = OpLoad %14 %335 +%337 = OpAccessChain %128 %40 %76 +%338 = OpLoad %18 %337 +%339 = OpSampledImage %131 %336 %338 +%340 = OpImageSampleDrefExplicitLod %6 %339 %80 %69 Lod %69 +%341 = OpLoad %6 %51 +%342 = OpFAdd %6 %341 %340 +OpStore %51 %342 +%343 = OpAccessChain %83 %28 %67 +%344 = OpLoad %5 %343 +%345 = OpAccessChain %101 %38 %67 +%346 = OpLoad %18 %345 +%347 = OpSampledImage %104 %344 %346 +%348 = OpImageSampleExplicitLod %22 %347 %80 Grad %80 %80 +%349 = OpLoad %22 %54 +%350 = OpFAdd %22 %349 %348 +OpStore %54 %350 +%351 = OpAccessChain %83 %28 %75 +%352 = OpLoad %5 %351 +%353 = OpAccessChain %101 %38 %75 +%354 = OpLoad %18 %353 +%355 = OpSampledImage %104 %352 %354 +%356 = OpImageSampleExplicitLod %22 %355 %80 Grad %80 %80 +%357 = OpLoad %22 %54 +%358 = OpFAdd %22 %357 %356 +OpStore %54 %358 +%359 = OpAccessChain %83 %28 %76 +%360 = OpLoad %5 %359 +%361 = OpAccessChain %101 %38 %76 +%362 = OpLoad %18 %361 +%363 = OpSampledImage %104 %360 %362 +%364 = OpImageSampleExplicitLod %22 %363 %80 Grad %80 %80 +%365 = OpLoad %22 %54 +%366 = OpFAdd %22 %365 %364 +OpStore %54 %366 +%367 = OpAccessChain %83 %28 %67 +%368 = OpLoad %5 %367 +%369 = OpAccessChain %101 %38 %67 +%370 = OpLoad %18 %369 +%371 = OpSampledImage %104 %368 %370 +%372 = OpImageSampleExplicitLod %22 %371 %80 Lod %69 +%373 = OpLoad %22 %54 +%374 = OpFAdd %22 %373 %372 +OpStore %54 %374 +%375 = OpAccessChain %83 %28 %75 +%376 = OpLoad %5 %375 +%377 = OpAccessChain %101 %38 %75 +%378 = OpLoad %18 %377 +%379 = OpSampledImage %104 %376 %378 +%380 = OpImageSampleExplicitLod %22 %379 %80 Lod %69 +%381 = OpLoad %22 %54 +%382 = OpFAdd %22 %381 %380 +OpStore %54 %382 +%383 = OpAccessChain %83 %28 %76 +%384 = OpLoad %5 %383 +%385 = OpAccessChain %101 %38 %76 +%386 = OpLoad %18 %385 +%387 = OpSampledImage %104 %384 %386 +%388 = OpImageSampleExplicitLod %22 %387 %80 Lod %69 +%389 = OpLoad %22 %54 +%390 = OpFAdd %22 %389 %388 +OpStore %54 %390 +%392 = OpAccessChain %391 %36 %67 +%393 = OpLoad %16 %392 +%394 = OpLoad %22 %54 +%395 = OpImageQuerySize %81 %393 +%396 = OpULessThan %160 %82 %395 +%397 = OpAll %154 %396 +OpSelectionMerge %398 None +OpBranchConditional %397 %399 %398 %399 = OpLabel -%401 = OpAccessChain %392 %40 %78 -%402 = OpLoad %16 %401 -%403 = OpLoad %22 %58 -%404 = OpImageQuerySize %25 %402 -%405 = OpULessThan %161 %83 %404 -%406 = OpAll %155 %405 -OpSelectionMerge %407 None -OpBranchConditional %406 %408 %407 -%408 = OpLabel -OpImageWrite %402 %83 %403 -OpBranch %407 +OpImageWrite %393 %82 %394 +OpBranch %398 +%398 = OpLabel +%400 = OpAccessChain %391 %36 %75 +%401 = OpLoad %16 %400 +%402 = OpLoad %22 %54 +%403 = OpImageQuerySize %81 %401 +%404 = OpULessThan %160 %82 %403 +%405 = OpAll %154 %404 +OpSelectionMerge %406 None +OpBranchConditional %405 %407 %406 %407 = OpLabel -%409 = OpAccessChain %392 %40 %79 -%410 = OpLoad %16 %409 -%411 = OpLoad %22 %58 -%412 = OpImageQuerySize %25 %410 -%413 = OpULessThan %161 %83 %412 -%414 = OpAll %155 %413 -OpSelectionMerge %415 None -OpBranchConditional %414 %416 %415 -%416 = OpLabel -OpImageWrite %410 %83 %411 -OpBranch %415 +OpImageWrite %401 %82 %402 +OpBranch %406 +%406 = OpLabel +%408 = OpAccessChain %391 %36 %76 +%409 = OpLoad %16 %408 +%410 = OpLoad %22 %54 +%411 = OpImageQuerySize %81 %409 +%412 = OpULessThan %160 %82 %411 +%413 = OpAll %154 %412 +OpSelectionMerge %414 None +OpBranchConditional %413 %415 %414 %415 = OpLabel -%417 = OpLoad %23 %52 -%418 = OpLoad %3 %49 -%419 = OpCompositeConstruct %23 %418 %418 -%420 = OpIAdd %23 %417 %419 -%421 = OpConvertUToF %24 %420 -%422 = OpLoad %22 %58 -%423 = OpCompositeExtract %6 %421 0 -%424 = OpCompositeExtract %6 %421 1 -%425 = OpCompositeExtract %6 %421 0 -%426 = OpCompositeExtract %6 %421 1 -%427 = OpCompositeConstruct %22 %423 %424 %425 %426 -%428 = OpFAdd %22 %422 %427 -%429 = OpLoad %6 %55 -%430 = OpCompositeConstruct %22 %429 %429 %429 %429 -%431 = OpFAdd %22 %428 %430 -OpStore %66 %431 +OpImageWrite %409 %82 %410 +OpBranch %414 +%414 = OpLabel +%416 = OpLoad %23 %48 +%417 = OpLoad %3 %45 +%418 = OpCompositeConstruct %23 %417 %417 +%419 = OpIAdd %23 %416 %418 +%420 = OpConvertUToF %79 %419 +%421 = OpLoad %22 %54 +%422 = OpCompositeExtract %6 %420 0 +%423 = OpCompositeExtract %6 %420 1 +%424 = OpCompositeExtract %6 %420 0 +%425 = OpCompositeExtract %6 %420 1 +%426 = OpCompositeConstruct %22 %422 %423 %424 %425 +%427 = OpFAdd %22 %421 %426 +%428 = OpLoad %6 %51 +%429 = OpCompositeConstruct %22 %428 %428 %428 %428 +%430 = OpFAdd %22 %427 %429 +OpStore %62 %430 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/binding-buffer-arrays.spvasm b/tests/out/spv/binding-buffer-arrays.spvasm index 00d5b0fcfb..bc89271fd3 100644 --- a/tests/out/spv/binding-buffer-arrays.spvasm +++ b/tests/out/spv/binding-buffer-arrays.spvasm @@ -1,30 +1,30 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 63 +; Bound: 61 OpCapability Shader OpCapability ShaderNonUniform OpExtension "SPV_KHR_storage_buffer_storage_class" OpExtension "SPV_EXT_descriptor_indexing" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %28 "main" %23 %26 -OpExecutionMode %28 OriginUpperLeft +OpEntryPoint Fragment %26 "main" %21 %24 +OpExecutionMode %26 OriginUpperLeft OpMemberDecorate %4 0 Offset 0 OpMemberDecorate %5 0 Offset 0 OpMemberDecorate %8 0 Offset 0 -OpDecorate %11 NonWritable -OpDecorate %11 DescriptorSet 0 -OpDecorate %11 Binding 0 +OpDecorate %9 NonWritable +OpDecorate %9 DescriptorSet 0 +OpDecorate %9 Binding 0 OpDecorate %5 Block -OpDecorate %15 DescriptorSet 0 -OpDecorate %15 Binding 10 -OpDecorate %16 Block -OpMemberDecorate %16 0 Offset 0 -OpDecorate %23 Location 0 -OpDecorate %23 Flat -OpDecorate %26 Location 0 -OpDecorate %55 NonUniform +OpDecorate %13 DescriptorSet 0 +OpDecorate %13 Binding 10 +OpDecorate %14 Block +OpMemberDecorate %14 0 Offset 0 +OpDecorate %21 Location 0 +OpDecorate %21 Flat +OpDecorate %24 Location 0 +OpDecorate %53 NonUniform %2 = OpTypeVoid %3 = OpTypeInt 32 0 %4 = OpTypeStruct %3 @@ -32,71 +32,69 @@ OpDecorate %55 NonUniform %7 = OpConstant %3 1 %6 = OpTypeArray %5 %7 %8 = OpTypeStruct %3 -%10 = OpTypeInt 32 1 -%9 = OpConstant %10 1 -%14 = OpConstant %3 10 -%13 = OpTypeArray %5 %14 -%12 = OpTypePointer StorageBuffer %13 -%11 = OpVariable %12 StorageBuffer -%16 = OpTypeStruct %4 -%17 = OpTypePointer Uniform %16 -%15 = OpVariable %17 Uniform -%19 = OpTypePointer Function %3 -%20 = OpConstantNull %3 -%24 = OpTypePointer Input %3 -%23 = OpVariable %24 Input -%27 = OpTypePointer Output %3 -%26 = OpVariable %27 Output -%29 = OpTypeFunction %2 -%30 = OpTypePointer Uniform %4 -%31 = OpConstant %3 0 -%33 = OpTypePointer StorageBuffer %6 -%35 = OpTypePointer Uniform %3 -%39 = OpTypePointer StorageBuffer %5 -%40 = OpTypePointer StorageBuffer %3 -%46 = OpTypeBool -%28 = OpFunction %2 None %29 -%21 = OpLabel -%18 = OpVariable %19 Function %20 -%25 = OpLoad %3 %23 -%22 = OpCompositeConstruct %8 %25 -%32 = OpAccessChain %30 %15 %31 -OpBranch %34 -%34 = OpLabel -%36 = OpAccessChain %35 %32 %31 -%37 = OpLoad %3 %36 -%38 = OpCompositeExtract %3 %22 0 -OpStore %18 %31 -%41 = OpAccessChain %40 %11 %31 %31 -%42 = OpLoad %3 %41 -%43 = OpLoad %3 %18 -%44 = OpIAdd %3 %43 %42 -OpStore %18 %44 -%45 = OpULessThan %46 %37 %7 -OpSelectionMerge %48 None -OpBranchConditional %45 %49 %48 -%49 = OpLabel -%47 = OpAccessChain %40 %11 %37 %31 -%50 = OpLoad %3 %47 -OpBranch %48 -%48 = OpLabel -%51 = OpPhi %3 %20 %34 %50 %49 -%52 = OpLoad %3 %18 -%53 = OpIAdd %3 %52 %51 -OpStore %18 %53 -%54 = OpULessThan %46 %38 %7 -OpSelectionMerge %56 None -OpBranchConditional %54 %57 %56 -%57 = OpLabel -%55 = OpAccessChain %40 %11 %38 %31 -%58 = OpLoad %3 %55 -OpBranch %56 -%56 = OpLabel -%59 = OpPhi %3 %20 %48 %58 %57 -%60 = OpLoad %3 %18 -%61 = OpIAdd %3 %60 %59 -OpStore %18 %61 -%62 = OpLoad %3 %18 -OpStore %26 %62 +%12 = OpConstant %3 10 +%11 = OpTypeArray %5 %12 +%10 = OpTypePointer StorageBuffer %11 +%9 = OpVariable %10 StorageBuffer +%14 = OpTypeStruct %4 +%15 = OpTypePointer Uniform %14 +%13 = OpVariable %15 Uniform +%17 = OpTypePointer Function %3 +%18 = OpConstantNull %3 +%22 = OpTypePointer Input %3 +%21 = OpVariable %22 Input +%25 = OpTypePointer Output %3 +%24 = OpVariable %25 Output +%27 = OpTypeFunction %2 +%28 = OpTypePointer Uniform %4 +%29 = OpConstant %3 0 +%31 = OpTypePointer StorageBuffer %6 +%33 = OpTypePointer Uniform %3 +%37 = OpTypePointer StorageBuffer %5 +%38 = OpTypePointer StorageBuffer %3 +%44 = OpTypeBool +%26 = OpFunction %2 None %27 +%19 = OpLabel +%16 = OpVariable %17 Function %18 +%23 = OpLoad %3 %21 +%20 = OpCompositeConstruct %8 %23 +%30 = OpAccessChain %28 %13 %29 +OpBranch %32 +%32 = OpLabel +%34 = OpAccessChain %33 %30 %29 +%35 = OpLoad %3 %34 +%36 = OpCompositeExtract %3 %20 0 +OpStore %16 %29 +%39 = OpAccessChain %38 %9 %29 %29 +%40 = OpLoad %3 %39 +%41 = OpLoad %3 %16 +%42 = OpIAdd %3 %41 %40 +OpStore %16 %42 +%43 = OpULessThan %44 %35 %7 +OpSelectionMerge %46 None +OpBranchConditional %43 %47 %46 +%47 = OpLabel +%45 = OpAccessChain %38 %9 %35 %29 +%48 = OpLoad %3 %45 +OpBranch %46 +%46 = OpLabel +%49 = OpPhi %3 %18 %32 %48 %47 +%50 = OpLoad %3 %16 +%51 = OpIAdd %3 %50 %49 +OpStore %16 %51 +%52 = OpULessThan %44 %36 %7 +OpSelectionMerge %54 None +OpBranchConditional %52 %55 %54 +%55 = OpLabel +%53 = OpAccessChain %38 %9 %36 %29 +%56 = OpLoad %3 %53 +OpBranch %54 +%54 = OpLabel +%57 = OpPhi %3 %18 %46 %56 %55 +%58 = OpLoad %3 %16 +%59 = OpIAdd %3 %58 %57 +OpStore %16 %59 +%60 = OpLoad %3 %16 +OpStore %24 %60 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/bounds-check-restrict.spvasm b/tests/out/spv/bounds-check-restrict.spvasm index 69e612022f..c7cf675a17 100644 --- a/tests/out/spv/bounds-check-restrict.spvasm +++ b/tests/out/spv/bounds-check-restrict.spvasm @@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 164 +; Bound: 163 OpCapability Shader OpCapability Linkage OpExtension "SPV_KHR_storage_buffer_storage_class" @@ -16,8 +16,8 @@ OpMemberDecorate %10 2 ColMajor OpMemberDecorate %10 2 MatrixStride 16 OpMemberDecorate %10 3 Offset 112 OpDecorate %10 Block -OpDecorate %13 DescriptorSet 0 -OpDecorate %13 Binding 0 +OpDecorate %12 DescriptorSet 0 +OpDecorate %12 Binding 0 %2 = OpTypeVoid %3 = OpTypeFloat 32 %6 = OpTypeInt 32 0 @@ -28,209 +28,208 @@ OpDecorate %13 Binding 0 %9 = OpTypeRuntimeArray %3 %10 = OpTypeStruct %4 %7 %8 %9 %11 = OpTypeInt 32 1 -%12 = OpConstant %11 10 -%14 = OpTypePointer StorageBuffer %10 -%13 = OpVariable %14 StorageBuffer -%18 = OpTypeFunction %3 %11 -%20 = OpTypePointer StorageBuffer %4 -%21 = OpTypePointer StorageBuffer %3 -%22 = OpConstant %6 9 -%24 = OpConstant %6 0 -%31 = OpTypePointer StorageBuffer %9 -%33 = OpConstant %6 1 -%36 = OpConstant %6 3 -%43 = OpTypePointer StorageBuffer %7 -%44 = OpTypePointer StorageBuffer %3 -%52 = OpTypeFunction %3 %7 %11 -%59 = OpTypeFunction %7 %11 -%61 = OpTypePointer StorageBuffer %8 -%62 = OpTypePointer StorageBuffer %7 -%63 = OpConstant %6 2 -%71 = OpTypeFunction %3 %11 %11 -%80 = OpConstant %3 100.0 -%92 = OpTypeFunction %3 -%106 = OpTypeFunction %2 %11 %3 -%130 = OpTypeFunction %2 %11 %7 -%139 = OpTypeFunction %2 %11 %11 %3 -%159 = OpTypeFunction %2 %3 -%17 = OpFunction %3 None %18 -%16 = OpFunctionParameter %11 -%15 = OpLabel -OpBranch %19 -%19 = OpLabel -%23 = OpExtInst %6 %1 UMin %16 %22 -%25 = OpAccessChain %21 %13 %24 %23 -%26 = OpLoad %3 %25 -OpReturnValue %26 +%13 = OpTypePointer StorageBuffer %10 +%12 = OpVariable %13 StorageBuffer +%17 = OpTypeFunction %3 %11 +%19 = OpTypePointer StorageBuffer %4 +%20 = OpTypePointer StorageBuffer %3 +%21 = OpConstant %6 9 +%23 = OpConstant %6 0 +%30 = OpTypePointer StorageBuffer %9 +%32 = OpConstant %6 1 +%35 = OpConstant %6 3 +%42 = OpTypePointer StorageBuffer %7 +%43 = OpTypePointer StorageBuffer %3 +%51 = OpTypeFunction %3 %7 %11 +%58 = OpTypeFunction %7 %11 +%60 = OpTypePointer StorageBuffer %8 +%61 = OpTypePointer StorageBuffer %7 +%62 = OpConstant %6 2 +%70 = OpTypeFunction %3 %11 %11 +%79 = OpConstant %3 100.0 +%91 = OpTypeFunction %3 +%105 = OpTypeFunction %2 %11 %3 +%129 = OpTypeFunction %2 %11 %7 +%138 = OpTypeFunction %2 %11 %11 %3 +%158 = OpTypeFunction %2 %3 +%16 = OpFunction %3 None %17 +%15 = OpFunctionParameter %11 +%14 = OpLabel +OpBranch %18 +%18 = OpLabel +%22 = OpExtInst %6 %1 UMin %15 %21 +%24 = OpAccessChain %20 %12 %23 %22 +%25 = OpLoad %3 %24 +OpReturnValue %25 OpFunctionEnd -%29 = OpFunction %3 None %18 -%28 = OpFunctionParameter %11 -%27 = OpLabel -OpBranch %30 -%30 = OpLabel -%32 = OpArrayLength %6 %13 3 -%34 = OpISub %6 %32 %33 -%35 = OpExtInst %6 %1 UMin %28 %34 -%37 = OpAccessChain %21 %13 %36 %35 -%38 = OpLoad %3 %37 -OpReturnValue %38 +%28 = OpFunction %3 None %17 +%27 = OpFunctionParameter %11 +%26 = OpLabel +OpBranch %29 +%29 = OpLabel +%31 = OpArrayLength %6 %12 3 +%33 = OpISub %6 %31 %32 +%34 = OpExtInst %6 %1 UMin %27 %33 +%36 = OpAccessChain %20 %12 %35 %34 +%37 = OpLoad %3 %36 +OpReturnValue %37 OpFunctionEnd -%41 = OpFunction %3 None %18 -%40 = OpFunctionParameter %11 -%39 = OpLabel -OpBranch %42 -%42 = OpLabel -%45 = OpExtInst %6 %1 UMin %40 %36 -%46 = OpAccessChain %44 %13 %33 %45 -%47 = OpLoad %3 %46 -OpReturnValue %47 +%40 = OpFunction %3 None %17 +%39 = OpFunctionParameter %11 +%38 = OpLabel +OpBranch %41 +%41 = OpLabel +%44 = OpExtInst %6 %1 UMin %39 %35 +%45 = OpAccessChain %43 %12 %32 %44 +%46 = OpLoad %3 %45 +OpReturnValue %46 OpFunctionEnd -%51 = OpFunction %3 None %52 -%49 = OpFunctionParameter %7 -%50 = OpFunctionParameter %11 -%48 = OpLabel -OpBranch %53 -%53 = OpLabel -%54 = OpExtInst %6 %1 UMin %50 %36 -%55 = OpVectorExtractDynamic %3 %49 %54 -OpReturnValue %55 +%50 = OpFunction %3 None %51 +%48 = OpFunctionParameter %7 +%49 = OpFunctionParameter %11 +%47 = OpLabel +OpBranch %52 +%52 = OpLabel +%53 = OpExtInst %6 %1 UMin %49 %35 +%54 = OpVectorExtractDynamic %3 %48 %53 +OpReturnValue %54 OpFunctionEnd -%58 = OpFunction %7 None %59 -%57 = OpFunctionParameter %11 -%56 = OpLabel -OpBranch %60 -%60 = OpLabel -%64 = OpExtInst %6 %1 UMin %57 %63 -%65 = OpAccessChain %62 %13 %63 %64 -%66 = OpLoad %7 %65 -OpReturnValue %66 +%57 = OpFunction %7 None %58 +%56 = OpFunctionParameter %11 +%55 = OpLabel +OpBranch %59 +%59 = OpLabel +%63 = OpExtInst %6 %1 UMin %56 %62 +%64 = OpAccessChain %61 %12 %62 %63 +%65 = OpLoad %7 %64 +OpReturnValue %65 OpFunctionEnd -%70 = OpFunction %3 None %71 +%69 = OpFunction %3 None %70 +%67 = OpFunctionParameter %11 %68 = OpFunctionParameter %11 -%69 = OpFunctionParameter %11 -%67 = OpLabel -OpBranch %72 -%72 = OpLabel -%73 = OpExtInst %6 %1 UMin %69 %36 -%74 = OpExtInst %6 %1 UMin %68 %63 -%75 = OpAccessChain %44 %13 %63 %74 %73 -%76 = OpLoad %3 %75 -OpReturnValue %76 +%66 = OpLabel +OpBranch %71 +%71 = OpLabel +%72 = OpExtInst %6 %1 UMin %68 %35 +%73 = OpExtInst %6 %1 UMin %67 %62 +%74 = OpAccessChain %43 %12 %62 %73 %72 +%75 = OpLoad %3 %74 +OpReturnValue %75 OpFunctionEnd -%79 = OpFunction %3 None %18 -%78 = OpFunctionParameter %11 -%77 = OpLabel -OpBranch %81 -%81 = OpLabel -%82 = OpConvertSToF %3 %78 -%83 = OpFDiv %3 %82 %80 -%84 = OpExtInst %3 %1 Sin %83 -%85 = OpFMul %3 %84 %80 -%86 = OpConvertFToS %11 %85 -%87 = OpExtInst %6 %1 UMin %86 %22 -%88 = OpAccessChain %21 %13 %24 %87 -%89 = OpLoad %3 %88 -OpReturnValue %89 +%78 = OpFunction %3 None %17 +%77 = OpFunctionParameter %11 +%76 = OpLabel +OpBranch %80 +%80 = OpLabel +%81 = OpConvertSToF %3 %77 +%82 = OpFDiv %3 %81 %79 +%83 = OpExtInst %3 %1 Sin %82 +%84 = OpFMul %3 %83 %79 +%85 = OpConvertFToS %11 %84 +%86 = OpExtInst %6 %1 UMin %85 %21 +%87 = OpAccessChain %20 %12 %23 %86 +%88 = OpLoad %3 %87 +OpReturnValue %88 OpFunctionEnd -%91 = OpFunction %3 None %92 -%90 = OpLabel -OpBranch %93 -%93 = OpLabel -%94 = OpAccessChain %21 %13 %24 %22 -%95 = OpLoad %3 %94 -%96 = OpAccessChain %44 %13 %33 %36 -%97 = OpLoad %3 %96 -%98 = OpFAdd %3 %95 %97 -%99 = OpAccessChain %44 %13 %63 %63 %36 -%100 = OpLoad %3 %99 -%101 = OpFAdd %3 %98 %100 -OpReturnValue %101 +%90 = OpFunction %3 None %91 +%89 = OpLabel +OpBranch %92 +%92 = OpLabel +%93 = OpAccessChain %20 %12 %23 %21 +%94 = OpLoad %3 %93 +%95 = OpAccessChain %43 %12 %32 %35 +%96 = OpLoad %3 %95 +%97 = OpFAdd %3 %94 %96 +%98 = OpAccessChain %43 %12 %62 %62 %35 +%99 = OpLoad %3 %98 +%100 = OpFAdd %3 %97 %99 +OpReturnValue %100 OpFunctionEnd -%105 = OpFunction %2 None %106 -%103 = OpFunctionParameter %11 -%104 = OpFunctionParameter %3 -%102 = OpLabel -OpBranch %107 -%107 = OpLabel -%108 = OpExtInst %6 %1 UMin %103 %22 -%109 = OpAccessChain %21 %13 %24 %108 -OpStore %109 %104 +%104 = OpFunction %2 None %105 +%102 = OpFunctionParameter %11 +%103 = OpFunctionParameter %3 +%101 = OpLabel +OpBranch %106 +%106 = OpLabel +%107 = OpExtInst %6 %1 UMin %102 %21 +%108 = OpAccessChain %20 %12 %23 %107 +OpStore %108 %103 OpReturn OpFunctionEnd -%113 = OpFunction %2 None %106 -%111 = OpFunctionParameter %11 -%112 = OpFunctionParameter %3 -%110 = OpLabel -OpBranch %114 -%114 = OpLabel -%115 = OpArrayLength %6 %13 3 -%116 = OpISub %6 %115 %33 -%117 = OpExtInst %6 %1 UMin %111 %116 -%118 = OpAccessChain %21 %13 %36 %117 -OpStore %118 %112 +%112 = OpFunction %2 None %105 +%110 = OpFunctionParameter %11 +%111 = OpFunctionParameter %3 +%109 = OpLabel +OpBranch %113 +%113 = OpLabel +%114 = OpArrayLength %6 %12 3 +%115 = OpISub %6 %114 %32 +%116 = OpExtInst %6 %1 UMin %110 %115 +%117 = OpAccessChain %20 %12 %35 %116 +OpStore %117 %111 OpReturn OpFunctionEnd -%122 = OpFunction %2 None %106 -%120 = OpFunctionParameter %11 -%121 = OpFunctionParameter %3 -%119 = OpLabel -OpBranch %123 -%123 = OpLabel -%124 = OpExtInst %6 %1 UMin %120 %36 -%125 = OpAccessChain %44 %13 %33 %124 -OpStore %125 %121 +%121 = OpFunction %2 None %105 +%119 = OpFunctionParameter %11 +%120 = OpFunctionParameter %3 +%118 = OpLabel +OpBranch %122 +%122 = OpLabel +%123 = OpExtInst %6 %1 UMin %119 %35 +%124 = OpAccessChain %43 %12 %32 %123 +OpStore %124 %120 OpReturn OpFunctionEnd -%129 = OpFunction %2 None %130 -%127 = OpFunctionParameter %11 -%128 = OpFunctionParameter %7 -%126 = OpLabel -OpBranch %131 -%131 = OpLabel -%132 = OpExtInst %6 %1 UMin %127 %63 -%133 = OpAccessChain %62 %13 %63 %132 -OpStore %133 %128 +%128 = OpFunction %2 None %129 +%126 = OpFunctionParameter %11 +%127 = OpFunctionParameter %7 +%125 = OpLabel +OpBranch %130 +%130 = OpLabel +%131 = OpExtInst %6 %1 UMin %126 %62 +%132 = OpAccessChain %61 %12 %62 %131 +OpStore %132 %127 OpReturn OpFunctionEnd -%138 = OpFunction %2 None %139 +%137 = OpFunction %2 None %138 +%134 = OpFunctionParameter %11 %135 = OpFunctionParameter %11 -%136 = OpFunctionParameter %11 -%137 = OpFunctionParameter %3 -%134 = OpLabel -OpBranch %140 -%140 = OpLabel -%141 = OpExtInst %6 %1 UMin %136 %36 -%142 = OpExtInst %6 %1 UMin %135 %63 -%143 = OpAccessChain %44 %13 %63 %142 %141 -OpStore %143 %137 +%136 = OpFunctionParameter %3 +%133 = OpLabel +OpBranch %139 +%139 = OpLabel +%140 = OpExtInst %6 %1 UMin %135 %35 +%141 = OpExtInst %6 %1 UMin %134 %62 +%142 = OpAccessChain %43 %12 %62 %141 %140 +OpStore %142 %136 OpReturn OpFunctionEnd -%147 = OpFunction %2 None %106 -%145 = OpFunctionParameter %11 -%146 = OpFunctionParameter %3 -%144 = OpLabel -OpBranch %148 -%148 = OpLabel -%149 = OpConvertSToF %3 %145 -%150 = OpFDiv %3 %149 %80 -%151 = OpExtInst %3 %1 Sin %150 -%152 = OpFMul %3 %151 %80 -%153 = OpConvertFToS %11 %152 -%154 = OpExtInst %6 %1 UMin %153 %22 -%155 = OpAccessChain %21 %13 %24 %154 -OpStore %155 %146 +%146 = OpFunction %2 None %105 +%144 = OpFunctionParameter %11 +%145 = OpFunctionParameter %3 +%143 = OpLabel +OpBranch %147 +%147 = OpLabel +%148 = OpConvertSToF %3 %144 +%149 = OpFDiv %3 %148 %79 +%150 = OpExtInst %3 %1 Sin %149 +%151 = OpFMul %3 %150 %79 +%152 = OpConvertFToS %11 %151 +%153 = OpExtInst %6 %1 UMin %152 %21 +%154 = OpAccessChain %20 %12 %23 %153 +OpStore %154 %145 OpReturn OpFunctionEnd -%158 = OpFunction %2 None %159 -%157 = OpFunctionParameter %3 -%156 = OpLabel -OpBranch %160 -%160 = OpLabel -%161 = OpAccessChain %21 %13 %24 %22 -OpStore %161 %157 -%162 = OpAccessChain %44 %13 %33 %36 -OpStore %162 %157 -%163 = OpAccessChain %44 %13 %63 %63 %36 -OpStore %163 %157 +%157 = OpFunction %2 None %158 +%156 = OpFunctionParameter %3 +%155 = OpLabel +OpBranch %159 +%159 = OpLabel +%160 = OpAccessChain %20 %12 %23 %21 +OpStore %160 %156 +%161 = OpAccessChain %43 %12 %32 %35 +OpStore %161 %156 +%162 = OpAccessChain %43 %12 %62 %62 %35 +OpStore %162 %156 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/bounds-check-zero.spvasm b/tests/out/spv/bounds-check-zero.spvasm index f24ab2cc73..2bb81261e1 100644 --- a/tests/out/spv/bounds-check-zero.spvasm +++ b/tests/out/spv/bounds-check-zero.spvasm @@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 201 +; Bound: 200 OpCapability Shader OpCapability Linkage OpExtension "SPV_KHR_storage_buffer_storage_class" @@ -16,8 +16,8 @@ OpMemberDecorate %10 2 ColMajor OpMemberDecorate %10 2 MatrixStride 16 OpMemberDecorate %10 3 Offset 112 OpDecorate %10 Block -OpDecorate %13 DescriptorSet 0 -OpDecorate %13 Binding 0 +OpDecorate %12 DescriptorSet 0 +OpDecorate %12 Binding 0 %2 = OpTypeVoid %3 = OpTypeFloat 32 %6 = OpTypeInt 32 0 @@ -28,285 +28,284 @@ OpDecorate %13 Binding 0 %9 = OpTypeRuntimeArray %3 %10 = OpTypeStruct %4 %7 %8 %9 %11 = OpTypeInt 32 1 -%12 = OpConstant %11 10 -%14 = OpTypePointer StorageBuffer %10 -%13 = OpVariable %14 StorageBuffer -%18 = OpTypeFunction %3 %11 -%20 = OpTypePointer StorageBuffer %4 -%21 = OpTypePointer StorageBuffer %3 -%23 = OpTypeBool -%24 = OpConstant %6 0 -%26 = OpConstantNull %3 -%35 = OpTypePointer StorageBuffer %9 -%38 = OpConstant %6 3 -%48 = OpTypePointer StorageBuffer %7 -%49 = OpTypePointer StorageBuffer %3 -%50 = OpConstant %6 4 -%52 = OpConstant %6 1 -%62 = OpTypeFunction %3 %7 %11 -%72 = OpTypeFunction %7 %11 -%74 = OpTypePointer StorageBuffer %8 -%75 = OpTypePointer StorageBuffer %7 -%77 = OpConstant %6 2 -%79 = OpConstantNull %7 -%88 = OpTypeFunction %3 %11 %11 -%101 = OpConstant %3 100.0 -%116 = OpTypeFunction %3 -%118 = OpConstant %6 9 -%131 = OpTypeFunction %2 %11 %3 -%160 = OpTypeFunction %2 %11 %7 -%171 = OpTypeFunction %2 %11 %11 %3 -%196 = OpTypeFunction %2 %3 -%17 = OpFunction %3 None %18 -%16 = OpFunctionParameter %11 -%15 = OpLabel -OpBranch %19 -%19 = OpLabel -%22 = OpULessThan %23 %16 %5 -OpSelectionMerge %27 None -OpBranchConditional %22 %28 %27 -%28 = OpLabel -%25 = OpAccessChain %21 %13 %24 %16 -%29 = OpLoad %3 %25 -OpBranch %27 +%13 = OpTypePointer StorageBuffer %10 +%12 = OpVariable %13 StorageBuffer +%17 = OpTypeFunction %3 %11 +%19 = OpTypePointer StorageBuffer %4 +%20 = OpTypePointer StorageBuffer %3 +%22 = OpTypeBool +%23 = OpConstant %6 0 +%25 = OpConstantNull %3 +%34 = OpTypePointer StorageBuffer %9 +%37 = OpConstant %6 3 +%47 = OpTypePointer StorageBuffer %7 +%48 = OpTypePointer StorageBuffer %3 +%49 = OpConstant %6 4 +%51 = OpConstant %6 1 +%61 = OpTypeFunction %3 %7 %11 +%71 = OpTypeFunction %7 %11 +%73 = OpTypePointer StorageBuffer %8 +%74 = OpTypePointer StorageBuffer %7 +%76 = OpConstant %6 2 +%78 = OpConstantNull %7 +%87 = OpTypeFunction %3 %11 %11 +%100 = OpConstant %3 100.0 +%115 = OpTypeFunction %3 +%117 = OpConstant %6 9 +%130 = OpTypeFunction %2 %11 %3 +%159 = OpTypeFunction %2 %11 %7 +%170 = OpTypeFunction %2 %11 %11 %3 +%195 = OpTypeFunction %2 %3 +%16 = OpFunction %3 None %17 +%15 = OpFunctionParameter %11 +%14 = OpLabel +OpBranch %18 +%18 = OpLabel +%21 = OpULessThan %22 %15 %5 +OpSelectionMerge %26 None +OpBranchConditional %21 %27 %26 %27 = OpLabel -%30 = OpPhi %3 %26 %19 %29 %28 -OpReturnValue %30 +%24 = OpAccessChain %20 %12 %23 %15 +%28 = OpLoad %3 %24 +OpBranch %26 +%26 = OpLabel +%29 = OpPhi %3 %25 %18 %28 %27 +OpReturnValue %29 OpFunctionEnd -%33 = OpFunction %3 None %18 -%32 = OpFunctionParameter %11 -%31 = OpLabel -OpBranch %34 -%34 = OpLabel -%36 = OpArrayLength %6 %13 3 -%37 = OpULessThan %23 %32 %36 -OpSelectionMerge %40 None -OpBranchConditional %37 %41 %40 -%41 = OpLabel -%39 = OpAccessChain %21 %13 %38 %32 -%42 = OpLoad %3 %39 -OpBranch %40 +%32 = OpFunction %3 None %17 +%31 = OpFunctionParameter %11 +%30 = OpLabel +OpBranch %33 +%33 = OpLabel +%35 = OpArrayLength %6 %12 3 +%36 = OpULessThan %22 %31 %35 +OpSelectionMerge %39 None +OpBranchConditional %36 %40 %39 %40 = OpLabel -%43 = OpPhi %3 %26 %34 %42 %41 -OpReturnValue %43 +%38 = OpAccessChain %20 %12 %37 %31 +%41 = OpLoad %3 %38 +OpBranch %39 +%39 = OpLabel +%42 = OpPhi %3 %25 %33 %41 %40 +OpReturnValue %42 OpFunctionEnd -%46 = OpFunction %3 None %18 -%45 = OpFunctionParameter %11 -%44 = OpLabel -OpBranch %47 -%47 = OpLabel -%51 = OpULessThan %23 %45 %50 -OpSelectionMerge %54 None -OpBranchConditional %51 %55 %54 -%55 = OpLabel -%53 = OpAccessChain %49 %13 %52 %45 -%56 = OpLoad %3 %53 -OpBranch %54 +%45 = OpFunction %3 None %17 +%44 = OpFunctionParameter %11 +%43 = OpLabel +OpBranch %46 +%46 = OpLabel +%50 = OpULessThan %22 %44 %49 +OpSelectionMerge %53 None +OpBranchConditional %50 %54 %53 %54 = OpLabel -%57 = OpPhi %3 %26 %47 %56 %55 -OpReturnValue %57 +%52 = OpAccessChain %48 %12 %51 %44 +%55 = OpLoad %3 %52 +OpBranch %53 +%53 = OpLabel +%56 = OpPhi %3 %25 %46 %55 %54 +OpReturnValue %56 OpFunctionEnd -%61 = OpFunction %3 None %62 -%59 = OpFunctionParameter %7 -%60 = OpFunctionParameter %11 -%58 = OpLabel -OpBranch %63 -%63 = OpLabel -%64 = OpULessThan %23 %60 %50 -OpSelectionMerge %65 None -OpBranchConditional %64 %66 %65 -%66 = OpLabel -%67 = OpVectorExtractDynamic %3 %59 %60 -OpBranch %65 +%60 = OpFunction %3 None %61 +%58 = OpFunctionParameter %7 +%59 = OpFunctionParameter %11 +%57 = OpLabel +OpBranch %62 +%62 = OpLabel +%63 = OpULessThan %22 %59 %49 +OpSelectionMerge %64 None +OpBranchConditional %63 %65 %64 %65 = OpLabel -%68 = OpPhi %3 %26 %63 %67 %66 -OpReturnValue %68 +%66 = OpVectorExtractDynamic %3 %58 %59 +OpBranch %64 +%64 = OpLabel +%67 = OpPhi %3 %25 %62 %66 %65 +OpReturnValue %67 OpFunctionEnd -%71 = OpFunction %7 None %72 -%70 = OpFunctionParameter %11 -%69 = OpLabel -OpBranch %73 -%73 = OpLabel -%76 = OpULessThan %23 %70 %38 -OpSelectionMerge %80 None -OpBranchConditional %76 %81 %80 -%81 = OpLabel -%78 = OpAccessChain %75 %13 %77 %70 -%82 = OpLoad %7 %78 -OpBranch %80 +%70 = OpFunction %7 None %71 +%69 = OpFunctionParameter %11 +%68 = OpLabel +OpBranch %72 +%72 = OpLabel +%75 = OpULessThan %22 %69 %37 +OpSelectionMerge %79 None +OpBranchConditional %75 %80 %79 %80 = OpLabel -%83 = OpPhi %7 %79 %73 %82 %81 -OpReturnValue %83 +%77 = OpAccessChain %74 %12 %76 %69 +%81 = OpLoad %7 %77 +OpBranch %79 +%79 = OpLabel +%82 = OpPhi %7 %78 %72 %81 %80 +OpReturnValue %82 OpFunctionEnd -%87 = OpFunction %3 None %88 +%86 = OpFunction %3 None %87 +%84 = OpFunctionParameter %11 %85 = OpFunctionParameter %11 -%86 = OpFunctionParameter %11 -%84 = OpLabel -OpBranch %89 -%89 = OpLabel -%90 = OpULessThan %23 %86 %50 -%91 = OpULessThan %23 %85 %38 -%92 = OpLogicalAnd %23 %90 %91 -OpSelectionMerge %94 None -OpBranchConditional %92 %95 %94 -%95 = OpLabel -%93 = OpAccessChain %49 %13 %77 %85 %86 -%96 = OpLoad %3 %93 -OpBranch %94 +%83 = OpLabel +OpBranch %88 +%88 = OpLabel +%89 = OpULessThan %22 %85 %49 +%90 = OpULessThan %22 %84 %37 +%91 = OpLogicalAnd %22 %89 %90 +OpSelectionMerge %93 None +OpBranchConditional %91 %94 %93 %94 = OpLabel -%97 = OpPhi %3 %26 %89 %96 %95 -OpReturnValue %97 +%92 = OpAccessChain %48 %12 %76 %84 %85 +%95 = OpLoad %3 %92 +OpBranch %93 +%93 = OpLabel +%96 = OpPhi %3 %25 %88 %95 %94 +OpReturnValue %96 OpFunctionEnd -%100 = OpFunction %3 None %18 -%99 = OpFunctionParameter %11 -%98 = OpLabel -OpBranch %102 -%102 = OpLabel -%103 = OpConvertSToF %3 %99 -%104 = OpFDiv %3 %103 %101 -%105 = OpExtInst %3 %1 Sin %104 -%106 = OpFMul %3 %105 %101 -%107 = OpConvertFToS %11 %106 -%108 = OpULessThan %23 %107 %5 -OpSelectionMerge %110 None -OpBranchConditional %108 %111 %110 -%111 = OpLabel -%109 = OpAccessChain %21 %13 %24 %107 -%112 = OpLoad %3 %109 -OpBranch %110 +%99 = OpFunction %3 None %17 +%98 = OpFunctionParameter %11 +%97 = OpLabel +OpBranch %101 +%101 = OpLabel +%102 = OpConvertSToF %3 %98 +%103 = OpFDiv %3 %102 %100 +%104 = OpExtInst %3 %1 Sin %103 +%105 = OpFMul %3 %104 %100 +%106 = OpConvertFToS %11 %105 +%107 = OpULessThan %22 %106 %5 +OpSelectionMerge %109 None +OpBranchConditional %107 %110 %109 %110 = OpLabel -%113 = OpPhi %3 %26 %102 %112 %111 -OpReturnValue %113 +%108 = OpAccessChain %20 %12 %23 %106 +%111 = OpLoad %3 %108 +OpBranch %109 +%109 = OpLabel +%112 = OpPhi %3 %25 %101 %111 %110 +OpReturnValue %112 OpFunctionEnd -%115 = OpFunction %3 None %116 -%114 = OpLabel -OpBranch %117 -%117 = OpLabel -%119 = OpAccessChain %21 %13 %24 %118 -%120 = OpLoad %3 %119 -%121 = OpAccessChain %49 %13 %52 %38 -%122 = OpLoad %3 %121 -%123 = OpFAdd %3 %120 %122 -%124 = OpAccessChain %49 %13 %77 %77 %38 -%125 = OpLoad %3 %124 -%126 = OpFAdd %3 %123 %125 -OpReturnValue %126 +%114 = OpFunction %3 None %115 +%113 = OpLabel +OpBranch %116 +%116 = OpLabel +%118 = OpAccessChain %20 %12 %23 %117 +%119 = OpLoad %3 %118 +%120 = OpAccessChain %48 %12 %51 %37 +%121 = OpLoad %3 %120 +%122 = OpFAdd %3 %119 %121 +%123 = OpAccessChain %48 %12 %76 %76 %37 +%124 = OpLoad %3 %123 +%125 = OpFAdd %3 %122 %124 +OpReturnValue %125 OpFunctionEnd -%130 = OpFunction %2 None %131 -%128 = OpFunctionParameter %11 -%129 = OpFunctionParameter %3 -%127 = OpLabel -OpBranch %132 -%132 = OpLabel -%133 = OpULessThan %23 %128 %5 -OpSelectionMerge %135 None -OpBranchConditional %133 %136 %135 -%136 = OpLabel -%134 = OpAccessChain %21 %13 %24 %128 -OpStore %134 %129 -OpBranch %135 +%129 = OpFunction %2 None %130 +%127 = OpFunctionParameter %11 +%128 = OpFunctionParameter %3 +%126 = OpLabel +OpBranch %131 +%131 = OpLabel +%132 = OpULessThan %22 %127 %5 +OpSelectionMerge %134 None +OpBranchConditional %132 %135 %134 %135 = OpLabel +%133 = OpAccessChain %20 %12 %23 %127 +OpStore %133 %128 +OpBranch %134 +%134 = OpLabel OpReturn OpFunctionEnd -%140 = OpFunction %2 None %131 -%138 = OpFunctionParameter %11 -%139 = OpFunctionParameter %3 -%137 = OpLabel -OpBranch %141 -%141 = OpLabel -%142 = OpArrayLength %6 %13 3 -%143 = OpULessThan %23 %138 %142 -OpSelectionMerge %145 None -OpBranchConditional %143 %146 %145 -%146 = OpLabel -%144 = OpAccessChain %21 %13 %38 %138 -OpStore %144 %139 -OpBranch %145 +%139 = OpFunction %2 None %130 +%137 = OpFunctionParameter %11 +%138 = OpFunctionParameter %3 +%136 = OpLabel +OpBranch %140 +%140 = OpLabel +%141 = OpArrayLength %6 %12 3 +%142 = OpULessThan %22 %137 %141 +OpSelectionMerge %144 None +OpBranchConditional %142 %145 %144 %145 = OpLabel +%143 = OpAccessChain %20 %12 %37 %137 +OpStore %143 %138 +OpBranch %144 +%144 = OpLabel OpReturn OpFunctionEnd -%150 = OpFunction %2 None %131 -%148 = OpFunctionParameter %11 -%149 = OpFunctionParameter %3 -%147 = OpLabel -OpBranch %151 -%151 = OpLabel -%152 = OpULessThan %23 %148 %50 -OpSelectionMerge %154 None -OpBranchConditional %152 %155 %154 -%155 = OpLabel -%153 = OpAccessChain %49 %13 %52 %148 -OpStore %153 %149 -OpBranch %154 +%149 = OpFunction %2 None %130 +%147 = OpFunctionParameter %11 +%148 = OpFunctionParameter %3 +%146 = OpLabel +OpBranch %150 +%150 = OpLabel +%151 = OpULessThan %22 %147 %49 +OpSelectionMerge %153 None +OpBranchConditional %151 %154 %153 %154 = OpLabel +%152 = OpAccessChain %48 %12 %51 %147 +OpStore %152 %148 +OpBranch %153 +%153 = OpLabel OpReturn OpFunctionEnd -%159 = OpFunction %2 None %160 -%157 = OpFunctionParameter %11 -%158 = OpFunctionParameter %7 -%156 = OpLabel -OpBranch %161 -%161 = OpLabel -%162 = OpULessThan %23 %157 %38 -OpSelectionMerge %164 None -OpBranchConditional %162 %165 %164 -%165 = OpLabel -%163 = OpAccessChain %75 %13 %77 %157 -OpStore %163 %158 -OpBranch %164 +%158 = OpFunction %2 None %159 +%156 = OpFunctionParameter %11 +%157 = OpFunctionParameter %7 +%155 = OpLabel +OpBranch %160 +%160 = OpLabel +%161 = OpULessThan %22 %156 %37 +OpSelectionMerge %163 None +OpBranchConditional %161 %164 %163 %164 = OpLabel +%162 = OpAccessChain %74 %12 %76 %156 +OpStore %162 %157 +OpBranch %163 +%163 = OpLabel OpReturn OpFunctionEnd -%170 = OpFunction %2 None %171 +%169 = OpFunction %2 None %170 +%166 = OpFunctionParameter %11 %167 = OpFunctionParameter %11 -%168 = OpFunctionParameter %11 -%169 = OpFunctionParameter %3 -%166 = OpLabel -OpBranch %172 -%172 = OpLabel -%173 = OpULessThan %23 %168 %50 -%174 = OpULessThan %23 %167 %38 -%175 = OpLogicalAnd %23 %173 %174 -OpSelectionMerge %177 None -OpBranchConditional %175 %178 %177 -%178 = OpLabel -%176 = OpAccessChain %49 %13 %77 %167 %168 -OpStore %176 %169 -OpBranch %177 +%168 = OpFunctionParameter %3 +%165 = OpLabel +OpBranch %171 +%171 = OpLabel +%172 = OpULessThan %22 %167 %49 +%173 = OpULessThan %22 %166 %37 +%174 = OpLogicalAnd %22 %172 %173 +OpSelectionMerge %176 None +OpBranchConditional %174 %177 %176 %177 = OpLabel +%175 = OpAccessChain %48 %12 %76 %166 %167 +OpStore %175 %168 +OpBranch %176 +%176 = OpLabel OpReturn OpFunctionEnd -%182 = OpFunction %2 None %131 -%180 = OpFunctionParameter %11 -%181 = OpFunctionParameter %3 -%179 = OpLabel -OpBranch %183 -%183 = OpLabel -%184 = OpConvertSToF %3 %180 -%185 = OpFDiv %3 %184 %101 -%186 = OpExtInst %3 %1 Sin %185 -%187 = OpFMul %3 %186 %101 -%188 = OpConvertFToS %11 %187 -%189 = OpULessThan %23 %188 %5 -OpSelectionMerge %191 None -OpBranchConditional %189 %192 %191 -%192 = OpLabel -%190 = OpAccessChain %21 %13 %24 %188 -OpStore %190 %181 -OpBranch %191 +%181 = OpFunction %2 None %130 +%179 = OpFunctionParameter %11 +%180 = OpFunctionParameter %3 +%178 = OpLabel +OpBranch %182 +%182 = OpLabel +%183 = OpConvertSToF %3 %179 +%184 = OpFDiv %3 %183 %100 +%185 = OpExtInst %3 %1 Sin %184 +%186 = OpFMul %3 %185 %100 +%187 = OpConvertFToS %11 %186 +%188 = OpULessThan %22 %187 %5 +OpSelectionMerge %190 None +OpBranchConditional %188 %191 %190 %191 = OpLabel +%189 = OpAccessChain %20 %12 %23 %187 +OpStore %189 %180 +OpBranch %190 +%190 = OpLabel OpReturn OpFunctionEnd -%195 = OpFunction %2 None %196 -%194 = OpFunctionParameter %3 -%193 = OpLabel -OpBranch %197 -%197 = OpLabel -%198 = OpAccessChain %21 %13 %24 %118 -OpStore %198 %194 -%199 = OpAccessChain %49 %13 %52 %38 -OpStore %199 %194 -%200 = OpAccessChain %49 %13 %77 %77 %38 -OpStore %200 %194 +%194 = OpFunction %2 None %195 +%193 = OpFunctionParameter %3 +%192 = OpLabel +OpBranch %196 +%196 = OpLabel +%197 = OpAccessChain %20 %12 %23 %117 +OpStore %197 %193 +%198 = OpAccessChain %48 %12 %51 %37 +OpStore %198 %193 +%199 = OpAccessChain %48 %12 %76 %76 %37 +OpStore %199 %193 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/constructors.spvasm b/tests/out/spv/constructors.spvasm index f52bd338cd..ec54d6d1bb 100644 --- a/tests/out/spv/constructors.spvasm +++ b/tests/out/spv/constructors.spvasm @@ -39,31 +39,31 @@ OpDecorate %17 ArrayStride 4 %26 = OpConstantComposite %9 %21 %22 %27 = OpConstantComposite %9 %23 %25 %28 = OpConstantComposite %8 %26 %27 -%29 = OpConstant %5 1 -%30 = OpConstantComposite %10 %28 -%31 = OpConstantNull %13 -%32 = OpConstantNull %5 -%33 = OpConstantNull %12 -%34 = OpConstantNull %4 -%35 = OpConstantNull %14 -%36 = OpConstantNull %8 -%37 = OpConstant %5 3 -%38 = OpConstantNull %15 -%39 = OpConstantNull %6 -%40 = OpConstant %5 0 -%41 = OpConstant %5 2 -%42 = OpConstantComposite %17 %40 %29 %41 %37 +%29 = OpConstantComposite %10 %28 +%30 = OpConstantNull %13 +%31 = OpConstantNull %5 +%32 = OpConstantNull %12 +%33 = OpConstantNull %4 +%34 = OpConstantNull %14 +%35 = OpConstantNull %8 +%36 = OpConstantNull %15 +%37 = OpConstantNull %6 +%38 = OpConstant %5 0 +%39 = OpConstant %5 1 +%40 = OpConstant %5 2 +%41 = OpConstant %5 3 +%42 = OpConstantComposite %17 %38 %39 %40 %41 %44 = OpTypePointer Function %6 %47 = OpTypeFunction %2 %48 = OpConstant %12 0 %49 = OpConstantNull %20 %46 = OpFunction %2 None %47 %45 = OpLabel -%43 = OpVariable %44 Function %39 +%43 = OpVariable %44 Function %37 OpBranch %50 %50 = OpLabel %51 = OpCompositeConstruct %3 %22 %22 %22 %22 -%52 = OpCompositeConstruct %6 %51 %29 +%52 = OpCompositeConstruct %6 %51 %39 OpStore %43 %52 %53 = OpCompositeConstruct %9 %22 %21 %54 = OpCompositeConstruct %9 %21 %22 @@ -77,7 +77,7 @@ OpStore %43 %52 %62 = OpCompositeConstruct %9 %21 %21 %63 = OpCompositeConstruct %9 %21 %21 %64 = OpCompositeConstruct %8 %62 %63 -%65 = OpCompositeConstruct %17 %40 %29 %41 %37 +%65 = OpCompositeConstruct %17 %38 %39 %40 %41 %71 = OpCopyObject %20 %49 %73 = OpCopyObject %20 %49 OpReturn diff --git a/tests/out/spv/extra.spvasm b/tests/out/spv/extra.spvasm index 16b9b750c9..93de9e8d99 100644 --- a/tests/out/spv/extra.spvasm +++ b/tests/out/spv/extra.spvasm @@ -7,18 +7,18 @@ OpCapability Float64 OpCapability Geometry %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %24 "main" %16 %19 %22 -OpExecutionMode %24 OriginUpperLeft +OpEntryPoint Fragment %23 "main" %15 %18 %21 +OpExecutionMode %23 OriginUpperLeft OpMemberDecorate %6 0 Offset 0 OpMemberDecorate %6 1 Offset 16 OpMemberDecorate %9 0 Offset 0 OpMemberDecorate %9 1 Offset 16 -OpDecorate %12 Block -OpMemberDecorate %12 0 Offset 0 -OpDecorate %16 Location 0 -OpDecorate %19 BuiltIn PrimitiveId -OpDecorate %19 Flat -OpDecorate %22 Location 0 +OpDecorate %11 Block +OpMemberDecorate %11 0 Offset 0 +OpDecorate %15 Location 0 +OpDecorate %18 BuiltIn PrimitiveId +OpDecorate %18 Flat +OpDecorate %21 Location 0 %2 = OpTypeVoid %3 = OpTypeInt 32 0 %5 = OpTypeFloat 64 @@ -27,50 +27,50 @@ OpDecorate %22 Location 0 %8 = OpTypeFloat 32 %7 = OpTypeVector %8 4 %9 = OpTypeStruct %7 %3 -%10 = OpTypeVector %8 3 -%12 = OpTypeStruct %6 -%13 = OpTypePointer PushConstant %12 -%11 = OpVariable %13 PushConstant -%17 = OpTypePointer Input %7 -%16 = OpVariable %17 Input -%20 = OpTypePointer Input %3 -%19 = OpVariable %20 Input -%23 = OpTypePointer Output %7 -%22 = OpVariable %23 Output -%25 = OpTypeFunction %2 -%26 = OpTypePointer PushConstant %6 -%27 = OpConstant %3 0 -%29 = OpConstant %8 1.0 -%32 = OpTypePointer PushConstant %3 -%35 = OpTypeBool -%24 = OpFunction %2 None %25 -%14 = OpLabel -%18 = OpLoad %7 %16 -%21 = OpLoad %3 %19 -%15 = OpCompositeConstruct %9 %18 %21 -%28 = OpAccessChain %26 %11 %27 -OpBranch %30 -%30 = OpLabel -%31 = OpCompositeExtract %3 %15 1 -%33 = OpAccessChain %32 %28 %27 -%34 = OpLoad %3 %33 -%36 = OpIEqual %35 %31 %34 -OpSelectionMerge %37 None -OpBranchConditional %36 %38 %39 -%38 = OpLabel -%40 = OpCompositeExtract %7 %15 0 -OpStore %22 %40 +%11 = OpTypeStruct %6 +%12 = OpTypePointer PushConstant %11 +%10 = OpVariable %12 PushConstant +%16 = OpTypePointer Input %7 +%15 = OpVariable %16 Input +%19 = OpTypePointer Input %3 +%18 = OpVariable %19 Input +%22 = OpTypePointer Output %7 +%21 = OpVariable %22 Output +%24 = OpTypeFunction %2 +%25 = OpTypePointer PushConstant %6 +%26 = OpConstant %3 0 +%28 = OpConstant %8 1.0 +%31 = OpTypePointer PushConstant %3 +%34 = OpTypeBool +%40 = OpTypeVector %8 3 +%23 = OpFunction %2 None %24 +%13 = OpLabel +%17 = OpLoad %7 %15 +%20 = OpLoad %3 %18 +%14 = OpCompositeConstruct %9 %17 %20 +%27 = OpAccessChain %25 %10 %26 +OpBranch %29 +%29 = OpLabel +%30 = OpCompositeExtract %3 %14 1 +%32 = OpAccessChain %31 %27 %26 +%33 = OpLoad %3 %32 +%35 = OpIEqual %34 %30 %33 +OpSelectionMerge %36 None +OpBranchConditional %35 %37 %38 +%37 = OpLabel +%39 = OpCompositeExtract %7 %14 0 +OpStore %21 %39 OpReturn -%39 = OpLabel -%41 = OpCompositeConstruct %10 %29 %29 %29 -%42 = OpCompositeExtract %7 %15 0 -%43 = OpVectorShuffle %10 %42 %42 0 1 2 -%44 = OpFSub %10 %41 %43 -%45 = OpCompositeExtract %7 %15 0 +%38 = OpLabel +%41 = OpCompositeConstruct %40 %28 %28 %28 +%42 = OpCompositeExtract %7 %14 0 +%43 = OpVectorShuffle %40 %42 %42 0 1 2 +%44 = OpFSub %40 %41 %43 +%45 = OpCompositeExtract %7 %14 0 %46 = OpCompositeExtract %8 %45 3 %47 = OpCompositeConstruct %7 %44 %46 -OpStore %22 %47 +OpStore %21 %47 OpReturn -%37 = OpLabel +%36 = OpLabel OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/functions.spvasm b/tests/out/spv/functions.spvasm index f114e29705..a7338a932d 100644 --- a/tests/out/spv/functions.spvasm +++ b/tests/out/spv/functions.spvasm @@ -11,65 +11,65 @@ OpExecutionMode %73 LocalSize 1 1 1 %4 = OpTypeFloat 32 %3 = OpTypeVector %4 2 %5 = OpTypeInt 32 1 -%6 = OpTypeVector %5 2 -%8 = OpTypeInt 32 0 -%7 = OpTypeVector %8 3 -%9 = OpTypeVector %5 4 -%12 = OpTypeFunction %3 -%13 = OpConstant %4 2.0 -%14 = OpConstant %4 0.5 -%22 = OpTypeFunction %5 -%23 = OpConstant %5 1 -%24 = OpConstant %8 1 -%25 = OpConstant %5 4 -%26 = OpConstant %5 2 -%31 = OpConstantNull %5 -%42 = OpConstantNull %8 +%8 = OpTypeFunction %3 +%9 = OpConstant %4 2.0 +%10 = OpConstant %4 0.5 +%18 = OpTypeFunction %5 +%19 = OpConstant %5 1 +%20 = OpTypeInt 32 0 +%21 = OpConstant %20 1 +%22 = OpConstant %5 4 +%23 = OpConstant %5 2 +%25 = OpTypeVector %5 2 +%29 = OpConstantNull %5 +%37 = OpTypeVector %20 3 +%41 = OpConstantNull %20 +%53 = OpTypeVector %5 4 %74 = OpTypeFunction %2 -%11 = OpFunction %3 None %12 -%10 = OpLabel -OpBranch %15 -%15 = OpLabel -%16 = OpCompositeConstruct %3 %13 %13 -%17 = OpCompositeConstruct %3 %14 %14 -%18 = OpCompositeConstruct %3 %14 %14 -%19 = OpExtInst %3 %1 Fma %16 %17 %18 -OpReturnValue %19 +%7 = OpFunction %3 None %8 +%6 = OpLabel +OpBranch %11 +%11 = OpLabel +%12 = OpCompositeConstruct %3 %9 %9 +%13 = OpCompositeConstruct %3 %10 %10 +%14 = OpCompositeConstruct %3 %10 %10 +%15 = OpExtInst %3 %1 Fma %12 %13 %14 +OpReturnValue %15 OpFunctionEnd -%21 = OpFunction %5 None %22 -%20 = OpLabel -OpBranch %27 -%27 = OpLabel -%28 = OpCompositeConstruct %6 %23 %23 -%29 = OpCompositeConstruct %6 %23 %23 -%32 = OpCompositeExtract %5 %28 0 -%33 = OpCompositeExtract %5 %29 0 -%34 = OpIMul %5 %32 %33 -%35 = OpIAdd %5 %31 %34 -%36 = OpCompositeExtract %5 %28 1 -%37 = OpCompositeExtract %5 %29 1 -%38 = OpIMul %5 %36 %37 -%30 = OpIAdd %5 %35 %38 -%39 = OpCompositeConstruct %7 %24 %24 %24 -%40 = OpCompositeConstruct %7 %24 %24 %24 -%43 = OpCompositeExtract %8 %39 0 -%44 = OpCompositeExtract %8 %40 0 -%45 = OpIMul %8 %43 %44 -%46 = OpIAdd %8 %42 %45 -%47 = OpCompositeExtract %8 %39 1 -%48 = OpCompositeExtract %8 %40 1 -%49 = OpIMul %8 %47 %48 -%50 = OpIAdd %8 %46 %49 -%51 = OpCompositeExtract %8 %39 2 -%52 = OpCompositeExtract %8 %40 2 -%53 = OpIMul %8 %51 %52 -%41 = OpIAdd %8 %50 %53 -%54 = OpCompositeConstruct %9 %25 %25 %25 %25 -%55 = OpCompositeConstruct %9 %26 %26 %26 %26 +%17 = OpFunction %5 None %18 +%16 = OpLabel +OpBranch %24 +%24 = OpLabel +%26 = OpCompositeConstruct %25 %19 %19 +%27 = OpCompositeConstruct %25 %19 %19 +%30 = OpCompositeExtract %5 %26 0 +%31 = OpCompositeExtract %5 %27 0 +%32 = OpIMul %5 %30 %31 +%33 = OpIAdd %5 %29 %32 +%34 = OpCompositeExtract %5 %26 1 +%35 = OpCompositeExtract %5 %27 1 +%36 = OpIMul %5 %34 %35 +%28 = OpIAdd %5 %33 %36 +%38 = OpCompositeConstruct %37 %21 %21 %21 +%39 = OpCompositeConstruct %37 %21 %21 %21 +%42 = OpCompositeExtract %20 %38 0 +%43 = OpCompositeExtract %20 %39 0 +%44 = OpIMul %20 %42 %43 +%45 = OpIAdd %20 %41 %44 +%46 = OpCompositeExtract %20 %38 1 +%47 = OpCompositeExtract %20 %39 1 +%48 = OpIMul %20 %46 %47 +%49 = OpIAdd %20 %45 %48 +%50 = OpCompositeExtract %20 %38 2 +%51 = OpCompositeExtract %20 %39 2 +%52 = OpIMul %20 %50 %51 +%40 = OpIAdd %20 %49 %52 +%54 = OpCompositeConstruct %53 %22 %22 %22 %22 +%55 = OpCompositeConstruct %53 %23 %23 %23 %23 %57 = OpCompositeExtract %5 %54 0 %58 = OpCompositeExtract %5 %55 0 %59 = OpIMul %5 %57 %58 -%60 = OpIAdd %5 %31 %59 +%60 = OpIAdd %5 %29 %59 %61 = OpCompositeExtract %5 %54 1 %62 = OpCompositeExtract %5 %55 1 %63 = OpIMul %5 %61 %62 @@ -88,7 +88,7 @@ OpFunctionEnd %72 = OpLabel OpBranch %75 %75 = OpLabel -%76 = OpFunctionCall %3 %11 -%77 = OpFunctionCall %5 %21 +%76 = OpFunctionCall %3 %7 +%77 = OpFunctionCall %5 %17 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/globals.spvasm b/tests/out/spv/globals.spvasm index 015195c732..9050f944bb 100644 --- a/tests/out/spv/globals.spvasm +++ b/tests/out/spv/globals.spvasm @@ -1,13 +1,13 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 178 +; Bound: 177 OpCapability Shader OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %102 "main" %121 -OpExecutionMode %102 LocalSize 1 1 1 +OpEntryPoint GLCompute %100 "main" %119 +OpExecutionMode %100 LocalSize 1 1 1 OpDecorate %5 ArrayStride 4 OpMemberDecorate %9 0 Offset 0 OpMemberDecorate %9 1 Offset 12 @@ -17,38 +17,38 @@ OpDecorate %17 ArrayStride 32 OpDecorate %19 ArrayStride 64 OpDecorate %21 ArrayStride 32 OpDecorate %22 ArrayStride 64 -OpDecorate %32 DescriptorSet 0 -OpDecorate %32 Binding 1 -OpDecorate %33 Block -OpMemberDecorate %33 0 Offset 0 -OpDecorate %35 NonWritable -OpDecorate %35 DescriptorSet 0 -OpDecorate %35 Binding 2 -OpDecorate %36 Block -OpMemberDecorate %36 0 Offset 0 -OpDecorate %38 DescriptorSet 0 -OpDecorate %38 Binding 3 -OpDecorate %39 Block -OpMemberDecorate %39 0 Offset 0 -OpDecorate %41 DescriptorSet 0 -OpDecorate %41 Binding 4 -OpDecorate %42 Block -OpMemberDecorate %42 0 Offset 0 -OpDecorate %44 DescriptorSet 0 -OpDecorate %44 Binding 5 -OpDecorate %45 Block -OpMemberDecorate %45 0 Offset 0 -OpMemberDecorate %45 0 ColMajor -OpMemberDecorate %45 0 MatrixStride 8 -OpDecorate %47 DescriptorSet 0 -OpDecorate %47 Binding 6 -OpDecorate %48 Block -OpMemberDecorate %48 0 Offset 0 -OpDecorate %50 DescriptorSet 0 -OpDecorate %50 Binding 7 -OpDecorate %51 Block -OpMemberDecorate %51 0 Offset 0 -OpDecorate %121 BuiltIn LocalInvocationId +OpDecorate %30 DescriptorSet 0 +OpDecorate %30 Binding 1 +OpDecorate %31 Block +OpMemberDecorate %31 0 Offset 0 +OpDecorate %33 NonWritable +OpDecorate %33 DescriptorSet 0 +OpDecorate %33 Binding 2 +OpDecorate %34 Block +OpMemberDecorate %34 0 Offset 0 +OpDecorate %36 DescriptorSet 0 +OpDecorate %36 Binding 3 +OpDecorate %37 Block +OpMemberDecorate %37 0 Offset 0 +OpDecorate %39 DescriptorSet 0 +OpDecorate %39 Binding 4 +OpDecorate %40 Block +OpMemberDecorate %40 0 Offset 0 +OpDecorate %42 DescriptorSet 0 +OpDecorate %42 Binding 5 +OpDecorate %43 Block +OpMemberDecorate %43 0 Offset 0 +OpMemberDecorate %43 0 ColMajor +OpMemberDecorate %43 0 MatrixStride 8 +OpDecorate %45 DescriptorSet 0 +OpDecorate %45 Binding 6 +OpDecorate %46 Block +OpMemberDecorate %46 0 Offset 0 +OpDecorate %48 DescriptorSet 0 +OpDecorate %48 Binding 7 +OpDecorate %49 Block +OpMemberDecorate %49 0 Offset 0 +OpDecorate %119 BuiltIn LocalInvocationId %2 = OpTypeVoid %3 = OpTypeBool %4 = OpTypeFloat 32 @@ -73,187 +73,186 @@ OpDecorate %121 BuiltIn LocalInvocationId %23 = OpTypeInt 32 1 %24 = OpTypeMatrix %8 3 %25 = OpConstantTrue %3 -%26 = OpConstant %23 20 -%27 = OpConstant %23 2 -%29 = OpTypePointer Workgroup %5 +%27 = OpTypePointer Workgroup %5 +%26 = OpVariable %27 Workgroup +%29 = OpTypePointer Workgroup %7 %28 = OpVariable %29 Workgroup -%31 = OpTypePointer Workgroup %7 -%30 = OpVariable %31 Workgroup -%33 = OpTypeStruct %9 -%34 = OpTypePointer StorageBuffer %33 -%32 = OpVariable %34 StorageBuffer -%36 = OpTypeStruct %11 -%37 = OpTypePointer StorageBuffer %36 -%35 = OpVariable %37 StorageBuffer -%39 = OpTypeStruct %13 -%40 = OpTypePointer Uniform %39 -%38 = OpVariable %40 Uniform -%42 = OpTypeStruct %8 -%43 = OpTypePointer Uniform %42 -%41 = OpVariable %43 Uniform -%45 = OpTypeStruct %15 -%46 = OpTypePointer Uniform %45 -%44 = OpVariable %46 Uniform -%48 = OpTypeStruct %19 -%49 = OpTypePointer Uniform %48 -%47 = OpVariable %49 Uniform -%51 = OpTypeStruct %22 -%52 = OpTypePointer Uniform %51 -%50 = OpVariable %52 Uniform -%56 = OpTypeFunction %2 %8 -%59 = OpTypePointer Function %23 -%60 = OpConstantNull %23 -%63 = OpTypeFunction %2 -%64 = OpTypePointer StorageBuffer %9 -%65 = OpConstant %7 0 -%67 = OpConstant %4 1.0 -%68 = OpConstant %23 1 -%69 = OpConstant %4 2.0 -%70 = OpConstant %4 3.0 -%71 = OpConstantNull %24 -%73 = OpTypePointer StorageBuffer %8 -%76 = OpTypePointer StorageBuffer %4 -%96 = OpTypePointer Function %4 -%97 = OpConstantNull %4 -%99 = OpTypePointer Function %3 -%100 = OpConstantNull %3 -%104 = OpTypePointer StorageBuffer %11 -%106 = OpTypePointer Uniform %13 -%108 = OpTypePointer Uniform %8 -%110 = OpTypePointer Uniform %15 -%112 = OpTypePointer Uniform %19 -%114 = OpTypePointer Uniform %22 -%116 = OpConstant %4 4.0 -%118 = OpConstantNull %5 -%119 = OpConstantNull %7 -%120 = OpTypeVector %7 3 -%122 = OpTypePointer Input %120 -%121 = OpVariable %122 Input -%124 = OpConstantNull %120 -%125 = OpTypeVector %3 3 -%130 = OpConstant %7 264 -%133 = OpTypePointer Workgroup %4 -%134 = OpTypePointer Uniform %21 -%135 = OpTypePointer Uniform %20 -%138 = OpTypePointer Uniform %17 -%139 = OpTypePointer Uniform %16 -%140 = OpTypePointer Uniform %12 -%145 = OpConstant %7 7 -%151 = OpConstant %7 6 -%153 = OpTypePointer StorageBuffer %10 -%154 = OpConstant %7 1 -%157 = OpConstant %7 5 -%159 = OpTypePointer Uniform %12 -%160 = OpTypePointer Uniform %4 -%161 = OpConstant %7 3 -%164 = OpConstant %7 4 -%166 = OpTypePointer StorageBuffer %4 -%177 = OpConstant %7 256 -%55 = OpFunction %2 None %56 -%54 = OpFunctionParameter %8 -%53 = OpLabel -OpBranch %57 -%57 = OpLabel +%31 = OpTypeStruct %9 +%32 = OpTypePointer StorageBuffer %31 +%30 = OpVariable %32 StorageBuffer +%34 = OpTypeStruct %11 +%35 = OpTypePointer StorageBuffer %34 +%33 = OpVariable %35 StorageBuffer +%37 = OpTypeStruct %13 +%38 = OpTypePointer Uniform %37 +%36 = OpVariable %38 Uniform +%40 = OpTypeStruct %8 +%41 = OpTypePointer Uniform %40 +%39 = OpVariable %41 Uniform +%43 = OpTypeStruct %15 +%44 = OpTypePointer Uniform %43 +%42 = OpVariable %44 Uniform +%46 = OpTypeStruct %19 +%47 = OpTypePointer Uniform %46 +%45 = OpVariable %47 Uniform +%49 = OpTypeStruct %22 +%50 = OpTypePointer Uniform %49 +%48 = OpVariable %50 Uniform +%54 = OpTypeFunction %2 %8 +%57 = OpTypePointer Function %23 +%58 = OpConstantNull %23 +%61 = OpTypeFunction %2 +%62 = OpTypePointer StorageBuffer %9 +%63 = OpConstant %7 0 +%65 = OpConstant %4 1.0 +%66 = OpConstant %23 1 +%67 = OpConstant %4 2.0 +%68 = OpConstant %4 3.0 +%69 = OpConstantNull %24 +%71 = OpTypePointer StorageBuffer %8 +%74 = OpTypePointer StorageBuffer %4 +%94 = OpTypePointer Function %4 +%95 = OpConstantNull %4 +%97 = OpTypePointer Function %3 +%98 = OpConstantNull %3 +%102 = OpTypePointer StorageBuffer %11 +%104 = OpTypePointer Uniform %13 +%106 = OpTypePointer Uniform %8 +%108 = OpTypePointer Uniform %15 +%110 = OpTypePointer Uniform %19 +%112 = OpTypePointer Uniform %22 +%114 = OpConstant %4 4.0 +%116 = OpConstantNull %5 +%117 = OpConstantNull %7 +%118 = OpTypeVector %7 3 +%120 = OpTypePointer Input %118 +%119 = OpVariable %120 Input +%122 = OpConstantNull %118 +%123 = OpTypeVector %3 3 +%128 = OpConstant %7 264 +%131 = OpTypePointer Workgroup %4 +%132 = OpTypePointer Uniform %21 +%133 = OpTypePointer Uniform %20 +%136 = OpTypePointer Uniform %17 +%137 = OpTypePointer Uniform %16 +%138 = OpTypePointer Uniform %12 +%143 = OpConstant %7 7 +%149 = OpConstant %7 6 +%151 = OpTypePointer StorageBuffer %10 +%152 = OpConstant %7 1 +%155 = OpConstant %7 5 +%157 = OpTypePointer Uniform %12 +%158 = OpTypePointer Uniform %4 +%159 = OpConstant %7 3 +%162 = OpConstant %7 4 +%164 = OpTypePointer StorageBuffer %4 +%175 = OpConstant %23 2 +%176 = OpConstant %7 256 +%53 = OpFunction %2 None %54 +%52 = OpFunctionParameter %8 +%51 = OpLabel +OpBranch %55 +%55 = OpLabel OpReturn OpFunctionEnd -%62 = OpFunction %2 None %63 -%61 = OpLabel -%58 = OpVariable %59 Function %60 -%66 = OpAccessChain %64 %32 %65 -OpBranch %72 -%72 = OpLabel -%74 = OpCompositeConstruct %8 %67 %67 %67 -%75 = OpAccessChain %73 %66 %65 -OpStore %75 %74 -OpStore %58 %68 -%77 = OpAccessChain %76 %66 %65 %65 -OpStore %77 %67 -%78 = OpAccessChain %76 %66 %65 %65 -OpStore %78 %69 -%79 = OpLoad %23 %58 -%80 = OpAccessChain %76 %66 %65 %79 -OpStore %80 %70 -%81 = OpLoad %9 %66 -%82 = OpCompositeExtract %8 %81 0 -%83 = OpCompositeExtract %8 %81 0 -%84 = OpVectorShuffle %10 %83 %83 2 0 -%85 = OpCompositeExtract %8 %81 0 -%86 = OpFunctionCall %2 %55 %85 -%87 = OpCompositeExtract %8 %81 0 -%88 = OpVectorTimesMatrix %8 %87 %71 -%89 = OpCompositeExtract %8 %81 0 -%90 = OpMatrixTimesVector %8 %71 %89 -%91 = OpCompositeExtract %8 %81 0 -%92 = OpVectorTimesScalar %8 %91 %69 -%93 = OpCompositeExtract %8 %81 0 -%94 = OpVectorTimesScalar %8 %93 %69 +%60 = OpFunction %2 None %61 +%59 = OpLabel +%56 = OpVariable %57 Function %58 +%64 = OpAccessChain %62 %30 %63 +OpBranch %70 +%70 = OpLabel +%72 = OpCompositeConstruct %8 %65 %65 %65 +%73 = OpAccessChain %71 %64 %63 +OpStore %73 %72 +OpStore %56 %66 +%75 = OpAccessChain %74 %64 %63 %63 +OpStore %75 %65 +%76 = OpAccessChain %74 %64 %63 %63 +OpStore %76 %67 +%77 = OpLoad %23 %56 +%78 = OpAccessChain %74 %64 %63 %77 +OpStore %78 %68 +%79 = OpLoad %9 %64 +%80 = OpCompositeExtract %8 %79 0 +%81 = OpCompositeExtract %8 %79 0 +%82 = OpVectorShuffle %10 %81 %81 2 0 +%83 = OpCompositeExtract %8 %79 0 +%84 = OpFunctionCall %2 %53 %83 +%85 = OpCompositeExtract %8 %79 0 +%86 = OpVectorTimesMatrix %8 %85 %69 +%87 = OpCompositeExtract %8 %79 0 +%88 = OpMatrixTimesVector %8 %69 %87 +%89 = OpCompositeExtract %8 %79 0 +%90 = OpVectorTimesScalar %8 %89 %67 +%91 = OpCompositeExtract %8 %79 0 +%92 = OpVectorTimesScalar %8 %91 %67 OpReturn OpFunctionEnd -%102 = OpFunction %2 None %63 -%101 = OpLabel -%95 = OpVariable %96 Function %97 -%98 = OpVariable %99 Function %100 -%103 = OpAccessChain %64 %32 %65 -%105 = OpAccessChain %104 %35 %65 -%107 = OpAccessChain %106 %38 %65 -%109 = OpAccessChain %108 %41 %65 -%111 = OpAccessChain %110 %44 %65 -%113 = OpAccessChain %112 %47 %65 -%115 = OpAccessChain %114 %50 %65 -OpBranch %117 -%117 = OpLabel -%123 = OpLoad %120 %121 -%126 = OpIEqual %125 %123 %124 -%127 = OpAll %3 %126 -OpSelectionMerge %128 None -OpBranchConditional %127 %129 %128 +%100 = OpFunction %2 None %61 +%99 = OpLabel +%93 = OpVariable %94 Function %95 +%96 = OpVariable %97 Function %98 +%101 = OpAccessChain %62 %30 %63 +%103 = OpAccessChain %102 %33 %63 +%105 = OpAccessChain %104 %36 %63 +%107 = OpAccessChain %106 %39 %63 +%109 = OpAccessChain %108 %42 %63 +%111 = OpAccessChain %110 %45 %63 +%113 = OpAccessChain %112 %48 %63 +OpBranch %115 +%115 = OpLabel +%121 = OpLoad %118 %119 +%124 = OpIEqual %123 %121 %122 +%125 = OpAll %3 %124 +OpSelectionMerge %126 None +OpBranchConditional %125 %127 %126 +%127 = OpLabel +OpStore %26 %116 +OpStore %28 %117 +OpBranch %126 +%126 = OpLabel +OpControlBarrier %18 %18 %128 +OpBranch %129 %129 = OpLabel -OpStore %28 %118 -OpStore %30 %119 -OpBranch %128 -%128 = OpLabel -OpControlBarrier %18 %18 %130 -OpBranch %131 -%131 = OpLabel -%132 = OpFunctionCall %2 %62 -%136 = OpAccessChain %135 %115 %65 %65 -%137 = OpLoad %20 %136 -%141 = OpAccessChain %140 %113 %65 %65 %65 -%142 = OpLoad %12 %141 -%143 = OpMatrixTimesVector %10 %137 %142 -%144 = OpCompositeExtract %4 %143 0 -%146 = OpAccessChain %133 %28 %145 -OpStore %146 %144 -%147 = OpLoad %15 %111 -%148 = OpLoad %8 %109 -%149 = OpMatrixTimesVector %10 %147 %148 -%150 = OpCompositeExtract %4 %149 0 -%152 = OpAccessChain %133 %28 %151 -OpStore %152 %150 -%155 = OpAccessChain %76 %105 %154 %154 -%156 = OpLoad %4 %155 -%158 = OpAccessChain %133 %28 %157 -OpStore %158 %156 -%162 = OpAccessChain %160 %107 %65 %161 -%163 = OpLoad %4 %162 -%165 = OpAccessChain %133 %28 %164 -OpStore %165 %163 -%167 = OpAccessChain %166 %103 %154 -%168 = OpLoad %4 %167 -%169 = OpAccessChain %133 %28 %161 -OpStore %169 %168 -%170 = OpAccessChain %76 %103 %65 %65 -%171 = OpLoad %4 %170 -%172 = OpAccessChain %133 %28 %18 -OpStore %172 %171 -%173 = OpAccessChain %166 %103 %154 -OpStore %173 %116 -%174 = OpArrayLength %7 %35 0 -%175 = OpConvertUToF %4 %174 -%176 = OpAccessChain %133 %28 %154 -OpStore %176 %175 -OpAtomicStore %30 %27 %177 %18 -OpStore %95 %67 -OpStore %98 %25 +%130 = OpFunctionCall %2 %60 +%134 = OpAccessChain %133 %113 %63 %63 +%135 = OpLoad %20 %134 +%139 = OpAccessChain %138 %111 %63 %63 %63 +%140 = OpLoad %12 %139 +%141 = OpMatrixTimesVector %10 %135 %140 +%142 = OpCompositeExtract %4 %141 0 +%144 = OpAccessChain %131 %26 %143 +OpStore %144 %142 +%145 = OpLoad %15 %109 +%146 = OpLoad %8 %107 +%147 = OpMatrixTimesVector %10 %145 %146 +%148 = OpCompositeExtract %4 %147 0 +%150 = OpAccessChain %131 %26 %149 +OpStore %150 %148 +%153 = OpAccessChain %74 %103 %152 %152 +%154 = OpLoad %4 %153 +%156 = OpAccessChain %131 %26 %155 +OpStore %156 %154 +%160 = OpAccessChain %158 %105 %63 %159 +%161 = OpLoad %4 %160 +%163 = OpAccessChain %131 %26 %162 +OpStore %163 %161 +%165 = OpAccessChain %164 %101 %152 +%166 = OpLoad %4 %165 +%167 = OpAccessChain %131 %26 %159 +OpStore %167 %166 +%168 = OpAccessChain %74 %101 %63 %63 +%169 = OpLoad %4 %168 +%170 = OpAccessChain %131 %26 %18 +OpStore %170 %169 +%171 = OpAccessChain %164 %101 %152 +OpStore %171 %114 +%172 = OpArrayLength %7 %33 0 +%173 = OpConvertUToF %4 %172 +%174 = OpAccessChain %131 %26 %152 +OpStore %174 %173 +OpAtomicStore %28 %175 %176 %18 +OpStore %93 %65 +OpStore %96 %25 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/image.spvasm b/tests/out/spv/image.spvasm index 45eadbae77..1b6ef28879 100644 --- a/tests/out/spv/image.spvasm +++ b/tests/out/spv/image.spvasm @@ -9,106 +9,106 @@ OpCapability SampledCubeArray OpCapability ImageQuery %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %82 "main" %79 -OpEntryPoint GLCompute %171 "depth_load" %169 -OpEntryPoint Vertex %192 "queries" %190 -OpEntryPoint Vertex %244 "levels_queries" %243 -OpEntryPoint Fragment %276 "texture_sample" %275 +OpEntryPoint GLCompute %78 "main" %75 +OpEntryPoint GLCompute %169 "depth_load" %167 +OpEntryPoint Vertex %190 "queries" %188 +OpEntryPoint Vertex %242 "levels_queries" %241 +OpEntryPoint Fragment %274 "texture_sample" %273 OpEntryPoint Fragment %421 "texture_sample_comparison" %419 OpEntryPoint Fragment %476 "gather" %475 OpEntryPoint Fragment %511 "depth_no_comparison" %510 -OpExecutionMode %82 LocalSize 16 1 1 -OpExecutionMode %171 LocalSize 16 1 1 -OpExecutionMode %276 OriginUpperLeft +OpExecutionMode %78 LocalSize 16 1 1 +OpExecutionMode %169 LocalSize 16 1 1 +OpExecutionMode %274 OriginUpperLeft OpExecutionMode %421 OriginUpperLeft OpExecutionMode %476 OriginUpperLeft OpExecutionMode %511 OriginUpperLeft -OpName %35 "image_mipmapped_src" -OpName %37 "image_multisampled_src" -OpName %39 "image_depth_multisampled_src" -OpName %41 "image_storage_src" -OpName %43 "image_array_src" -OpName %45 "image_dup_src" -OpName %47 "image_1d_src" -OpName %49 "image_dst" -OpName %51 "image_1d" -OpName %53 "image_2d" -OpName %55 "image_2d_u32" -OpName %56 "image_2d_i32" -OpName %58 "image_2d_array" -OpName %60 "image_cube" -OpName %62 "image_cube_array" -OpName %64 "image_3d" -OpName %66 "image_aa" -OpName %68 "sampler_reg" -OpName %70 "sampler_cmp" -OpName %72 "image_2d_depth" -OpName %74 "image_2d_array_depth" -OpName %76 "image_cube_depth" -OpName %79 "local_id" -OpName %82 "main" -OpName %169 "local_id" -OpName %171 "depth_load" -OpName %192 "queries" -OpName %244 "levels_queries" -OpName %271 "a" -OpName %276 "texture_sample" +OpName %31 "image_mipmapped_src" +OpName %33 "image_multisampled_src" +OpName %35 "image_depth_multisampled_src" +OpName %37 "image_storage_src" +OpName %39 "image_array_src" +OpName %41 "image_dup_src" +OpName %43 "image_1d_src" +OpName %45 "image_dst" +OpName %47 "image_1d" +OpName %49 "image_2d" +OpName %51 "image_2d_u32" +OpName %52 "image_2d_i32" +OpName %54 "image_2d_array" +OpName %56 "image_cube" +OpName %58 "image_cube_array" +OpName %60 "image_3d" +OpName %62 "image_aa" +OpName %64 "sampler_reg" +OpName %66 "sampler_cmp" +OpName %68 "image_2d_depth" +OpName %70 "image_2d_array_depth" +OpName %72 "image_cube_depth" +OpName %75 "local_id" +OpName %78 "main" +OpName %167 "local_id" +OpName %169 "depth_load" +OpName %190 "queries" +OpName %242 "levels_queries" +OpName %269 "a" +OpName %274 "texture_sample" OpName %415 "a" OpName %421 "texture_sample_comparison" OpName %476 "gather" OpName %511 "depth_no_comparison" +OpDecorate %31 DescriptorSet 0 +OpDecorate %31 Binding 0 +OpDecorate %33 DescriptorSet 0 +OpDecorate %33 Binding 3 OpDecorate %35 DescriptorSet 0 -OpDecorate %35 Binding 0 +OpDecorate %35 Binding 4 +OpDecorate %37 NonWritable OpDecorate %37 DescriptorSet 0 -OpDecorate %37 Binding 3 +OpDecorate %37 Binding 1 OpDecorate %39 DescriptorSet 0 -OpDecorate %39 Binding 4 +OpDecorate %39 Binding 5 OpDecorate %41 NonWritable OpDecorate %41 DescriptorSet 0 -OpDecorate %41 Binding 1 +OpDecorate %41 Binding 6 OpDecorate %43 DescriptorSet 0 -OpDecorate %43 Binding 5 -OpDecorate %45 NonWritable +OpDecorate %43 Binding 7 +OpDecorate %45 NonReadable OpDecorate %45 DescriptorSet 0 -OpDecorate %45 Binding 6 +OpDecorate %45 Binding 2 OpDecorate %47 DescriptorSet 0 -OpDecorate %47 Binding 7 -OpDecorate %49 NonReadable +OpDecorate %47 Binding 0 OpDecorate %49 DescriptorSet 0 -OpDecorate %49 Binding 2 +OpDecorate %49 Binding 1 OpDecorate %51 DescriptorSet 0 -OpDecorate %51 Binding 0 -OpDecorate %53 DescriptorSet 0 -OpDecorate %53 Binding 1 -OpDecorate %55 DescriptorSet 0 -OpDecorate %55 Binding 2 +OpDecorate %51 Binding 2 +OpDecorate %52 DescriptorSet 0 +OpDecorate %52 Binding 3 +OpDecorate %54 DescriptorSet 0 +OpDecorate %54 Binding 4 OpDecorate %56 DescriptorSet 0 -OpDecorate %56 Binding 3 +OpDecorate %56 Binding 5 OpDecorate %58 DescriptorSet 0 -OpDecorate %58 Binding 4 +OpDecorate %58 Binding 6 OpDecorate %60 DescriptorSet 0 -OpDecorate %60 Binding 5 +OpDecorate %60 Binding 7 OpDecorate %62 DescriptorSet 0 -OpDecorate %62 Binding 6 -OpDecorate %64 DescriptorSet 0 -OpDecorate %64 Binding 7 -OpDecorate %66 DescriptorSet 0 -OpDecorate %66 Binding 8 +OpDecorate %62 Binding 8 +OpDecorate %64 DescriptorSet 1 +OpDecorate %64 Binding 0 +OpDecorate %66 DescriptorSet 1 +OpDecorate %66 Binding 1 OpDecorate %68 DescriptorSet 1 -OpDecorate %68 Binding 0 +OpDecorate %68 Binding 2 OpDecorate %70 DescriptorSet 1 -OpDecorate %70 Binding 1 +OpDecorate %70 Binding 3 OpDecorate %72 DescriptorSet 1 -OpDecorate %72 Binding 2 -OpDecorate %74 DescriptorSet 1 -OpDecorate %74 Binding 3 -OpDecorate %76 DescriptorSet 1 -OpDecorate %76 Binding 4 -OpDecorate %79 BuiltIn LocalInvocationId -OpDecorate %169 BuiltIn LocalInvocationId -OpDecorate %190 BuiltIn Position -OpDecorate %243 BuiltIn Position -OpDecorate %275 Location 0 +OpDecorate %72 Binding 4 +OpDecorate %75 BuiltIn LocalInvocationId +OpDecorate %167 BuiltIn LocalInvocationId +OpDecorate %188 BuiltIn Position +OpDecorate %241 BuiltIn Position +OpDecorate %273 Location 0 OpDecorate %419 Location 0 OpDecorate %475 Location 0 OpDecorate %510 Location 0 @@ -125,47 +125,47 @@ OpDecorate %510 Location 0 %12 = OpTypeVector %4 3 %14 = OpTypeInt 32 1 %13 = OpTypeVector %14 2 -%15 = OpTypeVector %4 2 -%16 = OpTypeVector %4 4 -%17 = OpTypeImage %7 1D 0 0 0 1 Unknown -%18 = OpTypeImage %7 2D 0 0 0 1 Unknown -%19 = OpTypeImage %14 2D 0 0 0 1 Unknown -%20 = OpTypeImage %7 2D 0 1 0 1 Unknown -%21 = OpTypeImage %7 Cube 0 0 0 1 Unknown -%22 = OpTypeImage %7 Cube 0 1 0 1 Unknown -%23 = OpTypeImage %7 3D 0 0 0 1 Unknown -%24 = OpTypeImage %7 2D 0 0 1 1 Unknown -%25 = OpTypeVector %7 4 -%26 = OpTypeSampler -%27 = OpTypeVector %7 2 -%28 = OpTypeVector %7 3 -%29 = OpTypeImage %7 2D 1 0 0 1 Unknown -%30 = OpTypeImage %7 2D 1 1 0 1 Unknown -%31 = OpTypeImage %7 Cube 1 0 0 1 Unknown -%32 = OpConstant %14 3 -%33 = OpConstant %14 1 -%34 = OpConstantComposite %13 %32 %33 -%36 = OpTypePointer UniformConstant %3 +%15 = OpTypeImage %7 1D 0 0 0 1 Unknown +%16 = OpTypeImage %7 2D 0 0 0 1 Unknown +%17 = OpTypeImage %14 2D 0 0 0 1 Unknown +%18 = OpTypeImage %7 2D 0 1 0 1 Unknown +%19 = OpTypeImage %7 Cube 0 0 0 1 Unknown +%20 = OpTypeImage %7 Cube 0 1 0 1 Unknown +%21 = OpTypeImage %7 3D 0 0 0 1 Unknown +%22 = OpTypeImage %7 2D 0 0 1 1 Unknown +%23 = OpTypeVector %7 4 +%24 = OpTypeSampler +%25 = OpTypeImage %7 2D 1 0 0 1 Unknown +%26 = OpTypeImage %7 2D 1 1 0 1 Unknown +%27 = OpTypeImage %7 Cube 1 0 0 1 Unknown +%28 = OpConstant %14 3 +%29 = OpConstant %14 1 +%30 = OpConstantComposite %13 %28 %29 +%32 = OpTypePointer UniformConstant %3 +%31 = OpVariable %32 UniformConstant +%34 = OpTypePointer UniformConstant %5 +%33 = OpVariable %34 UniformConstant +%36 = OpTypePointer UniformConstant %6 %35 = OpVariable %36 UniformConstant -%38 = OpTypePointer UniformConstant %5 +%38 = OpTypePointer UniformConstant %8 %37 = OpVariable %38 UniformConstant -%40 = OpTypePointer UniformConstant %6 +%40 = OpTypePointer UniformConstant %9 %39 = OpVariable %40 UniformConstant -%42 = OpTypePointer UniformConstant %8 +%42 = OpTypePointer UniformConstant %10 %41 = OpVariable %42 UniformConstant -%44 = OpTypePointer UniformConstant %9 +%44 = OpTypePointer UniformConstant %11 %43 = OpVariable %44 UniformConstant %46 = OpTypePointer UniformConstant %10 %45 = OpVariable %46 UniformConstant -%48 = OpTypePointer UniformConstant %11 +%48 = OpTypePointer UniformConstant %15 %47 = OpVariable %48 UniformConstant -%50 = OpTypePointer UniformConstant %10 +%50 = OpTypePointer UniformConstant %16 %49 = OpVariable %50 UniformConstant -%52 = OpTypePointer UniformConstant %17 -%51 = OpVariable %52 UniformConstant -%54 = OpTypePointer UniformConstant %18 -%53 = OpVariable %54 UniformConstant -%55 = OpVariable %36 UniformConstant +%51 = OpVariable %32 UniformConstant +%53 = OpTypePointer UniformConstant %17 +%52 = OpVariable %53 UniformConstant +%55 = OpTypePointer UniformConstant %18 +%54 = OpVariable %55 UniformConstant %57 = OpTypePointer UniformConstant %19 %56 = OpVariable %57 UniformConstant %59 = OpTypePointer UniformConstant %20 @@ -174,470 +174,470 @@ OpDecorate %510 Location 0 %60 = OpVariable %61 UniformConstant %63 = OpTypePointer UniformConstant %22 %62 = OpVariable %63 UniformConstant -%65 = OpTypePointer UniformConstant %23 +%65 = OpTypePointer UniformConstant %24 %64 = OpVariable %65 UniformConstant %67 = OpTypePointer UniformConstant %24 %66 = OpVariable %67 UniformConstant -%69 = OpTypePointer UniformConstant %26 +%69 = OpTypePointer UniformConstant %25 %68 = OpVariable %69 UniformConstant %71 = OpTypePointer UniformConstant %26 %70 = OpVariable %71 UniformConstant -%73 = OpTypePointer UniformConstant %29 +%73 = OpTypePointer UniformConstant %27 %72 = OpVariable %73 UniformConstant -%75 = OpTypePointer UniformConstant %30 -%74 = OpVariable %75 UniformConstant -%77 = OpTypePointer UniformConstant %31 -%76 = OpVariable %77 UniformConstant -%80 = OpTypePointer Input %12 -%79 = OpVariable %80 Input -%83 = OpTypeFunction %2 -%90 = OpConstant %14 10 -%91 = OpConstant %14 20 -%111 = OpTypeVector %14 3 -%169 = OpVariable %80 Input -%191 = OpTypePointer Output %25 -%190 = OpVariable %191 Output -%201 = OpConstant %4 0 -%243 = OpVariable %191 Output -%272 = OpTypePointer Function %25 -%273 = OpConstantNull %25 -%275 = OpVariable %191 Output -%282 = OpConstant %7 0.5 -%283 = OpConstant %7 2.3 -%284 = OpConstant %7 2.0 -%285 = OpConstant %14 0 -%290 = OpTypeSampledImage %17 -%295 = OpTypeSampledImage %18 -%316 = OpTypeSampledImage %20 -%377 = OpTypeSampledImage %22 +%76 = OpTypePointer Input %12 +%75 = OpVariable %76 Input +%79 = OpTypeFunction %2 +%86 = OpConstant %14 10 +%87 = OpConstant %14 20 +%89 = OpTypeVector %4 2 +%98 = OpTypeVector %4 4 +%109 = OpTypeVector %14 3 +%167 = OpVariable %76 Input +%189 = OpTypePointer Output %23 +%188 = OpVariable %189 Output +%199 = OpConstant %4 0 +%241 = OpVariable %189 Output +%270 = OpTypePointer Function %23 +%271 = OpConstantNull %23 +%273 = OpVariable %189 Output +%280 = OpConstant %7 0.5 +%281 = OpConstant %7 2.3 +%282 = OpConstant %7 2.0 +%283 = OpConstant %14 0 +%285 = OpTypeVector %7 2 +%287 = OpTypeVector %7 3 +%290 = OpTypeSampledImage %15 +%295 = OpTypeSampledImage %16 +%316 = OpTypeSampledImage %18 +%377 = OpTypeSampledImage %20 %416 = OpTypePointer Function %7 %417 = OpConstantNull %7 %420 = OpTypePointer Output %7 %419 = OpVariable %420 Output -%429 = OpTypeSampledImage %29 -%434 = OpTypeSampledImage %30 -%447 = OpTypeSampledImage %31 +%429 = OpTypeSampledImage %25 +%434 = OpTypeSampledImage %26 +%447 = OpTypeSampledImage %27 %454 = OpConstant %7 0.0 -%475 = OpVariable %191 Output +%475 = OpVariable %189 Output %487 = OpConstant %4 1 %490 = OpConstant %4 3 %495 = OpTypeSampledImage %3 %498 = OpTypeVector %14 4 -%499 = OpTypeSampledImage %19 -%510 = OpVariable %191 Output -%82 = OpFunction %2 None %83 -%78 = OpLabel -%81 = OpLoad %12 %79 -%84 = OpLoad %3 %35 -%85 = OpLoad %5 %37 -%86 = OpLoad %8 %41 -%87 = OpLoad %9 %43 -%88 = OpLoad %11 %47 -%89 = OpLoad %10 %49 -OpBranch %92 -%92 = OpLabel -%93 = OpImageQuerySize %15 %86 -%94 = OpVectorShuffle %15 %81 %81 0 1 -%95 = OpIMul %15 %93 %94 -%96 = OpBitcast %13 %95 -%97 = OpCompositeConstruct %13 %90 %91 -%98 = OpSRem %13 %96 %97 -%99 = OpCompositeExtract %4 %81 2 -%100 = OpBitcast %14 %99 -%101 = OpImageFetch %16 %84 %98 Lod %100 -%102 = OpCompositeExtract %4 %81 2 -%103 = OpBitcast %14 %102 -%104 = OpImageFetch %16 %85 %98 Sample %103 -%105 = OpImageRead %16 %86 %98 -%106 = OpCompositeExtract %4 %81 2 -%107 = OpCompositeExtract %4 %81 2 -%108 = OpBitcast %14 %107 -%109 = OpIAdd %14 %108 %33 -%110 = OpBitcast %14 %106 -%112 = OpCompositeConstruct %111 %98 %110 -%113 = OpImageFetch %16 %87 %112 Lod %109 -%114 = OpCompositeExtract %4 %81 2 +%499 = OpTypeSampledImage %17 +%510 = OpVariable %189 Output +%78 = OpFunction %2 None %79 +%74 = OpLabel +%77 = OpLoad %12 %75 +%80 = OpLoad %3 %31 +%81 = OpLoad %5 %33 +%82 = OpLoad %8 %37 +%83 = OpLoad %9 %39 +%84 = OpLoad %11 %43 +%85 = OpLoad %10 %45 +OpBranch %88 +%88 = OpLabel +%90 = OpImageQuerySize %89 %82 +%91 = OpVectorShuffle %89 %77 %77 0 1 +%92 = OpIMul %89 %90 %91 +%93 = OpBitcast %13 %92 +%94 = OpCompositeConstruct %13 %86 %87 +%95 = OpSRem %13 %93 %94 +%96 = OpCompositeExtract %4 %77 2 +%97 = OpBitcast %14 %96 +%99 = OpImageFetch %98 %80 %95 Lod %97 +%100 = OpCompositeExtract %4 %77 2 +%101 = OpBitcast %14 %100 +%102 = OpImageFetch %98 %81 %95 Sample %101 +%103 = OpImageRead %98 %82 %95 +%104 = OpCompositeExtract %4 %77 2 +%105 = OpCompositeExtract %4 %77 2 +%106 = OpBitcast %14 %105 +%107 = OpIAdd %14 %106 %29 +%108 = OpBitcast %14 %104 +%110 = OpCompositeConstruct %109 %95 %108 +%111 = OpImageFetch %98 %83 %110 Lod %107 +%112 = OpCompositeExtract %4 %77 2 +%113 = OpBitcast %14 %112 +%114 = OpCompositeExtract %4 %77 2 %115 = OpBitcast %14 %114 -%116 = OpCompositeExtract %4 %81 2 -%117 = OpBitcast %14 %116 -%118 = OpIAdd %14 %117 %33 -%119 = OpCompositeConstruct %111 %98 %115 -%120 = OpImageFetch %16 %87 %119 Lod %118 -%121 = OpCompositeExtract %4 %81 0 +%116 = OpIAdd %14 %115 %29 +%117 = OpCompositeConstruct %109 %95 %113 +%118 = OpImageFetch %98 %83 %117 Lod %116 +%119 = OpCompositeExtract %4 %77 0 +%120 = OpBitcast %14 %119 +%121 = OpCompositeExtract %4 %77 2 %122 = OpBitcast %14 %121 -%123 = OpCompositeExtract %4 %81 2 -%124 = OpBitcast %14 %123 -%125 = OpImageFetch %16 %88 %122 Lod %124 -%126 = OpBitcast %15 %98 -%127 = OpCompositeExtract %4 %81 2 -%128 = OpBitcast %14 %127 -%129 = OpImageFetch %16 %84 %126 Lod %128 -%130 = OpBitcast %15 %98 -%131 = OpCompositeExtract %4 %81 2 -%132 = OpBitcast %14 %131 -%133 = OpImageFetch %16 %85 %130 Sample %132 -%134 = OpBitcast %15 %98 -%135 = OpImageRead %16 %86 %134 -%136 = OpBitcast %15 %98 -%137 = OpCompositeExtract %4 %81 2 -%138 = OpCompositeExtract %4 %81 2 -%139 = OpBitcast %14 %138 -%140 = OpIAdd %14 %139 %33 -%141 = OpCompositeConstruct %12 %136 %137 -%142 = OpImageFetch %16 %87 %141 Lod %140 -%143 = OpBitcast %15 %98 -%144 = OpCompositeExtract %4 %81 2 +%123 = OpImageFetch %98 %84 %120 Lod %122 +%124 = OpBitcast %89 %95 +%125 = OpCompositeExtract %4 %77 2 +%126 = OpBitcast %14 %125 +%127 = OpImageFetch %98 %80 %124 Lod %126 +%128 = OpBitcast %89 %95 +%129 = OpCompositeExtract %4 %77 2 +%130 = OpBitcast %14 %129 +%131 = OpImageFetch %98 %81 %128 Sample %130 +%132 = OpBitcast %89 %95 +%133 = OpImageRead %98 %82 %132 +%134 = OpBitcast %89 %95 +%135 = OpCompositeExtract %4 %77 2 +%136 = OpCompositeExtract %4 %77 2 +%137 = OpBitcast %14 %136 +%138 = OpIAdd %14 %137 %29 +%139 = OpCompositeConstruct %12 %134 %135 +%140 = OpImageFetch %98 %83 %139 Lod %138 +%141 = OpBitcast %89 %95 +%142 = OpCompositeExtract %4 %77 2 +%143 = OpBitcast %14 %142 +%144 = OpCompositeExtract %4 %77 2 %145 = OpBitcast %14 %144 -%146 = OpCompositeExtract %4 %81 2 -%147 = OpBitcast %14 %146 -%148 = OpIAdd %14 %147 %33 -%149 = OpBitcast %4 %145 -%150 = OpCompositeConstruct %12 %143 %149 -%151 = OpImageFetch %16 %87 %150 Lod %148 -%152 = OpCompositeExtract %4 %81 0 -%154 = OpCompositeExtract %4 %81 2 -%155 = OpBitcast %14 %154 -%156 = OpImageFetch %16 %88 %152 Lod %155 -%157 = OpCompositeExtract %14 %98 0 -%158 = OpIAdd %16 %101 %104 -%159 = OpIAdd %16 %158 %105 -%160 = OpIAdd %16 %159 %113 -%161 = OpIAdd %16 %160 %120 -OpImageWrite %89 %157 %161 -%162 = OpCompositeExtract %14 %98 0 -%163 = OpBitcast %4 %162 -%164 = OpIAdd %16 %129 %133 -%165 = OpIAdd %16 %164 %135 -%166 = OpIAdd %16 %165 %142 -%167 = OpIAdd %16 %166 %151 -OpImageWrite %89 %163 %167 +%146 = OpIAdd %14 %145 %29 +%147 = OpBitcast %4 %143 +%148 = OpCompositeConstruct %12 %141 %147 +%149 = OpImageFetch %98 %83 %148 Lod %146 +%150 = OpCompositeExtract %4 %77 0 +%152 = OpCompositeExtract %4 %77 2 +%153 = OpBitcast %14 %152 +%154 = OpImageFetch %98 %84 %150 Lod %153 +%155 = OpCompositeExtract %14 %95 0 +%156 = OpIAdd %98 %99 %102 +%157 = OpIAdd %98 %156 %103 +%158 = OpIAdd %98 %157 %111 +%159 = OpIAdd %98 %158 %118 +OpImageWrite %85 %155 %159 +%160 = OpCompositeExtract %14 %95 0 +%161 = OpBitcast %4 %160 +%162 = OpIAdd %98 %127 %131 +%163 = OpIAdd %98 %162 %133 +%164 = OpIAdd %98 %163 %140 +%165 = OpIAdd %98 %164 %149 +OpImageWrite %85 %161 %165 OpReturn OpFunctionEnd -%171 = OpFunction %2 None %83 -%168 = OpLabel -%170 = OpLoad %12 %169 -%172 = OpLoad %6 %39 -%173 = OpLoad %8 %41 -%174 = OpLoad %10 %49 -OpBranch %175 -%175 = OpLabel -%176 = OpImageQuerySize %15 %173 -%177 = OpVectorShuffle %15 %170 %170 0 1 -%178 = OpIMul %15 %176 %177 -%179 = OpBitcast %13 %178 -%180 = OpCompositeConstruct %13 %90 %91 -%181 = OpSRem %13 %179 %180 -%182 = OpCompositeExtract %4 %170 2 -%183 = OpBitcast %14 %182 -%184 = OpImageFetch %25 %172 %181 Sample %183 -%185 = OpCompositeExtract %7 %184 0 -%186 = OpCompositeExtract %14 %181 0 -%187 = OpConvertFToU %4 %185 -%188 = OpCompositeConstruct %16 %187 %187 %187 %187 -OpImageWrite %174 %186 %188 +%169 = OpFunction %2 None %79 +%166 = OpLabel +%168 = OpLoad %12 %167 +%170 = OpLoad %6 %35 +%171 = OpLoad %8 %37 +%172 = OpLoad %10 %45 +OpBranch %173 +%173 = OpLabel +%174 = OpImageQuerySize %89 %171 +%175 = OpVectorShuffle %89 %168 %168 0 1 +%176 = OpIMul %89 %174 %175 +%177 = OpBitcast %13 %176 +%178 = OpCompositeConstruct %13 %86 %87 +%179 = OpSRem %13 %177 %178 +%180 = OpCompositeExtract %4 %168 2 +%181 = OpBitcast %14 %180 +%182 = OpImageFetch %23 %170 %179 Sample %181 +%183 = OpCompositeExtract %7 %182 0 +%184 = OpCompositeExtract %14 %179 0 +%185 = OpConvertFToU %4 %183 +%186 = OpCompositeConstruct %98 %185 %185 %185 %185 +OpImageWrite %172 %184 %186 OpReturn OpFunctionEnd -%192 = OpFunction %2 None %83 -%189 = OpLabel -%193 = OpLoad %17 %51 -%194 = OpLoad %18 %53 +%190 = OpFunction %2 None %79 +%187 = OpLabel +%191 = OpLoad %15 %47 +%192 = OpLoad %16 %49 +%193 = OpLoad %18 %54 +%194 = OpLoad %19 %56 %195 = OpLoad %20 %58 %196 = OpLoad %21 %60 %197 = OpLoad %22 %62 -%198 = OpLoad %23 %64 -%199 = OpLoad %24 %66 -OpBranch %200 -%200 = OpLabel -%202 = OpImageQuerySizeLod %4 %193 %201 -%203 = OpBitcast %14 %202 -%204 = OpImageQuerySizeLod %4 %193 %203 -%205 = OpImageQuerySizeLod %15 %194 %201 -%206 = OpImageQuerySizeLod %15 %194 %33 -%207 = OpImageQuerySizeLod %12 %195 %201 -%208 = OpVectorShuffle %15 %207 %207 0 1 -%209 = OpImageQuerySizeLod %12 %195 %33 -%210 = OpVectorShuffle %15 %209 %209 0 1 -%211 = OpImageQuerySizeLod %15 %196 %201 -%212 = OpImageQuerySizeLod %15 %196 %33 -%213 = OpImageQuerySizeLod %12 %197 %201 -%214 = OpVectorShuffle %15 %213 %213 0 0 -%215 = OpImageQuerySizeLod %12 %197 %33 -%216 = OpVectorShuffle %15 %215 %215 0 0 -%217 = OpImageQuerySizeLod %12 %198 %201 -%218 = OpImageQuerySizeLod %12 %198 %33 -%219 = OpImageQuerySize %15 %199 -%220 = OpCompositeExtract %4 %205 1 -%221 = OpIAdd %4 %202 %220 +OpBranch %198 +%198 = OpLabel +%200 = OpImageQuerySizeLod %4 %191 %199 +%201 = OpBitcast %14 %200 +%202 = OpImageQuerySizeLod %4 %191 %201 +%203 = OpImageQuerySizeLod %89 %192 %199 +%204 = OpImageQuerySizeLod %89 %192 %29 +%205 = OpImageQuerySizeLod %12 %193 %199 +%206 = OpVectorShuffle %89 %205 %205 0 1 +%207 = OpImageQuerySizeLod %12 %193 %29 +%208 = OpVectorShuffle %89 %207 %207 0 1 +%209 = OpImageQuerySizeLod %89 %194 %199 +%210 = OpImageQuerySizeLod %89 %194 %29 +%211 = OpImageQuerySizeLod %12 %195 %199 +%212 = OpVectorShuffle %89 %211 %211 0 0 +%213 = OpImageQuerySizeLod %12 %195 %29 +%214 = OpVectorShuffle %89 %213 %213 0 0 +%215 = OpImageQuerySizeLod %12 %196 %199 +%216 = OpImageQuerySizeLod %12 %196 %29 +%217 = OpImageQuerySize %89 %197 +%218 = OpCompositeExtract %4 %203 1 +%219 = OpIAdd %4 %200 %218 +%220 = OpCompositeExtract %4 %204 1 +%221 = OpIAdd %4 %219 %220 %222 = OpCompositeExtract %4 %206 1 %223 = OpIAdd %4 %221 %222 %224 = OpCompositeExtract %4 %208 1 %225 = OpIAdd %4 %223 %224 -%226 = OpCompositeExtract %4 %210 1 +%226 = OpCompositeExtract %4 %209 1 %227 = OpIAdd %4 %225 %226 -%228 = OpCompositeExtract %4 %211 1 +%228 = OpCompositeExtract %4 %210 1 %229 = OpIAdd %4 %227 %228 %230 = OpCompositeExtract %4 %212 1 %231 = OpIAdd %4 %229 %230 %232 = OpCompositeExtract %4 %214 1 %233 = OpIAdd %4 %231 %232 -%234 = OpCompositeExtract %4 %216 1 +%234 = OpCompositeExtract %4 %215 2 %235 = OpIAdd %4 %233 %234 -%236 = OpCompositeExtract %4 %217 2 +%236 = OpCompositeExtract %4 %216 2 %237 = OpIAdd %4 %235 %236 -%238 = OpCompositeExtract %4 %218 2 -%239 = OpIAdd %4 %237 %238 -%240 = OpConvertUToF %7 %239 -%241 = OpCompositeConstruct %25 %240 %240 %240 %240 -OpStore %190 %241 +%238 = OpConvertUToF %7 %237 +%239 = OpCompositeConstruct %23 %238 %238 %238 %238 +OpStore %188 %239 OpReturn OpFunctionEnd -%244 = OpFunction %2 None %83 -%242 = OpLabel -%245 = OpLoad %18 %53 +%242 = OpFunction %2 None %79 +%240 = OpLabel +%243 = OpLoad %16 %49 +%244 = OpLoad %18 %54 +%245 = OpLoad %19 %56 %246 = OpLoad %20 %58 %247 = OpLoad %21 %60 %248 = OpLoad %22 %62 -%249 = OpLoad %23 %64 -%250 = OpLoad %24 %66 -OpBranch %251 -%251 = OpLabel -%252 = OpImageQueryLevels %4 %245 -%253 = OpImageQueryLevels %4 %246 -%254 = OpImageQuerySizeLod %12 %246 %201 -%255 = OpCompositeExtract %4 %254 2 -%256 = OpImageQueryLevels %4 %247 -%257 = OpImageQueryLevels %4 %248 -%258 = OpImageQuerySizeLod %12 %248 %201 -%259 = OpCompositeExtract %4 %258 2 -%260 = OpImageQueryLevels %4 %249 -%261 = OpImageQuerySamples %4 %250 -%262 = OpIAdd %4 %255 %259 -%263 = OpIAdd %4 %262 %261 -%264 = OpIAdd %4 %263 %252 -%265 = OpIAdd %4 %264 %253 -%266 = OpIAdd %4 %265 %260 -%267 = OpIAdd %4 %266 %256 -%268 = OpIAdd %4 %267 %257 -%269 = OpConvertUToF %7 %268 -%270 = OpCompositeConstruct %25 %269 %269 %269 %269 -OpStore %243 %270 +OpBranch %249 +%249 = OpLabel +%250 = OpImageQueryLevels %4 %243 +%251 = OpImageQueryLevels %4 %244 +%252 = OpImageQuerySizeLod %12 %244 %199 +%253 = OpCompositeExtract %4 %252 2 +%254 = OpImageQueryLevels %4 %245 +%255 = OpImageQueryLevels %4 %246 +%256 = OpImageQuerySizeLod %12 %246 %199 +%257 = OpCompositeExtract %4 %256 2 +%258 = OpImageQueryLevels %4 %247 +%259 = OpImageQuerySamples %4 %248 +%260 = OpIAdd %4 %253 %257 +%261 = OpIAdd %4 %260 %259 +%262 = OpIAdd %4 %261 %250 +%263 = OpIAdd %4 %262 %251 +%264 = OpIAdd %4 %263 %258 +%265 = OpIAdd %4 %264 %254 +%266 = OpIAdd %4 %265 %255 +%267 = OpConvertUToF %7 %266 +%268 = OpCompositeConstruct %23 %267 %267 %267 %267 +OpStore %241 %268 OpReturn OpFunctionEnd -%276 = OpFunction %2 None %83 -%274 = OpLabel -%271 = OpVariable %272 Function %273 -%277 = OpLoad %17 %51 -%278 = OpLoad %18 %53 -%279 = OpLoad %20 %58 -%280 = OpLoad %22 %62 -%281 = OpLoad %26 %68 -OpBranch %286 -%286 = OpLabel -%287 = OpCompositeConstruct %27 %282 %282 -%288 = OpCompositeConstruct %28 %282 %282 %282 -%289 = OpCompositeExtract %7 %287 0 -%291 = OpSampledImage %290 %277 %281 -%292 = OpImageSampleImplicitLod %25 %291 %289 -%293 = OpLoad %25 %271 -%294 = OpFAdd %25 %293 %292 -OpStore %271 %294 -%296 = OpSampledImage %295 %278 %281 -%297 = OpImageSampleImplicitLod %25 %296 %287 -%298 = OpLoad %25 %271 -%299 = OpFAdd %25 %298 %297 -OpStore %271 %299 -%300 = OpSampledImage %295 %278 %281 -%301 = OpImageSampleImplicitLod %25 %300 %287 ConstOffset %34 -%302 = OpLoad %25 %271 -%303 = OpFAdd %25 %302 %301 -OpStore %271 %303 -%304 = OpSampledImage %295 %278 %281 -%305 = OpImageSampleExplicitLod %25 %304 %287 Lod %283 -%306 = OpLoad %25 %271 -%307 = OpFAdd %25 %306 %305 -OpStore %271 %307 -%308 = OpSampledImage %295 %278 %281 -%309 = OpImageSampleExplicitLod %25 %308 %287 Lod|ConstOffset %283 %34 -%310 = OpLoad %25 %271 -%311 = OpFAdd %25 %310 %309 -OpStore %271 %311 -%312 = OpSampledImage %295 %278 %281 -%313 = OpImageSampleImplicitLod %25 %312 %287 Bias|ConstOffset %284 %34 -%314 = OpLoad %25 %271 -%315 = OpFAdd %25 %314 %313 -OpStore %271 %315 -%317 = OpConvertUToF %7 %201 -%318 = OpCompositeConstruct %28 %287 %317 -%319 = OpSampledImage %316 %279 %281 -%320 = OpImageSampleImplicitLod %25 %319 %318 -%321 = OpLoad %25 %271 -%322 = OpFAdd %25 %321 %320 -OpStore %271 %322 -%323 = OpConvertUToF %7 %201 -%324 = OpCompositeConstruct %28 %287 %323 -%325 = OpSampledImage %316 %279 %281 -%326 = OpImageSampleImplicitLod %25 %325 %324 ConstOffset %34 -%327 = OpLoad %25 %271 -%328 = OpFAdd %25 %327 %326 -OpStore %271 %328 -%329 = OpConvertUToF %7 %201 -%330 = OpCompositeConstruct %28 %287 %329 -%331 = OpSampledImage %316 %279 %281 -%332 = OpImageSampleExplicitLod %25 %331 %330 Lod %283 -%333 = OpLoad %25 %271 -%334 = OpFAdd %25 %333 %332 -OpStore %271 %334 -%335 = OpConvertUToF %7 %201 -%336 = OpCompositeConstruct %28 %287 %335 -%337 = OpSampledImage %316 %279 %281 -%338 = OpImageSampleExplicitLod %25 %337 %336 Lod|ConstOffset %283 %34 -%339 = OpLoad %25 %271 -%340 = OpFAdd %25 %339 %338 -OpStore %271 %340 -%341 = OpConvertUToF %7 %201 -%342 = OpCompositeConstruct %28 %287 %341 -%343 = OpSampledImage %316 %279 %281 -%344 = OpImageSampleImplicitLod %25 %343 %342 Bias|ConstOffset %284 %34 -%345 = OpLoad %25 %271 -%346 = OpFAdd %25 %345 %344 -OpStore %271 %346 -%347 = OpConvertSToF %7 %285 -%348 = OpCompositeConstruct %28 %287 %347 -%349 = OpSampledImage %316 %279 %281 -%350 = OpImageSampleImplicitLod %25 %349 %348 -%351 = OpLoad %25 %271 -%352 = OpFAdd %25 %351 %350 -OpStore %271 %352 -%353 = OpConvertSToF %7 %285 -%354 = OpCompositeConstruct %28 %287 %353 -%355 = OpSampledImage %316 %279 %281 -%356 = OpImageSampleImplicitLod %25 %355 %354 ConstOffset %34 -%357 = OpLoad %25 %271 -%358 = OpFAdd %25 %357 %356 -OpStore %271 %358 -%359 = OpConvertSToF %7 %285 -%360 = OpCompositeConstruct %28 %287 %359 -%361 = OpSampledImage %316 %279 %281 -%362 = OpImageSampleExplicitLod %25 %361 %360 Lod %283 -%363 = OpLoad %25 %271 -%364 = OpFAdd %25 %363 %362 -OpStore %271 %364 -%365 = OpConvertSToF %7 %285 -%366 = OpCompositeConstruct %28 %287 %365 -%367 = OpSampledImage %316 %279 %281 -%368 = OpImageSampleExplicitLod %25 %367 %366 Lod|ConstOffset %283 %34 -%369 = OpLoad %25 %271 -%370 = OpFAdd %25 %369 %368 -OpStore %271 %370 -%371 = OpConvertSToF %7 %285 -%372 = OpCompositeConstruct %28 %287 %371 -%373 = OpSampledImage %316 %279 %281 -%374 = OpImageSampleImplicitLod %25 %373 %372 Bias|ConstOffset %284 %34 -%375 = OpLoad %25 %271 -%376 = OpFAdd %25 %375 %374 -OpStore %271 %376 -%378 = OpConvertUToF %7 %201 -%379 = OpCompositeConstruct %25 %288 %378 -%380 = OpSampledImage %377 %280 %281 -%381 = OpImageSampleImplicitLod %25 %380 %379 -%382 = OpLoad %25 %271 -%383 = OpFAdd %25 %382 %381 -OpStore %271 %383 -%384 = OpConvertUToF %7 %201 -%385 = OpCompositeConstruct %25 %288 %384 -%386 = OpSampledImage %377 %280 %281 -%387 = OpImageSampleExplicitLod %25 %386 %385 Lod %283 -%388 = OpLoad %25 %271 -%389 = OpFAdd %25 %388 %387 -OpStore %271 %389 -%390 = OpConvertUToF %7 %201 -%391 = OpCompositeConstruct %25 %288 %390 -%392 = OpSampledImage %377 %280 %281 -%393 = OpImageSampleImplicitLod %25 %392 %391 Bias %284 -%394 = OpLoad %25 %271 -%395 = OpFAdd %25 %394 %393 -OpStore %271 %395 -%396 = OpConvertSToF %7 %285 -%397 = OpCompositeConstruct %25 %288 %396 -%398 = OpSampledImage %377 %280 %281 -%399 = OpImageSampleImplicitLod %25 %398 %397 -%400 = OpLoad %25 %271 -%401 = OpFAdd %25 %400 %399 -OpStore %271 %401 -%402 = OpConvertSToF %7 %285 -%403 = OpCompositeConstruct %25 %288 %402 -%404 = OpSampledImage %377 %280 %281 -%405 = OpImageSampleExplicitLod %25 %404 %403 Lod %283 -%406 = OpLoad %25 %271 -%407 = OpFAdd %25 %406 %405 -OpStore %271 %407 -%408 = OpConvertSToF %7 %285 -%409 = OpCompositeConstruct %25 %288 %408 -%410 = OpSampledImage %377 %280 %281 -%411 = OpImageSampleImplicitLod %25 %410 %409 Bias %284 -%412 = OpLoad %25 %271 -%413 = OpFAdd %25 %412 %411 -OpStore %271 %413 -%414 = OpLoad %25 %271 -OpStore %275 %414 +%274 = OpFunction %2 None %79 +%272 = OpLabel +%269 = OpVariable %270 Function %271 +%275 = OpLoad %15 %47 +%276 = OpLoad %16 %49 +%277 = OpLoad %18 %54 +%278 = OpLoad %20 %58 +%279 = OpLoad %24 %64 +OpBranch %284 +%284 = OpLabel +%286 = OpCompositeConstruct %285 %280 %280 +%288 = OpCompositeConstruct %287 %280 %280 %280 +%289 = OpCompositeExtract %7 %286 0 +%291 = OpSampledImage %290 %275 %279 +%292 = OpImageSampleImplicitLod %23 %291 %289 +%293 = OpLoad %23 %269 +%294 = OpFAdd %23 %293 %292 +OpStore %269 %294 +%296 = OpSampledImage %295 %276 %279 +%297 = OpImageSampleImplicitLod %23 %296 %286 +%298 = OpLoad %23 %269 +%299 = OpFAdd %23 %298 %297 +OpStore %269 %299 +%300 = OpSampledImage %295 %276 %279 +%301 = OpImageSampleImplicitLod %23 %300 %286 ConstOffset %30 +%302 = OpLoad %23 %269 +%303 = OpFAdd %23 %302 %301 +OpStore %269 %303 +%304 = OpSampledImage %295 %276 %279 +%305 = OpImageSampleExplicitLod %23 %304 %286 Lod %281 +%306 = OpLoad %23 %269 +%307 = OpFAdd %23 %306 %305 +OpStore %269 %307 +%308 = OpSampledImage %295 %276 %279 +%309 = OpImageSampleExplicitLod %23 %308 %286 Lod|ConstOffset %281 %30 +%310 = OpLoad %23 %269 +%311 = OpFAdd %23 %310 %309 +OpStore %269 %311 +%312 = OpSampledImage %295 %276 %279 +%313 = OpImageSampleImplicitLod %23 %312 %286 Bias|ConstOffset %282 %30 +%314 = OpLoad %23 %269 +%315 = OpFAdd %23 %314 %313 +OpStore %269 %315 +%317 = OpConvertUToF %7 %199 +%318 = OpCompositeConstruct %287 %286 %317 +%319 = OpSampledImage %316 %277 %279 +%320 = OpImageSampleImplicitLod %23 %319 %318 +%321 = OpLoad %23 %269 +%322 = OpFAdd %23 %321 %320 +OpStore %269 %322 +%323 = OpConvertUToF %7 %199 +%324 = OpCompositeConstruct %287 %286 %323 +%325 = OpSampledImage %316 %277 %279 +%326 = OpImageSampleImplicitLod %23 %325 %324 ConstOffset %30 +%327 = OpLoad %23 %269 +%328 = OpFAdd %23 %327 %326 +OpStore %269 %328 +%329 = OpConvertUToF %7 %199 +%330 = OpCompositeConstruct %287 %286 %329 +%331 = OpSampledImage %316 %277 %279 +%332 = OpImageSampleExplicitLod %23 %331 %330 Lod %281 +%333 = OpLoad %23 %269 +%334 = OpFAdd %23 %333 %332 +OpStore %269 %334 +%335 = OpConvertUToF %7 %199 +%336 = OpCompositeConstruct %287 %286 %335 +%337 = OpSampledImage %316 %277 %279 +%338 = OpImageSampleExplicitLod %23 %337 %336 Lod|ConstOffset %281 %30 +%339 = OpLoad %23 %269 +%340 = OpFAdd %23 %339 %338 +OpStore %269 %340 +%341 = OpConvertUToF %7 %199 +%342 = OpCompositeConstruct %287 %286 %341 +%343 = OpSampledImage %316 %277 %279 +%344 = OpImageSampleImplicitLod %23 %343 %342 Bias|ConstOffset %282 %30 +%345 = OpLoad %23 %269 +%346 = OpFAdd %23 %345 %344 +OpStore %269 %346 +%347 = OpConvertSToF %7 %283 +%348 = OpCompositeConstruct %287 %286 %347 +%349 = OpSampledImage %316 %277 %279 +%350 = OpImageSampleImplicitLod %23 %349 %348 +%351 = OpLoad %23 %269 +%352 = OpFAdd %23 %351 %350 +OpStore %269 %352 +%353 = OpConvertSToF %7 %283 +%354 = OpCompositeConstruct %287 %286 %353 +%355 = OpSampledImage %316 %277 %279 +%356 = OpImageSampleImplicitLod %23 %355 %354 ConstOffset %30 +%357 = OpLoad %23 %269 +%358 = OpFAdd %23 %357 %356 +OpStore %269 %358 +%359 = OpConvertSToF %7 %283 +%360 = OpCompositeConstruct %287 %286 %359 +%361 = OpSampledImage %316 %277 %279 +%362 = OpImageSampleExplicitLod %23 %361 %360 Lod %281 +%363 = OpLoad %23 %269 +%364 = OpFAdd %23 %363 %362 +OpStore %269 %364 +%365 = OpConvertSToF %7 %283 +%366 = OpCompositeConstruct %287 %286 %365 +%367 = OpSampledImage %316 %277 %279 +%368 = OpImageSampleExplicitLod %23 %367 %366 Lod|ConstOffset %281 %30 +%369 = OpLoad %23 %269 +%370 = OpFAdd %23 %369 %368 +OpStore %269 %370 +%371 = OpConvertSToF %7 %283 +%372 = OpCompositeConstruct %287 %286 %371 +%373 = OpSampledImage %316 %277 %279 +%374 = OpImageSampleImplicitLod %23 %373 %372 Bias|ConstOffset %282 %30 +%375 = OpLoad %23 %269 +%376 = OpFAdd %23 %375 %374 +OpStore %269 %376 +%378 = OpConvertUToF %7 %199 +%379 = OpCompositeConstruct %23 %288 %378 +%380 = OpSampledImage %377 %278 %279 +%381 = OpImageSampleImplicitLod %23 %380 %379 +%382 = OpLoad %23 %269 +%383 = OpFAdd %23 %382 %381 +OpStore %269 %383 +%384 = OpConvertUToF %7 %199 +%385 = OpCompositeConstruct %23 %288 %384 +%386 = OpSampledImage %377 %278 %279 +%387 = OpImageSampleExplicitLod %23 %386 %385 Lod %281 +%388 = OpLoad %23 %269 +%389 = OpFAdd %23 %388 %387 +OpStore %269 %389 +%390 = OpConvertUToF %7 %199 +%391 = OpCompositeConstruct %23 %288 %390 +%392 = OpSampledImage %377 %278 %279 +%393 = OpImageSampleImplicitLod %23 %392 %391 Bias %282 +%394 = OpLoad %23 %269 +%395 = OpFAdd %23 %394 %393 +OpStore %269 %395 +%396 = OpConvertSToF %7 %283 +%397 = OpCompositeConstruct %23 %288 %396 +%398 = OpSampledImage %377 %278 %279 +%399 = OpImageSampleImplicitLod %23 %398 %397 +%400 = OpLoad %23 %269 +%401 = OpFAdd %23 %400 %399 +OpStore %269 %401 +%402 = OpConvertSToF %7 %283 +%403 = OpCompositeConstruct %23 %288 %402 +%404 = OpSampledImage %377 %278 %279 +%405 = OpImageSampleExplicitLod %23 %404 %403 Lod %281 +%406 = OpLoad %23 %269 +%407 = OpFAdd %23 %406 %405 +OpStore %269 %407 +%408 = OpConvertSToF %7 %283 +%409 = OpCompositeConstruct %23 %288 %408 +%410 = OpSampledImage %377 %278 %279 +%411 = OpImageSampleImplicitLod %23 %410 %409 Bias %282 +%412 = OpLoad %23 %269 +%413 = OpFAdd %23 %412 %411 +OpStore %269 %413 +%414 = OpLoad %23 %269 +OpStore %273 %414 OpReturn OpFunctionEnd -%421 = OpFunction %2 None %83 +%421 = OpFunction %2 None %79 %418 = OpLabel %415 = OpVariable %416 Function %417 -%422 = OpLoad %26 %70 -%423 = OpLoad %29 %72 -%424 = OpLoad %30 %74 -%425 = OpLoad %31 %76 +%422 = OpLoad %24 %66 +%423 = OpLoad %25 %68 +%424 = OpLoad %26 %70 +%425 = OpLoad %27 %72 OpBranch %426 %426 = OpLabel -%427 = OpCompositeConstruct %27 %282 %282 -%428 = OpCompositeConstruct %28 %282 %282 %282 +%427 = OpCompositeConstruct %285 %280 %280 +%428 = OpCompositeConstruct %287 %280 %280 %280 %430 = OpSampledImage %429 %423 %422 -%431 = OpImageSampleDrefImplicitLod %7 %430 %427 %282 +%431 = OpImageSampleDrefImplicitLod %7 %430 %427 %280 %432 = OpLoad %7 %415 %433 = OpFAdd %7 %432 %431 OpStore %415 %433 -%435 = OpConvertUToF %7 %201 -%436 = OpCompositeConstruct %28 %427 %435 +%435 = OpConvertUToF %7 %199 +%436 = OpCompositeConstruct %287 %427 %435 %437 = OpSampledImage %434 %424 %422 -%438 = OpImageSampleDrefImplicitLod %7 %437 %436 %282 +%438 = OpImageSampleDrefImplicitLod %7 %437 %436 %280 %439 = OpLoad %7 %415 %440 = OpFAdd %7 %439 %438 OpStore %415 %440 -%441 = OpConvertSToF %7 %285 -%442 = OpCompositeConstruct %28 %427 %441 +%441 = OpConvertSToF %7 %283 +%442 = OpCompositeConstruct %287 %427 %441 %443 = OpSampledImage %434 %424 %422 -%444 = OpImageSampleDrefImplicitLod %7 %443 %442 %282 +%444 = OpImageSampleDrefImplicitLod %7 %443 %442 %280 %445 = OpLoad %7 %415 %446 = OpFAdd %7 %445 %444 OpStore %415 %446 %448 = OpSampledImage %447 %425 %422 -%449 = OpImageSampleDrefImplicitLod %7 %448 %428 %282 +%449 = OpImageSampleDrefImplicitLod %7 %448 %428 %280 %450 = OpLoad %7 %415 %451 = OpFAdd %7 %450 %449 OpStore %415 %451 %452 = OpSampledImage %429 %423 %422 -%453 = OpImageSampleDrefExplicitLod %7 %452 %427 %282 Lod %454 +%453 = OpImageSampleDrefExplicitLod %7 %452 %427 %280 Lod %454 %455 = OpLoad %7 %415 %456 = OpFAdd %7 %455 %453 OpStore %415 %456 -%457 = OpConvertUToF %7 %201 -%458 = OpCompositeConstruct %28 %427 %457 +%457 = OpConvertUToF %7 %199 +%458 = OpCompositeConstruct %287 %427 %457 %459 = OpSampledImage %434 %424 %422 -%460 = OpImageSampleDrefExplicitLod %7 %459 %458 %282 Lod %454 +%460 = OpImageSampleDrefExplicitLod %7 %459 %458 %280 Lod %454 %461 = OpLoad %7 %415 %462 = OpFAdd %7 %461 %460 OpStore %415 %462 -%463 = OpConvertSToF %7 %285 -%464 = OpCompositeConstruct %28 %427 %463 +%463 = OpConvertSToF %7 %283 +%464 = OpCompositeConstruct %287 %427 %463 %465 = OpSampledImage %434 %424 %422 -%466 = OpImageSampleDrefExplicitLod %7 %465 %464 %282 Lod %454 +%466 = OpImageSampleDrefExplicitLod %7 %465 %464 %280 Lod %454 %467 = OpLoad %7 %415 %468 = OpFAdd %7 %467 %466 OpStore %415 %468 %469 = OpSampledImage %447 %425 %422 -%470 = OpImageSampleDrefExplicitLod %7 %469 %428 %282 Lod %454 +%470 = OpImageSampleDrefExplicitLod %7 %469 %428 %280 Lod %454 %471 = OpLoad %7 %415 %472 = OpFAdd %7 %471 %470 OpStore %415 %472 @@ -645,53 +645,53 @@ OpStore %415 %472 OpStore %419 %473 OpReturn OpFunctionEnd -%476 = OpFunction %2 None %83 +%476 = OpFunction %2 None %79 %474 = OpLabel -%477 = OpLoad %18 %53 -%478 = OpLoad %3 %55 -%479 = OpLoad %19 %56 -%480 = OpLoad %26 %68 -%481 = OpLoad %26 %70 -%482 = OpLoad %29 %72 +%477 = OpLoad %16 %49 +%478 = OpLoad %3 %51 +%479 = OpLoad %17 %52 +%480 = OpLoad %24 %64 +%481 = OpLoad %24 %66 +%482 = OpLoad %25 %68 OpBranch %483 %483 = OpLabel -%484 = OpCompositeConstruct %27 %282 %282 +%484 = OpCompositeConstruct %285 %280 %280 %485 = OpSampledImage %295 %477 %480 -%486 = OpImageGather %25 %485 %484 %487 +%486 = OpImageGather %23 %485 %484 %487 %488 = OpSampledImage %295 %477 %480 -%489 = OpImageGather %25 %488 %484 %490 ConstOffset %34 +%489 = OpImageGather %23 %488 %484 %490 ConstOffset %30 %491 = OpSampledImage %429 %482 %481 -%492 = OpImageDrefGather %25 %491 %484 %282 +%492 = OpImageDrefGather %23 %491 %484 %280 %493 = OpSampledImage %429 %482 %481 -%494 = OpImageDrefGather %25 %493 %484 %282 ConstOffset %34 +%494 = OpImageDrefGather %23 %493 %484 %280 ConstOffset %30 %496 = OpSampledImage %495 %478 %480 -%497 = OpImageGather %16 %496 %484 %201 +%497 = OpImageGather %98 %496 %484 %199 %500 = OpSampledImage %499 %479 %480 -%501 = OpImageGather %498 %500 %484 %201 -%502 = OpConvertUToF %25 %497 -%503 = OpConvertSToF %25 %501 -%504 = OpFAdd %25 %502 %503 -%505 = OpFAdd %25 %486 %489 -%506 = OpFAdd %25 %505 %492 -%507 = OpFAdd %25 %506 %494 -%508 = OpFAdd %25 %507 %504 +%501 = OpImageGather %498 %500 %484 %199 +%502 = OpConvertUToF %23 %497 +%503 = OpConvertSToF %23 %501 +%504 = OpFAdd %23 %502 %503 +%505 = OpFAdd %23 %486 %489 +%506 = OpFAdd %23 %505 %492 +%507 = OpFAdd %23 %506 %494 +%508 = OpFAdd %23 %507 %504 OpStore %475 %508 OpReturn OpFunctionEnd -%511 = OpFunction %2 None %83 +%511 = OpFunction %2 None %79 %509 = OpLabel -%512 = OpLoad %26 %68 -%513 = OpLoad %29 %72 +%512 = OpLoad %24 %64 +%513 = OpLoad %25 %68 OpBranch %514 %514 = OpLabel -%515 = OpCompositeConstruct %27 %282 %282 +%515 = OpCompositeConstruct %285 %280 %280 %516 = OpSampledImage %429 %513 %512 -%517 = OpImageSampleImplicitLod %25 %516 %515 +%517 = OpImageSampleImplicitLod %23 %516 %515 %518 = OpCompositeExtract %7 %517 0 %519 = OpSampledImage %429 %513 %512 -%520 = OpImageGather %25 %519 %515 %201 -%521 = OpCompositeConstruct %25 %518 %518 %518 %518 -%522 = OpFAdd %25 %521 %520 +%520 = OpImageGather %23 %519 %515 %199 +%521 = OpCompositeConstruct %23 %518 %518 %518 %518 +%522 = OpFAdd %23 %521 %520 OpStore %510 %522 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/interface.compute.spvasm b/tests/out/spv/interface.compute.spvasm index df5e3edda4..73f6ecb2c2 100644 --- a/tests/out/spv/interface.compute.spvasm +++ b/tests/out/spv/interface.compute.spvasm @@ -1,12 +1,12 @@ ; SPIR-V ; Version: 1.0 ; Generator: rspirv -; Bound: 55 +; Bound: 53 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %31 "compute" %19 %22 %24 %27 %29 -OpExecutionMode %31 LocalSize 1 1 1 +OpEntryPoint GLCompute %29 "compute" %17 %20 %22 %25 %27 +OpExecutionMode %29 LocalSize 1 1 1 OpMemberDecorate %5 0 Offset 0 OpMemberDecorate %5 1 Offset 16 OpMemberDecorate %7 0 Offset 0 @@ -15,11 +15,11 @@ OpMemberDecorate %7 2 Offset 8 OpDecorate %9 ArrayStride 4 OpMemberDecorate %12 0 Offset 0 OpMemberDecorate %13 0 Offset 0 -OpDecorate %19 BuiltIn GlobalInvocationId -OpDecorate %22 BuiltIn LocalInvocationId -OpDecorate %24 BuiltIn LocalInvocationIndex -OpDecorate %27 BuiltIn WorkgroupId -OpDecorate %29 BuiltIn NumWorkgroups +OpDecorate %17 BuiltIn GlobalInvocationId +OpDecorate %20 BuiltIn LocalInvocationId +OpDecorate %22 BuiltIn LocalInvocationIndex +OpDecorate %25 BuiltIn WorkgroupId +OpDecorate %27 BuiltIn NumWorkgroups %2 = OpTypeVoid %4 = OpTypeFloat 32 %3 = OpTypeVector %4 4 @@ -32,54 +32,52 @@ OpDecorate %29 BuiltIn NumWorkgroups %11 = OpTypeVector %6 3 %12 = OpTypeStruct %6 %13 = OpTypeStruct %6 -%15 = OpTypeInt 32 1 -%14 = OpConstant %15 1 -%17 = OpTypePointer Workgroup %9 -%16 = OpVariable %17 Workgroup -%20 = OpTypePointer Input %11 -%19 = OpVariable %20 Input -%22 = OpVariable %20 Input -%25 = OpTypePointer Input %6 -%24 = OpVariable %25 Input -%27 = OpVariable %20 Input -%29 = OpVariable %20 Input -%32 = OpTypeFunction %2 -%34 = OpConstantNull %9 -%35 = OpConstantNull %11 -%36 = OpTypeVector %8 3 -%41 = OpConstant %6 2 -%42 = OpConstant %6 264 -%44 = OpTypePointer Workgroup %6 -%53 = OpConstant %6 0 -%31 = OpFunction %2 None %32 -%18 = OpLabel -%21 = OpLoad %11 %19 -%23 = OpLoad %11 %22 -%26 = OpLoad %6 %24 +%15 = OpTypePointer Workgroup %9 +%14 = OpVariable %15 Workgroup +%18 = OpTypePointer Input %11 +%17 = OpVariable %18 Input +%20 = OpVariable %18 Input +%23 = OpTypePointer Input %6 +%22 = OpVariable %23 Input +%25 = OpVariable %18 Input +%27 = OpVariable %18 Input +%30 = OpTypeFunction %2 +%32 = OpConstantNull %9 +%33 = OpConstantNull %11 +%34 = OpTypeVector %8 3 +%39 = OpConstant %6 2 +%40 = OpConstant %6 264 +%42 = OpTypePointer Workgroup %6 +%51 = OpConstant %6 0 +%29 = OpFunction %2 None %30 +%16 = OpLabel +%19 = OpLoad %11 %17 +%21 = OpLoad %11 %20 +%24 = OpLoad %6 %22 +%26 = OpLoad %11 %25 %28 = OpLoad %11 %27 -%30 = OpLoad %11 %29 -OpBranch %33 -%33 = OpLabel -%37 = OpIEqual %36 %23 %35 -%38 = OpAll %8 %37 -OpSelectionMerge %39 None -OpBranchConditional %38 %40 %39 -%40 = OpLabel -OpStore %16 %34 -OpBranch %39 -%39 = OpLabel -OpControlBarrier %41 %41 %42 -OpBranch %43 -%43 = OpLabel -%45 = OpCompositeExtract %6 %21 0 -%46 = OpCompositeExtract %6 %23 0 -%47 = OpIAdd %6 %45 %46 -%48 = OpIAdd %6 %47 %26 +OpBranch %31 +%31 = OpLabel +%35 = OpIEqual %34 %21 %33 +%36 = OpAll %8 %35 +OpSelectionMerge %37 None +OpBranchConditional %36 %38 %37 +%38 = OpLabel +OpStore %14 %32 +OpBranch %37 +%37 = OpLabel +OpControlBarrier %39 %39 %40 +OpBranch %41 +%41 = OpLabel +%43 = OpCompositeExtract %6 %19 0 +%44 = OpCompositeExtract %6 %21 0 +%45 = OpIAdd %6 %43 %44 +%46 = OpIAdd %6 %45 %24 +%47 = OpCompositeExtract %6 %26 0 +%48 = OpIAdd %6 %46 %47 %49 = OpCompositeExtract %6 %28 0 %50 = OpIAdd %6 %48 %49 -%51 = OpCompositeExtract %6 %30 0 -%52 = OpIAdd %6 %50 %51 -%54 = OpAccessChain %44 %16 %53 -OpStore %54 %52 +%52 = OpAccessChain %42 %14 %51 +OpStore %52 %50 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/interface.fragment.spvasm b/tests/out/spv/interface.fragment.spvasm index 6acbab9d78..bb42c678ec 100644 --- a/tests/out/spv/interface.fragment.spvasm +++ b/tests/out/spv/interface.fragment.spvasm @@ -1,14 +1,14 @@ ; SPIR-V ; Version: 1.0 ; Generator: rspirv -; Bound: 52 +; Bound: 50 OpCapability Shader OpCapability SampleRateShading %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Fragment %37 "fragment" %18 %21 %24 %27 %30 %32 %34 %36 -OpExecutionMode %37 OriginUpperLeft -OpExecutionMode %37 DepthReplacing +OpEntryPoint Fragment %35 "fragment" %16 %19 %22 %25 %28 %30 %32 %34 +OpExecutionMode %35 OriginUpperLeft +OpExecutionMode %35 DepthReplacing OpMemberDecorate %5 0 Offset 0 OpMemberDecorate %5 1 Offset 16 OpMemberDecorate %7 0 Offset 0 @@ -17,18 +17,18 @@ OpMemberDecorate %7 2 Offset 8 OpDecorate %9 ArrayStride 4 OpMemberDecorate %12 0 Offset 0 OpMemberDecorate %13 0 Offset 0 -OpDecorate %18 Invariant -OpDecorate %18 BuiltIn FragCoord -OpDecorate %21 Location 1 -OpDecorate %24 BuiltIn FrontFacing -OpDecorate %24 Flat -OpDecorate %27 BuiltIn SampleId -OpDecorate %27 Flat -OpDecorate %30 BuiltIn SampleMask -OpDecorate %30 Flat -OpDecorate %32 BuiltIn FragDepth -OpDecorate %34 BuiltIn SampleMask -OpDecorate %36 Location 0 +OpDecorate %16 Invariant +OpDecorate %16 BuiltIn FragCoord +OpDecorate %19 Location 1 +OpDecorate %22 BuiltIn FrontFacing +OpDecorate %22 Flat +OpDecorate %25 BuiltIn SampleId +OpDecorate %25 Flat +OpDecorate %28 BuiltIn SampleMask +OpDecorate %28 Flat +OpDecorate %30 BuiltIn FragDepth +OpDecorate %32 BuiltIn SampleMask +OpDecorate %34 Location 0 %2 = OpTypeVoid %4 = OpTypeFloat 32 %3 = OpTypeVector %4 4 @@ -41,48 +41,46 @@ OpDecorate %36 Location 0 %11 = OpTypeVector %6 3 %12 = OpTypeStruct %6 %13 = OpTypeStruct %6 -%15 = OpTypeInt 32 1 -%14 = OpConstant %15 1 -%19 = OpTypePointer Input %3 -%18 = OpVariable %19 Input -%22 = OpTypePointer Input %4 -%21 = OpVariable %22 Input -%25 = OpTypePointer Input %8 -%24 = OpVariable %25 Input -%28 = OpTypePointer Input %6 -%27 = OpVariable %28 Input -%30 = OpVariable %28 Input -%33 = OpTypePointer Output %4 +%17 = OpTypePointer Input %3 +%16 = OpVariable %17 Input +%20 = OpTypePointer Input %4 +%19 = OpVariable %20 Input +%23 = OpTypePointer Input %8 +%22 = OpVariable %23 Input +%26 = OpTypePointer Input %6 +%25 = OpVariable %26 Input +%28 = OpVariable %26 Input +%31 = OpTypePointer Output %4 +%30 = OpVariable %31 Output +%33 = OpTypePointer Output %6 %32 = OpVariable %33 Output -%35 = OpTypePointer Output %6 -%34 = OpVariable %35 Output -%36 = OpVariable %33 Output -%38 = OpTypeFunction %2 -%39 = OpConstant %4 0.0 -%40 = OpConstant %4 1.0 -%37 = OpFunction %2 None %38 -%16 = OpLabel -%20 = OpLoad %3 %18 -%23 = OpLoad %4 %21 -%17 = OpCompositeConstruct %5 %20 %23 -%26 = OpLoad %8 %24 -%29 = OpLoad %6 %27 -%31 = OpLoad %6 %30 -OpBranch %41 -%41 = OpLabel -%42 = OpShiftLeftLogical %6 %10 %29 -%43 = OpBitwiseAnd %6 %31 %42 -%44 = OpSelect %4 %26 %40 %39 -%45 = OpCompositeExtract %4 %17 1 -%46 = OpCompositeConstruct %7 %45 %43 %44 -%47 = OpCompositeExtract %4 %46 0 -OpStore %32 %47 -%48 = OpLoad %4 %32 -%49 = OpExtInst %4 %1 FClamp %48 %39 %40 -OpStore %32 %49 -%50 = OpCompositeExtract %6 %46 1 -OpStore %34 %50 -%51 = OpCompositeExtract %4 %46 2 -OpStore %36 %51 +%34 = OpVariable %31 Output +%36 = OpTypeFunction %2 +%37 = OpConstant %4 0.0 +%38 = OpConstant %4 1.0 +%35 = OpFunction %2 None %36 +%14 = OpLabel +%18 = OpLoad %3 %16 +%21 = OpLoad %4 %19 +%15 = OpCompositeConstruct %5 %18 %21 +%24 = OpLoad %8 %22 +%27 = OpLoad %6 %25 +%29 = OpLoad %6 %28 +OpBranch %39 +%39 = OpLabel +%40 = OpShiftLeftLogical %6 %10 %27 +%41 = OpBitwiseAnd %6 %29 %40 +%42 = OpSelect %4 %24 %38 %37 +%43 = OpCompositeExtract %4 %15 1 +%44 = OpCompositeConstruct %7 %43 %41 %42 +%45 = OpCompositeExtract %4 %44 0 +OpStore %30 %45 +%46 = OpLoad %4 %30 +%47 = OpExtInst %4 %1 FClamp %46 %37 %38 +OpStore %30 %47 +%48 = OpCompositeExtract %6 %44 1 +OpStore %32 %48 +%49 = OpCompositeExtract %4 %44 2 +OpStore %34 %49 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/interface.vertex.spvasm b/tests/out/spv/interface.vertex.spvasm index 6e930aa01a..d2c9492962 100644 --- a/tests/out/spv/interface.vertex.spvasm +++ b/tests/out/spv/interface.vertex.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.0 ; Generator: rspirv -; Bound: 41 +; Bound: 39 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %31 "vertex" %17 %20 %22 %24 %26 %28 +OpEntryPoint Vertex %29 "vertex" %15 %18 %20 %22 %24 %26 OpMemberDecorate %5 0 Offset 0 OpMemberDecorate %5 1 Offset 16 OpMemberDecorate %7 0 Offset 0 @@ -14,13 +14,13 @@ OpMemberDecorate %7 2 Offset 8 OpDecorate %9 ArrayStride 4 OpMemberDecorate %12 0 Offset 0 OpMemberDecorate %13 0 Offset 0 -OpDecorate %17 BuiltIn VertexIndex -OpDecorate %20 BuiltIn InstanceIndex -OpDecorate %22 Location 10 -OpDecorate %24 Invariant -OpDecorate %24 BuiltIn Position -OpDecorate %26 Location 1 -OpDecorate %28 BuiltIn PointSize +OpDecorate %15 BuiltIn VertexIndex +OpDecorate %18 BuiltIn InstanceIndex +OpDecorate %20 Location 10 +OpDecorate %22 Invariant +OpDecorate %22 BuiltIn Position +OpDecorate %24 Location 1 +OpDecorate %26 BuiltIn PointSize %2 = OpTypeVoid %4 = OpTypeFloat 32 %3 = OpTypeVector %4 4 @@ -33,36 +33,34 @@ OpDecorate %28 BuiltIn PointSize %11 = OpTypeVector %6 3 %12 = OpTypeStruct %6 %13 = OpTypeStruct %6 -%15 = OpTypeInt 32 1 -%14 = OpConstant %15 1 -%18 = OpTypePointer Input %6 -%17 = OpVariable %18 Input -%20 = OpVariable %18 Input -%22 = OpVariable %18 Input -%25 = OpTypePointer Output %3 +%16 = OpTypePointer Input %6 +%15 = OpVariable %16 Input +%18 = OpVariable %16 Input +%20 = OpVariable %16 Input +%23 = OpTypePointer Output %3 +%22 = OpVariable %23 Output +%25 = OpTypePointer Output %4 %24 = OpVariable %25 Output %27 = OpTypePointer Output %4 %26 = OpVariable %27 Output -%29 = OpTypePointer Output %4 -%28 = OpVariable %29 Output -%30 = OpConstant %4 1.0 -%32 = OpTypeFunction %2 -%31 = OpFunction %2 None %32 -%16 = OpLabel -%19 = OpLoad %6 %17 +%28 = OpConstant %4 1.0 +%30 = OpTypeFunction %2 +%29 = OpFunction %2 None %30 +%14 = OpLabel +%17 = OpLoad %6 %15 +%19 = OpLoad %6 %18 %21 = OpLoad %6 %20 -%23 = OpLoad %6 %22 -OpStore %28 %30 -OpBranch %33 -%33 = OpLabel -%34 = OpIAdd %6 %19 %21 -%35 = OpIAdd %6 %34 %23 -%36 = OpCompositeConstruct %3 %30 %30 %30 %30 -%37 = OpConvertUToF %4 %35 -%38 = OpCompositeConstruct %5 %36 %37 -%39 = OpCompositeExtract %3 %38 0 -OpStore %24 %39 -%40 = OpCompositeExtract %4 %38 1 -OpStore %26 %40 +OpStore %26 %28 +OpBranch %31 +%31 = OpLabel +%32 = OpIAdd %6 %17 %19 +%33 = OpIAdd %6 %32 %21 +%34 = OpCompositeConstruct %3 %28 %28 %28 %28 +%35 = OpConvertUToF %4 %33 +%36 = OpCompositeConstruct %5 %34 %35 +%37 = OpCompositeExtract %3 %36 0 +OpStore %22 %37 +%38 = OpCompositeExtract %4 %36 1 +OpStore %24 %38 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/interface.vertex_two_structs.spvasm b/tests/out/spv/interface.vertex_two_structs.spvasm index db2bf9b994..505c558433 100644 --- a/tests/out/spv/interface.vertex_two_structs.spvasm +++ b/tests/out/spv/interface.vertex_two_structs.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.0 ; Generator: rspirv -; Bound: 44 +; Bound: 42 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %32 "vertex_two_structs" %21 %25 %27 %29 +OpEntryPoint Vertex %30 "vertex_two_structs" %19 %23 %25 %27 OpMemberDecorate %5 0 Offset 0 OpMemberDecorate %5 1 Offset 16 OpMemberDecorate %7 0 Offset 0 @@ -14,11 +14,11 @@ OpMemberDecorate %7 2 Offset 8 OpDecorate %9 ArrayStride 4 OpMemberDecorate %12 0 Offset 0 OpMemberDecorate %13 0 Offset 0 -OpDecorate %21 BuiltIn VertexIndex -OpDecorate %25 BuiltIn InstanceIndex -OpDecorate %27 Invariant -OpDecorate %27 BuiltIn Position -OpDecorate %29 BuiltIn PointSize +OpDecorate %19 BuiltIn VertexIndex +OpDecorate %23 BuiltIn InstanceIndex +OpDecorate %25 Invariant +OpDecorate %25 BuiltIn Position +OpDecorate %27 BuiltIn PointSize %2 = OpTypeVoid %4 = OpTypeFloat 32 %3 = OpTypeVector %4 4 @@ -31,39 +31,37 @@ OpDecorate %29 BuiltIn PointSize %11 = OpTypeVector %6 3 %12 = OpTypeStruct %6 %13 = OpTypeStruct %6 -%15 = OpTypeInt 32 1 -%14 = OpConstant %15 1 -%17 = OpTypePointer Function %6 -%18 = OpConstantNull %6 -%22 = OpTypePointer Input %6 -%21 = OpVariable %22 Input -%25 = OpVariable %22 Input -%28 = OpTypePointer Output %3 +%15 = OpTypePointer Function %6 +%16 = OpConstantNull %6 +%20 = OpTypePointer Input %6 +%19 = OpVariable %20 Input +%23 = OpVariable %20 Input +%26 = OpTypePointer Output %3 +%25 = OpVariable %26 Output +%28 = OpTypePointer Output %4 %27 = OpVariable %28 Output -%30 = OpTypePointer Output %4 -%29 = OpVariable %30 Output -%31 = OpConstant %4 1.0 -%33 = OpTypeFunction %2 -%34 = OpConstant %6 2 -%35 = OpConstant %4 0.0 -%32 = OpFunction %2 None %33 -%19 = OpLabel -%16 = OpVariable %17 Function %18 -%23 = OpLoad %6 %21 -%20 = OpCompositeConstruct %12 %23 -%26 = OpLoad %6 %25 -%24 = OpCompositeConstruct %13 %26 -OpStore %29 %31 -OpBranch %36 -%36 = OpLabel -OpStore %16 %34 -%37 = OpCompositeExtract %6 %20 0 +%29 = OpConstant %4 1.0 +%31 = OpTypeFunction %2 +%32 = OpConstant %6 2 +%33 = OpConstant %4 0.0 +%30 = OpFunction %2 None %31 +%17 = OpLabel +%14 = OpVariable %15 Function %16 +%21 = OpLoad %6 %19 +%18 = OpCompositeConstruct %12 %21 +%24 = OpLoad %6 %23 +%22 = OpCompositeConstruct %13 %24 +OpStore %27 %29 +OpBranch %34 +%34 = OpLabel +OpStore %14 %32 +%35 = OpCompositeExtract %6 %18 0 +%36 = OpConvertUToF %4 %35 +%37 = OpCompositeExtract %6 %22 0 %38 = OpConvertUToF %4 %37 -%39 = OpCompositeExtract %6 %24 0 +%39 = OpLoad %6 %14 %40 = OpConvertUToF %4 %39 -%41 = OpLoad %6 %16 -%42 = OpConvertUToF %4 %41 -%43 = OpCompositeConstruct %3 %38 %40 %42 %35 -OpStore %27 %43 +%41 = OpCompositeConstruct %3 %36 %38 %40 %33 +OpStore %25 %41 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/operators.spvasm b/tests/out/spv/operators.spvasm index 6544cfd406..71bd913f7a 100644 --- a/tests/out/spv/operators.spvasm +++ b/tests/out/spv/operators.spvasm @@ -16,51 +16,51 @@ OpExecutionMode %511 LocalSize 1 1 1 %7 = OpTypeVector %8 4 %9 = OpTypeVector %4 2 %10 = OpTypeVector %4 3 -%11 = OpTypeVector %8 3 -%12 = OpTypeMatrix %10 3 -%13 = OpTypeMatrix %10 4 -%14 = OpTypeMatrix %3 3 -%15 = OpTypeVector %6 3 -%16 = OpConstant %4 1.0 -%17 = OpConstantComposite %3 %16 %16 %16 %16 -%18 = OpConstant %4 0.0 -%19 = OpConstantComposite %3 %18 %18 %18 %18 -%20 = OpConstant %4 0.5 -%21 = OpConstantComposite %3 %20 %20 %20 %20 -%22 = OpConstant %6 1 -%23 = OpConstantComposite %5 %22 %22 %22 %22 -%26 = OpTypeFunction %3 -%27 = OpConstantTrue %8 -%28 = OpConstant %6 0 -%29 = OpConstantFalse %8 -%30 = OpConstant %4 0.1 -%55 = OpConstant %4 2.0 -%56 = OpConstant %4 3.0 -%57 = OpConstant %4 4.0 -%58 = OpConstant %6 5 -%59 = OpConstant %6 2 -%75 = OpTypePointer Function %9 -%76 = OpConstantNull %9 -%79 = OpTypeFunction %9 -%95 = OpTypeFunction %10 %10 -%97 = OpConstantComposite %10 %18 %18 %18 -%99 = OpConstantComposite %10 %16 %16 %16 +%11 = OpTypeMatrix %10 3 +%12 = OpTypeMatrix %10 4 +%13 = OpTypeMatrix %3 3 +%14 = OpTypeVector %6 3 +%15 = OpConstant %4 1.0 +%16 = OpConstantComposite %3 %15 %15 %15 %15 +%17 = OpConstant %4 0.0 +%18 = OpConstantComposite %3 %17 %17 %17 %17 +%19 = OpConstant %4 0.5 +%20 = OpConstantComposite %3 %19 %19 %19 %19 +%21 = OpConstant %6 1 +%22 = OpConstantComposite %5 %21 %21 %21 %21 +%25 = OpTypeFunction %3 +%26 = OpConstantTrue %8 +%27 = OpConstant %6 0 +%28 = OpConstantFalse %8 +%29 = OpConstant %4 0.1 +%54 = OpConstant %4 2.0 +%55 = OpConstant %4 3.0 +%56 = OpConstant %4 4.0 +%57 = OpConstant %6 5 +%58 = OpConstant %6 2 +%74 = OpTypePointer Function %9 +%75 = OpConstantNull %9 +%78 = OpTypeFunction %9 +%94 = OpTypeFunction %10 %10 +%96 = OpTypeVector %8 3 +%97 = OpConstantComposite %10 %17 %17 %17 +%99 = OpConstantComposite %10 %15 %15 %15 %103 = OpTypeFunction %2 %106 = OpTypeVector %8 2 %121 = OpConstant %4 -1.0 %122 = OpTypeInt 32 0 %123 = OpConstant %122 2 %124 = OpConstant %122 1 -%125 = OpConstantNull %12 -%126 = OpConstantNull %13 -%127 = OpConstantNull %14 +%125 = OpConstantNull %11 +%126 = OpConstantNull %12 +%127 = OpConstantNull %13 %129 = OpTypeVector %6 2 %140 = OpTypeVector %122 3 %203 = OpTypeVector %122 2 %438 = OpTypePointer Function %6 %439 = OpConstantNull %6 -%441 = OpTypePointer Function %15 -%442 = OpConstantNull %15 +%441 = OpTypePointer Function %14 +%442 = OpConstantNull %14 %472 = OpTypePointer Function %6 %483 = OpConstant %6 -1 %484 = OpConstant %6 -2 @@ -70,80 +70,80 @@ OpExecutionMode %511 LocalSize 1 1 1 %488 = OpConstant %6 6 %489 = OpConstant %6 -7 %490 = OpConstant %6 -8 -%25 = OpFunction %3 None %26 -%24 = OpLabel -OpBranch %31 -%31 = OpLabel -%32 = OpSelect %6 %27 %22 %28 -%34 = OpCompositeConstruct %7 %27 %27 %27 %27 -%33 = OpSelect %3 %34 %17 %19 -%35 = OpCompositeConstruct %7 %29 %29 %29 %29 -%36 = OpSelect %3 %35 %19 %17 -%37 = OpExtInst %3 %1 FMix %19 %17 %21 -%39 = OpCompositeConstruct %3 %30 %30 %30 %30 -%38 = OpExtInst %3 %1 FMix %19 %17 %39 -%40 = OpCompositeExtract %6 %23 0 -%41 = OpBitcast %4 %40 -%42 = OpBitcast %3 %23 -%43 = OpConvertFToS %5 %19 -%44 = OpCompositeConstruct %5 %32 %32 %32 %32 -%45 = OpIAdd %5 %44 %43 -%46 = OpConvertSToF %3 %45 -%47 = OpFAdd %3 %46 %33 +%24 = OpFunction %3 None %25 +%23 = OpLabel +OpBranch %30 +%30 = OpLabel +%31 = OpSelect %6 %26 %21 %27 +%33 = OpCompositeConstruct %7 %26 %26 %26 %26 +%32 = OpSelect %3 %33 %16 %18 +%34 = OpCompositeConstruct %7 %28 %28 %28 %28 +%35 = OpSelect %3 %34 %18 %16 +%36 = OpExtInst %3 %1 FMix %18 %16 %20 +%38 = OpCompositeConstruct %3 %29 %29 %29 %29 +%37 = OpExtInst %3 %1 FMix %18 %16 %38 +%39 = OpCompositeExtract %6 %22 0 +%40 = OpBitcast %4 %39 +%41 = OpBitcast %3 %22 +%42 = OpConvertFToS %5 %18 +%43 = OpCompositeConstruct %5 %31 %31 %31 %31 +%44 = OpIAdd %5 %43 %42 +%45 = OpConvertSToF %3 %44 +%46 = OpFAdd %3 %45 %32 +%47 = OpFAdd %3 %46 %36 %48 = OpFAdd %3 %47 %37 -%49 = OpFAdd %3 %48 %38 -%50 = OpCompositeConstruct %3 %41 %41 %41 %41 -%51 = OpFAdd %3 %49 %50 -%52 = OpFAdd %3 %51 %42 -OpReturnValue %52 +%49 = OpCompositeConstruct %3 %40 %40 %40 %40 +%50 = OpFAdd %3 %48 %49 +%51 = OpFAdd %3 %50 %41 +OpReturnValue %51 OpFunctionEnd -%54 = OpFunction %3 None %26 -%53 = OpLabel -OpBranch %60 -%60 = OpLabel -%61 = OpCompositeConstruct %9 %55 %55 -%62 = OpCompositeConstruct %9 %16 %16 -%63 = OpFAdd %9 %62 %61 -%64 = OpCompositeConstruct %9 %56 %56 -%65 = OpFSub %9 %63 %64 -%66 = OpCompositeConstruct %9 %57 %57 -%67 = OpFDiv %9 %65 %66 +%53 = OpFunction %3 None %25 +%52 = OpLabel +OpBranch %59 +%59 = OpLabel +%60 = OpCompositeConstruct %9 %54 %54 +%61 = OpCompositeConstruct %9 %15 %15 +%62 = OpFAdd %9 %61 %60 +%63 = OpCompositeConstruct %9 %55 %55 +%64 = OpFSub %9 %62 %63 +%65 = OpCompositeConstruct %9 %56 %56 +%66 = OpFDiv %9 %64 %65 +%67 = OpCompositeConstruct %5 %57 %57 %57 %57 %68 = OpCompositeConstruct %5 %58 %58 %58 %58 -%69 = OpCompositeConstruct %5 %59 %59 %59 %59 -%70 = OpSRem %5 %68 %69 -%71 = OpVectorShuffle %3 %67 %67 0 1 0 1 -%72 = OpConvertSToF %3 %70 -%73 = OpFAdd %3 %71 %72 -OpReturnValue %73 +%69 = OpSRem %5 %67 %68 +%70 = OpVectorShuffle %3 %66 %66 0 1 0 1 +%71 = OpConvertSToF %3 %69 +%72 = OpFAdd %3 %70 %71 +OpReturnValue %72 OpFunctionEnd -%78 = OpFunction %9 None %79 -%77 = OpLabel -%74 = OpVariable %75 Function %76 -OpBranch %80 -%80 = OpLabel -%81 = OpCompositeConstruct %9 %55 %55 -OpStore %74 %81 -%82 = OpLoad %9 %74 -%83 = OpCompositeConstruct %9 %16 %16 -%84 = OpFAdd %9 %82 %83 -OpStore %74 %84 -%85 = OpLoad %9 %74 -%86 = OpCompositeConstruct %9 %56 %56 -%87 = OpFSub %9 %85 %86 -OpStore %74 %87 -%88 = OpLoad %9 %74 -%89 = OpCompositeConstruct %9 %57 %57 -%90 = OpFDiv %9 %88 %89 -OpStore %74 %90 -%91 = OpLoad %9 %74 -OpReturnValue %91 +%77 = OpFunction %9 None %78 +%76 = OpLabel +%73 = OpVariable %74 Function %75 +OpBranch %79 +%79 = OpLabel +%80 = OpCompositeConstruct %9 %54 %54 +OpStore %73 %80 +%81 = OpLoad %9 %73 +%82 = OpCompositeConstruct %9 %15 %15 +%83 = OpFAdd %9 %81 %82 +OpStore %73 %83 +%84 = OpLoad %9 %73 +%85 = OpCompositeConstruct %9 %55 %55 +%86 = OpFSub %9 %84 %85 +OpStore %73 %86 +%87 = OpLoad %9 %73 +%88 = OpCompositeConstruct %9 %56 %56 +%89 = OpFDiv %9 %87 %88 +OpStore %73 %89 +%90 = OpLoad %9 %73 +OpReturnValue %90 OpFunctionEnd -%94 = OpFunction %10 None %95 -%93 = OpFunctionParameter %10 -%92 = OpLabel -OpBranch %96 -%96 = OpLabel -%98 = OpFUnordNotEqual %11 %93 %97 +%93 = OpFunction %10 None %94 +%92 = OpFunctionParameter %10 +%91 = OpLabel +OpBranch %95 +%95 = OpLabel +%98 = OpFUnordNotEqual %96 %92 %97 %100 = OpSelect %10 %98 %99 %97 OpReturnValue %100 OpFunctionEnd @@ -151,18 +151,18 @@ OpFunctionEnd %101 = OpLabel OpBranch %104 %104 = OpLabel -%105 = OpLogicalNot %8 %27 -%107 = OpCompositeConstruct %106 %27 %27 +%105 = OpLogicalNot %8 %26 +%107 = OpCompositeConstruct %106 %26 %26 %108 = OpLogicalNot %106 %107 -%109 = OpLogicalOr %8 %27 %29 -%110 = OpLogicalAnd %8 %27 %29 -%111 = OpLogicalOr %8 %27 %29 -%112 = OpCompositeConstruct %11 %27 %27 %27 -%113 = OpCompositeConstruct %11 %29 %29 %29 -%114 = OpLogicalOr %11 %112 %113 -%115 = OpLogicalAnd %8 %27 %29 -%116 = OpCompositeConstruct %7 %27 %27 %27 %27 -%117 = OpCompositeConstruct %7 %29 %29 %29 %29 +%109 = OpLogicalOr %8 %26 %28 +%110 = OpLogicalAnd %8 %26 %28 +%111 = OpLogicalOr %8 %26 %28 +%112 = OpCompositeConstruct %96 %26 %26 %26 +%113 = OpCompositeConstruct %96 %28 %28 %28 +%114 = OpLogicalOr %96 %112 %113 +%115 = OpLogicalAnd %8 %26 %28 +%116 = OpCompositeConstruct %7 %26 %26 %26 %26 +%117 = OpCompositeConstruct %7 %28 %28 %28 %28 %118 = OpLogicalAnd %7 %116 %117 OpReturn OpFunctionEnd @@ -170,77 +170,77 @@ OpFunctionEnd %119 = OpLabel OpBranch %128 %128 = OpLabel -%130 = OpCompositeConstruct %129 %22 %22 +%130 = OpCompositeConstruct %129 %21 %21 %131 = OpSNegate %129 %130 -%132 = OpCompositeConstruct %9 %16 %16 +%132 = OpCompositeConstruct %9 %15 %15 %133 = OpFNegate %9 %132 -%134 = OpIAdd %6 %59 %22 +%134 = OpIAdd %6 %58 %21 %135 = OpIAdd %122 %123 %124 -%136 = OpFAdd %4 %55 %16 -%137 = OpCompositeConstruct %129 %59 %59 -%138 = OpCompositeConstruct %129 %22 %22 +%136 = OpFAdd %4 %54 %15 +%137 = OpCompositeConstruct %129 %58 %58 +%138 = OpCompositeConstruct %129 %21 %21 %139 = OpIAdd %129 %137 %138 %141 = OpCompositeConstruct %140 %123 %123 %123 %142 = OpCompositeConstruct %140 %124 %124 %124 %143 = OpIAdd %140 %141 %142 -%144 = OpCompositeConstruct %3 %55 %55 %55 %55 -%145 = OpCompositeConstruct %3 %16 %16 %16 %16 +%144 = OpCompositeConstruct %3 %54 %54 %54 %54 +%145 = OpCompositeConstruct %3 %15 %15 %15 %15 %146 = OpFAdd %3 %144 %145 -%147 = OpISub %6 %59 %22 +%147 = OpISub %6 %58 %21 %148 = OpISub %122 %123 %124 -%149 = OpFSub %4 %55 %16 -%150 = OpCompositeConstruct %129 %59 %59 -%151 = OpCompositeConstruct %129 %22 %22 +%149 = OpFSub %4 %54 %15 +%150 = OpCompositeConstruct %129 %58 %58 +%151 = OpCompositeConstruct %129 %21 %21 %152 = OpISub %129 %150 %151 %153 = OpCompositeConstruct %140 %123 %123 %123 %154 = OpCompositeConstruct %140 %124 %124 %124 %155 = OpISub %140 %153 %154 -%156 = OpCompositeConstruct %3 %55 %55 %55 %55 -%157 = OpCompositeConstruct %3 %16 %16 %16 %16 +%156 = OpCompositeConstruct %3 %54 %54 %54 %54 +%157 = OpCompositeConstruct %3 %15 %15 %15 %15 %158 = OpFSub %3 %156 %157 -%159 = OpIMul %6 %59 %22 +%159 = OpIMul %6 %58 %21 %160 = OpIMul %122 %123 %124 -%161 = OpFMul %4 %55 %16 -%162 = OpCompositeConstruct %129 %59 %59 -%163 = OpCompositeConstruct %129 %22 %22 +%161 = OpFMul %4 %54 %15 +%162 = OpCompositeConstruct %129 %58 %58 +%163 = OpCompositeConstruct %129 %21 %21 %164 = OpIMul %129 %162 %163 %165 = OpCompositeConstruct %140 %123 %123 %123 %166 = OpCompositeConstruct %140 %124 %124 %124 %167 = OpIMul %140 %165 %166 -%168 = OpCompositeConstruct %3 %55 %55 %55 %55 -%169 = OpCompositeConstruct %3 %16 %16 %16 %16 +%168 = OpCompositeConstruct %3 %54 %54 %54 %54 +%169 = OpCompositeConstruct %3 %15 %15 %15 %15 %170 = OpFMul %3 %168 %169 -%171 = OpSDiv %6 %59 %22 +%171 = OpSDiv %6 %58 %21 %172 = OpUDiv %122 %123 %124 -%173 = OpFDiv %4 %55 %16 -%174 = OpCompositeConstruct %129 %59 %59 -%175 = OpCompositeConstruct %129 %22 %22 +%173 = OpFDiv %4 %54 %15 +%174 = OpCompositeConstruct %129 %58 %58 +%175 = OpCompositeConstruct %129 %21 %21 %176 = OpSDiv %129 %174 %175 %177 = OpCompositeConstruct %140 %123 %123 %123 %178 = OpCompositeConstruct %140 %124 %124 %124 %179 = OpUDiv %140 %177 %178 -%180 = OpCompositeConstruct %3 %55 %55 %55 %55 -%181 = OpCompositeConstruct %3 %16 %16 %16 %16 +%180 = OpCompositeConstruct %3 %54 %54 %54 %54 +%181 = OpCompositeConstruct %3 %15 %15 %15 %15 %182 = OpFDiv %3 %180 %181 -%183 = OpSRem %6 %59 %22 +%183 = OpSRem %6 %58 %21 %184 = OpUMod %122 %123 %124 -%185 = OpFRem %4 %55 %16 -%186 = OpCompositeConstruct %129 %59 %59 -%187 = OpCompositeConstruct %129 %22 %22 +%185 = OpFRem %4 %54 %15 +%186 = OpCompositeConstruct %129 %58 %58 +%187 = OpCompositeConstruct %129 %21 %21 %188 = OpSRem %129 %186 %187 %189 = OpCompositeConstruct %140 %123 %123 %123 %190 = OpCompositeConstruct %140 %124 %124 %124 %191 = OpUMod %140 %189 %190 -%192 = OpCompositeConstruct %3 %55 %55 %55 %55 -%193 = OpCompositeConstruct %3 %16 %16 %16 %16 +%192 = OpCompositeConstruct %3 %54 %54 %54 %54 +%193 = OpCompositeConstruct %3 %15 %15 %15 %15 %194 = OpFRem %3 %192 %193 OpBranch %195 %195 = OpLabel -%197 = OpCompositeConstruct %129 %59 %59 -%198 = OpCompositeConstruct %129 %22 %22 +%197 = OpCompositeConstruct %129 %58 %58 +%198 = OpCompositeConstruct %129 %21 %21 %199 = OpIAdd %129 %197 %198 -%200 = OpCompositeConstruct %129 %22 %22 -%201 = OpCompositeConstruct %129 %59 %59 +%200 = OpCompositeConstruct %129 %21 %21 +%201 = OpCompositeConstruct %129 %58 %58 %202 = OpIAdd %129 %201 %200 %204 = OpCompositeConstruct %203 %123 %123 %205 = OpCompositeConstruct %203 %124 %124 @@ -248,17 +248,17 @@ OpBranch %195 %207 = OpCompositeConstruct %203 %124 %124 %208 = OpCompositeConstruct %203 %123 %123 %209 = OpIAdd %203 %208 %207 -%210 = OpCompositeConstruct %9 %55 %55 -%211 = OpCompositeConstruct %9 %16 %16 +%210 = OpCompositeConstruct %9 %54 %54 +%211 = OpCompositeConstruct %9 %15 %15 %212 = OpFAdd %9 %210 %211 -%213 = OpCompositeConstruct %9 %16 %16 -%214 = OpCompositeConstruct %9 %55 %55 +%213 = OpCompositeConstruct %9 %15 %15 +%214 = OpCompositeConstruct %9 %54 %54 %215 = OpFAdd %9 %214 %213 -%216 = OpCompositeConstruct %129 %59 %59 -%217 = OpCompositeConstruct %129 %22 %22 +%216 = OpCompositeConstruct %129 %58 %58 +%217 = OpCompositeConstruct %129 %21 %21 %218 = OpISub %129 %216 %217 -%219 = OpCompositeConstruct %129 %22 %22 -%220 = OpCompositeConstruct %129 %59 %59 +%219 = OpCompositeConstruct %129 %21 %21 +%220 = OpCompositeConstruct %129 %58 %58 %221 = OpISub %129 %220 %219 %222 = OpCompositeConstruct %203 %123 %123 %223 = OpCompositeConstruct %203 %124 %124 @@ -266,17 +266,17 @@ OpBranch %195 %225 = OpCompositeConstruct %203 %124 %124 %226 = OpCompositeConstruct %203 %123 %123 %227 = OpISub %203 %226 %225 -%228 = OpCompositeConstruct %9 %55 %55 -%229 = OpCompositeConstruct %9 %16 %16 +%228 = OpCompositeConstruct %9 %54 %54 +%229 = OpCompositeConstruct %9 %15 %15 %230 = OpFSub %9 %228 %229 -%231 = OpCompositeConstruct %9 %16 %16 -%232 = OpCompositeConstruct %9 %55 %55 +%231 = OpCompositeConstruct %9 %15 %15 +%232 = OpCompositeConstruct %9 %54 %54 %233 = OpFSub %9 %232 %231 -%234 = OpCompositeConstruct %129 %59 %59 -%236 = OpCompositeConstruct %129 %22 %22 +%234 = OpCompositeConstruct %129 %58 %58 +%236 = OpCompositeConstruct %129 %21 %21 %235 = OpIMul %129 %234 %236 -%237 = OpCompositeConstruct %129 %22 %22 -%239 = OpCompositeConstruct %129 %59 %59 +%237 = OpCompositeConstruct %129 %21 %21 +%239 = OpCompositeConstruct %129 %58 %58 %238 = OpIMul %129 %237 %239 %240 = OpCompositeConstruct %203 %123 %123 %242 = OpCompositeConstruct %203 %124 %124 @@ -284,15 +284,15 @@ OpBranch %195 %243 = OpCompositeConstruct %203 %124 %124 %245 = OpCompositeConstruct %203 %123 %123 %244 = OpIMul %203 %243 %245 -%246 = OpCompositeConstruct %9 %55 %55 -%247 = OpVectorTimesScalar %9 %246 %16 -%248 = OpCompositeConstruct %9 %16 %16 -%249 = OpVectorTimesScalar %9 %248 %55 -%250 = OpCompositeConstruct %129 %59 %59 -%251 = OpCompositeConstruct %129 %22 %22 +%246 = OpCompositeConstruct %9 %54 %54 +%247 = OpVectorTimesScalar %9 %246 %15 +%248 = OpCompositeConstruct %9 %15 %15 +%249 = OpVectorTimesScalar %9 %248 %54 +%250 = OpCompositeConstruct %129 %58 %58 +%251 = OpCompositeConstruct %129 %21 %21 %252 = OpSDiv %129 %250 %251 -%253 = OpCompositeConstruct %129 %22 %22 -%254 = OpCompositeConstruct %129 %59 %59 +%253 = OpCompositeConstruct %129 %21 %21 +%254 = OpCompositeConstruct %129 %58 %58 %255 = OpSDiv %129 %254 %253 %256 = OpCompositeConstruct %203 %123 %123 %257 = OpCompositeConstruct %203 %124 %124 @@ -300,17 +300,17 @@ OpBranch %195 %259 = OpCompositeConstruct %203 %124 %124 %260 = OpCompositeConstruct %203 %123 %123 %261 = OpUDiv %203 %260 %259 -%262 = OpCompositeConstruct %9 %55 %55 -%263 = OpCompositeConstruct %9 %16 %16 +%262 = OpCompositeConstruct %9 %54 %54 +%263 = OpCompositeConstruct %9 %15 %15 %264 = OpFDiv %9 %262 %263 -%265 = OpCompositeConstruct %9 %16 %16 -%266 = OpCompositeConstruct %9 %55 %55 +%265 = OpCompositeConstruct %9 %15 %15 +%266 = OpCompositeConstruct %9 %54 %54 %267 = OpFDiv %9 %266 %265 -%268 = OpCompositeConstruct %129 %59 %59 -%269 = OpCompositeConstruct %129 %22 %22 +%268 = OpCompositeConstruct %129 %58 %58 +%269 = OpCompositeConstruct %129 %21 %21 %270 = OpSRem %129 %268 %269 -%271 = OpCompositeConstruct %129 %22 %22 -%272 = OpCompositeConstruct %129 %59 %59 +%271 = OpCompositeConstruct %129 %21 %21 +%272 = OpCompositeConstruct %129 %58 %58 %273 = OpSRem %129 %272 %271 %274 = OpCompositeConstruct %203 %123 %123 %275 = OpCompositeConstruct %203 %124 %124 @@ -318,11 +318,11 @@ OpBranch %195 %277 = OpCompositeConstruct %203 %124 %124 %278 = OpCompositeConstruct %203 %123 %123 %279 = OpUMod %203 %278 %277 -%280 = OpCompositeConstruct %9 %55 %55 -%281 = OpCompositeConstruct %9 %16 %16 +%280 = OpCompositeConstruct %9 %54 %54 +%281 = OpCompositeConstruct %9 %15 %15 %282 = OpFRem %9 %280 %281 -%283 = OpCompositeConstruct %9 %16 %16 -%284 = OpCompositeConstruct %9 %55 %55 +%283 = OpCompositeConstruct %9 %15 %15 +%284 = OpCompositeConstruct %9 %54 %54 %285 = OpFRem %9 %284 %283 OpBranch %196 %196 = OpLabel @@ -335,7 +335,7 @@ OpBranch %196 %293 = OpCompositeExtract %10 %125 2 %294 = OpCompositeExtract %10 %125 2 %295 = OpFAdd %10 %293 %294 -%286 = OpCompositeConstruct %12 %289 %292 %295 +%286 = OpCompositeConstruct %11 %289 %292 %295 %297 = OpCompositeExtract %10 %125 0 %298 = OpCompositeExtract %10 %125 0 %299 = OpFSub %10 %297 %298 @@ -345,61 +345,61 @@ OpBranch %196 %303 = OpCompositeExtract %10 %125 2 %304 = OpCompositeExtract %10 %125 2 %305 = OpFSub %10 %303 %304 -%296 = OpCompositeConstruct %12 %299 %302 %305 -%306 = OpMatrixTimesScalar %12 %125 %16 -%307 = OpMatrixTimesScalar %12 %125 %55 -%308 = OpCompositeConstruct %3 %16 %16 %16 %16 +%296 = OpCompositeConstruct %11 %299 %302 %305 +%306 = OpMatrixTimesScalar %11 %125 %15 +%307 = OpMatrixTimesScalar %11 %125 %54 +%308 = OpCompositeConstruct %3 %15 %15 %15 %15 %309 = OpMatrixTimesVector %10 %126 %308 -%310 = OpCompositeConstruct %10 %55 %55 %55 +%310 = OpCompositeConstruct %10 %54 %54 %54 %311 = OpVectorTimesMatrix %3 %310 %126 -%312 = OpMatrixTimesMatrix %12 %126 %127 +%312 = OpMatrixTimesMatrix %11 %126 %127 OpReturn OpFunctionEnd %314 = OpFunction %2 None %103 %313 = OpLabel OpBranch %315 %315 = OpLabel -%316 = OpNot %6 %22 +%316 = OpNot %6 %21 %317 = OpNot %122 %124 -%318 = OpCompositeConstruct %129 %22 %22 +%318 = OpCompositeConstruct %129 %21 %21 %319 = OpNot %129 %318 %320 = OpCompositeConstruct %140 %124 %124 %124 %321 = OpNot %140 %320 -%322 = OpBitwiseOr %6 %59 %22 +%322 = OpBitwiseOr %6 %58 %21 %323 = OpBitwiseOr %122 %123 %124 -%324 = OpCompositeConstruct %129 %59 %59 -%325 = OpCompositeConstruct %129 %22 %22 +%324 = OpCompositeConstruct %129 %58 %58 +%325 = OpCompositeConstruct %129 %21 %21 %326 = OpBitwiseOr %129 %324 %325 %327 = OpCompositeConstruct %140 %123 %123 %123 %328 = OpCompositeConstruct %140 %124 %124 %124 %329 = OpBitwiseOr %140 %327 %328 -%330 = OpBitwiseAnd %6 %59 %22 +%330 = OpBitwiseAnd %6 %58 %21 %331 = OpBitwiseAnd %122 %123 %124 -%332 = OpCompositeConstruct %129 %59 %59 -%333 = OpCompositeConstruct %129 %22 %22 +%332 = OpCompositeConstruct %129 %58 %58 +%333 = OpCompositeConstruct %129 %21 %21 %334 = OpBitwiseAnd %129 %332 %333 %335 = OpCompositeConstruct %140 %123 %123 %123 %336 = OpCompositeConstruct %140 %124 %124 %124 %337 = OpBitwiseAnd %140 %335 %336 -%338 = OpBitwiseXor %6 %59 %22 +%338 = OpBitwiseXor %6 %58 %21 %339 = OpBitwiseXor %122 %123 %124 -%340 = OpCompositeConstruct %129 %59 %59 -%341 = OpCompositeConstruct %129 %22 %22 +%340 = OpCompositeConstruct %129 %58 %58 +%341 = OpCompositeConstruct %129 %21 %21 %342 = OpBitwiseXor %129 %340 %341 %343 = OpCompositeConstruct %140 %123 %123 %123 %344 = OpCompositeConstruct %140 %124 %124 %124 %345 = OpBitwiseXor %140 %343 %344 -%346 = OpShiftLeftLogical %6 %59 %124 +%346 = OpShiftLeftLogical %6 %58 %124 %347 = OpShiftLeftLogical %122 %123 %124 -%348 = OpCompositeConstruct %129 %59 %59 +%348 = OpCompositeConstruct %129 %58 %58 %349 = OpCompositeConstruct %203 %124 %124 %350 = OpShiftLeftLogical %129 %348 %349 %351 = OpCompositeConstruct %140 %123 %123 %123 %352 = OpCompositeConstruct %140 %124 %124 %124 %353 = OpShiftLeftLogical %140 %351 %352 -%354 = OpShiftRightArithmetic %6 %59 %124 +%354 = OpShiftRightArithmetic %6 %58 %124 %355 = OpShiftRightLogical %122 %123 %124 -%356 = OpCompositeConstruct %129 %59 %59 +%356 = OpCompositeConstruct %129 %58 %58 %357 = OpCompositeConstruct %203 %124 %124 %358 = OpShiftRightArithmetic %129 %356 %357 %359 = OpCompositeConstruct %140 %123 %123 %123 @@ -411,77 +411,77 @@ OpFunctionEnd %362 = OpLabel OpBranch %364 %364 = OpLabel -%365 = OpIEqual %8 %59 %22 +%365 = OpIEqual %8 %58 %21 %366 = OpIEqual %8 %123 %124 -%367 = OpFOrdEqual %8 %55 %16 -%368 = OpCompositeConstruct %129 %59 %59 -%369 = OpCompositeConstruct %129 %22 %22 +%367 = OpFOrdEqual %8 %54 %15 +%368 = OpCompositeConstruct %129 %58 %58 +%369 = OpCompositeConstruct %129 %21 %21 %370 = OpIEqual %106 %368 %369 %371 = OpCompositeConstruct %140 %123 %123 %123 %372 = OpCompositeConstruct %140 %124 %124 %124 -%373 = OpIEqual %11 %371 %372 -%374 = OpCompositeConstruct %3 %55 %55 %55 %55 -%375 = OpCompositeConstruct %3 %16 %16 %16 %16 +%373 = OpIEqual %96 %371 %372 +%374 = OpCompositeConstruct %3 %54 %54 %54 %54 +%375 = OpCompositeConstruct %3 %15 %15 %15 %15 %376 = OpFOrdEqual %7 %374 %375 -%377 = OpINotEqual %8 %59 %22 +%377 = OpINotEqual %8 %58 %21 %378 = OpINotEqual %8 %123 %124 -%379 = OpFOrdNotEqual %8 %55 %16 -%380 = OpCompositeConstruct %129 %59 %59 -%381 = OpCompositeConstruct %129 %22 %22 +%379 = OpFOrdNotEqual %8 %54 %15 +%380 = OpCompositeConstruct %129 %58 %58 +%381 = OpCompositeConstruct %129 %21 %21 %382 = OpINotEqual %106 %380 %381 %383 = OpCompositeConstruct %140 %123 %123 %123 %384 = OpCompositeConstruct %140 %124 %124 %124 -%385 = OpINotEqual %11 %383 %384 -%386 = OpCompositeConstruct %3 %55 %55 %55 %55 -%387 = OpCompositeConstruct %3 %16 %16 %16 %16 +%385 = OpINotEqual %96 %383 %384 +%386 = OpCompositeConstruct %3 %54 %54 %54 %54 +%387 = OpCompositeConstruct %3 %15 %15 %15 %15 %388 = OpFOrdNotEqual %7 %386 %387 -%389 = OpSLessThan %8 %59 %22 +%389 = OpSLessThan %8 %58 %21 %390 = OpULessThan %8 %123 %124 -%391 = OpFOrdLessThan %8 %55 %16 -%392 = OpCompositeConstruct %129 %59 %59 -%393 = OpCompositeConstruct %129 %22 %22 +%391 = OpFOrdLessThan %8 %54 %15 +%392 = OpCompositeConstruct %129 %58 %58 +%393 = OpCompositeConstruct %129 %21 %21 %394 = OpSLessThan %106 %392 %393 %395 = OpCompositeConstruct %140 %123 %123 %123 %396 = OpCompositeConstruct %140 %124 %124 %124 -%397 = OpULessThan %11 %395 %396 -%398 = OpCompositeConstruct %3 %55 %55 %55 %55 -%399 = OpCompositeConstruct %3 %16 %16 %16 %16 +%397 = OpULessThan %96 %395 %396 +%398 = OpCompositeConstruct %3 %54 %54 %54 %54 +%399 = OpCompositeConstruct %3 %15 %15 %15 %15 %400 = OpFOrdLessThan %7 %398 %399 -%401 = OpSLessThanEqual %8 %59 %22 +%401 = OpSLessThanEqual %8 %58 %21 %402 = OpULessThanEqual %8 %123 %124 -%403 = OpFOrdLessThanEqual %8 %55 %16 -%404 = OpCompositeConstruct %129 %59 %59 -%405 = OpCompositeConstruct %129 %22 %22 +%403 = OpFOrdLessThanEqual %8 %54 %15 +%404 = OpCompositeConstruct %129 %58 %58 +%405 = OpCompositeConstruct %129 %21 %21 %406 = OpSLessThanEqual %106 %404 %405 %407 = OpCompositeConstruct %140 %123 %123 %123 %408 = OpCompositeConstruct %140 %124 %124 %124 -%409 = OpULessThanEqual %11 %407 %408 -%410 = OpCompositeConstruct %3 %55 %55 %55 %55 -%411 = OpCompositeConstruct %3 %16 %16 %16 %16 +%409 = OpULessThanEqual %96 %407 %408 +%410 = OpCompositeConstruct %3 %54 %54 %54 %54 +%411 = OpCompositeConstruct %3 %15 %15 %15 %15 %412 = OpFOrdLessThanEqual %7 %410 %411 -%413 = OpSGreaterThan %8 %59 %22 +%413 = OpSGreaterThan %8 %58 %21 %414 = OpUGreaterThan %8 %123 %124 -%415 = OpFOrdGreaterThan %8 %55 %16 -%416 = OpCompositeConstruct %129 %59 %59 -%417 = OpCompositeConstruct %129 %22 %22 +%415 = OpFOrdGreaterThan %8 %54 %15 +%416 = OpCompositeConstruct %129 %58 %58 +%417 = OpCompositeConstruct %129 %21 %21 %418 = OpSGreaterThan %106 %416 %417 %419 = OpCompositeConstruct %140 %123 %123 %123 %420 = OpCompositeConstruct %140 %124 %124 %124 -%421 = OpUGreaterThan %11 %419 %420 -%422 = OpCompositeConstruct %3 %55 %55 %55 %55 -%423 = OpCompositeConstruct %3 %16 %16 %16 %16 +%421 = OpUGreaterThan %96 %419 %420 +%422 = OpCompositeConstruct %3 %54 %54 %54 %54 +%423 = OpCompositeConstruct %3 %15 %15 %15 %15 %424 = OpFOrdGreaterThan %7 %422 %423 -%425 = OpSGreaterThanEqual %8 %59 %22 +%425 = OpSGreaterThanEqual %8 %58 %21 %426 = OpUGreaterThanEqual %8 %123 %124 -%427 = OpFOrdGreaterThanEqual %8 %55 %16 -%428 = OpCompositeConstruct %129 %59 %59 -%429 = OpCompositeConstruct %129 %22 %22 +%427 = OpFOrdGreaterThanEqual %8 %54 %15 +%428 = OpCompositeConstruct %129 %58 %58 +%429 = OpCompositeConstruct %129 %21 %21 %430 = OpSGreaterThanEqual %106 %428 %429 %431 = OpCompositeConstruct %140 %123 %123 %123 %432 = OpCompositeConstruct %140 %124 %124 %124 -%433 = OpUGreaterThanEqual %11 %431 %432 -%434 = OpCompositeConstruct %3 %55 %55 %55 %55 -%435 = OpCompositeConstruct %3 %16 %16 %16 %16 +%433 = OpUGreaterThanEqual %96 %431 %432 +%434 = OpCompositeConstruct %3 %54 %54 %54 %54 +%435 = OpCompositeConstruct %3 %15 %15 %15 %15 %436 = OpFOrdGreaterThanEqual %7 %434 %435 OpReturn OpFunctionEnd @@ -491,12 +491,12 @@ OpFunctionEnd %440 = OpVariable %441 Function %442 OpBranch %445 %445 = OpLabel -OpStore %437 %22 +OpStore %437 %21 %446 = OpLoad %6 %437 -%447 = OpIAdd %6 %446 %22 +%447 = OpIAdd %6 %446 %21 OpStore %437 %447 %448 = OpLoad %6 %437 -%449 = OpISub %6 %448 %22 +%449 = OpISub %6 %448 %21 OpStore %437 %449 %450 = OpLoad %6 %437 %451 = OpLoad %6 %437 @@ -507,16 +507,16 @@ OpStore %437 %452 %455 = OpSDiv %6 %454 %453 OpStore %437 %455 %456 = OpLoad %6 %437 -%457 = OpSRem %6 %456 %22 +%457 = OpSRem %6 %456 %21 OpStore %437 %457 %458 = OpLoad %6 %437 -%459 = OpBitwiseAnd %6 %458 %28 +%459 = OpBitwiseAnd %6 %458 %27 OpStore %437 %459 %460 = OpLoad %6 %437 -%461 = OpBitwiseOr %6 %460 %28 +%461 = OpBitwiseOr %6 %460 %27 OpStore %437 %461 %462 = OpLoad %6 %437 -%463 = OpBitwiseXor %6 %462 %28 +%463 = OpBitwiseXor %6 %462 %27 OpStore %437 %463 %464 = OpLoad %6 %437 %465 = OpShiftLeftLogical %6 %464 %123 @@ -525,20 +525,20 @@ OpStore %437 %465 %467 = OpShiftRightArithmetic %6 %466 %124 OpStore %437 %467 %468 = OpLoad %6 %437 -%469 = OpIAdd %6 %468 %22 +%469 = OpIAdd %6 %468 %21 OpStore %437 %469 %470 = OpLoad %6 %437 -%471 = OpISub %6 %470 %22 +%471 = OpISub %6 %470 %21 OpStore %437 %471 OpStore %440 %442 %473 = OpAccessChain %472 %440 %124 %474 = OpLoad %6 %473 -%475 = OpIAdd %6 %474 %22 +%475 = OpIAdd %6 %474 %21 %476 = OpAccessChain %472 %440 %124 OpStore %476 %475 %477 = OpAccessChain %472 %440 %124 %478 = OpLoad %6 %477 -%479 = OpISub %6 %478 %22 +%479 = OpISub %6 %478 %21 %480 = OpAccessChain %472 %440 %124 OpStore %480 %479 OpReturn @@ -571,10 +571,10 @@ OpFunctionEnd %510 = OpLabel OpBranch %512 %512 = OpLabel -%513 = OpFunctionCall %3 %25 -%514 = OpFunctionCall %3 %54 -%515 = OpVectorShuffle %10 %17 %17 0 1 2 -%516 = OpFunctionCall %10 %94 %515 +%513 = OpFunctionCall %3 %24 +%514 = OpFunctionCall %3 %53 +%515 = OpVectorShuffle %10 %16 %16 0 1 2 +%516 = OpFunctionCall %10 %93 %515 %517 = OpFunctionCall %2 %102 %518 = OpFunctionCall %2 %120 %519 = OpFunctionCall %2 %314 diff --git a/tests/out/spv/padding.spvasm b/tests/out/spv/padding.spvasm index 93c4ce63c7..e0b4251ae4 100644 --- a/tests/out/spv/padding.spvasm +++ b/tests/out/spv/padding.spvasm @@ -1,11 +1,11 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 51 +; Bound: 49 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %28 "vertex" %26 +OpEntryPoint Vertex %26 "vertex" %24 OpMemberName %5 0 "a" OpName %5 "S" OpMemberName %6 0 "a" @@ -17,10 +17,10 @@ OpName %10 "Test2" OpMemberName %12 0 "a" OpMemberName %12 1 "b" OpName %12 "Test3" -OpName %16 "input1" -OpName %19 "input2" -OpName %22 "input3" -OpName %28 "vertex" +OpName %14 "input1" +OpName %17 "input2" +OpName %20 "input3" +OpName %26 "vertex" OpMemberDecorate %5 0 Offset 0 OpMemberDecorate %6 0 Offset 0 OpMemberDecorate %6 1 Offset 16 @@ -31,19 +31,19 @@ OpMemberDecorate %12 0 Offset 0 OpMemberDecorate %12 0 ColMajor OpMemberDecorate %12 0 MatrixStride 16 OpMemberDecorate %12 1 Offset 64 -OpDecorate %16 DescriptorSet 0 -OpDecorate %16 Binding 0 -OpDecorate %17 Block -OpMemberDecorate %17 0 Offset 0 -OpDecorate %19 DescriptorSet 0 -OpDecorate %19 Binding 1 -OpDecorate %20 Block -OpMemberDecorate %20 0 Offset 0 -OpDecorate %22 DescriptorSet 0 -OpDecorate %22 Binding 2 -OpDecorate %23 Block -OpMemberDecorate %23 0 Offset 0 -OpDecorate %26 BuiltIn Position +OpDecorate %14 DescriptorSet 0 +OpDecorate %14 Binding 0 +OpDecorate %15 Block +OpMemberDecorate %15 0 Offset 0 +OpDecorate %17 DescriptorSet 0 +OpDecorate %17 Binding 1 +OpDecorate %18 Block +OpMemberDecorate %18 0 Offset 0 +OpDecorate %20 DescriptorSet 0 +OpDecorate %20 Binding 2 +OpDecorate %21 Block +OpMemberDecorate %21 0 Offset 0 +OpDecorate %24 BuiltIn Position %2 = OpTypeVoid %4 = OpTypeFloat 32 %3 = OpTypeVector %4 3 @@ -56,44 +56,42 @@ OpDecorate %26 BuiltIn Position %11 = OpTypeMatrix %3 4 %12 = OpTypeStruct %11 %4 %13 = OpTypeVector %4 4 -%15 = OpTypeInt 32 1 -%14 = OpConstant %15 2 -%17 = OpTypeStruct %6 -%18 = OpTypePointer Uniform %17 -%16 = OpVariable %18 Uniform -%20 = OpTypeStruct %10 -%21 = OpTypePointer Uniform %20 -%19 = OpVariable %21 Uniform -%23 = OpTypeStruct %12 -%24 = OpTypePointer Uniform %23 -%22 = OpVariable %24 Uniform -%27 = OpTypePointer Output %13 -%26 = OpVariable %27 Output -%29 = OpTypeFunction %2 -%30 = OpTypePointer Uniform %6 -%31 = OpConstant %9 0 -%33 = OpTypePointer Uniform %10 -%35 = OpTypePointer Uniform %12 -%37 = OpConstant %4 1.0 -%40 = OpTypePointer Uniform %4 -%41 = OpConstant %9 1 -%28 = OpFunction %2 None %29 -%25 = OpLabel -%32 = OpAccessChain %30 %16 %31 -%34 = OpAccessChain %33 %19 %31 -%36 = OpAccessChain %35 %22 %31 -OpBranch %38 -%38 = OpLabel -%39 = OpCompositeConstruct %13 %37 %37 %37 %37 -%42 = OpAccessChain %40 %32 %41 -%43 = OpLoad %4 %42 -%44 = OpVectorTimesScalar %13 %39 %43 -%45 = OpAccessChain %40 %34 %41 -%46 = OpLoad %4 %45 -%47 = OpVectorTimesScalar %13 %44 %46 -%48 = OpAccessChain %40 %36 %41 -%49 = OpLoad %4 %48 -%50 = OpVectorTimesScalar %13 %47 %49 -OpStore %26 %50 +%15 = OpTypeStruct %6 +%16 = OpTypePointer Uniform %15 +%14 = OpVariable %16 Uniform +%18 = OpTypeStruct %10 +%19 = OpTypePointer Uniform %18 +%17 = OpVariable %19 Uniform +%21 = OpTypeStruct %12 +%22 = OpTypePointer Uniform %21 +%20 = OpVariable %22 Uniform +%25 = OpTypePointer Output %13 +%24 = OpVariable %25 Output +%27 = OpTypeFunction %2 +%28 = OpTypePointer Uniform %6 +%29 = OpConstant %9 0 +%31 = OpTypePointer Uniform %10 +%33 = OpTypePointer Uniform %12 +%35 = OpConstant %4 1.0 +%38 = OpTypePointer Uniform %4 +%39 = OpConstant %9 1 +%26 = OpFunction %2 None %27 +%23 = OpLabel +%30 = OpAccessChain %28 %14 %29 +%32 = OpAccessChain %31 %17 %29 +%34 = OpAccessChain %33 %20 %29 +OpBranch %36 +%36 = OpLabel +%37 = OpCompositeConstruct %13 %35 %35 %35 %35 +%40 = OpAccessChain %38 %30 %39 +%41 = OpLoad %4 %40 +%42 = OpVectorTimesScalar %13 %37 %41 +%43 = OpAccessChain %38 %32 %39 +%44 = OpLoad %4 %43 +%45 = OpVectorTimesScalar %13 %42 %44 +%46 = OpAccessChain %38 %34 %39 +%47 = OpLoad %4 %46 +%48 = OpVectorTimesScalar %13 %45 %47 +OpStore %24 %48 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/pointers.spvasm b/tests/out/spv/pointers.spvasm index 332d265fad..2de4a49711 100644 --- a/tests/out/spv/pointers.spvasm +++ b/tests/out/spv/pointers.spvasm @@ -9,69 +9,69 @@ OpExtension "SPV_KHR_storage_buffer_storage_class" OpMemoryModel Logical GLSL450 OpMemberName %7 0 "arr" OpName %7 "DynamicArray" -OpName %10 "dynamic_array" -OpName %11 "v" -OpName %15 "f" -OpName %23 "i" -OpName %24 "v" -OpName %25 "index_unsized" +OpName %8 "dynamic_array" +OpName %10 "v" +OpName %14 "f" +OpName %22 "i" +OpName %23 "v" +OpName %24 "index_unsized" OpName %34 "i" OpName %35 "v" OpName %36 "index_dynamic_array" OpDecorate %6 ArrayStride 4 OpMemberDecorate %7 0 Offset 0 OpDecorate %7 Block -OpDecorate %10 DescriptorSet 0 -OpDecorate %10 Binding 0 +OpDecorate %8 DescriptorSet 0 +OpDecorate %8 Binding 0 %2 = OpTypeVoid %4 = OpTypeInt 32 1 %3 = OpTypeVector %4 2 %5 = OpTypeInt 32 0 %6 = OpTypeRuntimeArray %5 %7 = OpTypeStruct %6 -%8 = OpTypePointer StorageBuffer %7 -%9 = OpTypePointer StorageBuffer %6 -%10 = OpVariable %8 StorageBuffer -%12 = OpTypePointer Function %3 -%13 = OpConstantNull %3 -%16 = OpTypeFunction %2 -%17 = OpConstant %4 10 -%19 = OpTypePointer Function %4 -%20 = OpConstant %5 0 -%26 = OpTypeFunction %2 %4 %5 +%9 = OpTypePointer StorageBuffer %7 +%8 = OpVariable %9 StorageBuffer +%11 = OpTypePointer Function %3 +%12 = OpConstantNull %3 +%15 = OpTypeFunction %2 +%16 = OpConstant %4 10 +%18 = OpTypePointer Function %4 +%19 = OpConstant %5 0 +%25 = OpTypeFunction %2 %4 %5 +%27 = OpTypePointer StorageBuffer %6 %28 = OpTypePointer StorageBuffer %5 -%15 = OpFunction %2 None %16 -%14 = OpLabel -%11 = OpVariable %12 Function %13 -OpBranch %18 -%18 = OpLabel -%21 = OpAccessChain %19 %11 %20 -OpStore %21 %17 +%14 = OpFunction %2 None %15 +%13 = OpLabel +%10 = OpVariable %11 Function %12 +OpBranch %17 +%17 = OpLabel +%20 = OpAccessChain %18 %10 %19 +OpStore %20 %16 OpReturn OpFunctionEnd -%25 = OpFunction %2 None %26 -%23 = OpFunctionParameter %4 -%24 = OpFunctionParameter %5 -%22 = OpLabel -OpBranch %27 -%27 = OpLabel -%29 = OpAccessChain %28 %10 %20 %23 +%24 = OpFunction %2 None %25 +%22 = OpFunctionParameter %4 +%23 = OpFunctionParameter %5 +%21 = OpLabel +OpBranch %26 +%26 = OpLabel +%29 = OpAccessChain %28 %8 %19 %22 %30 = OpLoad %5 %29 -%31 = OpIAdd %5 %30 %24 -%32 = OpAccessChain %28 %10 %20 %23 +%31 = OpIAdd %5 %30 %23 +%32 = OpAccessChain %28 %8 %19 %22 OpStore %32 %31 OpReturn OpFunctionEnd -%36 = OpFunction %2 None %26 +%36 = OpFunction %2 None %25 %34 = OpFunctionParameter %4 %35 = OpFunctionParameter %5 %33 = OpLabel OpBranch %37 %37 = OpLabel -%38 = OpAccessChain %28 %10 %20 %34 +%38 = OpAccessChain %28 %8 %19 %34 %39 = OpLoad %5 %38 %40 = OpIAdd %5 %39 %35 -%41 = OpAccessChain %28 %10 %20 %34 +%41 = OpAccessChain %28 %8 %19 %34 OpStore %41 %40 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/policy-mix.spvasm b/tests/out/spv/policy-mix.spvasm index ea77b3bb44..a23714d9de 100644 --- a/tests/out/spv/policy-mix.spvasm +++ b/tests/out/spv/policy-mix.spvasm @@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 106 +; Bound: 101 OpCapability Shader OpCapability ImageQuery OpCapability Linkage @@ -12,16 +12,16 @@ OpMemberName %8 0 "a" OpName %8 "InStorage" OpMemberName %11 0 "a" OpName %11 "InUniform" -OpName %26 "in_storage" -OpName %29 "in_uniform" -OpName %32 "image_2d_array" -OpName %34 "in_workgroup" -OpName %36 "in_private" -OpName %39 "in_function" -OpName %43 "c" -OpName %44 "i" -OpName %45 "l" -OpName %46 "mock_function" +OpName %21 "in_storage" +OpName %24 "in_uniform" +OpName %27 "image_2d_array" +OpName %29 "in_workgroup" +OpName %31 "in_private" +OpName %34 "in_function" +OpName %38 "c" +OpName %39 "i" +OpName %40 "l" +OpName %41 "mock_function" OpDecorate %5 ArrayStride 16 OpMemberDecorate %8 0 Offset 0 OpDecorate %9 ArrayStride 16 @@ -29,17 +29,17 @@ OpMemberDecorate %11 0 Offset 0 OpDecorate %13 ArrayStride 4 OpDecorate %15 ArrayStride 4 OpDecorate %19 ArrayStride 16 -OpDecorate %26 NonWritable -OpDecorate %26 DescriptorSet 0 -OpDecorate %26 Binding 0 -OpDecorate %27 Block -OpMemberDecorate %27 0 Offset 0 -OpDecorate %29 DescriptorSet 0 -OpDecorate %29 Binding 1 -OpDecorate %30 Block -OpMemberDecorate %30 0 Offset 0 -OpDecorate %32 DescriptorSet 0 -OpDecorate %32 Binding 2 +OpDecorate %21 NonWritable +OpDecorate %21 DescriptorSet 0 +OpDecorate %21 Binding 0 +OpDecorate %22 Block +OpMemberDecorate %22 0 Offset 0 +OpDecorate %24 DescriptorSet 0 +OpDecorate %24 Binding 1 +OpDecorate %25 Block +OpMemberDecorate %25 0 Offset 0 +OpDecorate %27 DescriptorSet 0 +OpDecorate %27 Binding 2 %2 = OpTypeVoid %4 = OpTypeFloat 32 %3 = OpTypeVector %4 4 @@ -59,96 +59,91 @@ OpDecorate %32 Binding 2 %17 = OpTypeVector %18 2 %20 = OpConstant %7 2 %19 = OpTypeArray %3 %20 -%21 = OpConstant %18 10 -%22 = OpConstant %18 20 -%23 = OpConstant %18 30 -%24 = OpConstant %18 40 -%25 = OpConstant %18 2 -%27 = OpTypeStruct %8 -%28 = OpTypePointer StorageBuffer %27 -%26 = OpVariable %28 StorageBuffer -%30 = OpTypeStruct %11 -%31 = OpTypePointer Uniform %30 -%29 = OpVariable %31 Uniform -%33 = OpTypePointer UniformConstant %12 -%32 = OpVariable %33 UniformConstant -%35 = OpTypePointer Workgroup %13 -%34 = OpVariable %35 Workgroup -%37 = OpTypePointer Private %15 -%38 = OpConstantNull %15 -%36 = OpVariable %37 Private %38 -%40 = OpTypePointer Function %19 -%41 = OpConstantNull %19 -%47 = OpTypeFunction %3 %17 %18 %18 -%48 = OpTypePointer StorageBuffer %8 -%49 = OpConstant %7 0 -%51 = OpTypePointer Uniform %11 -%54 = OpConstant %4 0.707 -%55 = OpConstant %4 0.0 -%56 = OpConstant %4 1.0 -%61 = OpTypePointer StorageBuffer %5 -%62 = OpTypePointer StorageBuffer %3 -%65 = OpTypePointer Uniform %9 -%66 = OpTypePointer Uniform %3 -%70 = OpTypeVector %18 3 -%72 = OpTypeBool -%73 = OpConstantNull %3 -%79 = OpTypeVector %72 3 -%86 = OpTypePointer Workgroup %4 -%87 = OpConstant %7 29 -%93 = OpTypePointer Private %4 -%94 = OpConstant %7 39 -%100 = OpTypePointer Function %3 -%101 = OpConstant %7 1 -%46 = OpFunction %3 None %47 -%43 = OpFunctionParameter %17 -%44 = OpFunctionParameter %18 -%45 = OpFunctionParameter %18 -%42 = OpLabel -%39 = OpVariable %40 Function %41 -%50 = OpAccessChain %48 %26 %49 -%52 = OpAccessChain %51 %29 %49 -%53 = OpLoad %12 %32 -OpBranch %57 -%57 = OpLabel -%58 = OpCompositeConstruct %3 %54 %55 %55 %56 -%59 = OpCompositeConstruct %3 %55 %54 %55 %56 -%60 = OpCompositeConstruct %19 %58 %59 -OpStore %39 %60 -%63 = OpAccessChain %62 %50 %49 %44 -%64 = OpLoad %3 %63 -%67 = OpAccessChain %66 %52 %49 %44 -%68 = OpLoad %3 %67 -%69 = OpFAdd %3 %64 %68 -%71 = OpCompositeConstruct %70 %43 %44 -%74 = OpImageQueryLevels %18 %53 -%75 = OpULessThan %72 %45 %74 -OpSelectionMerge %76 None -OpBranchConditional %75 %77 %76 +%22 = OpTypeStruct %8 +%23 = OpTypePointer StorageBuffer %22 +%21 = OpVariable %23 StorageBuffer +%25 = OpTypeStruct %11 +%26 = OpTypePointer Uniform %25 +%24 = OpVariable %26 Uniform +%28 = OpTypePointer UniformConstant %12 +%27 = OpVariable %28 UniformConstant +%30 = OpTypePointer Workgroup %13 +%29 = OpVariable %30 Workgroup +%32 = OpTypePointer Private %15 +%33 = OpConstantNull %15 +%31 = OpVariable %32 Private %33 +%35 = OpTypePointer Function %19 +%36 = OpConstantNull %19 +%42 = OpTypeFunction %3 %17 %18 %18 +%43 = OpTypePointer StorageBuffer %8 +%44 = OpConstant %7 0 +%46 = OpTypePointer Uniform %11 +%49 = OpConstant %4 0.707 +%50 = OpConstant %4 0.0 +%51 = OpConstant %4 1.0 +%56 = OpTypePointer StorageBuffer %5 +%57 = OpTypePointer StorageBuffer %3 +%60 = OpTypePointer Uniform %9 +%61 = OpTypePointer Uniform %3 +%65 = OpTypeVector %18 3 +%67 = OpTypeBool +%68 = OpConstantNull %3 +%74 = OpTypeVector %67 3 +%81 = OpTypePointer Workgroup %4 +%82 = OpConstant %7 29 +%88 = OpTypePointer Private %4 +%89 = OpConstant %7 39 +%95 = OpTypePointer Function %3 +%96 = OpConstant %7 1 +%41 = OpFunction %3 None %42 +%38 = OpFunctionParameter %17 +%39 = OpFunctionParameter %18 +%40 = OpFunctionParameter %18 +%37 = OpLabel +%34 = OpVariable %35 Function %36 +%45 = OpAccessChain %43 %21 %44 +%47 = OpAccessChain %46 %24 %44 +%48 = OpLoad %12 %27 +OpBranch %52 +%52 = OpLabel +%53 = OpCompositeConstruct %3 %49 %50 %50 %51 +%54 = OpCompositeConstruct %3 %50 %49 %50 %51 +%55 = OpCompositeConstruct %19 %53 %54 +OpStore %34 %55 +%58 = OpAccessChain %57 %45 %44 %39 +%59 = OpLoad %3 %58 +%62 = OpAccessChain %61 %47 %44 %39 +%63 = OpLoad %3 %62 +%64 = OpFAdd %3 %59 %63 +%66 = OpCompositeConstruct %65 %38 %39 +%69 = OpImageQueryLevels %18 %48 +%70 = OpULessThan %67 %40 %69 +OpSelectionMerge %71 None +OpBranchConditional %70 %72 %71 +%72 = OpLabel +%73 = OpImageQuerySizeLod %65 %48 %40 +%75 = OpULessThan %74 %66 %73 +%76 = OpAll %67 %75 +OpBranchConditional %76 %77 %71 %77 = OpLabel -%78 = OpImageQuerySizeLod %70 %53 %45 -%80 = OpULessThan %79 %71 %78 -%81 = OpAll %72 %80 -OpBranchConditional %81 %82 %76 -%82 = OpLabel -%83 = OpImageFetch %3 %53 %71 Lod %45 -OpBranch %76 -%76 = OpLabel -%84 = OpPhi %3 %73 %57 %73 %77 %83 %82 -%85 = OpFAdd %3 %69 %84 -%88 = OpExtInst %7 %1 UMin %44 %87 -%89 = OpAccessChain %86 %34 %88 -%90 = OpLoad %4 %89 -%91 = OpCompositeConstruct %3 %90 %90 %90 %90 -%92 = OpFAdd %3 %85 %91 -%95 = OpExtInst %7 %1 UMin %44 %94 -%96 = OpAccessChain %93 %36 %95 -%97 = OpLoad %4 %96 -%98 = OpCompositeConstruct %3 %97 %97 %97 %97 -%99 = OpFAdd %3 %92 %98 -%102 = OpExtInst %7 %1 UMin %44 %101 -%103 = OpAccessChain %100 %39 %102 -%104 = OpLoad %3 %103 -%105 = OpFAdd %3 %99 %104 -OpReturnValue %105 +%78 = OpImageFetch %3 %48 %66 Lod %40 +OpBranch %71 +%71 = OpLabel +%79 = OpPhi %3 %68 %52 %68 %72 %78 %77 +%80 = OpFAdd %3 %64 %79 +%83 = OpExtInst %7 %1 UMin %39 %82 +%84 = OpAccessChain %81 %29 %83 +%85 = OpLoad %4 %84 +%86 = OpCompositeConstruct %3 %85 %85 %85 %85 +%87 = OpFAdd %3 %80 %86 +%90 = OpExtInst %7 %1 UMin %39 %89 +%91 = OpAccessChain %88 %31 %90 +%92 = OpLoad %4 %91 +%93 = OpCompositeConstruct %3 %92 %92 %92 %92 +%94 = OpFAdd %3 %87 %93 +%97 = OpExtInst %7 %1 UMin %39 %96 +%98 = OpAccessChain %95 %34 %97 +%99 = OpLoad %3 %98 +%100 = OpFAdd %3 %94 %99 +OpReturnValue %100 OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/runtime-array-in-unused-struct.spvasm b/tests/out/spv/runtime-array-in-unused-struct.spvasm index ab3bd3d01b..d88b35b0ba 100644 --- a/tests/out/spv/runtime-array-in-unused-struct.spvasm +++ b/tests/out/spv/runtime-array-in-unused-struct.spvasm @@ -1,24 +1,9 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 10 +; Bound: 3 OpCapability Shader OpCapability Linkage %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpMemberDecorate %5 0 Offset 0 -OpMemberDecorate %5 1 Offset 16 -OpDecorate %6 ArrayStride 32 -OpMemberDecorate %7 0 Offset 0 -OpDecorate %7 Block -OpDecorate %8 ArrayStride 4 -OpMemberDecorate %9 0 Offset 0 -OpDecorate %9 Block -%2 = OpTypeVoid -%3 = OpTypeFloat 32 -%4 = OpTypeVector %3 4 -%5 = OpTypeStruct %3 %4 -%6 = OpTypeRuntimeArray %5 -%7 = OpTypeStruct %6 -%8 = OpTypeRuntimeArray %3 -%9 = OpTypeStruct %8 \ No newline at end of file +%2 = OpTypeVoid \ No newline at end of file diff --git a/tests/out/spv/shadow.spvasm b/tests/out/spv/shadow.spvasm index c5b1c7c3e4..d0e3309c23 100644 --- a/tests/out/spv/shadow.spvasm +++ b/tests/out/spv/shadow.spvasm @@ -1,16 +1,16 @@ ; SPIR-V ; Version: 1.2 ; Generator: rspirv -; Bound: 268 +; Bound: 267 OpCapability Shader OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint Vertex %88 "vs_main" %78 %81 %83 %85 %87 -OpEntryPoint Fragment %148 "fs_main" %139 %142 %145 %147 -OpEntryPoint Fragment %215 "fs_main_without_storage" %208 %210 %212 %214 -OpExecutionMode %148 OriginUpperLeft -OpExecutionMode %215 OriginUpperLeft +OpEntryPoint Vertex %87 "vs_main" %77 %80 %82 %84 %86 +OpEntryPoint Fragment %147 "fs_main" %138 %141 %144 %146 +OpEntryPoint Fragment %214 "fs_main_without_storage" %207 %209 %211 %213 +OpExecutionMode %147 OriginUpperLeft +OpExecutionMode %214 OriginUpperLeft OpMemberName %8 0 "view_proj" OpMemberName %8 1 "num_lights" OpName %8 "Globals" @@ -25,36 +25,36 @@ OpMemberName %15 0 "proj" OpMemberName %15 1 "pos" OpMemberName %15 2 "color" OpName %15 "Light" -OpName %24 "c_ambient" +OpName %23 "c_ambient" OpName %18 "c_max_lights" -OpName %25 "u_globals" -OpName %28 "u_entity" -OpName %31 "s_lights" -OpName %34 "u_lights" -OpName %37 "t_shadow" -OpName %39 "sampler_shadow" -OpName %42 "light_id" -OpName %43 "homogeneous_coords" -OpName %44 "fetch_shadow" -OpName %74 "out" -OpName %78 "position" -OpName %81 "normal" -OpName %83 "proj_position" -OpName %85 "world_normal" -OpName %87 "world_position" -OpName %88 "vs_main" -OpName %132 "color" -OpName %134 "i" -OpName %139 "proj_position" -OpName %142 "world_normal" -OpName %145 "world_position" -OpName %148 "fs_main" -OpName %204 "color" -OpName %205 "i" -OpName %208 "proj_position" -OpName %210 "world_normal" -OpName %212 "world_position" -OpName %215 "fs_main_without_storage" +OpName %24 "u_globals" +OpName %27 "u_entity" +OpName %30 "s_lights" +OpName %33 "u_lights" +OpName %36 "t_shadow" +OpName %38 "sampler_shadow" +OpName %41 "light_id" +OpName %42 "homogeneous_coords" +OpName %43 "fetch_shadow" +OpName %73 "out" +OpName %77 "position" +OpName %80 "normal" +OpName %82 "proj_position" +OpName %84 "world_normal" +OpName %86 "world_position" +OpName %87 "vs_main" +OpName %131 "color" +OpName %133 "i" +OpName %138 "proj_position" +OpName %141 "world_normal" +OpName %144 "world_position" +OpName %147 "fs_main" +OpName %203 "color" +OpName %204 "i" +OpName %207 "proj_position" +OpName %209 "world_normal" +OpName %211 "world_position" +OpName %214 "fs_main_without_storage" OpMemberDecorate %8 0 Offset 0 OpMemberDecorate %8 0 ColMajor OpMemberDecorate %8 0 MatrixStride 16 @@ -73,40 +73,40 @@ OpMemberDecorate %15 1 Offset 64 OpMemberDecorate %15 2 Offset 80 OpDecorate %16 ArrayStride 96 OpDecorate %17 ArrayStride 96 -OpDecorate %25 DescriptorSet 0 -OpDecorate %25 Binding 0 -OpDecorate %26 Block -OpMemberDecorate %26 0 Offset 0 -OpDecorate %28 DescriptorSet 1 -OpDecorate %28 Binding 0 -OpDecorate %29 Block -OpMemberDecorate %29 0 Offset 0 -OpDecorate %31 NonWritable -OpDecorate %31 DescriptorSet 0 -OpDecorate %31 Binding 1 -OpDecorate %32 Block -OpMemberDecorate %32 0 Offset 0 -OpDecorate %34 DescriptorSet 0 -OpDecorate %34 Binding 1 -OpDecorate %35 Block -OpMemberDecorate %35 0 Offset 0 -OpDecorate %37 DescriptorSet 0 -OpDecorate %37 Binding 2 -OpDecorate %39 DescriptorSet 0 -OpDecorate %39 Binding 3 -OpDecorate %78 Location 0 -OpDecorate %81 Location 1 -OpDecorate %83 BuiltIn Position -OpDecorate %85 Location 0 -OpDecorate %87 Location 1 -OpDecorate %139 BuiltIn FragCoord -OpDecorate %142 Location 0 -OpDecorate %145 Location 1 -OpDecorate %147 Location 0 -OpDecorate %208 BuiltIn FragCoord -OpDecorate %210 Location 0 -OpDecorate %212 Location 1 -OpDecorate %214 Location 0 +OpDecorate %24 DescriptorSet 0 +OpDecorate %24 Binding 0 +OpDecorate %25 Block +OpMemberDecorate %25 0 Offset 0 +OpDecorate %27 DescriptorSet 1 +OpDecorate %27 Binding 0 +OpDecorate %28 Block +OpMemberDecorate %28 0 Offset 0 +OpDecorate %30 NonWritable +OpDecorate %30 DescriptorSet 0 +OpDecorate %30 Binding 1 +OpDecorate %31 Block +OpMemberDecorate %31 0 Offset 0 +OpDecorate %33 DescriptorSet 0 +OpDecorate %33 Binding 1 +OpDecorate %34 Block +OpMemberDecorate %34 0 Offset 0 +OpDecorate %36 DescriptorSet 0 +OpDecorate %36 Binding 2 +OpDecorate %38 DescriptorSet 0 +OpDecorate %38 Binding 3 +OpDecorate %77 Location 0 +OpDecorate %80 Location 1 +OpDecorate %82 BuiltIn Position +OpDecorate %84 Location 0 +OpDecorate %86 Location 1 +OpDecorate %138 BuiltIn FragCoord +OpDecorate %141 Location 0 +OpDecorate %144 Location 1 +OpDecorate %146 Location 0 +OpDecorate %207 BuiltIn FragCoord +OpDecorate %209 Location 0 +OpDecorate %211 Location 1 +OpDecorate %213 Location 0 %2 = OpTypeVoid %5 = OpTypeFloat 32 %4 = OpTypeVector %5 4 @@ -127,301 +127,300 @@ OpDecorate %214 Location 0 %19 = OpTypeImage %5 2D 1 1 0 1 Unknown %20 = OpTypeSampler %21 = OpTypeVector %5 2 -%22 = OpConstant %13 10 -%23 = OpConstant %5 0.05 -%24 = OpConstantComposite %10 %23 %23 %23 -%26 = OpTypeStruct %8 -%27 = OpTypePointer Uniform %26 -%25 = OpVariable %27 Uniform -%29 = OpTypeStruct %9 -%30 = OpTypePointer Uniform %29 -%28 = OpVariable %30 Uniform -%32 = OpTypeStruct %16 -%33 = OpTypePointer StorageBuffer %32 -%31 = OpVariable %33 StorageBuffer -%35 = OpTypeStruct %17 -%36 = OpTypePointer Uniform %35 -%34 = OpVariable %36 Uniform -%38 = OpTypePointer UniformConstant %19 -%37 = OpVariable %38 UniformConstant -%40 = OpTypePointer UniformConstant %20 -%39 = OpVariable %40 UniformConstant -%45 = OpTypeFunction %5 %7 %4 -%48 = OpConstant %5 0.0 -%49 = OpConstant %5 1.0 -%50 = OpConstant %5 0.5 -%51 = OpConstant %5 -0.5 -%54 = OpTypeBool -%69 = OpTypeSampledImage %19 -%75 = OpTypePointer Function %11 -%76 = OpConstantNull %11 -%79 = OpTypePointer Input %12 -%78 = OpVariable %79 Input -%81 = OpVariable %79 Input -%84 = OpTypePointer Output %4 -%83 = OpVariable %84 Output -%86 = OpTypePointer Output %10 -%85 = OpVariable %86 Output -%87 = OpVariable %84 Output -%89 = OpTypeFunction %2 -%90 = OpTypePointer Uniform %8 -%91 = OpConstant %7 0 -%93 = OpTypePointer Uniform %9 -%96 = OpTypePointer Uniform %3 -%103 = OpTypePointer Function %10 -%111 = OpTypeVector %13 3 -%115 = OpConstant %7 1 -%117 = OpTypePointer Function %4 -%118 = OpConstant %7 2 -%126 = OpTypePointer Output %5 -%133 = OpConstantNull %10 -%135 = OpTypePointer Function %7 -%136 = OpConstantNull %7 -%140 = OpTypePointer Input %4 -%139 = OpVariable %140 Input -%143 = OpTypePointer Input %10 -%142 = OpVariable %143 Input -%145 = OpVariable %140 Input -%147 = OpVariable %84 Output -%151 = OpTypePointer StorageBuffer %16 -%163 = OpTypePointer Uniform %6 -%164 = OpTypePointer Uniform %7 -%174 = OpTypePointer StorageBuffer %15 -%200 = OpTypePointer Uniform %4 -%208 = OpVariable %140 Input -%210 = OpVariable %143 Input -%212 = OpVariable %140 Input -%214 = OpVariable %84 Output -%218 = OpTypePointer Uniform %17 -%239 = OpTypePointer Uniform %15 -%44 = OpFunction %5 None %45 -%42 = OpFunctionParameter %7 -%43 = OpFunctionParameter %4 -%41 = OpLabel -%46 = OpLoad %19 %37 -%47 = OpLoad %20 %39 -OpBranch %52 -%52 = OpLabel -%53 = OpCompositeExtract %5 %43 3 -%55 = OpFOrdLessThanEqual %54 %53 %48 -OpSelectionMerge %56 None -OpBranchConditional %55 %57 %56 -%57 = OpLabel -OpReturnValue %49 +%22 = OpConstant %5 0.05 +%23 = OpConstantComposite %10 %22 %22 %22 +%25 = OpTypeStruct %8 +%26 = OpTypePointer Uniform %25 +%24 = OpVariable %26 Uniform +%28 = OpTypeStruct %9 +%29 = OpTypePointer Uniform %28 +%27 = OpVariable %29 Uniform +%31 = OpTypeStruct %16 +%32 = OpTypePointer StorageBuffer %31 +%30 = OpVariable %32 StorageBuffer +%34 = OpTypeStruct %17 +%35 = OpTypePointer Uniform %34 +%33 = OpVariable %35 Uniform +%37 = OpTypePointer UniformConstant %19 +%36 = OpVariable %37 UniformConstant +%39 = OpTypePointer UniformConstant %20 +%38 = OpVariable %39 UniformConstant +%44 = OpTypeFunction %5 %7 %4 +%47 = OpConstant %5 0.0 +%48 = OpConstant %5 1.0 +%49 = OpConstant %5 0.5 +%50 = OpConstant %5 -0.5 +%53 = OpTypeBool +%68 = OpTypeSampledImage %19 +%74 = OpTypePointer Function %11 +%75 = OpConstantNull %11 +%78 = OpTypePointer Input %12 +%77 = OpVariable %78 Input +%80 = OpVariable %78 Input +%83 = OpTypePointer Output %4 +%82 = OpVariable %83 Output +%85 = OpTypePointer Output %10 +%84 = OpVariable %85 Output +%86 = OpVariable %83 Output +%88 = OpTypeFunction %2 +%89 = OpTypePointer Uniform %8 +%90 = OpConstant %7 0 +%92 = OpTypePointer Uniform %9 +%95 = OpTypePointer Uniform %3 +%102 = OpTypePointer Function %10 +%110 = OpTypeVector %13 3 +%114 = OpConstant %7 1 +%116 = OpTypePointer Function %4 +%117 = OpConstant %7 2 +%125 = OpTypePointer Output %5 +%132 = OpConstantNull %10 +%134 = OpTypePointer Function %7 +%135 = OpConstantNull %7 +%139 = OpTypePointer Input %4 +%138 = OpVariable %139 Input +%142 = OpTypePointer Input %10 +%141 = OpVariable %142 Input +%144 = OpVariable %139 Input +%146 = OpVariable %83 Output +%150 = OpTypePointer StorageBuffer %16 +%162 = OpTypePointer Uniform %6 +%163 = OpTypePointer Uniform %7 +%173 = OpTypePointer StorageBuffer %15 +%199 = OpTypePointer Uniform %4 +%207 = OpVariable %139 Input +%209 = OpVariable %142 Input +%211 = OpVariable %139 Input +%213 = OpVariable %83 Output +%217 = OpTypePointer Uniform %17 +%238 = OpTypePointer Uniform %15 +%43 = OpFunction %5 None %44 +%41 = OpFunctionParameter %7 +%42 = OpFunctionParameter %4 +%40 = OpLabel +%45 = OpLoad %19 %36 +%46 = OpLoad %20 %38 +OpBranch %51 +%51 = OpLabel +%52 = OpCompositeExtract %5 %42 3 +%54 = OpFOrdLessThanEqual %53 %52 %47 +OpSelectionMerge %55 None +OpBranchConditional %54 %56 %55 %56 = OpLabel -%58 = OpCompositeConstruct %21 %50 %51 -%59 = OpCompositeExtract %5 %43 3 -%60 = OpFDiv %5 %49 %59 -%61 = OpVectorShuffle %21 %43 %43 0 1 -%62 = OpFMul %21 %61 %58 -%63 = OpVectorTimesScalar %21 %62 %60 -%64 = OpCompositeConstruct %21 %50 %50 -%65 = OpFAdd %21 %63 %64 -%66 = OpBitcast %13 %42 -%67 = OpCompositeExtract %5 %43 2 -%68 = OpFMul %5 %67 %60 -%70 = OpConvertSToF %5 %66 -%71 = OpCompositeConstruct %10 %65 %70 -%72 = OpSampledImage %69 %46 %47 -%73 = OpImageSampleDrefExplicitLod %5 %72 %71 %68 Lod %48 -OpReturnValue %73 +OpReturnValue %48 +%55 = OpLabel +%57 = OpCompositeConstruct %21 %49 %50 +%58 = OpCompositeExtract %5 %42 3 +%59 = OpFDiv %5 %48 %58 +%60 = OpVectorShuffle %21 %42 %42 0 1 +%61 = OpFMul %21 %60 %57 +%62 = OpVectorTimesScalar %21 %61 %59 +%63 = OpCompositeConstruct %21 %49 %49 +%64 = OpFAdd %21 %62 %63 +%65 = OpBitcast %13 %41 +%66 = OpCompositeExtract %5 %42 2 +%67 = OpFMul %5 %66 %59 +%69 = OpConvertSToF %5 %65 +%70 = OpCompositeConstruct %10 %64 %69 +%71 = OpSampledImage %68 %45 %46 +%72 = OpImageSampleDrefExplicitLod %5 %71 %70 %67 Lod %47 +OpReturnValue %72 OpFunctionEnd -%88 = OpFunction %2 None %89 -%77 = OpLabel -%74 = OpVariable %75 Function %76 -%80 = OpLoad %12 %78 -%82 = OpLoad %12 %81 -%92 = OpAccessChain %90 %25 %91 -%94 = OpAccessChain %93 %28 %91 -OpBranch %95 -%95 = OpLabel -%97 = OpAccessChain %96 %94 %91 -%98 = OpLoad %3 %97 -%99 = OpAccessChain %96 %94 %91 -%100 = OpLoad %3 %99 -%101 = OpConvertSToF %4 %80 -%102 = OpMatrixTimesVector %4 %100 %101 -%104 = OpCompositeExtract %4 %98 0 -%105 = OpVectorShuffle %10 %104 %104 0 1 2 -%106 = OpCompositeExtract %4 %98 1 -%107 = OpVectorShuffle %10 %106 %106 0 1 2 -%108 = OpCompositeExtract %4 %98 2 -%109 = OpVectorShuffle %10 %108 %108 0 1 2 -%110 = OpCompositeConstruct %14 %105 %107 %109 -%112 = OpVectorShuffle %111 %82 %82 0 1 2 -%113 = OpConvertSToF %10 %112 -%114 = OpMatrixTimesVector %10 %110 %113 -%116 = OpAccessChain %103 %74 %115 -OpStore %116 %114 -%119 = OpAccessChain %117 %74 %118 -OpStore %119 %102 -%120 = OpAccessChain %96 %92 %91 -%121 = OpLoad %3 %120 -%122 = OpMatrixTimesVector %4 %121 %102 -%123 = OpAccessChain %117 %74 %91 -OpStore %123 %122 -%124 = OpLoad %11 %74 -%125 = OpCompositeExtract %4 %124 0 -OpStore %83 %125 -%127 = OpAccessChain %126 %83 %115 -%128 = OpLoad %5 %127 -%129 = OpFNegate %5 %128 -OpStore %127 %129 -%130 = OpCompositeExtract %10 %124 1 -OpStore %85 %130 -%131 = OpCompositeExtract %4 %124 2 -OpStore %87 %131 +%87 = OpFunction %2 None %88 +%76 = OpLabel +%73 = OpVariable %74 Function %75 +%79 = OpLoad %12 %77 +%81 = OpLoad %12 %80 +%91 = OpAccessChain %89 %24 %90 +%93 = OpAccessChain %92 %27 %90 +OpBranch %94 +%94 = OpLabel +%96 = OpAccessChain %95 %93 %90 +%97 = OpLoad %3 %96 +%98 = OpAccessChain %95 %93 %90 +%99 = OpLoad %3 %98 +%100 = OpConvertSToF %4 %79 +%101 = OpMatrixTimesVector %4 %99 %100 +%103 = OpCompositeExtract %4 %97 0 +%104 = OpVectorShuffle %10 %103 %103 0 1 2 +%105 = OpCompositeExtract %4 %97 1 +%106 = OpVectorShuffle %10 %105 %105 0 1 2 +%107 = OpCompositeExtract %4 %97 2 +%108 = OpVectorShuffle %10 %107 %107 0 1 2 +%109 = OpCompositeConstruct %14 %104 %106 %108 +%111 = OpVectorShuffle %110 %81 %81 0 1 2 +%112 = OpConvertSToF %10 %111 +%113 = OpMatrixTimesVector %10 %109 %112 +%115 = OpAccessChain %102 %73 %114 +OpStore %115 %113 +%118 = OpAccessChain %116 %73 %117 +OpStore %118 %101 +%119 = OpAccessChain %95 %91 %90 +%120 = OpLoad %3 %119 +%121 = OpMatrixTimesVector %4 %120 %101 +%122 = OpAccessChain %116 %73 %90 +OpStore %122 %121 +%123 = OpLoad %11 %73 +%124 = OpCompositeExtract %4 %123 0 +OpStore %82 %124 +%126 = OpAccessChain %125 %82 %114 +%127 = OpLoad %5 %126 +%128 = OpFNegate %5 %127 +OpStore %126 %128 +%129 = OpCompositeExtract %10 %123 1 +OpStore %84 %129 +%130 = OpCompositeExtract %4 %123 2 +OpStore %86 %130 OpReturn OpFunctionEnd -%148 = OpFunction %2 None %89 -%137 = OpLabel -%132 = OpVariable %103 Function %133 -%134 = OpVariable %135 Function %136 -%141 = OpLoad %4 %139 -%144 = OpLoad %10 %142 -%146 = OpLoad %4 %145 -%138 = OpCompositeConstruct %11 %141 %144 %146 -%149 = OpAccessChain %90 %25 %91 -%150 = OpAccessChain %93 %28 %91 -%152 = OpAccessChain %151 %31 %91 -%153 = OpLoad %19 %37 -%154 = OpLoad %20 %39 -OpBranch %155 -%155 = OpLabel -%156 = OpCompositeExtract %10 %138 1 -%157 = OpExtInst %10 %1 Normalize %156 -OpStore %132 %24 -OpStore %134 %91 -OpBranch %158 -%158 = OpLabel -OpLoopMerge %159 %161 None -OpBranch %160 -%160 = OpLabel -%162 = OpLoad %7 %134 -%165 = OpAccessChain %164 %149 %115 %91 -%166 = OpLoad %7 %165 -%167 = OpExtInst %7 %1 UMin %166 %18 -%168 = OpULessThan %54 %162 %167 -OpSelectionMerge %169 None -OpBranchConditional %168 %169 %170 -%170 = OpLabel +%147 = OpFunction %2 None %88 +%136 = OpLabel +%131 = OpVariable %102 Function %132 +%133 = OpVariable %134 Function %135 +%140 = OpLoad %4 %138 +%143 = OpLoad %10 %141 +%145 = OpLoad %4 %144 +%137 = OpCompositeConstruct %11 %140 %143 %145 +%148 = OpAccessChain %89 %24 %90 +%149 = OpAccessChain %92 %27 %90 +%151 = OpAccessChain %150 %30 %90 +%152 = OpLoad %19 %36 +%153 = OpLoad %20 %38 +OpBranch %154 +%154 = OpLabel +%155 = OpCompositeExtract %10 %137 1 +%156 = OpExtInst %10 %1 Normalize %155 +OpStore %131 %23 +OpStore %133 %90 +OpBranch %157 +%157 = OpLabel +OpLoopMerge %158 %160 None OpBranch %159 +%159 = OpLabel +%161 = OpLoad %7 %133 +%164 = OpAccessChain %163 %148 %114 %90 +%165 = OpLoad %7 %164 +%166 = OpExtInst %7 %1 UMin %165 %18 +%167 = OpULessThan %53 %161 %166 +OpSelectionMerge %168 None +OpBranchConditional %167 %168 %169 %169 = OpLabel +OpBranch %158 +%168 = OpLabel +OpBranch %170 +%170 = OpLabel +%172 = OpLoad %7 %133 +%174 = OpAccessChain %173 %151 %172 +%175 = OpLoad %15 %174 +%176 = OpLoad %7 %133 +%177 = OpCompositeExtract %3 %175 0 +%178 = OpCompositeExtract %4 %137 2 +%179 = OpMatrixTimesVector %4 %177 %178 +%180 = OpFunctionCall %5 %43 %176 %179 +%181 = OpCompositeExtract %4 %175 1 +%182 = OpVectorShuffle %10 %181 %181 0 1 2 +%183 = OpCompositeExtract %4 %137 2 +%184 = OpVectorShuffle %10 %183 %183 0 1 2 +%185 = OpFSub %10 %182 %184 +%186 = OpExtInst %10 %1 Normalize %185 +%187 = OpDot %5 %156 %186 +%188 = OpExtInst %5 %1 FMax %47 %187 +%189 = OpFMul %5 %180 %188 +%190 = OpCompositeExtract %4 %175 2 +%191 = OpVectorShuffle %10 %190 %190 0 1 2 +%192 = OpVectorTimesScalar %10 %191 %189 +%193 = OpLoad %10 %131 +%194 = OpFAdd %10 %193 %192 +OpStore %131 %194 OpBranch %171 %171 = OpLabel -%173 = OpLoad %7 %134 -%175 = OpAccessChain %174 %152 %173 -%176 = OpLoad %15 %175 -%177 = OpLoad %7 %134 -%178 = OpCompositeExtract %3 %176 0 -%179 = OpCompositeExtract %4 %138 2 -%180 = OpMatrixTimesVector %4 %178 %179 -%181 = OpFunctionCall %5 %44 %177 %180 -%182 = OpCompositeExtract %4 %176 1 -%183 = OpVectorShuffle %10 %182 %182 0 1 2 -%184 = OpCompositeExtract %4 %138 2 -%185 = OpVectorShuffle %10 %184 %184 0 1 2 -%186 = OpFSub %10 %183 %185 -%187 = OpExtInst %10 %1 Normalize %186 -%188 = OpDot %5 %157 %187 -%189 = OpExtInst %5 %1 FMax %48 %188 -%190 = OpFMul %5 %181 %189 -%191 = OpCompositeExtract %4 %176 2 -%192 = OpVectorShuffle %10 %191 %191 0 1 2 -%193 = OpVectorTimesScalar %10 %192 %190 -%194 = OpLoad %10 %132 -%195 = OpFAdd %10 %194 %193 -OpStore %132 %195 -OpBranch %172 -%172 = OpLabel -OpBranch %161 -%161 = OpLabel -%196 = OpLoad %7 %134 -%197 = OpIAdd %7 %196 %115 -OpStore %134 %197 -OpBranch %158 -%159 = OpLabel -%198 = OpLoad %10 %132 -%199 = OpCompositeConstruct %4 %198 %49 -%201 = OpAccessChain %200 %150 %115 -%202 = OpLoad %4 %201 -%203 = OpFMul %4 %199 %202 -OpStore %147 %203 +OpBranch %160 +%160 = OpLabel +%195 = OpLoad %7 %133 +%196 = OpIAdd %7 %195 %114 +OpStore %133 %196 +OpBranch %157 +%158 = OpLabel +%197 = OpLoad %10 %131 +%198 = OpCompositeConstruct %4 %197 %48 +%200 = OpAccessChain %199 %149 %114 +%201 = OpLoad %4 %200 +%202 = OpFMul %4 %198 %201 +OpStore %146 %202 OpReturn OpFunctionEnd -%215 = OpFunction %2 None %89 -%206 = OpLabel -%204 = OpVariable %103 Function %133 -%205 = OpVariable %135 Function %136 -%209 = OpLoad %4 %208 -%211 = OpLoad %10 %210 -%213 = OpLoad %4 %212 -%207 = OpCompositeConstruct %11 %209 %211 %213 -%216 = OpAccessChain %90 %25 %91 -%217 = OpAccessChain %93 %28 %91 -%219 = OpAccessChain %218 %34 %91 -%220 = OpLoad %19 %37 -%221 = OpLoad %20 %39 -OpBranch %222 -%222 = OpLabel -%223 = OpCompositeExtract %10 %207 1 -%224 = OpExtInst %10 %1 Normalize %223 -OpStore %204 %24 -OpStore %205 %91 -OpBranch %225 -%225 = OpLabel -OpLoopMerge %226 %228 None -OpBranch %227 -%227 = OpLabel -%229 = OpLoad %7 %205 -%230 = OpAccessChain %164 %216 %115 %91 -%231 = OpLoad %7 %230 -%232 = OpExtInst %7 %1 UMin %231 %18 -%233 = OpULessThan %54 %229 %232 -OpSelectionMerge %234 None -OpBranchConditional %233 %234 %235 -%235 = OpLabel +%214 = OpFunction %2 None %88 +%205 = OpLabel +%203 = OpVariable %102 Function %132 +%204 = OpVariable %134 Function %135 +%208 = OpLoad %4 %207 +%210 = OpLoad %10 %209 +%212 = OpLoad %4 %211 +%206 = OpCompositeConstruct %11 %208 %210 %212 +%215 = OpAccessChain %89 %24 %90 +%216 = OpAccessChain %92 %27 %90 +%218 = OpAccessChain %217 %33 %90 +%219 = OpLoad %19 %36 +%220 = OpLoad %20 %38 +OpBranch %221 +%221 = OpLabel +%222 = OpCompositeExtract %10 %206 1 +%223 = OpExtInst %10 %1 Normalize %222 +OpStore %203 %23 +OpStore %204 %90 +OpBranch %224 +%224 = OpLabel +OpLoopMerge %225 %227 None OpBranch %226 +%226 = OpLabel +%228 = OpLoad %7 %204 +%229 = OpAccessChain %163 %215 %114 %90 +%230 = OpLoad %7 %229 +%231 = OpExtInst %7 %1 UMin %230 %18 +%232 = OpULessThan %53 %228 %231 +OpSelectionMerge %233 None +OpBranchConditional %232 %233 %234 %234 = OpLabel +OpBranch %225 +%233 = OpLabel +OpBranch %235 +%235 = OpLabel +%237 = OpLoad %7 %204 +%239 = OpAccessChain %238 %218 %237 +%240 = OpLoad %15 %239 +%241 = OpLoad %7 %204 +%242 = OpCompositeExtract %3 %240 0 +%243 = OpCompositeExtract %4 %206 2 +%244 = OpMatrixTimesVector %4 %242 %243 +%245 = OpFunctionCall %5 %43 %241 %244 +%246 = OpCompositeExtract %4 %240 1 +%247 = OpVectorShuffle %10 %246 %246 0 1 2 +%248 = OpCompositeExtract %4 %206 2 +%249 = OpVectorShuffle %10 %248 %248 0 1 2 +%250 = OpFSub %10 %247 %249 +%251 = OpExtInst %10 %1 Normalize %250 +%252 = OpDot %5 %223 %251 +%253 = OpExtInst %5 %1 FMax %47 %252 +%254 = OpFMul %5 %245 %253 +%255 = OpCompositeExtract %4 %240 2 +%256 = OpVectorShuffle %10 %255 %255 0 1 2 +%257 = OpVectorTimesScalar %10 %256 %254 +%258 = OpLoad %10 %203 +%259 = OpFAdd %10 %258 %257 +OpStore %203 %259 OpBranch %236 %236 = OpLabel -%238 = OpLoad %7 %205 -%240 = OpAccessChain %239 %219 %238 -%241 = OpLoad %15 %240 -%242 = OpLoad %7 %205 -%243 = OpCompositeExtract %3 %241 0 -%244 = OpCompositeExtract %4 %207 2 -%245 = OpMatrixTimesVector %4 %243 %244 -%246 = OpFunctionCall %5 %44 %242 %245 -%247 = OpCompositeExtract %4 %241 1 -%248 = OpVectorShuffle %10 %247 %247 0 1 2 -%249 = OpCompositeExtract %4 %207 2 -%250 = OpVectorShuffle %10 %249 %249 0 1 2 -%251 = OpFSub %10 %248 %250 -%252 = OpExtInst %10 %1 Normalize %251 -%253 = OpDot %5 %224 %252 -%254 = OpExtInst %5 %1 FMax %48 %253 -%255 = OpFMul %5 %246 %254 -%256 = OpCompositeExtract %4 %241 2 -%257 = OpVectorShuffle %10 %256 %256 0 1 2 -%258 = OpVectorTimesScalar %10 %257 %255 -%259 = OpLoad %10 %204 -%260 = OpFAdd %10 %259 %258 -OpStore %204 %260 -OpBranch %237 -%237 = OpLabel -OpBranch %228 -%228 = OpLabel -%261 = OpLoad %7 %205 -%262 = OpIAdd %7 %261 %115 -OpStore %205 %262 -OpBranch %225 -%226 = OpLabel -%263 = OpLoad %10 %204 -%264 = OpCompositeConstruct %4 %263 %49 -%265 = OpAccessChain %200 %217 %115 -%266 = OpLoad %4 %265 -%267 = OpFMul %4 %264 %266 -OpStore %214 %267 +OpBranch %227 +%227 = OpLabel +%260 = OpLoad %7 %204 +%261 = OpIAdd %7 %260 %114 +OpStore %204 %261 +OpBranch %224 +%225 = OpLabel +%262 = OpLoad %10 %203 +%263 = OpCompositeConstruct %4 %262 %48 +%264 = OpAccessChain %199 %216 %114 +%265 = OpLoad %4 %264 +%266 = OpFMul %4 %263 %265 +OpStore %213 %266 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/spv/workgroup-var-init.spvasm b/tests/out/spv/workgroup-var-init.spvasm index 905ed00bf3..399f63855c 100644 --- a/tests/out/spv/workgroup-var-init.spvasm +++ b/tests/out/spv/workgroup-var-init.spvasm @@ -1,31 +1,31 @@ ; SPIR-V ; Version: 1.1 ; Generator: rspirv -; Bound: 43 +; Bound: 41 OpCapability Shader OpExtension "SPV_KHR_storage_buffer_storage_class" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 -OpEntryPoint GLCompute %19 "main" %27 -OpExecutionMode %19 LocalSize 1 1 1 +OpEntryPoint GLCompute %17 "main" %25 +OpExecutionMode %17 LocalSize 1 1 1 OpMemberName %10 0 "arr" OpMemberName %10 1 "atom" OpMemberName %10 2 "atom_arr" OpName %10 "WStruct" -OpName %13 "w_mem" -OpName %15 "output" -OpName %19 "main" +OpName %11 "w_mem" +OpName %13 "output" +OpName %17 "main" OpDecorate %4 ArrayStride 4 OpDecorate %7 ArrayStride 4 OpDecorate %9 ArrayStride 32 OpMemberDecorate %10 0 Offset 0 OpMemberDecorate %10 1 Offset 2048 OpMemberDecorate %10 2 Offset 2052 -OpDecorate %15 DescriptorSet 0 -OpDecorate %15 Binding 0 -OpDecorate %16 Block -OpMemberDecorate %16 0 Offset 0 -OpDecorate %27 BuiltIn LocalInvocationId +OpDecorate %13 DescriptorSet 0 +OpDecorate %13 Binding 0 +OpDecorate %14 Block +OpMemberDecorate %14 0 Offset 0 +OpDecorate %25 BuiltIn LocalInvocationId %2 = OpTypeVoid %3 = OpTypeInt 32 0 %5 = OpConstant %3 512 @@ -35,45 +35,43 @@ OpDecorate %27 BuiltIn LocalInvocationId %7 = OpTypeArray %6 %8 %9 = OpTypeArray %7 %8 %10 = OpTypeStruct %4 %6 %9 -%11 = OpConstant %6 512 -%12 = OpConstant %6 8 -%14 = OpTypePointer Workgroup %10 -%13 = OpVariable %14 Workgroup -%16 = OpTypeStruct %4 -%17 = OpTypePointer StorageBuffer %16 -%15 = OpVariable %17 StorageBuffer -%20 = OpTypeFunction %2 -%21 = OpTypePointer StorageBuffer %4 -%22 = OpConstant %3 0 -%25 = OpConstantNull %10 -%26 = OpTypeVector %3 3 -%28 = OpTypePointer Input %26 -%27 = OpVariable %28 Input -%30 = OpConstantNull %26 -%32 = OpTypeBool -%31 = OpTypeVector %32 3 -%37 = OpConstant %3 2 -%38 = OpConstant %3 264 -%40 = OpTypePointer Workgroup %4 -%19 = OpFunction %2 None %20 -%18 = OpLabel -%23 = OpAccessChain %21 %15 %22 -OpBranch %24 -%24 = OpLabel -%29 = OpLoad %26 %27 -%33 = OpIEqual %31 %29 %30 -%34 = OpAll %32 %33 -OpSelectionMerge %35 None -OpBranchConditional %34 %36 %35 -%36 = OpLabel -OpStore %13 %25 -OpBranch %35 -%35 = OpLabel -OpControlBarrier %37 %37 %38 -OpBranch %39 -%39 = OpLabel -%41 = OpAccessChain %40 %13 %22 -%42 = OpLoad %4 %41 -OpStore %23 %42 +%12 = OpTypePointer Workgroup %10 +%11 = OpVariable %12 Workgroup +%14 = OpTypeStruct %4 +%15 = OpTypePointer StorageBuffer %14 +%13 = OpVariable %15 StorageBuffer +%18 = OpTypeFunction %2 +%19 = OpTypePointer StorageBuffer %4 +%20 = OpConstant %3 0 +%23 = OpConstantNull %10 +%24 = OpTypeVector %3 3 +%26 = OpTypePointer Input %24 +%25 = OpVariable %26 Input +%28 = OpConstantNull %24 +%30 = OpTypeBool +%29 = OpTypeVector %30 3 +%35 = OpConstant %3 2 +%36 = OpConstant %3 264 +%38 = OpTypePointer Workgroup %4 +%17 = OpFunction %2 None %18 +%16 = OpLabel +%21 = OpAccessChain %19 %13 %20 +OpBranch %22 +%22 = OpLabel +%27 = OpLoad %24 %25 +%31 = OpIEqual %29 %27 %28 +%32 = OpAll %30 %31 +OpSelectionMerge %33 None +OpBranchConditional %32 %34 %33 +%34 = OpLabel +OpStore %11 %23 +OpBranch %33 +%33 = OpLabel +OpControlBarrier %35 %35 %36 +OpBranch %37 +%37 = OpLabel +%39 = OpAccessChain %38 %11 %20 +%40 = OpLoad %4 %39 +OpStore %21 %40 OpReturn OpFunctionEnd \ No newline at end of file diff --git a/tests/out/wgsl/access.wgsl b/tests/out/wgsl/access.wgsl index ea64e80db3..c01c4247c5 100644 --- a/tests/out/wgsl/access.wgsl +++ b/tests/out/wgsl/access.wgsl @@ -45,31 +45,31 @@ fn test_matrix_within_struct_accesses() { idx = (_e3 - 1); let l0_ = baz.m; let l1_ = baz.m[0]; - let _e15 = idx; - let l2_ = baz.m[_e15]; + let _e14 = idx; + let l2_ = baz.m[_e14]; let l3_ = baz.m[0][1]; - let _e29 = idx; - let l4_ = baz.m[0][_e29]; - let _e34 = idx; - let l5_ = baz.m[_e34][1]; - let _e41 = idx; - let _e43 = idx; - let l6_ = baz.m[_e41][_e43]; + let _e25 = idx; + let l4_ = baz.m[0][_e25]; + let _e30 = idx; + let l5_ = baz.m[_e30][1]; + let _e36 = idx; + let _e38 = idx; + let l6_ = baz.m[_e36][_e38]; t = Baz(mat3x2(vec2(1.0), vec2(2.0), vec2(3.0))); - let _e56 = idx; - idx = (_e56 + 1); + let _e51 = idx; + idx = (_e51 + 1); t.m = mat3x2(vec2(6.0), vec2(5.0), vec2(4.0)); t.m[0] = vec2(9.0); - let _e72 = idx; - t.m[_e72] = vec2(90.0); + let _e66 = idx; + t.m[_e66] = vec2(90.0); t.m[0][1] = 10.0; + let _e76 = idx; + t.m[0][_e76] = 20.0; + let _e80 = idx; + t.m[_e80][1] = 30.0; let _e85 = idx; - t.m[0][_e85] = 20.0; - let _e89 = idx; - t.m[_e89][1] = 30.0; - let _e95 = idx; - let _e97 = idx; - t.m[_e95][_e97] = 40.0; + let _e87 = idx; + t.m[_e85][_e87] = 40.0; return; } @@ -83,32 +83,32 @@ fn test_matrix_within_array_within_struct_accesses() { let l0_1 = nested_mat_cx2_.am; let l1_1 = nested_mat_cx2_.am[0]; let l2_1 = nested_mat_cx2_.am[0][0]; - let _e24 = idx_1; - let l3_1 = nested_mat_cx2_.am[0][_e24]; + let _e20 = idx_1; + let l3_1 = nested_mat_cx2_.am[0][_e20]; let l4_1 = nested_mat_cx2_.am[0][0][1]; - let _e42 = idx_1; - let l5_1 = nested_mat_cx2_.am[0][0][_e42]; - let _e49 = idx_1; - let l6_1 = nested_mat_cx2_.am[0][_e49][1]; - let _e58 = idx_1; - let _e60 = idx_1; - let l7_ = nested_mat_cx2_.am[0][_e58][_e60]; + let _e33 = idx_1; + let l5_1 = nested_mat_cx2_.am[0][0][_e33]; + let _e39 = idx_1; + let l6_1 = nested_mat_cx2_.am[0][_e39][1]; + let _e46 = idx_1; + let _e48 = idx_1; + let l7_ = nested_mat_cx2_.am[0][_e46][_e48]; t_1 = MatCx2InArray(array, 2>()); - let _e67 = idx_1; - idx_1 = (_e67 + 1); + let _e55 = idx_1; + idx_1 = (_e55 + 1); t_1.am = array, 2>(); t_1.am[0] = mat4x2(vec2(8.0), vec2(7.0), vec2(6.0), vec2(5.0)); t_1.am[0][0] = vec2(9.0); - let _e93 = idx_1; - t_1.am[0][_e93] = vec2(90.0); + let _e77 = idx_1; + t_1.am[0][_e77] = vec2(90.0); t_1.am[0][0][1] = 10.0; - let _e110 = idx_1; - t_1.am[0][0][_e110] = 20.0; - let _e116 = idx_1; - t_1.am[0][_e116][1] = 30.0; - let _e124 = idx_1; - let _e126 = idx_1; - t_1.am[0][_e124][_e126] = 40.0; + let _e89 = idx_1; + t_1.am[0][0][_e89] = 20.0; + let _e94 = idx_1; + t_1.am[0][_e94][1] = 30.0; + let _e100 = idx_1; + let _e102 = idx_1; + t_1.am[0][_e100][_e102] = 40.0; return; } @@ -147,11 +147,11 @@ fn foo_vert(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4 { let a_1 = bar.data[(arrayLength((&bar.data)) - 2u)].value; let c = qux; let data_pointer = (&bar.data[0].value); - let _e34 = read_from_private((&foo)); + let _e33 = read_from_private((&foo)); c2_ = array(a_1, i32(b), 3, 4, 5); c2_[(vi + 1u)] = 42; let value = c2_[vi]; - let _e48 = test_arr_as_arg(array, 5>()); + let _e47 = test_arr_as_arg(array, 5>()); return vec4((_matrix * vec4(vec4(value))), 2.0); } diff --git a/tests/out/wgsl/atomicOps.wgsl b/tests/out/wgsl/atomicOps.wgsl index 934a7b7952..dcffe38e14 100644 --- a/tests/out/wgsl/atomicOps.wgsl +++ b/tests/out/wgsl/atomicOps.wgsl @@ -33,75 +33,75 @@ fn cs_main(@builtin(local_invocation_id) id: vec3) { let l6_ = atomicLoad((&workgroup_struct.atomic_scalar)); let l7_ = atomicLoad((&workgroup_struct.atomic_arr[1])); workgroupBarrier(); - let _e59 = atomicAdd((&storage_atomic_scalar), 1u); - let _e64 = atomicAdd((&storage_atomic_arr[1]), 1); - let _e68 = atomicAdd((&storage_struct.atomic_scalar), 1u); - let _e74 = atomicAdd((&storage_struct.atomic_arr[1]), 1); - let _e77 = atomicAdd((&workgroup_atomic_scalar), 1u); - let _e82 = atomicAdd((&workgroup_atomic_arr[1]), 1); - let _e86 = atomicAdd((&workgroup_struct.atomic_scalar), 1u); - let _e92 = atomicAdd((&workgroup_struct.atomic_arr[1]), 1); + let _e51 = atomicAdd((&storage_atomic_scalar), 1u); + let _e55 = atomicAdd((&storage_atomic_arr[1]), 1); + let _e59 = atomicAdd((&storage_struct.atomic_scalar), 1u); + let _e64 = atomicAdd((&storage_struct.atomic_arr[1]), 1); + let _e67 = atomicAdd((&workgroup_atomic_scalar), 1u); + let _e71 = atomicAdd((&workgroup_atomic_arr[1]), 1); + let _e75 = atomicAdd((&workgroup_struct.atomic_scalar), 1u); + let _e80 = atomicAdd((&workgroup_struct.atomic_arr[1]), 1); workgroupBarrier(); - let _e95 = atomicSub((&storage_atomic_scalar), 1u); - let _e100 = atomicSub((&storage_atomic_arr[1]), 1); - let _e104 = atomicSub((&storage_struct.atomic_scalar), 1u); - let _e110 = atomicSub((&storage_struct.atomic_arr[1]), 1); - let _e113 = atomicSub((&workgroup_atomic_scalar), 1u); - let _e118 = atomicSub((&workgroup_atomic_arr[1]), 1); - let _e122 = atomicSub((&workgroup_struct.atomic_scalar), 1u); - let _e128 = atomicSub((&workgroup_struct.atomic_arr[1]), 1); + let _e83 = atomicSub((&storage_atomic_scalar), 1u); + let _e87 = atomicSub((&storage_atomic_arr[1]), 1); + let _e91 = atomicSub((&storage_struct.atomic_scalar), 1u); + let _e96 = atomicSub((&storage_struct.atomic_arr[1]), 1); + let _e99 = atomicSub((&workgroup_atomic_scalar), 1u); + let _e103 = atomicSub((&workgroup_atomic_arr[1]), 1); + let _e107 = atomicSub((&workgroup_struct.atomic_scalar), 1u); + let _e112 = atomicSub((&workgroup_struct.atomic_arr[1]), 1); workgroupBarrier(); - let _e131 = atomicMax((&storage_atomic_scalar), 1u); - let _e136 = atomicMax((&storage_atomic_arr[1]), 1); - let _e140 = atomicMax((&storage_struct.atomic_scalar), 1u); - let _e146 = atomicMax((&storage_struct.atomic_arr[1]), 1); - let _e149 = atomicMax((&workgroup_atomic_scalar), 1u); - let _e154 = atomicMax((&workgroup_atomic_arr[1]), 1); - let _e158 = atomicMax((&workgroup_struct.atomic_scalar), 1u); - let _e164 = atomicMax((&workgroup_struct.atomic_arr[1]), 1); + let _e115 = atomicMax((&storage_atomic_scalar), 1u); + let _e119 = atomicMax((&storage_atomic_arr[1]), 1); + let _e123 = atomicMax((&storage_struct.atomic_scalar), 1u); + let _e128 = atomicMax((&storage_struct.atomic_arr[1]), 1); + let _e131 = atomicMax((&workgroup_atomic_scalar), 1u); + let _e135 = atomicMax((&workgroup_atomic_arr[1]), 1); + let _e139 = atomicMax((&workgroup_struct.atomic_scalar), 1u); + let _e144 = atomicMax((&workgroup_struct.atomic_arr[1]), 1); workgroupBarrier(); - let _e167 = atomicMin((&storage_atomic_scalar), 1u); - let _e172 = atomicMin((&storage_atomic_arr[1]), 1); - let _e176 = atomicMin((&storage_struct.atomic_scalar), 1u); - let _e182 = atomicMin((&storage_struct.atomic_arr[1]), 1); - let _e185 = atomicMin((&workgroup_atomic_scalar), 1u); - let _e190 = atomicMin((&workgroup_atomic_arr[1]), 1); - let _e194 = atomicMin((&workgroup_struct.atomic_scalar), 1u); - let _e200 = atomicMin((&workgroup_struct.atomic_arr[1]), 1); + let _e147 = atomicMin((&storage_atomic_scalar), 1u); + let _e151 = atomicMin((&storage_atomic_arr[1]), 1); + let _e155 = atomicMin((&storage_struct.atomic_scalar), 1u); + let _e160 = atomicMin((&storage_struct.atomic_arr[1]), 1); + let _e163 = atomicMin((&workgroup_atomic_scalar), 1u); + let _e167 = atomicMin((&workgroup_atomic_arr[1]), 1); + let _e171 = atomicMin((&workgroup_struct.atomic_scalar), 1u); + let _e176 = atomicMin((&workgroup_struct.atomic_arr[1]), 1); workgroupBarrier(); - let _e203 = atomicAnd((&storage_atomic_scalar), 1u); - let _e208 = atomicAnd((&storage_atomic_arr[1]), 1); - let _e212 = atomicAnd((&storage_struct.atomic_scalar), 1u); - let _e218 = atomicAnd((&storage_struct.atomic_arr[1]), 1); - let _e221 = atomicAnd((&workgroup_atomic_scalar), 1u); - let _e226 = atomicAnd((&workgroup_atomic_arr[1]), 1); - let _e230 = atomicAnd((&workgroup_struct.atomic_scalar), 1u); - let _e236 = atomicAnd((&workgroup_struct.atomic_arr[1]), 1); + let _e179 = atomicAnd((&storage_atomic_scalar), 1u); + let _e183 = atomicAnd((&storage_atomic_arr[1]), 1); + let _e187 = atomicAnd((&storage_struct.atomic_scalar), 1u); + let _e192 = atomicAnd((&storage_struct.atomic_arr[1]), 1); + let _e195 = atomicAnd((&workgroup_atomic_scalar), 1u); + let _e199 = atomicAnd((&workgroup_atomic_arr[1]), 1); + let _e203 = atomicAnd((&workgroup_struct.atomic_scalar), 1u); + let _e208 = atomicAnd((&workgroup_struct.atomic_arr[1]), 1); workgroupBarrier(); - let _e239 = atomicOr((&storage_atomic_scalar), 1u); - let _e244 = atomicOr((&storage_atomic_arr[1]), 1); - let _e248 = atomicOr((&storage_struct.atomic_scalar), 1u); - let _e254 = atomicOr((&storage_struct.atomic_arr[1]), 1); - let _e257 = atomicOr((&workgroup_atomic_scalar), 1u); - let _e262 = atomicOr((&workgroup_atomic_arr[1]), 1); - let _e266 = atomicOr((&workgroup_struct.atomic_scalar), 1u); - let _e272 = atomicOr((&workgroup_struct.atomic_arr[1]), 1); + let _e211 = atomicOr((&storage_atomic_scalar), 1u); + let _e215 = atomicOr((&storage_atomic_arr[1]), 1); + let _e219 = atomicOr((&storage_struct.atomic_scalar), 1u); + let _e224 = atomicOr((&storage_struct.atomic_arr[1]), 1); + let _e227 = atomicOr((&workgroup_atomic_scalar), 1u); + let _e231 = atomicOr((&workgroup_atomic_arr[1]), 1); + let _e235 = atomicOr((&workgroup_struct.atomic_scalar), 1u); + let _e240 = atomicOr((&workgroup_struct.atomic_arr[1]), 1); workgroupBarrier(); - let _e275 = atomicXor((&storage_atomic_scalar), 1u); - let _e280 = atomicXor((&storage_atomic_arr[1]), 1); - let _e284 = atomicXor((&storage_struct.atomic_scalar), 1u); - let _e290 = atomicXor((&storage_struct.atomic_arr[1]), 1); - let _e293 = atomicXor((&workgroup_atomic_scalar), 1u); - let _e298 = atomicXor((&workgroup_atomic_arr[1]), 1); - let _e302 = atomicXor((&workgroup_struct.atomic_scalar), 1u); - let _e308 = atomicXor((&workgroup_struct.atomic_arr[1]), 1); - let _e311 = atomicExchange((&storage_atomic_scalar), 1u); - let _e316 = atomicExchange((&storage_atomic_arr[1]), 1); - let _e320 = atomicExchange((&storage_struct.atomic_scalar), 1u); - let _e326 = atomicExchange((&storage_struct.atomic_arr[1]), 1); - let _e329 = atomicExchange((&workgroup_atomic_scalar), 1u); - let _e334 = atomicExchange((&workgroup_atomic_arr[1]), 1); - let _e338 = atomicExchange((&workgroup_struct.atomic_scalar), 1u); - let _e344 = atomicExchange((&workgroup_struct.atomic_arr[1]), 1); + let _e243 = atomicXor((&storage_atomic_scalar), 1u); + let _e247 = atomicXor((&storage_atomic_arr[1]), 1); + let _e251 = atomicXor((&storage_struct.atomic_scalar), 1u); + let _e256 = atomicXor((&storage_struct.atomic_arr[1]), 1); + let _e259 = atomicXor((&workgroup_atomic_scalar), 1u); + let _e263 = atomicXor((&workgroup_atomic_arr[1]), 1); + let _e267 = atomicXor((&workgroup_struct.atomic_scalar), 1u); + let _e272 = atomicXor((&workgroup_struct.atomic_arr[1]), 1); + let _e275 = atomicExchange((&storage_atomic_scalar), 1u); + let _e279 = atomicExchange((&storage_atomic_arr[1]), 1); + let _e283 = atomicExchange((&storage_struct.atomic_scalar), 1u); + let _e288 = atomicExchange((&storage_struct.atomic_arr[1]), 1); + let _e291 = atomicExchange((&workgroup_atomic_scalar), 1u); + let _e295 = atomicExchange((&workgroup_atomic_arr[1]), 1); + let _e299 = atomicExchange((&workgroup_struct.atomic_scalar), 1u); + let _e304 = atomicExchange((&workgroup_struct.atomic_arr[1]), 1); return; } diff --git a/tests/out/wgsl/binding-arrays.dynamic.wgsl b/tests/out/wgsl/binding-arrays.dynamic.wgsl index bccabd060d..3a3b116643 100644 --- a/tests/out/wgsl/binding-arrays.dynamic.wgsl +++ b/tests/out/wgsl/binding-arrays.dynamic.wgsl @@ -5,8 +5,8 @@ var global_1: binding_array; var global_2: vec4; fn function() { - let _e9 = textureSampleLevel(global[1], global_1[1], vec2(0.5, 0.5), 0.0); - global_2 = _e9; + let _e8 = textureSampleLevel(global[1], global_1[1], vec2(0.5, 0.5), 0.0); + global_2 = _e8; return; } diff --git a/tests/out/wgsl/binding-arrays.static.wgsl b/tests/out/wgsl/binding-arrays.static.wgsl index e9dec5bf13..ff969359f0 100644 --- a/tests/out/wgsl/binding-arrays.static.wgsl +++ b/tests/out/wgsl/binding-arrays.static.wgsl @@ -5,8 +5,8 @@ var global_1: binding_array; var global_2: vec4; fn function() { - let _e10 = textureSampleLevel(global[1], global_1[1], vec2(0.5, 0.5), 0.0); - global_2 = _e10; + let _e8 = textureSampleLevel(global[1], global_1[1], vec2(0.5, 0.5), 0.0); + global_2 = _e8; return; } diff --git a/tests/out/wgsl/binding-arrays.wgsl b/tests/out/wgsl/binding-arrays.wgsl index 878fb2c91d..e9513c725d 100644 --- a/tests/out/wgsl/binding-arrays.wgsl +++ b/tests/out/wgsl/binding-arrays.wgsl @@ -40,133 +40,133 @@ fn main(fragment_in: FragmentIn) -> @location(0) vec4 { v4_ = vec4(0.0); let uv = vec2(0.0); let pix = vec2(0); - let _e22 = textureDimensions(texture_array_unbounded[0]); - let _e23 = u2_; - u2_ = (_e23 + _e22); - let _e27 = textureDimensions(texture_array_unbounded[uniform_index]); - let _e28 = u2_; - u2_ = (_e28 + _e27); - let _e32 = textureDimensions(texture_array_unbounded[non_uniform_index]); - let _e33 = u2_; - u2_ = (_e33 + _e32); - let _e42 = textureGather(0, texture_array_bounded[0], samp[0], uv); - let _e43 = v4_; - v4_ = (_e43 + _e42); - let _e50 = textureGather(0, texture_array_bounded[uniform_index], samp[uniform_index], uv); - let _e51 = v4_; - v4_ = (_e51 + _e50); - let _e58 = textureGather(0, texture_array_bounded[non_uniform_index], samp[non_uniform_index], uv); - let _e59 = v4_; - v4_ = (_e59 + _e58); - let _e68 = textureGatherCompare(texture_array_depth[0], samp_comp[0], uv, 0.0); + let _e21 = textureDimensions(texture_array_unbounded[0]); + let _e22 = u2_; + u2_ = (_e22 + _e21); + let _e26 = textureDimensions(texture_array_unbounded[uniform_index]); + let _e27 = u2_; + u2_ = (_e27 + _e26); + let _e31 = textureDimensions(texture_array_unbounded[non_uniform_index]); + let _e32 = u2_; + u2_ = (_e32 + _e31); + let _e38 = textureGather(0, texture_array_bounded[0], samp[0], uv); + let _e39 = v4_; + v4_ = (_e39 + _e38); + let _e45 = textureGather(0, texture_array_bounded[uniform_index], samp[uniform_index], uv); + let _e46 = v4_; + v4_ = (_e46 + _e45); + let _e52 = textureGather(0, texture_array_bounded[non_uniform_index], samp[non_uniform_index], uv); + let _e53 = v4_; + v4_ = (_e53 + _e52); + let _e60 = textureGatherCompare(texture_array_depth[0], samp_comp[0], uv, 0.0); + let _e61 = v4_; + v4_ = (_e61 + _e60); + let _e68 = textureGatherCompare(texture_array_depth[uniform_index], samp_comp[uniform_index], uv, 0.0); let _e69 = v4_; v4_ = (_e69 + _e68); - let _e76 = textureGatherCompare(texture_array_depth[uniform_index], samp_comp[uniform_index], uv, 0.0); + let _e76 = textureGatherCompare(texture_array_depth[non_uniform_index], samp_comp[non_uniform_index], uv, 0.0); let _e77 = v4_; v4_ = (_e77 + _e76); - let _e84 = textureGatherCompare(texture_array_depth[non_uniform_index], samp_comp[non_uniform_index], uv, 0.0); - let _e85 = v4_; - v4_ = (_e85 + _e84); - let _e91 = textureLoad(texture_array_unbounded[0], pix, 0); - let _e92 = v4_; - v4_ = (_e92 + _e91); - let _e97 = textureLoad(texture_array_unbounded[uniform_index], pix, 0); - let _e98 = v4_; - v4_ = (_e98 + _e97); - let _e103 = textureLoad(texture_array_unbounded[non_uniform_index], pix, 0); - let _e104 = v4_; - v4_ = (_e104 + _e103); - let _e109 = textureNumLayers(texture_array_2darray[0]); + let _e82 = textureLoad(texture_array_unbounded[0], pix, 0); + let _e83 = v4_; + v4_ = (_e83 + _e82); + let _e88 = textureLoad(texture_array_unbounded[uniform_index], pix, 0); + let _e89 = v4_; + v4_ = (_e89 + _e88); + let _e94 = textureLoad(texture_array_unbounded[non_uniform_index], pix, 0); + let _e95 = v4_; + v4_ = (_e95 + _e94); + let _e99 = textureNumLayers(texture_array_2darray[0]); + let _e100 = u1_; + u1_ = (_e100 + _e99); + let _e104 = textureNumLayers(texture_array_2darray[uniform_index]); + let _e105 = u1_; + u1_ = (_e105 + _e104); + let _e109 = textureNumLayers(texture_array_2darray[non_uniform_index]); let _e110 = u1_; u1_ = (_e110 + _e109); - let _e114 = textureNumLayers(texture_array_2darray[uniform_index]); + let _e114 = textureNumLevels(texture_array_bounded[0]); let _e115 = u1_; u1_ = (_e115 + _e114); - let _e119 = textureNumLayers(texture_array_2darray[non_uniform_index]); + let _e119 = textureNumLevels(texture_array_bounded[uniform_index]); let _e120 = u1_; u1_ = (_e120 + _e119); - let _e125 = textureNumLevels(texture_array_bounded[0]); - let _e126 = u1_; - u1_ = (_e126 + _e125); - let _e130 = textureNumLevels(texture_array_bounded[uniform_index]); - let _e131 = u1_; - u1_ = (_e131 + _e130); - let _e135 = textureNumLevels(texture_array_bounded[non_uniform_index]); - let _e136 = u1_; - u1_ = (_e136 + _e135); - let _e141 = textureNumSamples(texture_array_multisampled[0]); - let _e142 = u1_; - u1_ = (_e142 + _e141); - let _e146 = textureNumSamples(texture_array_multisampled[uniform_index]); - let _e147 = u1_; - u1_ = (_e147 + _e146); - let _e151 = textureNumSamples(texture_array_multisampled[non_uniform_index]); - let _e152 = u1_; - u1_ = (_e152 + _e151); - let _e160 = textureSample(texture_array_bounded[0], samp[0], uv); + let _e124 = textureNumLevels(texture_array_bounded[non_uniform_index]); + let _e125 = u1_; + u1_ = (_e125 + _e124); + let _e129 = textureNumSamples(texture_array_multisampled[0]); + let _e130 = u1_; + u1_ = (_e130 + _e129); + let _e134 = textureNumSamples(texture_array_multisampled[uniform_index]); + let _e135 = u1_; + u1_ = (_e135 + _e134); + let _e139 = textureNumSamples(texture_array_multisampled[non_uniform_index]); + let _e140 = u1_; + u1_ = (_e140 + _e139); + let _e146 = textureSample(texture_array_bounded[0], samp[0], uv); + let _e147 = v4_; + v4_ = (_e147 + _e146); + let _e153 = textureSample(texture_array_bounded[uniform_index], samp[uniform_index], uv); + let _e154 = v4_; + v4_ = (_e154 + _e153); + let _e160 = textureSample(texture_array_bounded[non_uniform_index], samp[non_uniform_index], uv); let _e161 = v4_; v4_ = (_e161 + _e160); - let _e167 = textureSample(texture_array_bounded[uniform_index], samp[uniform_index], uv); - let _e168 = v4_; - v4_ = (_e168 + _e167); - let _e174 = textureSample(texture_array_bounded[non_uniform_index], samp[non_uniform_index], uv); - let _e175 = v4_; - v4_ = (_e175 + _e174); - let _e184 = textureSampleBias(texture_array_bounded[0], samp[0], uv, 0.0); + let _e168 = textureSampleBias(texture_array_bounded[0], samp[0], uv, 0.0); + let _e169 = v4_; + v4_ = (_e169 + _e168); + let _e176 = textureSampleBias(texture_array_bounded[uniform_index], samp[uniform_index], uv, 0.0); + let _e177 = v4_; + v4_ = (_e177 + _e176); + let _e184 = textureSampleBias(texture_array_bounded[non_uniform_index], samp[non_uniform_index], uv, 0.0); let _e185 = v4_; v4_ = (_e185 + _e184); - let _e192 = textureSampleBias(texture_array_bounded[uniform_index], samp[uniform_index], uv, 0.0); - let _e193 = v4_; - v4_ = (_e193 + _e192); - let _e200 = textureSampleBias(texture_array_bounded[non_uniform_index], samp[non_uniform_index], uv, 0.0); - let _e201 = v4_; - v4_ = (_e201 + _e200); - let _e210 = textureSampleCompare(texture_array_depth[0], samp_comp[0], uv, 0.0); - let _e211 = v1_; - v1_ = (_e211 + _e210); - let _e218 = textureSampleCompare(texture_array_depth[uniform_index], samp_comp[uniform_index], uv, 0.0); - let _e219 = v1_; - v1_ = (_e219 + _e218); - let _e226 = textureSampleCompare(texture_array_depth[non_uniform_index], samp_comp[non_uniform_index], uv, 0.0); - let _e227 = v1_; - v1_ = (_e227 + _e226); - let _e236 = textureSampleCompareLevel(texture_array_depth[0], samp_comp[0], uv, 0.0); - let _e237 = v1_; - v1_ = (_e237 + _e236); - let _e244 = textureSampleCompareLevel(texture_array_depth[uniform_index], samp_comp[uniform_index], uv, 0.0); - let _e245 = v1_; - v1_ = (_e245 + _e244); - let _e252 = textureSampleCompareLevel(texture_array_depth[non_uniform_index], samp_comp[non_uniform_index], uv, 0.0); - let _e253 = v1_; - v1_ = (_e253 + _e252); - let _e261 = textureSampleGrad(texture_array_bounded[0], samp[0], uv, uv, uv); + let _e192 = textureSampleCompare(texture_array_depth[0], samp_comp[0], uv, 0.0); + let _e193 = v1_; + v1_ = (_e193 + _e192); + let _e200 = textureSampleCompare(texture_array_depth[uniform_index], samp_comp[uniform_index], uv, 0.0); + let _e201 = v1_; + v1_ = (_e201 + _e200); + let _e208 = textureSampleCompare(texture_array_depth[non_uniform_index], samp_comp[non_uniform_index], uv, 0.0); + let _e209 = v1_; + v1_ = (_e209 + _e208); + let _e216 = textureSampleCompareLevel(texture_array_depth[0], samp_comp[0], uv, 0.0); + let _e217 = v1_; + v1_ = (_e217 + _e216); + let _e224 = textureSampleCompareLevel(texture_array_depth[uniform_index], samp_comp[uniform_index], uv, 0.0); + let _e225 = v1_; + v1_ = (_e225 + _e224); + let _e232 = textureSampleCompareLevel(texture_array_depth[non_uniform_index], samp_comp[non_uniform_index], uv, 0.0); + let _e233 = v1_; + v1_ = (_e233 + _e232); + let _e239 = textureSampleGrad(texture_array_bounded[0], samp[0], uv, uv, uv); + let _e240 = v4_; + v4_ = (_e240 + _e239); + let _e246 = textureSampleGrad(texture_array_bounded[uniform_index], samp[uniform_index], uv, uv, uv); + let _e247 = v4_; + v4_ = (_e247 + _e246); + let _e253 = textureSampleGrad(texture_array_bounded[non_uniform_index], samp[non_uniform_index], uv, uv, uv); + let _e254 = v4_; + v4_ = (_e254 + _e253); + let _e261 = textureSampleLevel(texture_array_bounded[0], samp[0], uv, 0.0); let _e262 = v4_; v4_ = (_e262 + _e261); - let _e268 = textureSampleGrad(texture_array_bounded[uniform_index], samp[uniform_index], uv, uv, uv); - let _e269 = v4_; - v4_ = (_e269 + _e268); - let _e275 = textureSampleGrad(texture_array_bounded[non_uniform_index], samp[non_uniform_index], uv, uv, uv); - let _e276 = v4_; - v4_ = (_e276 + _e275); - let _e285 = textureSampleLevel(texture_array_bounded[0], samp[0], uv, 0.0); - let _e286 = v4_; - v4_ = (_e286 + _e285); - let _e293 = textureSampleLevel(texture_array_bounded[uniform_index], samp[uniform_index], uv, 0.0); + let _e269 = textureSampleLevel(texture_array_bounded[uniform_index], samp[uniform_index], uv, 0.0); + let _e270 = v4_; + v4_ = (_e270 + _e269); + let _e277 = textureSampleLevel(texture_array_bounded[non_uniform_index], samp[non_uniform_index], uv, 0.0); + let _e278 = v4_; + v4_ = (_e278 + _e277); + let _e282 = v4_; + textureStore(texture_array_storage[0], pix, _e282); + let _e285 = v4_; + textureStore(texture_array_storage[uniform_index], pix, _e285); + let _e288 = v4_; + textureStore(texture_array_storage[non_uniform_index], pix, _e288); + let _e289 = u2_; + let _e290 = u1_; + let v2_ = vec2((_e289 + vec2(_e290))); let _e294 = v4_; - v4_ = (_e294 + _e293); - let _e301 = textureSampleLevel(texture_array_bounded[non_uniform_index], samp[non_uniform_index], uv, 0.0); - let _e302 = v4_; - v4_ = (_e302 + _e301); - let _e307 = v4_; - textureStore(texture_array_storage[0], pix, _e307); - let _e310 = v4_; - textureStore(texture_array_storage[uniform_index], pix, _e310); - let _e313 = v4_; - textureStore(texture_array_storage[non_uniform_index], pix, _e313); - let _e314 = u2_; - let _e315 = u1_; - let v2_ = vec2((_e314 + vec2(_e315))); - let _e319 = v4_; - let _e326 = v1_; - return ((_e319 + vec4(v2_.x, v2_.y, v2_.x, v2_.y)) + vec4(_e326)); + let _e301 = v1_; + return ((_e294 + vec4(v2_.x, v2_.y, v2_.x, v2_.y)) + vec4(_e301)); } diff --git a/tests/out/wgsl/binding-buffer-arrays.wgsl b/tests/out/wgsl/binding-buffer-arrays.wgsl index 4a36faa399..d28237d758 100644 --- a/tests/out/wgsl/binding-buffer-arrays.wgsl +++ b/tests/out/wgsl/binding-buffer-arrays.wgsl @@ -22,15 +22,15 @@ fn main(fragment_in: FragmentIn) -> @location(0) @interpolate(flat) u32 { let uniform_index = uni.index; let non_uniform_index = fragment_in.index; u1_ = 0u; - let _e11 = storage_array[0].x; - let _e12 = u1_; - u1_ = (_e12 + _e11); - let _e17 = storage_array[uniform_index].x; - let _e18 = u1_; - u1_ = (_e18 + _e17); - let _e23 = storage_array[non_uniform_index].x; - let _e24 = u1_; - u1_ = (_e24 + _e23); - let _e26 = u1_; - return _e26; + let _e10 = storage_array[0].x; + let _e11 = u1_; + u1_ = (_e11 + _e10); + let _e16 = storage_array[uniform_index].x; + let _e17 = u1_; + u1_ = (_e17 + _e16); + let _e22 = storage_array[non_uniform_index].x; + let _e23 = u1_; + u1_ = (_e23 + _e22); + let _e25 = u1_; + return _e25; } diff --git a/tests/out/wgsl/do-while.wgsl b/tests/out/wgsl/do-while.wgsl index 50ed369f49..0b7e3afbcc 100644 --- a/tests/out/wgsl/do-while.wgsl +++ b/tests/out/wgsl/do-while.wgsl @@ -2,8 +2,8 @@ fn fb1_(cond: ptr) { loop { continue; continuing { - let _e2 = (*cond); - break if !(_e2); + let _e1 = (*cond); + break if !(_e1); } } return; diff --git a/tests/out/wgsl/empty-global-name.wgsl b/tests/out/wgsl/empty-global-name.wgsl index 11aa6b96e8..5114003beb 100644 --- a/tests/out/wgsl/empty-global-name.wgsl +++ b/tests/out/wgsl/empty-global-name.wgsl @@ -6,8 +6,8 @@ struct type_1 { var unnamed: type_1; fn function() { - let _e4 = unnamed.member; - unnamed.member = (_e4 + 1); + let _e3 = unnamed.member; + unnamed.member = (_e3 + 1); return; } diff --git a/tests/out/wgsl/globals.wgsl b/tests/out/wgsl/globals.wgsl index 3cd484487f..af72c0cb81 100644 --- a/tests/out/wgsl/globals.wgsl +++ b/tests/out/wgsl/globals.wgsl @@ -33,8 +33,8 @@ fn test_msl_packed_vec3_() { idx = 1; alignment.v3_.x = 1.0; alignment.v3_.x = 2.0; - let _e17 = idx; - alignment.v3_[_e17] = 3.0; + let _e16 = idx; + alignment.v3_[_e16] = 3.0; let data = alignment; let l0_ = data.v3_; let l1_ = data.v3_.zx; @@ -51,20 +51,20 @@ fn main() { var at: bool; test_msl_packed_vec3_(); - let _e8 = global_nested_arrays_of_matrices_4x2_[0][0]; - let _e16 = global_nested_arrays_of_matrices_2x4_[0][0][0]; - wg[7] = (_e8 * _e16).x; - let _e23 = global_mat; - let _e25 = global_vec; - wg[6] = (_e23 * _e25).x; - let _e35 = dummy[1].y; - wg[5] = _e35; - let _e43 = float_vecs[0].w; - wg[4] = _e43; - let _e49 = alignment.v1_; - wg[3] = _e49; - let _e56 = alignment.v3_.x; - wg[2] = _e56; + let _e5 = global_nested_arrays_of_matrices_4x2_[0][0]; + let _e10 = global_nested_arrays_of_matrices_2x4_[0][0][0]; + wg[7] = (_e5 * _e10).x; + let _e16 = global_mat; + let _e18 = global_vec; + wg[6] = (_e16 * _e18).x; + let _e26 = dummy[1].y; + wg[5] = _e26; + let _e32 = float_vecs[0].w; + wg[4] = _e32; + let _e37 = alignment.v1_; + wg[3] = _e37; + let _e43 = alignment.v3_.x; + wg[2] = _e43; alignment.v1_ = 4.0; wg[1] = f32(arrayLength((&dummy))); atomicStore((&at_1), 2u); diff --git a/tests/out/wgsl/operators.wgsl b/tests/out/wgsl/operators.wgsl index 3fb0846bf3..f444c6db0b 100644 --- a/tests/out/wgsl/operators.wgsl +++ b/tests/out/wgsl/operators.wgsl @@ -223,10 +223,10 @@ fn assignment() { let _e36 = a_1; a_1 = (_e36 - 1); vec0_ = vec3(); - let _e43 = vec0_.y; - vec0_.y = (_e43 + 1); - let _e48 = vec0_.y; - vec0_.y = (_e48 - 1); + let _e42 = vec0_.y; + vec0_.y = (_e42 + 1); + let _e46 = vec0_.y; + vec0_.y = (_e46 - 1); return; } diff --git a/tests/out/wgsl/quad-vert.wgsl b/tests/out/wgsl/quad-vert.wgsl index 72da615ccb..df7c6d0001 100644 --- a/tests/out/wgsl/quad-vert.wgsl +++ b/tests/out/wgsl/quad-vert.wgsl @@ -16,10 +16,10 @@ var perVertexStruct: gl_PerVertex = gl_PerVertex(vec4(0.0, 0.0, 0. var a_pos_1: vec2; fn main_1() { - let _e8 = a_uv_1; - v_uv = _e8; - let _e9 = a_pos_1; - perVertexStruct.gl_Position = vec4(_e9.x, _e9.y, 0.0, 1.0); + let _e6 = a_uv_1; + v_uv = _e6; + let _e7 = a_pos_1; + perVertexStruct.gl_Position = vec4(_e7.x, _e7.y, 0.0, 1.0); return; } diff --git a/tests/snapshots.rs b/tests/snapshots.rs index dce0a7edf9..4dcf1dd4d3 100644 --- a/tests/snapshots.rs +++ b/tests/snapshots.rs @@ -89,7 +89,12 @@ struct Parameters { } #[allow(unused_variables)] -fn check_targets(module: &naga::Module, name: &str, targets: Targets, source_code: Option<&str>) { +fn check_targets( + module: &mut naga::Module, + name: &str, + targets: Targets, + source_code: Option<&str>, +) { let root = env!("CARGO_MANIFEST_DIR"); let filepath = format!("{root}/{BASE_DIR_IN}/{name}.param.ron"); let params = match fs::read_to_string(&filepath) { @@ -120,6 +125,26 @@ fn check_targets(module: &naga::Module, name: &str, targets: Targets, source_cod .validate(module) .expect(&format!("Naga module validation failed on test '{name}'")); + #[cfg(feature = "compact")] + let info = { + naga::compact::compact(module); + + #[cfg(feature = "serialize")] + { + if targets.contains(Targets::IR) { + let config = ron::ser::PrettyConfig::default().new_line("\n".to_string()); + let string = ron::ser::to_string_pretty(module, config).unwrap(); + fs::write(dest.join(format!("ir/{name}.compact.ron")), string).unwrap(); + } + } + + naga::valid::Validator::new(naga::valid::ValidationFlags::all(), capabilities) + .validate(module) + .expect(&format!( + "Post-compaction module validation failed on test '{name}'" + )) + }; + #[cfg(feature = "serialize")] { if targets.contains(Targets::ANALYSIS) { @@ -284,6 +309,7 @@ fn write_output_spv_inner( ) { use naga::back::spv; use rspirv::binary::Disassemble; + println!("Writing SPIR-V {}", path); let spv = spv::write_vec(module, info, options, pipeline_options).unwrap(); let dis = rspirv::dr::load_words(spv) .expect("Produced invalid SPIR-V") @@ -624,7 +650,7 @@ fn convert_wgsl() { let file = fs::read_to_string(format!("{root}/{BASE_DIR_IN}/{name}.wgsl")) .expect("Couldn't find wgsl file"); match naga::front::wgsl::parse_str(&file) { - Ok(module) => check_targets(&module, name, targets, None), + Ok(mut module) => check_targets(&mut module, name, targets, None), Err(e) => panic!("{}", e.emit_to_string(&file)), } } @@ -641,7 +667,7 @@ fn convert_wgsl() { let file = fs::read_to_string(format!("{root}/{BASE_DIR_IN}/{name}.wgsl")) .expect("Couldn't find wgsl file"); match naga::front::wgsl::parse_str(&file) { - Ok(module) => check_targets(&module, name, targets, Some(&file)), + Ok(mut module) => check_targets(&mut module, name, targets, Some(&file)), Err(e) => panic!("{}", e.emit_to_string(&file)), } } @@ -655,7 +681,7 @@ fn convert_spv(name: &str, adjust_coordinate_space: bool, targets: Targets) { let root = env!("CARGO_MANIFEST_DIR"); println!("Processing '{name}'"); - let module = naga::front::spv::parse_u8_slice( + let mut module = naga::front::spv::parse_u8_slice( &fs::read(format!("{root}/{BASE_DIR_IN}/spv/{name}.spv")).expect("Couldn't find spv file"), &naga::front::spv::Options { adjust_coordinate_space, @@ -664,7 +690,7 @@ fn convert_spv(name: &str, adjust_coordinate_space: bool, targets: Targets) { }, ) .unwrap(); - check_targets(&module, name, targets, None); + check_targets(&mut module, name, targets, None); naga::valid::Validator::new( naga::valid::ValidationFlags::all(), naga::valid::Capabilities::default(), @@ -709,7 +735,7 @@ fn convert_glsl_variations_check() { let file = fs::read_to_string(format!("{root}/{BASE_DIR_IN}/variations.glsl")) .expect("Couldn't find glsl file"); let mut parser = naga::front::glsl::Frontend::default(); - let module = parser + let mut module = parser .parse( &naga::front::glsl::Options { stage: naga::ShaderStage::Fragment, @@ -718,7 +744,7 @@ fn convert_glsl_variations_check() { &file, ) .unwrap(); - check_targets(&module, "variations-glsl", Targets::GLSL, None); + check_targets(&mut module, "variations-glsl", Targets::GLSL, None); } #[cfg(feature = "glsl-in")]