tracel_rspirv/dr/
autogen_nonsemantic_debugprintf.rs

1// AUTOMATICALLY GENERATED from the SPIR-V JSON grammar:
2//   external/spirv.core.grammar.json.
3// DO NOT MODIFY!
4
5use crate::{
6    dr::{self, Builder},
7    spirv,
8};
9impl Builder {
10    #[allow(clippy::too_many_arguments)]
11    pub fn debug_printf(
12        &mut self,
13        format: spirv::Word,
14        id_ref: impl IntoIterator<Item = spirv::Word>,
15    ) -> Result<spirv::Word, dr::Error> {
16        self.debug_printf_id(None, format, id_ref)
17    }
18    #[allow(clippy::too_many_arguments)]
19    pub fn debug_printf_id(
20        &mut self,
21        result_id: Option<spirv::Word>,
22        format: spirv::Word,
23        id_ref: impl IntoIterator<Item = spirv::Word>,
24    ) -> Result<spirv::Word, dr::Error> {
25        let extension_set = super::ext_inst_import(self, "NonSemantic.DebugPrintf");
26        let result_type = self.type_void();
27        #[allow(unused_mut)]
28        let mut args = vec![dr::Operand::IdRef(format)];
29        args.extend(id_ref.into_iter().map(dr::Operand::IdRef));
30        self.ext_inst(
31            result_type,
32            result_id,
33            extension_set,
34            crate::spirv::DebugPrintfOp::DebugPrintf as spirv::Word,
35            args,
36        )
37    }
38}