From 3b9e0a786eb0a394899479c6df7f780459204cf7 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 27 Feb 2023 18:44:21 +0900 Subject: [PATCH] [vkgen] Support renaming of auto fields --- libs/video/renderer/vulkan/vkgen/vkfieldauto.r | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/video/renderer/vulkan/vkgen/vkfieldauto.r b/libs/video/renderer/vulkan/vkgen/vkfieldauto.r index ee3d79535..de4a347c9 100644 --- a/libs/video/renderer/vulkan/vkgen/vkfieldauto.r +++ b/libs/video/renderer/vulkan/vkgen/vkfieldauto.r @@ -1,3 +1,5 @@ +#include + #include "vkfieldauto.h" #include "vkgen.h" #include "vkstruct.h" @@ -10,7 +12,8 @@ if (!self) { return self; } - field = [strct findField:field_name]; + string real_name = [[item getObjectForKey:"field"] string]; + field = [strct findField:real_name ? real_name : field_name]; return self; } @@ -25,7 +28,7 @@ { Type *field_type = [Type findType: field.type]; fprintf (output_file, "\t{\"%s\", field_offset (%s, %s), %s, %s, %s},\n", - field_name, struct_name, field_name, + field_name, struct_name, field.name, [field_type parseType], [field_type parseFunc], [field_type parseData]); return self; @@ -36,7 +39,7 @@ Type *field_type = [Type findType: field.type]; fprintf (output_file, "\t{\"%s\", &%s, (void *) field_offset (%s, %s)},\n", - field_name, [field_type cexprType], struct_name, field_name); + field_name, [field_type cexprType], struct_name, field.name); return self; }