ImmutableString ImageFunctionHLSL::ImageFunction::name() const { static const ImmutableString kGlImageName("gl_image"); ImmutableString suffix(nullptr); if (readonly) { suffix = ImmutableString(TextureTypeSuffix(image, imageInternalFormat)); } else { suffix = ImmutableString(RWTextureTypeSuffix(image, imageInternalFormat)); } ImmutableStringBuilder name(kGlImageName.length() + suffix.length() + 5u); name << kGlImageName << suffix; switch (method) { case Method::SIZE: name << "Size"; break; case Method::LOAD: name << "Load"; break; case Method::STORE: name << "Store"; break; default: UNREACHABLE(); } return name; }
TIntermAggregate *EmulatePrecision::createCompoundAssignmentFunctionCallNode(TIntermTyped *left, TIntermTyped *right, const char *opNameStr) { std::stringstream strstr = sh::InitializeStream<std::stringstream>(); if (left->getPrecision() == EbpMedium) strstr << "angle_compound_" << opNameStr << "_frm"; else strstr << "angle_compound_" << opNameStr << "_frl"; ImmutableString functionName = ImmutableString(strstr.str()); TIntermSequence *arguments = new TIntermSequence(); arguments->push_back(left); arguments->push_back(right); TVector<const TVariable *> parameters; TType *leftParamType = new TType(left->getType()); leftParamType->setPrecision(EbpHigh); leftParamType->setQualifier(EvqOut); parameters.push_back(new TVariable(mSymbolTable, kParamXName, static_cast<const TType *>(leftParamType), SymbolType::AngleInternal)); TType *rightParamType = new TType(right->getType()); rightParamType->setPrecision(EbpHigh); rightParamType->setQualifier(EvqIn); parameters.push_back(new TVariable(mSymbolTable, kParamYName, static_cast<const TType *>(rightParamType), SymbolType::AngleInternal)); return TIntermAggregate::CreateRawFunctionCall( *getInternalFunction(functionName, left->getType(), arguments, parameters, false), arguments); }
ImmutableString::ImmutableString(ImmutableString & str) { ImmutableString(); m_pProxy = str.m_pProxy; AddRef(); }