Change serialization name for RDMTL structs

Changed from "RDMTL::TYPE" -> "MTLTYPE" to better match the Metal type name
Rename RDMTL::FunctionGroups -> RDMTL::FunctionGroup
This commit is contained in:
Jake Turner
2022-05-18 21:09:29 +01:00
committed by Baldur Karlsson
parent cb98a133bf
commit 362d1a46b3
3 changed files with 24 additions and 15 deletions
+2 -2
View File
@@ -166,7 +166,7 @@ void DoSerialise(SerialiserType &ser, RDMTL::VertexDescriptor &el)
}
template <typename SerialiserType>
void DoSerialise(SerialiserType &ser, RDMTL::FunctionGroups &el)
void DoSerialise(SerialiserType &ser, RDMTL::FunctionGroup &el)
{
SERIALISE_MEMBER(callsite);
SERIALISE_MEMBER(functions);
@@ -229,6 +229,6 @@ INSTANTIATE_SERIALISE_TYPE(RDMTL::PipelineBufferDescriptor);
INSTANTIATE_SERIALISE_TYPE(RDMTL::VertexAttributeDescriptor);
INSTANTIATE_SERIALISE_TYPE(RDMTL::VertexBufferLayoutDescriptor);
INSTANTIATE_SERIALISE_TYPE(RDMTL::VertexDescriptor);
INSTANTIATE_SERIALISE_TYPE(RDMTL::FunctionGroups);
INSTANTIATE_SERIALISE_TYPE(RDMTL::FunctionGroup);
INSTANTIATE_SERIALISE_TYPE(RDMTL::LinkedFunctions);
INSTANTIATE_SERIALISE_TYPE(RDMTL::RenderPipelineDescriptor);
+2 -2
View File
@@ -280,7 +280,7 @@ LinkedFunctions::LinkedFunctions(MTL::LinkedFunctions *objc)
NS::Array *funcs = (NS::Array *)objcGroups->object(key);
int countFuncs = funcs->count();
FunctionGroups &funcGroup = groups[i];
FunctionGroup &funcGroup = groups[i];
funcGroup.callsite.assign(key->utf8String());
funcGroup.functions.resize(countFuncs);
for(int j = 0; j < countFuncs; ++j)
@@ -305,7 +305,7 @@ void LinkedFunctions::CopyTo(MTL::LinkedFunctions *objc)
rdcarray<NS::String *> keys(countKeys);
for(int i = 0; i < countKeys; ++i)
{
FunctionGroups &funcGroup = groups[i];
FunctionGroup &funcGroup = groups[i];
keys[i] = NS::String::string(funcGroup.callsite.data(), NS::UTF8StringEncoding);
values[i] = CreateUnwrappedNSArray<MTL::Function *>(funcGroup.functions);
}
+20 -11
View File
@@ -189,7 +189,7 @@ struct VertexDescriptor
rdcarray<VertexAttributeDescriptor> attributes;
};
struct FunctionGroups
struct FunctionGroup
{
rdcstr callsite;
rdcarray<WrappedMTLFunction *> functions;
@@ -204,7 +204,7 @@ struct LinkedFunctions
void CopyTo(MTL::LinkedFunctions *objc);
rdcarray<WrappedMTLFunction *> functions;
rdcarray<WrappedMTLFunction *> binaryFunctions;
rdcarray<FunctionGroups> groups;
rdcarray<FunctionGroup> groups;
rdcarray<WrappedMTLFunction *> privateFunctions;
};
@@ -264,12 +264,21 @@ inline rdcliteral TypeName<NS::String *>()
template <class SerialiserType>
void DoSerialise(SerialiserType &ser, NS::String *&el);
DECLARE_REFLECTION_STRUCT(RDMTL::TextureDescriptor);
DECLARE_REFLECTION_STRUCT(RDMTL::RenderPipelineColorAttachmentDescriptor);
DECLARE_REFLECTION_STRUCT(RDMTL::PipelineBufferDescriptor);
DECLARE_REFLECTION_STRUCT(RDMTL::VertexAttributeDescriptor);
DECLARE_REFLECTION_STRUCT(RDMTL::VertexBufferLayoutDescriptor);
DECLARE_REFLECTION_STRUCT(RDMTL::VertexDescriptor);
DECLARE_REFLECTION_STRUCT(RDMTL::FunctionGroups);
DECLARE_REFLECTION_STRUCT(RDMTL::LinkedFunctions);
DECLARE_REFLECTION_STRUCT(RDMTL::RenderPipelineDescriptor);
#define RDMTL_DECLARE_REFLECTION_STRUCT(TYPE) \
template <> \
inline rdcliteral TypeName<RDMTL::TYPE>() \
{ \
return STRING_LITERAL(STRINGIZE(MTL##TYPE)); \
} \
template <class SerialiserType> \
void DoSerialise(SerialiserType &ser, RDMTL::TYPE &el);
RDMTL_DECLARE_REFLECTION_STRUCT(TextureDescriptor);
RDMTL_DECLARE_REFLECTION_STRUCT(RenderPipelineColorAttachmentDescriptor);
RDMTL_DECLARE_REFLECTION_STRUCT(PipelineBufferDescriptor);
RDMTL_DECLARE_REFLECTION_STRUCT(VertexAttributeDescriptor);
RDMTL_DECLARE_REFLECTION_STRUCT(VertexBufferLayoutDescriptor);
RDMTL_DECLARE_REFLECTION_STRUCT(VertexDescriptor);
RDMTL_DECLARE_REFLECTION_STRUCT(FunctionGroup);
RDMTL_DECLARE_REFLECTION_STRUCT(LinkedFunctions);
RDMTL_DECLARE_REFLECTION_STRUCT(RenderPipelineDescriptor);