diff --git a/src/back/hlsl/writer.rs b/src/back/hlsl/writer.rs index 7889842197..05e92ae67a 100644 --- a/src/back/hlsl/writer.rs +++ b/src/back/hlsl/writer.rs @@ -2008,8 +2008,19 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> { writeln!(self.out, "{level}}}")? } Statement::RayQuery { .. } => unreachable!(), - Statement::DebugPrint { .. } => { - return Err(Error::Unimplemented("debug printf".to_string())); + Statement::DebugPrintf { + ref format, + ref arguments, + } => { + write!(self.out, "{level}")?; + write!(self.out, "printf(\"{format}\",")?; + for (index, argument) in arguments.iter().enumerate() { + if index != 0 { + write!(self.out, ", ")?; + } + self.write_expr(module, *argument, func_ctx)?; + } + writeln!(self.out, ");")? } }