diff --git a/src/proc/mod.rs b/src/proc/mod.rs index c1eea6a2aa..5e8a2550c4 100644 --- a/src/proc/mod.rs +++ b/src/proc/mod.rs @@ -8,7 +8,7 @@ mod typifier; pub use layouter::{Alignment, Layouter}; pub use namer::{EntryPointIndex, NameKey, Namer}; pub use terminator::ensure_block_returns; -pub use typifier::{ResolveContext, ResolveError, Typifier, TypifyError}; +pub use typifier::{ResolveContext, ResolveError, TypeResolution, Typifier, TypifyError}; impl From for super::ScalarKind { fn from(format: super::StorageFormat) -> Self { diff --git a/src/proc/typifier.rs b/src/proc/typifier.rs index e849c31887..f1a07a3746 100644 --- a/src/proc/typifier.rs +++ b/src/proc/typifier.rs @@ -3,18 +3,36 @@ use crate::arena::{Arena, Handle}; use thiserror::Error; #[derive(Debug, PartialEq)] -enum Resolution { +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +pub enum TypeResolution { Handle(Handle), Value(crate::TypeInner), } +impl TypeResolution { + pub fn handle(&self) -> Option> { + match *self { + Self::Handle(handle) => Some(handle), + Self::Value(_) => None, + } + } + + pub fn inner_with<'a>(&'a self, arena: &'a Arena) -> &'a crate::TypeInner { + match *self { + Self::Handle(handle) => &arena[handle].inner, + Self::Value(ref inner) => inner, + } + } +} + // Clone is only implemented for numeric variants of `TypeInner`. -impl Clone for Resolution { +impl Clone for TypeResolution { fn clone(&self) -> Self { use crate::TypeInner as Ti; match *self { - Resolution::Handle(handle) => Resolution::Handle(handle), - Resolution::Value(ref v) => Resolution::Value(match *v { + Self::Handle(handle) => Self::Handle(handle), + Self::Value(ref v) => Self::Value(match *v { Ti::Scalar { kind, width } => Ti::Scalar { kind, width }, Ti::Vector { size, kind, width } => Ti::Vector { size, kind, width }, Ti::Matrix { @@ -47,7 +65,7 @@ impl Clone for Resolution { /// Helper processor that derives the types of all expressions. #[derive(Debug)] pub struct Typifier { - resolutions: Vec, + resolutions: Vec, } #[derive(Clone, Debug, Error, PartialEq)] @@ -81,6 +99,7 @@ pub enum ResolveError { IncompatibleOperands(String), } +//TODO: remove this #[repr(C)] // pack this tighter: 48 -> 40 bytes #[derive(Clone, Debug, Error, PartialEq)] #[error("Type resolution of {0:?} failed")] @@ -94,77 +113,34 @@ pub struct ResolveContext<'a> { pub arguments: &'a [crate::FunctionArgument], } -impl Typifier { - pub fn new() -> Self { - Typifier { - resolutions: Vec::new(), - } - } - - pub fn clear(&mut self) { - self.resolutions.clear() - } - - pub fn get<'a>( - &'a self, - expr_handle: Handle, - types: &'a Arena, - ) -> &'a crate::TypeInner { - match self.resolutions[expr_handle.index()] { - Resolution::Handle(ty_handle) => &types[ty_handle].inner, - Resolution::Value(ref inner) => inner, - } - } - - pub fn try_get<'a>( - &'a self, - expr_handle: Handle, - types: &'a Arena, - ) -> Option<&'a crate::TypeInner> { - let resolution = self.resolutions.get(expr_handle.index())?; - Some(match *resolution { - Resolution::Handle(ty_handle) => &types[ty_handle].inner, - Resolution::Value(ref inner) => inner, - }) - } - - pub fn get_handle( - &self, - expr_handle: Handle, - ) -> Result, &crate::TypeInner> { - match self.resolutions[expr_handle.index()] { - Resolution::Handle(ty_handle) => Ok(ty_handle), - Resolution::Value(ref inner) => Err(inner), - } - } - - fn resolve_impl( - &self, +impl TypeResolution { + pub fn new<'a>( expr: &crate::Expression, - types: &Arena, + types: &'a Arena, ctx: &ResolveContext, - ) -> Result { + past: impl Fn(Handle) -> &'a Self, + ) -> Result { use crate::TypeInner as Ti; Ok(match *expr { - crate::Expression::Access { base, .. } => match *self.get(base, types) { - Ti::Array { base, .. } => Resolution::Handle(base), + crate::Expression::Access { base, .. } => match *past(base).inner_with(types) { + Ti::Array { base, .. } => Self::Handle(base), Ti::Vector { size: _, kind, width, - } => Resolution::Value(Ti::Scalar { kind, width }), + } => Self::Value(Ti::Scalar { kind, width }), Ti::ValuePointer { size: Some(_), kind, width, class, - } => Resolution::Value(Ti::ValuePointer { + } => Self::Value(Ti::ValuePointer { size: None, kind, width, class, }), - Ti::Pointer { base, class } => Resolution::Value(match types[base].inner { + Ti::Pointer { base, class } => Self::Value(match types[base].inner { Ti::Array { base, .. } => Ti::Pointer { base, class }, Ti::Vector { size: _, @@ -192,12 +168,12 @@ impl Typifier { }); } }, - crate::Expression::AccessIndex { base, index } => match *self.get(base, types) { + crate::Expression::AccessIndex { base, index } => match *past(base).inner_with(types) { Ti::Vector { size, kind, width } => { if index >= size as u32 { return Err(ResolveError::OutOfBoundsIndex { expr: base, index }); } - Resolution::Value(Ti::Scalar { kind, width }) + Self::Value(Ti::Scalar { kind, width }) } Ti::Matrix { columns, @@ -207,13 +183,13 @@ impl Typifier { if index >= columns as u32 { return Err(ResolveError::OutOfBoundsIndex { expr: base, index }); } - Resolution::Value(crate::TypeInner::Vector { + Self::Value(crate::TypeInner::Vector { size: rows, kind: crate::ScalarKind::Float, width, }) } - Ti::Array { base, .. } => Resolution::Handle(base), + Ti::Array { base, .. } => Self::Handle(base), Ti::Struct { block: _, ref members, @@ -221,7 +197,7 @@ impl Typifier { let member = members .get(index as usize) .ok_or(ResolveError::OutOfBoundsIndex { expr: base, index })?; - Resolution::Handle(member.ty) + Self::Handle(member.ty) } Ti::ValuePointer { size: Some(size), @@ -232,7 +208,7 @@ impl Typifier { if index >= size as u32 { return Err(ResolveError::OutOfBoundsIndex { expr: base, index }); } - Resolution::Value(Ti::ValuePointer { + Self::Value(Ti::ValuePointer { size: None, kind, width, @@ -242,7 +218,7 @@ impl Typifier { Ti::Pointer { base: ty_base, class, - } => Resolution::Value(match types[ty_base].inner { + } => Self::Value(match types[ty_base].inner { Ti::Array { base, .. } => Ti::Pointer { base, class }, Ti::Vector { size, kind, width } => { if index >= size as u32 { @@ -299,24 +275,22 @@ impl Typifier { } }, crate::Expression::Constant(h) => match ctx.constants[h].inner { - crate::ConstantInner::Scalar { width, ref value } => { - Resolution::Value(Ti::Scalar { - kind: value.scalar_kind(), - width, - }) - } - crate::ConstantInner::Composite { ty, components: _ } => Resolution::Handle(ty), + crate::ConstantInner::Scalar { width, ref value } => Self::Value(Ti::Scalar { + kind: value.scalar_kind(), + width, + }), + crate::ConstantInner::Composite { ty, components: _ } => Self::Handle(ty), }, - crate::Expression::Compose { ty, .. } => Resolution::Handle(ty), + crate::Expression::Compose { ty, .. } => Self::Handle(ty), crate::Expression::FunctionArgument(index) => { - Resolution::Handle(ctx.arguments[index as usize].ty) + Self::Handle(ctx.arguments[index as usize].ty) } crate::Expression::GlobalVariable(h) => { let var = &ctx.global_vars[h]; if var.class == crate::StorageClass::Handle { - Resolution::Handle(var.ty) + Self::Handle(var.ty) } else { - Resolution::Value(Ti::Pointer { + Self::Value(Ti::Pointer { base: var.ty, class: var.class, }) @@ -324,19 +298,19 @@ impl Typifier { } crate::Expression::LocalVariable(h) => { let var = &ctx.local_vars[h]; - Resolution::Value(Ti::Pointer { + Self::Value(Ti::Pointer { base: var.ty, class: crate::StorageClass::Function, }) } - crate::Expression::Load { pointer } => match *self.get(pointer, types) { - Ti::Pointer { base, class: _ } => Resolution::Handle(base), + crate::Expression::Load { pointer } => match *past(pointer).inner_with(types) { + Ti::Pointer { base, class: _ } => Self::Handle(base), Ti::ValuePointer { size, kind, width, class: _, - } => Resolution::Value(match size { + } => Self::Value(match size { Some(size) => Ti::Vector { size, kind, width }, None => Ti::Scalar { kind, width }, }), @@ -346,8 +320,8 @@ impl Typifier { } }, crate::Expression::ImageSample { image, .. } - | crate::Expression::ImageLoad { image, .. } => match *self.get(image, types) { - Ti::Image { class, .. } => Resolution::Value(match class { + | crate::Expression::ImageLoad { image, .. } => match *past(image).inner_with(types) { + Ti::Image { class, .. } => Self::Value(match class { crate::ImageClass::Depth => Ti::Scalar { kind: crate::ScalarKind::Float, width: 4, @@ -368,8 +342,8 @@ impl Typifier { return Err(ResolveError::InvalidImage(image)); } }, - crate::Expression::ImageQuery { image, query } => Resolution::Value(match query { - crate::ImageQuery::Size { level: _ } => match *self.get(image, types) { + crate::Expression::ImageQuery { image, query } => Self::Value(match query { + crate::ImageQuery::Size { level: _ } => match *past(image).inner_with(types) { Ti::Image { dim, .. } => match dim { crate::ImageDimension::D1 => Ti::Scalar { kind: crate::ScalarKind::Sint, @@ -398,28 +372,30 @@ impl Typifier { width: 4, }, }), - crate::Expression::Unary { expr, .. } => self.resolutions[expr.index()].clone(), + crate::Expression::Unary { expr, .. } => past(expr).clone(), crate::Expression::Binary { op, left, right } => match op { crate::BinaryOperator::Add | crate::BinaryOperator::Subtract | crate::BinaryOperator::Divide - | crate::BinaryOperator::Modulo => self.resolutions[left.index()].clone(), + | crate::BinaryOperator::Modulo => past(left).clone(), crate::BinaryOperator::Multiply => { - let ty_left = self.get(left, types); - let ty_right = self.get(right, types); + let res_left = past(left); + let ty_left = res_left.inner_with(types); + let res_right = past(right); + let ty_right = res_right.inner_with(types); if ty_left == ty_right { - self.resolutions[left.index()].clone() + res_left.clone() } else if let Ti::Scalar { .. } = *ty_left { - self.resolutions[right.index()].clone() + res_right.clone() } else if let Ti::Scalar { .. } = *ty_right { - self.resolutions[left.index()].clone() + res_left.clone() } else if let Ti::Matrix { columns: _, rows, width, } = *ty_left { - Resolution::Value(Ti::Vector { + Self::Value(Ti::Vector { size: rows, kind: crate::ScalarKind::Float, width, @@ -430,7 +406,7 @@ impl Typifier { width, } = *ty_right { - Resolution::Value(Ti::Vector { + Self::Value(Ti::Vector { size: columns, kind: crate::ScalarKind::Float, width, @@ -452,7 +428,7 @@ impl Typifier { | crate::BinaryOperator::LogicalOr => { let kind = crate::ScalarKind::Bool; let width = 1; - let inner = match *self.get(left, types) { + let inner = match *past(left).inner_with(types) { Ti::Scalar { .. } => Ti::Scalar { kind, width }, Ti::Vector { size, .. } => Ti::Vector { size, kind, width }, ref other => { @@ -462,19 +438,17 @@ impl Typifier { ))) } }; - Resolution::Value(inner) + Self::Value(inner) } crate::BinaryOperator::And | crate::BinaryOperator::ExclusiveOr | crate::BinaryOperator::InclusiveOr | crate::BinaryOperator::ShiftLeft - | crate::BinaryOperator::ShiftRight => self.resolutions[left.index()].clone(), + | crate::BinaryOperator::ShiftRight => past(left).clone(), }, - crate::Expression::Select { accept, .. } => self.resolutions[accept.index()].clone(), - crate::Expression::Derivative { axis: _, expr } => { - self.resolutions[expr.index()].clone() - } - crate::Expression::Relational { .. } => Resolution::Value(Ti::Scalar { + crate::Expression::Select { accept, .. } => past(accept).clone(), + crate::Expression::Derivative { axis: _, expr } => past(expr).clone(), + crate::Expression::Relational { .. } => Self::Value(Ti::Scalar { kind: crate::ScalarKind::Bool, width: 4, }), @@ -485,6 +459,7 @@ impl Typifier { arg2: _, } => { use crate::MathFunction as Mf; + let res_arg = past(arg); match fun { // comparison Mf::Abs | @@ -516,14 +491,14 @@ impl Typifier { Mf::Exp2 | Mf::Log | Mf::Log2 | - Mf::Pow => self.resolutions[arg.index()].clone(), + Mf::Pow => res_arg.clone(), // geometry - Mf::Dot => match *self.get(arg, types) { + Mf::Dot => match *res_arg.inner_with(types) { Ti::Vector { kind, size: _, width, - } => Resolution::Value(Ti::Scalar { kind, width }), + } => Self::Value(Ti::Scalar { kind, width }), ref other => return Err(ResolveError::IncompatibleOperands( format!("{:?}({:?}, _)", fun, other) @@ -533,26 +508,26 @@ impl Typifier { let arg1 = arg1.ok_or_else(|| ResolveError::IncompatibleOperands( format!("{:?}(_, None)", fun) ))?; - match (self.get(arg, types), self.get(arg1,types)) { - (&Ti::Vector {kind: _, size: columns,width}, &Ti::Vector{ size: rows, .. }) => Resolution::Value(Ti::Matrix { columns, rows, width }), + match (res_arg.inner_with(types), past(arg1).inner_with(types)) { + (&Ti::Vector {kind: _, size: columns,width}, &Ti::Vector{ size: rows, .. }) => Self::Value(Ti::Matrix { columns, rows, width }), (left, right) => return Err(ResolveError::IncompatibleOperands( format!("{:?}({:?}, {:?})", fun, left, right) )), } }, - Mf::Cross => self.resolutions[arg.index()].clone(), + Mf::Cross => res_arg.clone(), Mf::Distance | - Mf::Length => match *self.get(arg, types) { + Mf::Length => match *res_arg.inner_with(types) { Ti::Scalar {width,kind} | - Ti::Vector {width,kind,size:_} => Resolution::Value(Ti::Scalar { kind, width }), + Ti::Vector {width,kind,size:_} => Self::Value(Ti::Scalar { kind, width }), ref other => return Err(ResolveError::IncompatibleOperands( format!("{:?}({:?})", fun, other) )), }, Mf::Normalize | Mf::FaceForward | - Mf::Reflect => self.resolutions[arg.index()].clone(), + Mf::Reflect => res_arg.clone(), // computational Mf::Sign | Mf::Fma | @@ -560,13 +535,13 @@ impl Typifier { Mf::Step | Mf::SmoothStep | Mf::Sqrt | - Mf::InverseSqrt => self.resolutions[arg.index()].clone(), - Mf::Transpose => match *self.get(arg, types) { + Mf::InverseSqrt => res_arg.clone(), + Mf::Transpose => match *res_arg.inner_with(types) { Ti::Matrix { columns, rows, width, - } => Resolution::Value(Ti::Matrix { + } => Self::Value(Ti::Matrix { columns: rows, rows: columns, width, @@ -575,12 +550,12 @@ impl Typifier { format!("{:?}({:?})", fun, other) )), }, - Mf::Inverse => match *self.get(arg, types) { + Mf::Inverse => match *res_arg.inner_with(types) { Ti::Matrix { columns, rows, width, - } if columns == rows => Resolution::Value(Ti::Matrix { + } if columns == rows => Self::Value(Ti::Matrix { columns, rows, width, @@ -589,31 +564,31 @@ impl Typifier { format!("{:?}({:?})", fun, other) )), }, - Mf::Determinant => match *self.get(arg, types) { + Mf::Determinant => match *res_arg.inner_with(types) { Ti::Matrix { width, .. - } => Resolution::Value(Ti::Scalar { kind: crate::ScalarKind::Float, width }), + } => Self::Value(Ti::Scalar { kind: crate::ScalarKind::Float, width }), ref other => return Err(ResolveError::IncompatibleOperands( format!("{:?}({:?})", fun, other) )), }, // bits Mf::CountOneBits | - Mf::ReverseBits => self.resolutions[arg.index()].clone(), + Mf::ReverseBits => res_arg.clone(), } } crate::Expression::As { expr, kind, convert: _, - } => match *self.get(expr, types) { - Ti::Scalar { kind: _, width } => Resolution::Value(Ti::Scalar { kind, width }), + } => match *past(expr).inner_with(types) { + Ti::Scalar { kind: _, width } => Self::Value(Ti::Scalar { kind, width }), Ti::Vector { kind: _, size, width, - } => Resolution::Value(Ti::Vector { kind, size, width }), + } => Self::Value(Ti::Vector { kind, size, width }), ref other => { return Err(ResolveError::IncompatibleOperands(format!( "{:?} as {:?}", @@ -626,14 +601,60 @@ impl Typifier { .result .as_ref() .ok_or(ResolveError::FunctionReturnsVoid)?; - Resolution::Handle(result.ty) + Self::Handle(result.ty) } - crate::Expression::ArrayLength(_) => Resolution::Value(Ti::Scalar { + crate::Expression::ArrayLength(_) => Self::Value(Ti::Scalar { kind: crate::ScalarKind::Uint, width: 4, }), }) } +} + +impl Typifier { + pub fn new() -> Self { + Typifier { + resolutions: Vec::new(), + } + } + + pub fn clear(&mut self) { + self.resolutions.clear() + } + + //TODO: remove most of these + pub fn get<'a>( + &'a self, + expr_handle: Handle, + types: &'a Arena, + ) -> &'a crate::TypeInner { + match self.resolutions[expr_handle.index()] { + TypeResolution::Handle(ty_handle) => &types[ty_handle].inner, + TypeResolution::Value(ref inner) => inner, + } + } + + pub fn try_get<'a>( + &'a self, + expr_handle: Handle, + types: &'a Arena, + ) -> Option<&'a crate::TypeInner> { + let resolution = self.resolutions.get(expr_handle.index())?; + Some(match *resolution { + TypeResolution::Handle(ty_handle) => &types[ty_handle].inner, + TypeResolution::Value(ref inner) => inner, + }) + } + + pub fn get_handle( + &self, + expr_handle: Handle, + ) -> Result, &crate::TypeInner> { + match self.resolutions[expr_handle.index()] { + TypeResolution::Handle(ty_handle) => Ok(ty_handle), + TypeResolution::Value(ref inner) => Err(inner), + } + } pub fn grow( &mut self, @@ -644,7 +665,8 @@ impl Typifier { ) -> Result<(), ResolveError> { if self.resolutions.len() <= expr_handle.index() { for (eh, expr) in expressions.iter().skip(self.resolutions.len()) { - let resolution = self.resolve_impl(expr, types, ctx)?; + let resolution = + TypeResolution::new(expr, types, ctx, |h| &self.resolutions[h.index()])?; log::debug!("Resolving {:?} = {:?} : {:?}", eh, expr, resolution); self.resolutions.push(resolution); } @@ -660,9 +682,9 @@ impl Typifier { ) -> Result<(), TypifyError> { self.clear(); for (handle, expr) in expressions.iter() { - let resolution = self - .resolve_impl(expr, types, ctx) - .map_err(|err| TypifyError(handle, err))?; + let resolution = + TypeResolution::new(expr, types, ctx, |h| &self.resolutions[h.index()]) + .map_err(|err| TypifyError(handle, err))?; self.resolutions.push(resolution); } Ok(()) diff --git a/src/valid/analyzer.rs b/src/valid/analyzer.rs index 20da97ad8d..bcb63316be 100644 --- a/src/valid/analyzer.rs +++ b/src/valid/analyzer.rs @@ -6,8 +6,11 @@ Figures out the following properties: - expression reference counts !*/ -use super::{CallError, FunctionError, ModuleInfo, ValidationFlags}; -use crate::arena::{Arena, Handle}; +use super::{CallError, ExpressionError, FunctionError, ModuleInfo, ValidationFlags}; +use crate::{ + arena::{Arena, Handle}, + proc::{ResolveContext, TypeResolution}, +}; use std::ops; pub type NonUniformResult = Option>; @@ -138,6 +141,7 @@ pub struct ExpressionInfo { pub uniformity: Uniformity, pub ref_count: usize, assignable_global: Option>, + pub ty: TypeResolution, } impl ExpressionInfo { @@ -146,6 +150,11 @@ impl ExpressionInfo { uniformity: Uniformity::new(), ref_count: 0, assignable_global: None, + // this doesn't matter at this point, will be overwritten + ty: TypeResolution::Value(crate::TypeInner::Scalar { + kind: crate::ScalarKind::Bool, + width: 0, + }), } } } @@ -284,15 +293,16 @@ impl FunctionInfo { fn process_expression( &mut self, handle: Handle, + expression: &crate::Expression, expression_arena: &Arena, - arguments: &[crate::FunctionArgument], - global_var_arena: &Arena, other_functions: &[FunctionInfo], - ) -> Result<(), FunctionError> { + type_arena: &Arena, + resolve_context: &ResolveContext, + ) -> Result<(), ExpressionError> { use crate::{Expression as E, SampleLevel as Sl}; let mut assignable_global = None; - let uniformity = match expression_arena[handle] { + let uniformity = match *expression { E::Access { base, index } => Uniformity { non_uniform_result: self .add_assignable_ref(base, &mut assignable_global) @@ -316,7 +326,7 @@ impl FunctionInfo { } // depends on the builtin or interpolation E::FunctionArgument(index) => { - let arg = &arguments[index as usize]; + let arg = &resolve_context.arguments[index as usize]; let uniform = match arg.binding { Some(crate::Binding::BuiltIn(built_in)) => match built_in { // per-polygon built-ins are uniform @@ -339,7 +349,7 @@ impl FunctionInfo { E::GlobalVariable(gh) => { use crate::StorageClass as Sc; assignable_global = Some(gh); - let var = &global_var_arena[gh]; + let var = &resolve_context.global_vars[gh]; let uniform = match var.class { // local data is non-uniform Sc::Function | Sc::Private => false, @@ -377,15 +387,11 @@ impl FunctionInfo { self.sampling_set.insert(SamplingKey { image: match expression_arena[image] { crate::Expression::GlobalVariable(var) => var, - ref other => { - return Err(FunctionError::ExpectedGlobalVariable(other.clone())) - } + _ => return Err(ExpressionError::ExpectedGlobalVariable), }, sampler: match expression_arena[sampler] { crate::Expression::GlobalVariable(var) => var, - ref other => { - return Err(FunctionError::ExpectedGlobalVariable(other.clone())) - } + _ => return Err(ExpressionError::ExpectedGlobalVariable), }, }); // "nur" == "Non-Uniform Result" @@ -482,13 +488,9 @@ impl FunctionInfo { requirements: UniformityRequirements::empty(), }, E::Call(function) => { - let fun = - other_functions - .get(function.index()) - .ok_or(FunctionError::InvalidCall { - function, - error: CallError::ForwardDeclaredFunction, - })?; + let fun = other_functions + .get(function.index()) + .ok_or(ExpressionError::CallToUndeclaredFunction(function))?; self.process_call(fun).result } E::ArrayLength(expr) => Uniformity { @@ -497,10 +499,14 @@ impl FunctionInfo { }, }; + let ty = TypeResolution::new(expression, type_arena, resolve_context, |h| { + &self.expressions[h.index()].ty + })?; self.expressions[handle.index()] = ExpressionInfo { uniformity, ref_count: 0, assignable_global, + ty, }; Ok(()) } @@ -648,6 +654,7 @@ impl FunctionInfo { error: CallError::ForwardDeclaredFunction, }, )?; + //Note: the result is validated by the Validator, not here self.process_call(info) } }; @@ -665,7 +672,7 @@ impl ModuleInfo { pub(super) fn process_function( &self, fun: &crate::Function, - global_var_arena: &Arena, + module: &crate::Module, flags: ValidationFlags, ) -> Result { let mut info = FunctionInfo { @@ -673,18 +680,28 @@ impl ModuleInfo { uniformity: Uniformity::new(), may_kill: false, sampling_set: crate::FastHashSet::default(), - global_uses: vec![GlobalUse::empty(); global_var_arena.len()].into_boxed_slice(), + global_uses: vec![GlobalUse::empty(); module.global_variables.len()].into_boxed_slice(), expressions: vec![ExpressionInfo::new(); fun.expressions.len()].into_boxed_slice(), }; + let resolve_context = ResolveContext { + constants: &module.constants, + global_vars: &module.global_variables, + local_vars: &fun.local_variables, + functions: &module.functions, + arguments: &fun.arguments, + }; - for (handle, _) in fun.expressions.iter() { - info.process_expression( + for (handle, expr) in fun.expressions.iter() { + if let Err(error) = info.process_expression( handle, + expr, &fun.expressions, - &fun.arguments, - global_var_arena, &self.functions, - )?; + &module.types, + &resolve_context, + ) { + return Err(FunctionError::Expression { handle, error }); + } } let uniformity = info.process_block(&fun.body, &self.functions, None)?; @@ -722,7 +739,8 @@ fn uniform_control_flow() { let mut type_arena = Arena::new(); let ty = type_arena.append(crate::Type { name: None, - inner: crate::TypeInner::Scalar { + inner: crate::TypeInner::Vector { + size: crate::VectorSize::Bi, kind: crate::ScalarKind::Float, width: 4, }, @@ -775,9 +793,23 @@ fn uniform_control_flow() { global_uses: vec![GlobalUse::empty(); global_var_arena.len()].into_boxed_slice(), expressions: vec![ExpressionInfo::new(); expressions.len()].into_boxed_slice(), }; - for (handle, _) in expressions.iter() { - info.process_expression(handle, &expressions, &[], &global_var_arena, &[]) - .unwrap(); + let resolve_context = ResolveContext { + constants: &constant_arena, + global_vars: &global_var_arena, + local_vars: &Arena::new(), + functions: &Arena::new(), + arguments: &[], + }; + for (handle, expression) in expressions.iter() { + info.process_expression( + handle, + expression, + &expressions, + &[], + &type_arena, + &resolve_context, + ) + .unwrap(); } assert_eq!(info[non_uniform_global_expr].ref_count, 1); assert_eq!(info[uniform_global_expr].ref_count, 1); diff --git a/src/valid/expression.rs b/src/valid/expression.rs index 0e460f7930..457a867891 100644 --- a/src/valid/expression.rs +++ b/src/valid/expression.rs @@ -1,6 +1,7 @@ +use super::FunctionInfo; use crate::{ arena::{Arena, Handle}, - proc::Typifier, + proc::ResolveError, }; #[derive(Clone, Debug, thiserror::Error)] @@ -52,12 +53,18 @@ pub enum ExpressionError { InvalidBooleanVector(Handle), #[error("Relational argument {0:?} is not a float")] InvalidFloatArgument(Handle), + #[error("Type resolution failed")] + Type(#[from] ResolveError), + #[error("Not a global variable")] + ExpectedGlobalVariable, + #[error("Calling an undeclared function {0:?}")] + CallToUndeclaredFunction(Handle), } struct ExpressionTypeResolver<'a> { root: Handle, types: &'a Arena, - typifier: &'a Typifier, + info: &'a FunctionInfo, } impl<'a> ExpressionTypeResolver<'a> { @@ -66,7 +73,7 @@ impl<'a> ExpressionTypeResolver<'a> { handle: Handle, ) -> Result<&'a crate::TypeInner, ExpressionError> { if handle < self.root { - Ok(self.typifier.get(handle, self.types)) + Ok(self.info[handle].ty.inner_with(self.types)) } else { Err(ExpressionError::ForwardDependency(handle)) } @@ -80,13 +87,14 @@ impl super::Validator { expression: &crate::Expression, function: &crate::Function, module: &crate::Module, + info: &FunctionInfo, ) -> Result<(), ExpressionError> { use crate::{Expression as E, ScalarKind as Sk, TypeInner as Ti}; let resolver = ExpressionTypeResolver { root, types: &module.types, - typifier: &self.typifier, + info, }; match *expression { diff --git a/src/valid/function.rs b/src/valid/function.rs index 770f70c851..88f2a2795c 100644 --- a/src/valid/function.rs +++ b/src/valid/function.rs @@ -1,11 +1,8 @@ use super::{ - analyzer::{FunctionInfo, UniformityDisruptor, UniformityRequirements}, - ExpressionError, ModuleInfo, TypeFlags, ValidationFlags, -}; -use crate::{ - arena::{Arena, Handle}, - proc::{ResolveContext, TypifyError}, + analyzer::{UniformityDisruptor, UniformityRequirements}, + ExpressionError, FunctionInfo, ModuleInfo, TypeFlags, ValidationFlags, }; +use crate::arena::{Arena, Handle}; #[derive(Clone, Debug, thiserror::Error)] #[cfg_attr(test, derive(PartialEq))] @@ -32,11 +29,8 @@ pub enum CallError { required: Handle, seen_expression: Handle, }, - #[error("Result value {seen_expression:?} does not match the type {required:?}")] - ResultType { - required: Option>, - seen_expression: Option>, - }, + #[error("The emitted expression doesn't match the call")] + ExpressionMismatch(Option>), } #[derive(Clone, Debug, thiserror::Error)] @@ -49,8 +43,6 @@ pub enum LocalVariableError { #[derive(Clone, Debug, thiserror::Error)] #[cfg_attr(test, derive(PartialEq))] pub enum FunctionError { - #[error(transparent)] - Resolve(#[from] TypifyError), #[error("Expression {handle:?} is invalid")] Expression { handle: Handle, @@ -103,8 +95,6 @@ pub enum FunctionError { #[source] error: CallError, }, - #[error("Expression {0:?} is not a global variable!")] - ExpectedGlobalVariable(crate::Expression), #[error( "Required uniformity of control flow for {0:?} in {1:?} is not fulfilled because of {2:?}" )] @@ -127,6 +117,7 @@ bitflags::bitflags! { struct BlockContext<'a> { flags: Flags, + info: &'a FunctionInfo, expressions: &'a Arena, types: &'a Arena, functions: &'a Arena, @@ -134,9 +125,10 @@ struct BlockContext<'a> { } impl<'a> BlockContext<'a> { - pub(super) fn new(fun: &'a crate::Function, module: &'a crate::Module) -> Self { + fn new(fun: &'a crate::Function, module: &'a crate::Module, info: &'a FunctionInfo) -> Self { Self { flags: Flags::CAN_JUMP, + info, expressions: &fun.expressions, types: &module.types, functions: &module.functions, @@ -147,6 +139,7 @@ impl<'a> BlockContext<'a> { fn with_flags(&self, flags: Flags) -> Self { BlockContext { flags, + info: self.info, expressions: self.expressions, types: self.types, functions: self.functions, @@ -162,6 +155,25 @@ impl<'a> BlockContext<'a> { .try_get(handle) .ok_or(FunctionError::InvalidExpression(handle)) } + + fn resolve_type_impl( + &self, + handle: Handle, + ) -> Result<&crate::TypeInner, ExpressionError> { + if handle.index() < self.expressions.len() { + Ok(self.info[handle].ty.inner_with(self.types)) + } else { + Err(ExpressionError::DoesntExist) + } + } + + fn resolve_type( + &self, + handle: Handle, + ) -> Result<&crate::TypeInner, FunctionError> { + self.resolve_type_impl(handle) + .map_err(|error| FunctionError::Expression { handle, error }) + } } impl super::Validator { @@ -183,8 +195,8 @@ impl super::Validator { }); } for (index, (arg, &expr)) in fun.arguments.iter().zip(arguments).enumerate() { - let ty = self - .resolve_statement_type_impl(expr, context.types) + let ty = context + .resolve_type_impl(expr) .map_err(|error| CallError::Argument { index, error })?; if ty != &context.types[arg.ty].inner { return Err(CallError::ArgumentType { @@ -201,49 +213,17 @@ impl super::Validator { } else { return Err(CallError::ResultAlreadyInScope(expr)); } + match context.expressions[expr] { + crate::Expression::Call(callee) if fun.result.is_some() && callee == function => {} + _ => return Err(CallError::ExpressionMismatch(result)), + } + } else if fun.result.is_some() { + return Err(CallError::ExpressionMismatch(result)); } - let result_ty = result - .map(|expr| self.resolve_statement_type_impl(expr, context.types)) - .transpose() - .map_err(CallError::ResultValue)?; - let expected_ty = fun.result.as_ref().map(|fr| &context.types[fr.ty].inner); - if result_ty != expected_ty { - log::error!( - "Called function returns {:?} where {:?} is expected", - result_ty, - expected_ty - ); - return Err(CallError::ResultType { - required: fun.result.as_ref().map(|fr| fr.ty), - seen_expression: result, - }); - } Ok(()) } - fn resolve_statement_type_impl<'a>( - &'a self, - handle: Handle, - types: &'a Arena, - ) -> Result<&'a crate::TypeInner, ExpressionError> { - if !self.valid_expression_set.contains(handle.index()) { - return Err(ExpressionError::NotInScope); - } - self.typifier - .try_get(handle, types) - .ok_or(ExpressionError::DoesntExist) - } - - fn resolve_statement_type<'a>( - &'a self, - handle: Handle, - types: &'a Arena, - ) -> Result<&'a crate::TypeInner, FunctionError> { - self.resolve_statement_type_impl(handle, types) - .map_err(|error| FunctionError::Expression { handle, error }) - } - fn validate_block_impl( &mut self, statements: &[crate::Statement], @@ -271,7 +251,7 @@ impl super::Validator { ref accept, ref reject, } => { - match *self.resolve_statement_type(condition, context.types)? { + match *context.resolve_type(condition)? { Ti::Scalar { kind: crate::ScalarKind::Bool, width: _, @@ -286,7 +266,7 @@ impl super::Validator { ref cases, ref default, } => { - match *self.resolve_statement_type(selector, context.types)? { + match *context.resolve_type(selector)? { Ti::Scalar { kind: crate::ScalarKind::Sint, width: _, @@ -330,9 +310,7 @@ impl super::Validator { if !context.flags.contains(Flags::CAN_JUMP) { return Err(FunctionError::InvalidReturnSpot); } - let value_ty = value - .map(|expr| self.resolve_statement_type(expr, context.types)) - .transpose()?; + let value_ty = value.map(|expr| context.resolve_type(expr)).transpose()?; let expected_ty = context.return_type.map(|ty| &context.types[ty].inner); if value_ty != expected_ty { log::error!( @@ -350,12 +328,7 @@ impl super::Validator { S::Store { pointer, value } => { let mut current = pointer; loop { - self.typifier.try_get(current, context.types).ok_or( - FunctionError::Expression { - handle: current, - error: ExpressionError::DoesntExist, - }, - )?; + let _ = context.resolve_type(current)?; match context.expressions[current] { crate::Expression::Access { base, .. } | crate::Expression::AccessIndex { base, .. } => current = base, @@ -366,29 +339,27 @@ impl super::Validator { } } - let value_ty = self.resolve_statement_type(value, context.types)?; + let value_ty = context.resolve_type(value)?; match *value_ty { Ti::Image { .. } | Ti::Sampler { .. } => { return Err(FunctionError::InvalidStoreValue(value)); } _ => {} } - let good = match self.typifier.try_get(pointer, context.types) { - Some(&Ti::Pointer { base, class: _ }) => { - *value_ty == context.types[base].inner - } - Some(&Ti::ValuePointer { + let good = match *context.resolve_type(pointer)? { + Ti::Pointer { base, class: _ } => *value_ty == context.types[base].inner, + Ti::ValuePointer { size: Some(size), kind, width, class: _, - }) => *value_ty == Ti::Vector { size, kind, width }, - Some(&Ti::ValuePointer { + } => *value_ty == Ti::Vector { size, kind, width }, + Ti::ValuePointer { size: None, kind, width, class: _, - }) => *value_ty == Ti::Scalar { kind, width }, + } => *value_ty == Ti::Scalar { kind, width }, _ => false, }; if !good { @@ -405,15 +376,14 @@ impl super::Validator { crate::Expression::GlobalVariable(_var_handle) => (), //TODO _ => return Err(FunctionError::InvalidImage(image)), }; - let value_ty = self.typifier.get(value, context.types); - match *value_ty { + match *context.resolve_type(value)? { Ti::Scalar { .. } | Ti::Vector { .. } => {} _ => { return Err(FunctionError::InvalidStoreValue(value)); } } if let Some(expr) = array_index { - match *self.typifier.get(expr, context.types) { + match *context.resolve_type(expr)? { Ti::Scalar { kind: crate::ScalarKind::Sint, width: _, @@ -483,16 +453,7 @@ impl super::Validator { module: &crate::Module, mod_info: &ModuleInfo, ) -> Result { - let resolve_ctx = ResolveContext { - constants: &module.constants, - global_vars: &module.global_variables, - local_vars: &fun.local_variables, - functions: &module.functions, - arguments: &fun.arguments, - }; - self.typifier - .resolve_all(&fun.expressions, &module.types, &resolve_ctx)?; - let info = mod_info.process_function(fun, &module.global_variables, self.flags)?; + let info = mod_info.process_function(fun, module, self.flags)?; for (var_handle, var) in fun.local_variables.iter() { self.validate_local_var(var, &module.types, &module.constants) @@ -521,14 +482,14 @@ impl super::Validator { self.valid_expression_set.insert(handle.index()); } if !self.flags.contains(ValidationFlags::EXPRESSIONS) { - if let Err(error) = self.validate_expression(handle, expr, fun, module) { + if let Err(error) = self.validate_expression(handle, expr, fun, module, &info) { return Err(FunctionError::Expression { handle, error }); } } } if self.flags.contains(ValidationFlags::BLOCKS) { - self.validate_block(&fun.body, &BlockContext::new(fun, module))?; + self.validate_block(&fun.body, &BlockContext::new(fun, module, &info))?; } Ok(info) } diff --git a/src/valid/mod.rs b/src/valid/mod.rs index b3223adf8e..b80d6e5dde 100644 --- a/src/valid/mod.rs +++ b/src/valid/mod.rs @@ -6,7 +6,7 @@ mod r#type; use crate::{ arena::{Arena, Handle}, - proc::{Layouter, Typifier}, + proc::Layouter, FastHashSet, }; use bit_set::BitSet; @@ -40,9 +40,6 @@ pub struct ModuleInfo { #[derive(Debug)] pub struct Validator { flags: ValidationFlags, - //Note: this is a bit tricky: some of the front-ends as well as backends - // already have to use the typifier, so the work here is redundant in a way. - typifier: Typifier, types: Vec, location_mask: BitSet, bind_group_masks: Vec, @@ -125,7 +122,6 @@ impl Validator { pub fn new(flags: ValidationFlags) -> Self { Validator { flags, - typifier: Typifier::new(), types: Vec::new(), location_mask: BitSet::new(), bind_group_masks: Vec::new(), diff --git a/src/valid/type.rs b/src/valid/type.rs index b1a6b7b137..ff89d3f6f8 100644 --- a/src/valid/type.rs +++ b/src/valid/type.rs @@ -103,7 +103,6 @@ impl super::Validator { } pub(super) fn reset_types(&mut self, size: usize) { - self.typifier.clear(); self.types.clear(); self.types.resize(size, TypeInfo::new()); } diff --git a/tests/out/collatz.info.ron.snap b/tests/out/collatz.info.ron.snap index 28ace10762..8947224191 100644 --- a/tests/out/collatz.info.ron.snap +++ b/tests/out/collatz.info.ron.snap @@ -31,6 +31,10 @@ expression: output ), ref_count: 0, assignable_global: Some(1), + ty: Value(Pointer( + base: 3, + class: Storage, + )), ), ( uniformity: ( @@ -41,6 +45,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ( uniformity: ( @@ -51,6 +56,10 @@ expression: output ), ref_count: 7, assignable_global: None, + ty: Value(Pointer( + base: 1, + class: Function, + )), ), ( uniformity: ( @@ -61,6 +70,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -71,6 +84,10 @@ expression: output ), ref_count: 3, assignable_global: None, + ty: Value(Pointer( + base: 1, + class: Function, + )), ), ( uniformity: ( @@ -81,6 +98,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ( uniformity: ( @@ -91,6 +109,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -101,6 +123,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Bool, + width: 1, + )), ), ( uniformity: ( @@ -111,6 +137,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ( uniformity: ( @@ -121,6 +148,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -131,6 +162,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ( uniformity: ( @@ -141,6 +173,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -151,6 +187,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Bool, + width: 1, + )), ), ( uniformity: ( @@ -161,6 +201,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ( uniformity: ( @@ -171,6 +212,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -181,6 +226,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ( uniformity: ( @@ -191,6 +237,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -201,6 +251,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ( uniformity: ( @@ -211,6 +262,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -221,6 +276,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -231,6 +290,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -241,6 +304,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ( uniformity: ( @@ -251,6 +315,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -261,6 +329,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ( uniformity: ( @@ -271,6 +340,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ], ), @@ -303,6 +373,10 @@ expression: output ), ref_count: 2, assignable_global: Some(1), + ty: Value(Pointer( + base: 3, + class: Storage, + )), ), ( uniformity: ( @@ -313,6 +387,7 @@ expression: output ), ref_count: 2, assignable_global: None, + ty: Handle(4), ), ( uniformity: ( @@ -323,6 +398,10 @@ expression: output ), ref_count: 1, assignable_global: Some(1), + ty: Value(Pointer( + base: 2, + class: Storage, + )), ), ( uniformity: ( @@ -333,6 +412,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -343,6 +426,10 @@ expression: output ), ref_count: 1, assignable_global: Some(1), + ty: Value(Pointer( + base: 1, + class: Storage, + )), ), ( uniformity: ( @@ -353,6 +440,10 @@ expression: output ), ref_count: 1, assignable_global: Some(1), + ty: Value(Pointer( + base: 2, + class: Storage, + )), ), ( uniformity: ( @@ -363,6 +454,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -373,6 +468,10 @@ expression: output ), ref_count: 1, assignable_global: Some(1), + ty: Value(Pointer( + base: 1, + class: Storage, + )), ), ( uniformity: ( @@ -383,6 +482,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ( uniformity: ( @@ -393,6 +493,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ], ), diff --git a/tests/out/shadow.info.ron.snap b/tests/out/shadow.info.ron.snap index 497d65c3c0..f0d4c9c29a 100644 --- a/tests/out/shadow.info.ron.snap +++ b/tests/out/shadow.info.ron.snap @@ -54,6 +54,10 @@ expression: output ), ref_count: 0, assignable_global: Some(3), + ty: Value(Pointer( + base: 14, + class: Uniform, + )), ), ( uniformity: ( @@ -64,6 +68,10 @@ expression: output ), ref_count: 0, assignable_global: Some(6), + ty: Value(Pointer( + base: 2, + class: Private, + )), ), ( uniformity: ( @@ -74,6 +82,10 @@ expression: output ), ref_count: 0, assignable_global: Some(5), + ty: Value(Pointer( + base: 4, + class: Private, + )), ), ( uniformity: ( @@ -84,6 +96,7 @@ expression: output ), ref_count: 1, assignable_global: Some(1), + ty: Handle(56), ), ( uniformity: ( @@ -94,6 +107,7 @@ expression: output ), ref_count: 1, assignable_global: Some(2), + ty: Handle(57), ), ( uniformity: ( @@ -104,6 +118,10 @@ expression: output ), ref_count: 0, assignable_global: Some(4), + ty: Value(Pointer( + base: 21, + class: Storage, + )), ), ( uniformity: ( @@ -114,6 +132,10 @@ expression: output ), ref_count: 0, assignable_global: Some(7), + ty: Value(Pointer( + base: 4, + class: Private, + )), ), ( uniformity: ( @@ -124,6 +146,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -134,6 +160,10 @@ expression: output ), ref_count: 3, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -144,6 +174,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -154,6 +188,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -164,6 +202,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -174,6 +216,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -184,6 +230,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -194,6 +244,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -204,6 +258,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -214,6 +272,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -224,6 +286,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -234,6 +300,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -244,6 +314,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -254,6 +328,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -264,6 +342,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -274,6 +356,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -284,6 +370,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -294,6 +384,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -304,6 +398,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -314,6 +412,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -324,6 +426,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -334,6 +440,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -344,6 +454,10 @@ expression: output ), ref_count: 3, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -354,6 +468,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -364,6 +482,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -374,6 +496,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -384,6 +510,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -394,6 +524,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -404,6 +538,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -414,6 +552,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -424,6 +566,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -434,6 +580,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -444,6 +594,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -454,6 +608,7 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -464,6 +619,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -474,6 +633,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(3), ), ( uniformity: ( @@ -484,6 +644,7 @@ expression: output ), ref_count: 6, assignable_global: None, + ty: Handle(4), ), ( uniformity: ( @@ -494,6 +655,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -504,6 +669,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Bool, + width: 1, + )), ), ( uniformity: ( @@ -514,6 +683,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -524,6 +697,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -534,6 +711,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(9), ), ( uniformity: ( @@ -544,6 +722,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(9), ), ( uniformity: ( @@ -554,6 +733,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(9), ), ( uniformity: ( @@ -564,6 +744,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -574,6 +758,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -584,6 +772,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(9), ), ( uniformity: ( @@ -594,6 +783,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(9), ), ( uniformity: ( @@ -604,6 +794,7 @@ expression: output ), ref_count: 2, assignable_global: None, + ty: Handle(9), ), ( uniformity: ( @@ -614,6 +805,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -624,6 +819,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -634,6 +833,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -644,6 +847,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -654,6 +861,7 @@ expression: output ), ref_count: 3, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -664,6 +872,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -674,6 +886,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -684,6 +900,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -694,6 +914,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -704,6 +928,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -714,6 +942,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -724,6 +956,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(6), ), ( uniformity: ( @@ -734,6 +967,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -744,6 +981,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -754,6 +995,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ], ), @@ -807,6 +1052,10 @@ expression: output ), ref_count: 1, assignable_global: Some(3), + ty: Value(Pointer( + base: 14, + class: Uniform, + )), ), ( uniformity: ( @@ -817,6 +1066,10 @@ expression: output ), ref_count: 1, assignable_global: Some(6), + ty: Value(Pointer( + base: 2, + class: Private, + )), ), ( uniformity: ( @@ -827,6 +1080,10 @@ expression: output ), ref_count: 4, assignable_global: Some(5), + ty: Value(Pointer( + base: 4, + class: Private, + )), ), ( uniformity: ( @@ -837,6 +1094,7 @@ expression: output ), ref_count: 0, assignable_global: Some(1), + ty: Handle(56), ), ( uniformity: ( @@ -847,6 +1105,7 @@ expression: output ), ref_count: 0, assignable_global: Some(2), + ty: Handle(57), ), ( uniformity: ( @@ -857,6 +1116,10 @@ expression: output ), ref_count: 7, assignable_global: Some(4), + ty: Value(Pointer( + base: 21, + class: Storage, + )), ), ( uniformity: ( @@ -867,6 +1130,10 @@ expression: output ), ref_count: 1, assignable_global: Some(7), + ty: Value(Pointer( + base: 4, + class: Private, + )), ), ( uniformity: ( @@ -877,6 +1144,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -887,6 +1158,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -897,6 +1172,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -907,6 +1186,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -917,6 +1200,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -927,6 +1214,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -937,6 +1228,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -947,6 +1242,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -957,6 +1256,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -967,6 +1270,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -977,6 +1284,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -987,6 +1298,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -997,6 +1312,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1007,6 +1326,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1017,6 +1340,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1027,6 +1354,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1037,6 +1368,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1047,6 +1382,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1057,6 +1396,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1067,6 +1410,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -1077,6 +1424,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -1087,6 +1438,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1097,6 +1452,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1107,6 +1466,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1117,6 +1480,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1127,6 +1494,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1137,6 +1508,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1147,6 +1522,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1157,6 +1536,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1167,6 +1550,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1177,6 +1564,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1187,6 +1578,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1197,6 +1592,10 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Value(Scalar( + kind: Sint, + width: 4, + )), ), ( uniformity: ( @@ -1207,6 +1606,7 @@ expression: output ), ref_count: 0, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -1217,6 +1617,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1227,6 +1631,10 @@ expression: output ), ref_count: 3, assignable_global: None, + ty: Value(Pointer( + base: 2, + class: Function, + )), ), ( uniformity: ( @@ -1237,6 +1645,10 @@ expression: output ), ref_count: 11, assignable_global: None, + ty: Value(Pointer( + base: 3, + class: Function, + )), ), ( uniformity: ( @@ -1247,6 +1659,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(3), ), ( uniformity: ( @@ -1257,6 +1670,10 @@ expression: output ), ref_count: 1, assignable_global: Some(3), + ty: Value(Pointer( + base: 13, + class: Uniform, + )), ), ( uniformity: ( @@ -1267,6 +1684,12 @@ expression: output ), ref_count: 1, assignable_global: Some(3), + ty: Value(ValuePointer( + size: None, + kind: Uint, + width: 4, + class: Uniform, + )), ), ( uniformity: ( @@ -1277,6 +1700,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -1287,6 +1714,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Uint, + width: 4, + )), ), ( uniformity: ( @@ -1297,6 +1728,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Bool, + width: 1, + )), ), ( uniformity: ( @@ -1307,6 +1742,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -1317,6 +1753,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(3), ), ( uniformity: ( @@ -1327,6 +1764,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 20, + class: Storage, + )), ), ( uniformity: ( @@ -1337,6 +1778,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(3), ), ( uniformity: ( @@ -1347,6 +1789,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 19, + class: Storage, + )), ), ( uniformity: ( @@ -1357,6 +1803,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 18, + class: Storage, + )), ), ( uniformity: ( @@ -1367,6 +1817,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(18), ), ( uniformity: ( @@ -1377,6 +1828,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(4), ), ( uniformity: ( @@ -1387,6 +1839,11 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Vector( + size: Quad, + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1397,6 +1854,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ( uniformity: ( @@ -1407,6 +1865,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -1417,6 +1876,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -1427,6 +1887,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 20, + class: Storage, + )), ), ( uniformity: ( @@ -1437,6 +1901,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(3), ), ( uniformity: ( @@ -1447,6 +1912,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 19, + class: Storage, + )), ), ( uniformity: ( @@ -1457,6 +1926,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 4, + class: Storage, + )), ), ( uniformity: ( @@ -1467,6 +1940,12 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(ValuePointer( + size: None, + kind: Float, + width: 4, + class: Storage, + )), ), ( uniformity: ( @@ -1477,6 +1956,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1487,6 +1970,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 20, + class: Storage, + )), ), ( uniformity: ( @@ -1497,6 +1984,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(3), ), ( uniformity: ( @@ -1507,6 +1995,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 19, + class: Storage, + )), ), ( uniformity: ( @@ -1517,6 +2009,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 4, + class: Storage, + )), ), ( uniformity: ( @@ -1527,6 +2023,12 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(ValuePointer( + size: None, + kind: Float, + width: 4, + class: Storage, + )), ), ( uniformity: ( @@ -1537,6 +2039,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1547,6 +2053,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 20, + class: Storage, + )), ), ( uniformity: ( @@ -1557,6 +2067,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(3), ), ( uniformity: ( @@ -1567,6 +2078,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 19, + class: Storage, + )), ), ( uniformity: ( @@ -1577,6 +2092,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 4, + class: Storage, + )), ), ( uniformity: ( @@ -1587,6 +2106,12 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(ValuePointer( + size: None, + kind: Float, + width: 4, + class: Storage, + )), ), ( uniformity: ( @@ -1597,6 +2122,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1607,6 +2136,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -1617,6 +2147,12 @@ expression: output ), ref_count: 1, assignable_global: Some(5), + ty: Value(ValuePointer( + size: None, + kind: Float, + width: 4, + class: Private, + )), ), ( uniformity: ( @@ -1627,6 +2163,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1637,6 +2177,12 @@ expression: output ), ref_count: 1, assignable_global: Some(5), + ty: Value(ValuePointer( + size: None, + kind: Float, + width: 4, + class: Private, + )), ), ( uniformity: ( @@ -1647,6 +2193,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1657,6 +2207,12 @@ expression: output ), ref_count: 1, assignable_global: Some(5), + ty: Value(ValuePointer( + size: None, + kind: Float, + width: 4, + class: Private, + )), ), ( uniformity: ( @@ -1667,6 +2223,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1677,6 +2237,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -1687,6 +2248,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -1697,6 +2259,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -1707,6 +2270,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1717,6 +2284,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1727,6 +2298,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(1), ), ( uniformity: ( @@ -1737,6 +2309,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 20, + class: Storage, + )), ), ( uniformity: ( @@ -1747,6 +2323,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(3), ), ( uniformity: ( @@ -1757,6 +2334,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 19, + class: Storage, + )), ), ( uniformity: ( @@ -1767,6 +2348,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 4, + class: Storage, + )), ), ( uniformity: ( @@ -1777,6 +2362,12 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(ValuePointer( + size: None, + kind: Float, + width: 4, + class: Storage, + )), ), ( uniformity: ( @@ -1787,6 +2378,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1797,6 +2392,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 20, + class: Storage, + )), ), ( uniformity: ( @@ -1807,6 +2406,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(3), ), ( uniformity: ( @@ -1817,6 +2417,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 19, + class: Storage, + )), ), ( uniformity: ( @@ -1827,6 +2431,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 4, + class: Storage, + )), ), ( uniformity: ( @@ -1837,6 +2445,12 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(ValuePointer( + size: None, + kind: Float, + width: 4, + class: Storage, + )), ), ( uniformity: ( @@ -1847,6 +2461,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1857,6 +2475,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 20, + class: Storage, + )), ), ( uniformity: ( @@ -1867,6 +2489,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(3), ), ( uniformity: ( @@ -1877,6 +2500,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 19, + class: Storage, + )), ), ( uniformity: ( @@ -1887,6 +2514,10 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(Pointer( + base: 4, + class: Storage, + )), ), ( uniformity: ( @@ -1897,6 +2528,12 @@ expression: output ), ref_count: 1, assignable_global: Some(4), + ty: Value(ValuePointer( + size: None, + kind: Float, + width: 4, + class: Storage, + )), ), ( uniformity: ( @@ -1907,6 +2544,10 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Value(Scalar( + kind: Float, + width: 4, + )), ), ( uniformity: ( @@ -1917,6 +2558,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -1927,6 +2569,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -1937,6 +2580,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -1947,6 +2591,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(3), ), ( uniformity: ( @@ -1957,6 +2602,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(3), ), ( uniformity: ( @@ -1967,6 +2613,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -1977,6 +2624,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(4), ), ], ), @@ -2032,6 +2680,10 @@ expression: output ), ref_count: 1, assignable_global: Some(6), + ty: Value(Pointer( + base: 2, + class: Private, + )), ), ( uniformity: ( @@ -2042,6 +2694,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(2), ), ( uniformity: ( @@ -2052,6 +2705,10 @@ expression: output ), ref_count: 1, assignable_global: Some(5), + ty: Value(Pointer( + base: 4, + class: Private, + )), ), ( uniformity: ( @@ -2062,6 +2719,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(4), ), ( uniformity: ( @@ -2072,6 +2730,10 @@ expression: output ), ref_count: 1, assignable_global: Some(7), + ty: Value(Pointer( + base: 4, + class: Private, + )), ), ( uniformity: ( @@ -2082,6 +2744,7 @@ expression: output ), ref_count: 1, assignable_global: None, + ty: Handle(4), ), ], ),