Exemple #1
0
TString Decorate(const ImmutableString &string)
{
    if (!string.beginsWith("gl_"))
    {
        return "_" + TString(string.data());
    }

    return TString(string.data());
}
Exemple #2
0
void TOutputVulkanGLSL::writeQualifier(TQualifier qualifier,
                                       const TType &type,
                                       const TSymbol *symbol)
{
    if (qualifier != EvqUniform && qualifier != EvqAttribute && qualifier != EvqVertexIn &&
        !sh::IsVarying(qualifier))
    {
        TOutputGLSLBase::writeQualifier(qualifier, type, symbol);
        return;
    }

    if (symbol == nullptr)
    {
        return;
    }

    ImmutableString name = symbol->name();

    // For interface blocks, use the block name instead.  When the qualifier is being replaced in
    // the backend, that would be the name that's available.
    if (type.isInterfaceBlock())
    {
        name = type.getInterfaceBlock()->name();
    }

    TInfoSinkBase &out = objSink();
    out << "@@ QUALIFIER-" << name.data() << " @@ ";
}
Exemple #3
0
TString DecorateField(const ImmutableString &string, const TStructure &structure)
{
    if (structure.symbolType() != SymbolType::BuiltIn)
    {
        return Decorate(string);
    }

    return TString(string.data());
}
Exemple #4
0
TString DecoratePrivate(const ImmutableString &privateText)
{
    return "dx_" + TString(privateText.data());
}