[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.
This commit is contained in:
Bill Currie 2023-06-16 18:49:58 +09:00
parent 57da924c1b
commit bcfb2ad182

View file

@ -22,8 +22,11 @@ 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);
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) {
@ -31,6 +34,7 @@ typedef enum VkBool32 {
prefix = str_hold (str_mid (var.name, 0, len + 1));
}
}
}
if (prefix) {
prefix_length = strlen (prefix);
}