From bcfb2ad18276998745a050c93c9270b1a7ba39cd Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 16 Jun 2023 18:49:58 +0900 Subject: [PATCH] [vkgen] Shorten "qfv_*" enum names The up-coming changes to push constant handling has qfv_float etc type enum values and using "float" instead of "qfv_float" is highly desirable as the names match the glsl type names. --- libs/video/renderer/vulkan/vkgen/vkenum.r | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libs/video/renderer/vulkan/vkgen/vkenum.r b/libs/video/renderer/vulkan/vkgen/vkenum.r index 8b7bde8f5..1995426fa 100644 --- a/libs/video/renderer/vulkan/vkgen/vkenum.r +++ b/libs/video/renderer/vulkan/vkgen/vkenum.r @@ -22,13 +22,17 @@ typedef enum VkBool32 { end = "_FLAG_BITS_MAX_ENUM_EXT"; } else if (str_mid([self name], -3) == "KHR") { end = "_MAX_ENUM_KHR"; + } else if (str_mid([self name], 0, 4) == "qfv_") { + prefix = "qfv_"; } len = -strlen (end); - for (int i = 0; i < type.strct.num_fields; i++) { - qfot_var_t *var = &type.strct.fields[i]; - if (str_mid (var.name, len) == end) { - // len is negative so +1 consumes 1 more char (_) - prefix = str_hold (str_mid (var.name, 0, len + 1)); + if (!prefix) { + for (int i = 0; i < type.strct.num_fields; i++) { + qfot_var_t *var = &type.strct.fields[i]; + if (str_mid (var.name, len) == end) { + // len is negative so +1 consumes 1 more char (_) + prefix = str_hold (str_mid (var.name, 0, len + 1)); + } } } if (prefix) {