MCPcopy Create free account
hub / github.com/baldurk/renderdoc / DeclareEnum

Method DeclareEnum

qrenderdoc/Code/BufferFormatter.cpp:3069–3087  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3067}
3068
3069QString BufferFormatter::DeclareEnum(const QString &name, const rdcarray<ShaderConstant> &members,
3070 VarType baseType)
3071{
3072 QString ret;
3073
3074 const bool signedEnum = VarTypeCompType(baseType) == CompType::SInt;
3075
3076 ShaderVariable tmp;
3077 tmp.columns = 1;
3078
3079 ret += QFormatStr("enum %1 : %2\n{\n").arg(name).arg(ToQStr(baseType));
3080 for(const ShaderConstant &c : members)
3081 {
3082 tmp.value.u64v[0] = c.defaultValue;
3083 ret += QFormatStr(" %1 = %2,\n").arg(c.name).arg(RowString(tmp, 0, baseType));
3084 }
3085 ret += lit("}\n");
3086 return ret;
3087}
3088
3089QString BufferFormatter::DeclareStruct(Packing::Rules pack, ResourceId shader, const QString &name,
3090 const rdcarray<ShaderConstant> &members,

Callers

nothing calls this directly

Calls 4

VarTypeCompTypeFunction · 0.85
RowStringFunction · 0.85
ToQStrFunction · 0.70
argMethod · 0.45

Tested by

no test coverage detected