quakeforge/libs/video/renderer/vulkan/vkgen/vkstruct.h
Bill Currie c1b85a3db7 [vkgen] Support custom parsing in multi-type fields
This allows the likes of:

    qfv_pushconstantrangeinfo_s = {
	.name = qfv_pushconstantrangeinfo_t;
	.type = (QFDictionary);
	.dictionary = {
	    .parse = {
		type = (labeledarray, qfv_pushconstantinfo_t, name);
		size = num_pushconstants;
		values = pushconstants;
	    };
	    stageFlags = $name.auto;
	};
	stageFlags = auto;
    };

Leading to:

    pushConstants = {
	vertex   = { Model = mat4; blend = float; };
	fragment = { colors = uint; base_color = vec4; fog = vec4; };
    };

Where the label of the labeled array (which pushConstants is) is
actually an enum flag and the dictionary value is another labeled array.
2023-06-16 18:53:37 +09:00

34 lines
631 B
Objective-C

#ifndef __renderer_vulkan_vkgen_vkstruct_h
#define __renderer_vulkan_vkgen_vkstruct_h
#include <Object.h>
#include "vkgen.h"
#include "vktype.h"
@class PLItem;
@class FieldDef;
@interface Struct: Type
{
string outname;
string label_field;
int write_symtab;
int skip;
Array *field_defs;
FieldDef *parse_def;
PLItem *field_dict;
PLItem *only;
}
-(void) queueFieldTypes;
-(qfot_var_t *)findField:(string) fieldName;
-(void) setLabelField:(string) label_field;
-(void) writeForward;
-(void) writeTable;
-(void) writeSymtabInit;
-(void) writeSymtabEntry;
-(string) outname;
@end
#endif//__renderer_vulkan_vkgen_vkstruct_h