diff --git a/src/valid/function.rs b/src/valid/function.rs index a55f57b6cd..6c732a7655 100644 --- a/src/valid/function.rs +++ b/src/valid/function.rs @@ -139,6 +139,11 @@ pub enum FunctionError { InvalidRayDescriptor(Handle), #[error("Ray Query {0:?} does not have a matching type")] InvalidRayQueryType(Handle), + #[error("Printf value argument {index} expression is invalid")] + InvalidPrintfArgument { + index: usize, + source: ExpressionError, + }, #[error( "Required uniformity of control flow for {0:?} in {1:?} is not fulfilled because of {2:?}" )] @@ -919,8 +924,15 @@ impl super::Validator { crate::RayQueryFunction::Terminate => {} } } - S::DebugPrintf { .. } => { - // FIXME + S::DebugPrintf { ref arguments, .. } => { + for (index, &expr) in arguments.iter().enumerate() { + context + .resolve_type_impl(expr, &self.valid_expression_set) + .map_err_inner(|source| { + FunctionError::InvalidPrintfArgument { index, source } + .with_span_handle(expr, context.expressions) + })?; + } } } }