From fe16fed01ab3684498928f01d8f0470d4926a673 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 4 Sep 2024 10:33:10 +0900 Subject: [PATCH] [vulkan] Update vkgen for the newly added bool type I had forgotten about this, and ironically it's just one field in all of vkparse, but adding support for bool to vkgen was easier than expected. --- .../video/renderer/vulkan/vkgen/Makemodule.am | 2 ++ libs/video/renderer/vulkan/vkgen/stdint.h | 1 - libs/video/renderer/vulkan/vkgen/vkbool.h | 11 ++++++++++ libs/video/renderer/vulkan/vkgen/vkbool.r | 22 +++++++++++++++++++ libs/video/renderer/vulkan/vkgen/vktype.r | 4 +++- 5 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 libs/video/renderer/vulkan/vkgen/vkbool.h create mode 100644 libs/video/renderer/vulkan/vkgen/vkbool.r diff --git a/libs/video/renderer/vulkan/vkgen/Makemodule.am b/libs/video/renderer/vulkan/vkgen/Makemodule.am index 8bec1de68..a092e3cfe 100644 --- a/libs/video/renderer/vulkan/vkgen/Makemodule.am +++ b/libs/video/renderer/vulkan/vkgen/Makemodule.am @@ -5,6 +5,7 @@ EXTRA_PROGRAMS += vkgen.dat$(EXEEXT) vkgen_dat_src= \ libs/video/renderer/vulkan/vkgen/vkalias.r \ + libs/video/renderer/vulkan/vkgen/vkbool.r \ libs/video/renderer/vulkan/vkgen/vkenum.r \ libs/video/renderer/vulkan/vkgen/vkfieldarray.r \ libs/video/renderer/vulkan/vkgen/vkfieldauto.r \ @@ -51,6 +52,7 @@ EXTRA_DIST += \ libs/video/renderer/vulkan/vkgen/stddef.h \ libs/video/renderer/vulkan/vkgen/stdint.h \ libs/video/renderer/vulkan/vkgen/vkalias.h \ + libs/video/renderer/vulkan/vkgen/vkbool.h \ libs/video/renderer/vulkan/vkgen/vkenum.h \ libs/video/renderer/vulkan/vkgen/vkfieldarray.h \ libs/video/renderer/vulkan/vkgen/vkfieldauto.h \ diff --git a/libs/video/renderer/vulkan/vkgen/stdint.h b/libs/video/renderer/vulkan/vkgen/stdint.h index 5b598953c..d0a448005 100644 --- a/libs/video/renderer/vulkan/vkgen/stdint.h +++ b/libs/video/renderer/vulkan/vkgen/stdint.h @@ -10,5 +10,4 @@ typedef int int32_t; typedef int int64_t; typedef int size_t; typedef struct char { int x; } char;//FIXME add char to qfcc -typedef struct bool { int x; } bool;//FIXME add bool to qfcc #endif//__vkgen_stdint_h diff --git a/libs/video/renderer/vulkan/vkgen/vkbool.h b/libs/video/renderer/vulkan/vkgen/vkbool.h new file mode 100644 index 000000000..5ab300282 --- /dev/null +++ b/libs/video/renderer/vulkan/vkgen/vkbool.h @@ -0,0 +1,11 @@ +#ifndef __renderer_vulkan_vkgen_vkbool_h +#define __renderer_vulkan_vkgen_vkbool_h + +#include "vktype.h" + +@class PLItem; + +@interface Bool: Type +@end + +#endif//__renderer_vulkan_vkgen_vkbool_h diff --git a/libs/video/renderer/vulkan/vkgen/vkbool.r b/libs/video/renderer/vulkan/vkgen/vkbool.r new file mode 100644 index 000000000..db806e99c --- /dev/null +++ b/libs/video/renderer/vulkan/vkgen/vkbool.r @@ -0,0 +1,22 @@ +#include + +#include "vkbool.h" +#include "vkgen.h" + +@implementation Bool + +-(string) name +{ + return "bool"; +} + +-(string) cexprType +{ + return "cexpr_bool"; +} + +-(string) parseType +{ + return "QFString"; +} +@end diff --git a/libs/video/renderer/vulkan/vkgen/vktype.r b/libs/video/renderer/vulkan/vkgen/vktype.r index fac2ef494..ebe9853cc 100644 --- a/libs/video/renderer/vulkan/vkgen/vktype.r +++ b/libs/video/renderer/vulkan/vkgen/vktype.r @@ -1,6 +1,7 @@ #include #include "vkalias.h" +#include "vkbool.h" #include "vkenum.h" #include "vkfixedarray.h" #include "vkgen.h" @@ -51,7 +52,8 @@ static string get_type_key (void *type, void *unused) return nil; } switch (type.meta) { - case ty_bool: //FIXME special type? + case ty_bool: + return [[Bool alloc] initWithType: type]; case ty_basic: if (type.type == ev_ptr) { Type *tgt = [Type findType: type.fldptr.aux_type];