diff --git a/autogen/src/sr.rs b/autogen/src/sr.rs index 14f935aa..93504b42 100644 --- a/autogen/src/sr.rs +++ b/autogen/src/sr.rs @@ -19,6 +19,14 @@ struct OperandTokens { lift_expression: TokenStream, } +enum OperandTy<'a> { + Single(&'a str), + Pair { first: &'a str, second: &'a str }, + // Image operands consist of a bitmask followed by a list of id refs + // These refs are not included in the json grammar. + ImageOperands, +} + impl OperandTokens { fn new( operands: &[structs::Operand], @@ -29,7 +37,7 @@ impl OperandTokens { let name = get_param_name(operands, operand_index); let iter = Ident::new(OPERAND_ITER, Span::call_site()); - let (ty, lift_value, first_name, second_name) = match operand.kind.as_str() { + let (ty, lift_value, op_ty) = match operand.kind.as_str() { "IdRef" => { let (ty, value) = match operand.name.trim_matches('\'') { "Length" => ( @@ -89,83 +97,94 @@ impl OperandTokens { } } }; - (ty, value, operand.kind.as_str(), None) + (ty, value, OperandTy::Single(operand.kind.as_str())) } "IdMemorySemantics" | "IdScope" | "IdResult" => ( //TODO: proper `Token<>` quote! { spirv::Word }, quote! { *value }, - operand.kind.as_str(), - None, + OperandTy::Single(operand.kind.as_str()), + ), + "LiteralInteger" => ( + quote! { u32 }, + quote! { *value }, + OperandTy::Single("LiteralInt32"), ), - "LiteralInteger" => (quote! { u32 }, quote! { *value }, "LiteralInt32", None), "LiteralExtInstInteger" => ( quote! { u32 }, quote! { *value }, - operand.kind.as_str(), - None, + OperandTy::Single(operand.kind.as_str()), ), "LiteralSpecConstantOpInteger" => ( quote! { spirv::Op }, quote! { *value }, - operand.kind.as_str(), - None, + OperandTy::Single(operand.kind.as_str()), ), "LiteralContextDependentNumber" => ( quote! { u32 }, quote! { *value }, - operand.kind.as_str(), - None, + OperandTy::Single(operand.kind.as_str()), ), "LiteralString" => ( quote! { String }, quote! { value.clone() }, - operand.kind.as_str(), - None, + OperandTy::Single(operand.kind.as_str()), ), "PairLiteralIntegerIdRef" => ( quote! { (u32, Jump) }, quote! { (first, self.lookup_jump(second)) }, - "LiteralInt32", - Some("IdRef"), + OperandTy::Pair { + first: "LiteralInt32", + second: "IdRef", + }, ), "PairIdRefLiteralInteger" => ( quote! { (Jump, u32) }, quote! { (self.lookup_jump(first), second) }, - "IdRef", - Some("LiteralInt32"), + OperandTy::Pair { + first: "IdRef", + second: "LiteralInt32", + }, ), "PairIdRefIdRef" => ( //TODO: proper `Token<>` quote! { (spirv::Word, spirv::Word) }, quote! { (first, second) }, - "IdRef", - Some("IdRef"), + OperandTy::Pair { + first: "IdRef", + second: "IdRef", + }, + ), + "ImageOperands" => ( + quote! { (spirv::ImageOperands, Vec) }, + quote! { (first, second) }, + OperandTy::ImageOperands, ), kind => { let kind = Ident::new(kind, Span::call_site()); ( quote! { spirv::#kind }, quote! { *value }, - operand.kind.as_str(), - None, + OperandTy::Single(operand.kind.as_str()), ) } }; - let first_key = Ident::new(first_name, Span::call_site()); - let lift = match second_name { - None => { + let lift = match op_ty { + OperandTy::Single(name) => { + let key = Ident::new(name, Span::call_site()); quote! { match #iter.next() { - Some(&dr::Operand::#first_key(ref value)) => Some(#lift_value), + Some(&dr::Operand::#key(ref value)) => Some(#lift_value), Some(_) => Err(OperandError::WrongType)?, None => None, } } } - Some(name) => { - let second_key = Ident::new(name, Span::call_site()); + OperandTy::Pair { first, second } => { + let first_key = Ident::new(first, Span::call_site()); + let second_key = Ident::new(second, Span::call_site()); + quote! { match (#iter.next(), #iter.next()) { (Some(&dr::Operand::#first_key(first)), Some(&dr::Operand::#second_key(second))) => Some(#lift_value), @@ -174,6 +193,29 @@ impl OperandTokens { } } } + OperandTy::ImageOperands => { + // Generate code will split the image operand mask and consume trailig id refs + // for each operand bit. + let first_key = Ident::new("ImageOperands", Span::call_site()); + let second_key = Ident::new("IdRef", Span::call_site()); + quote! { + match #iter.next() { + Some(&dr::Operand::#first_key(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands).map(|_| + match #iter.next() { + Some(&dr::Operand::#second_key(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + } + ).collect::, _>>()?; + Some((*value, operands)) + }, + Some(_) => Err(OperandError::WrongType)?, + None => None, + } + } + } }; let (quantified_type, lift_expression) = match operand.quantifier { diff --git a/rspirv/lift/autogen_context.rs b/rspirv/lift/autogen_context.rs index 5401907e..3a70d5d8 100644 --- a/rspirv/lift/autogen_context.rs +++ b/rspirv/lift/autogen_context.rs @@ -749,7 +749,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -768,7 +778,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: (match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }) @@ -794,7 +814,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -819,7 +849,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: (match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }) @@ -839,7 +879,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -858,7 +908,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: (match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }) @@ -884,7 +944,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -909,7 +979,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: (match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }) @@ -929,7 +1009,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -954,7 +1044,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -979,7 +1079,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -998,7 +1108,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -1023,7 +1143,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -3797,7 +3927,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -3816,7 +3956,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: (match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }) @@ -3842,7 +3992,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -3867,7 +4027,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: (match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }) @@ -3887,7 +4057,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -3906,7 +4086,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: (match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }) @@ -3932,7 +4122,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -3957,7 +4157,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: (match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }) @@ -3977,7 +4187,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -4002,7 +4222,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -4027,7 +4257,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -4095,7 +4335,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, @@ -5469,7 +5719,17 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, image_operands: match operands.next() { - Some(&dr::Operand::ImageOperands(ref value)) => Some(*value), + Some(&dr::Operand::ImageOperands(ref value)) => { + let num_operands = value.bits().count_ones(); + let operands = (0..num_operands) + .map(|_| match operands.next() { + Some(&dr::Operand::IdRef(second)) => Ok(second), + Some(_) => Err(OperandError::WrongType), + None => Err(OperandError::Missing), + }) + .collect::, _>>()?; + Some((*value, operands)) + } Some(_) => Err(OperandError::WrongType)?, None => None, }, diff --git a/rspirv/sr/autogen_ops.rs b/rspirv/sr/autogen_ops.rs index 0d7d1c6c..ced8745d 100644 --- a/rspirv/sr/autogen_ops.rs +++ b/rspirv/sr/autogen_ops.rs @@ -200,74 +200,74 @@ pub enum Op { ImageSampleImplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageSampleExplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, - image_operands: spirv::ImageOperands, + image_operands: (spirv::ImageOperands, Vec), }, ImageSampleDrefImplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, d_ref: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageSampleDrefExplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, d_ref: spirv::Word, - image_operands: spirv::ImageOperands, + image_operands: (spirv::ImageOperands, Vec), }, ImageSampleProjImplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageSampleProjExplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, - image_operands: spirv::ImageOperands, + image_operands: (spirv::ImageOperands, Vec), }, ImageSampleProjDrefImplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, d_ref: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageSampleProjDrefExplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, d_ref: spirv::Word, - image_operands: spirv::ImageOperands, + image_operands: (spirv::ImageOperands, Vec), }, ImageFetch { image: spirv::Word, coordinate: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageGather { sampled_image: spirv::Word, coordinate: spirv::Word, component: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageDrefGather { sampled_image: spirv::Word, coordinate: spirv::Word, d_ref: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageRead { image: spirv::Word, coordinate: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageWrite { image: spirv::Word, coordinate: spirv::Word, texel: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, Image { sampled_image: spirv::Word, @@ -1017,63 +1017,63 @@ pub enum Op { ImageSparseSampleImplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageSparseSampleExplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, - image_operands: spirv::ImageOperands, + image_operands: (spirv::ImageOperands, Vec), }, ImageSparseSampleDrefImplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, d_ref: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageSparseSampleDrefExplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, d_ref: spirv::Word, - image_operands: spirv::ImageOperands, + image_operands: (spirv::ImageOperands, Vec), }, ImageSparseSampleProjImplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageSparseSampleProjExplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, - image_operands: spirv::ImageOperands, + image_operands: (spirv::ImageOperands, Vec), }, ImageSparseSampleProjDrefImplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, d_ref: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageSparseSampleProjDrefExplicitLod { sampled_image: spirv::Word, coordinate: spirv::Word, d_ref: spirv::Word, - image_operands: spirv::ImageOperands, + image_operands: (spirv::ImageOperands, Vec), }, ImageSparseFetch { image: spirv::Word, coordinate: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageSparseGather { sampled_image: spirv::Word, coordinate: spirv::Word, component: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageSparseDrefGather { sampled_image: spirv::Word, coordinate: spirv::Word, d_ref: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, ImageSparseTexelsResident { resident_code: spirv::Word, @@ -1092,7 +1092,7 @@ pub enum Op { ImageSparseRead { image: spirv::Word, coordinate: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, SizeOf { pointer: spirv::Word, @@ -1448,7 +1448,7 @@ pub enum Op { coordinate: spirv::Word, granularity: spirv::Word, coarse: spirv::Word, - image_operands: Option, + image_operands: Option<(spirv::ImageOperands, Vec)>, }, GroupNonUniformPartitionNV { value: spirv::Word,