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

Function MatchBaseTypeDeclaration

qrenderdoc/Code/BufferFormatter.cpp:52–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50GraphicsAPI BufferFormatter::m_API;
51
52static bool MatchBaseTypeDeclaration(QString basetype, const bool isUnsigned, ShaderConstant &el)
53{
54 if(basetype == lit("bool"))
55 {
56 el.type.baseType = VarType::Bool;
57 }
58 else if(basetype == lit("byte") || basetype == lit("char") || basetype == lit("int8_t"))
59 {
60 el.type.baseType = VarType::SByte;
61
62 if(isUnsigned)
63 el.type.baseType = VarType::UByte;
64 }
65 else if(basetype == lit("ubyte") || basetype == lit("xbyte") || basetype == lit("uint8_t"))
66 {
67 el.type.baseType = VarType::UByte;
68 }
69 else if(basetype == lit("short") || basetype == lit("int16_t"))
70 {
71 el.type.baseType = VarType::SShort;
72
73 if(isUnsigned)
74 el.type.baseType = VarType::UShort;
75 }
76 else if(basetype == lit("ushort") || basetype == lit("xshort") || basetype == lit("uint16_t"))
77 {
78 el.type.baseType = VarType::UShort;
79 }
80 else if(basetype == lit("long") || basetype == lit("int64_t"))
81 {
82 el.type.baseType = VarType::SLong;
83
84 if(isUnsigned)
85 el.type.baseType = VarType::ULong;
86 }
87 else if(basetype == lit("ulong") || basetype == lit("xlong") || basetype == lit("uint64_t"))
88 {
89 el.type.baseType = VarType::ULong;
90 }
91 else if(basetype == lit("int") || basetype == lit("ivec") || basetype == lit("imat") ||
92 basetype == lit("int32_t"))
93 {
94 el.type.baseType = VarType::SInt;
95
96 if(isUnsigned)
97 el.type.baseType = VarType::UInt;
98 }
99 else if(basetype == lit("uint") || basetype == lit("xint") || basetype == lit("uvec") ||
100 basetype == lit("umat") || basetype == lit("uint32_t"))
101 {
102 el.type.baseType = VarType::UInt;
103 }
104 else if(basetype == lit("half") || basetype == lit("float16_t"))
105 {
106 el.type.baseType = VarType::Half;
107 }
108 else if(basetype == lit("float") || basetype == lit("vec") || basetype == lit("mat") ||
109 basetype == lit("float32_t"))

Callers 1

ParseFormatStringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected