ColorWriteFunction GetColorWriteFunction(GLenum format, GLenum type) { static const FormatWriteFunctionMap formatTypeMap = BuildFormatWriteFunctionMap(); FormatWriteFunctionMap::const_iterator iter = formatTypeMap.find(FormatTypePair(format, type)); ASSERT(iter != formatTypeMap.end()); if (iter != formatTypeMap.end()) { return iter->second; } else { return NULL; } }
ColorWriteFunction GetColorWriteFunction(const gl::FormatType &formatType) { static const FormatWriteFunctionMap formatTypeMap = BuildFormatWriteFunctionMap(); auto iter = formatTypeMap.find(formatType); ASSERT(iter != formatTypeMap.end()); if (iter != formatTypeMap.end()) { return iter->second; } else { return nullptr; } }