From 6b6f2ee8a8833db6da0977917bcf010b46dc1cd0 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Fri, 17 Feb 2023 19:50:59 +0100 Subject: [PATCH] generator: Limit `pCode` member workaround to `VkShaderModuleCreateInfo` (#707) An upcoming extension will ship with an untyped `pCode` member (`void *`) including a valid `len` field pointing to a `codeSize` field rather than obscure Latex math and a `/4` expression in `altlen`. Limit the scope of our workaround for that SPIR-V-specific `pCode` field to `VkShaderModuleCreateInfo`. --- generator/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/src/lib.rs b/generator/src/lib.rs index dc49b1c..b3c9ae0 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -1659,7 +1659,7 @@ pub fn derive_setters( } // Unique cases - if name == "pCode" { + if struct_.name == "VkShaderModuleCreateInfo" && name == "pCode" { return Some(quote!{ #[inline] pub fn code(mut self, code: &'a [u32]) -> Self {