static tcu::RenderTarget toRenderTarget (const RenderConfig& renderCfg) { const int width = getValueOrDefault(renderCfg, &RenderConfig::width, 256); const int height = getValueOrDefault(renderCfg, &RenderConfig::height, 256); const int redBits = getValueOrDefault(renderCfg, &RenderConfig::redBits, 8); const int greenBits = getValueOrDefault(renderCfg, &RenderConfig::greenBits, 8); const int blueBits = getValueOrDefault(renderCfg, &RenderConfig::blueBits, 8); const int alphaBits = getValueOrDefault(renderCfg, &RenderConfig::alphaBits, 8); const int depthBits = getValueOrDefault(renderCfg, &RenderConfig::depthBits, 24); const int stencilBits = getValueOrDefault(renderCfg, &RenderConfig::stencilBits, 8); const int numSamples = getValueOrDefault(renderCfg, &RenderConfig::numSamples, 0); return tcu::RenderTarget(width, height, tcu::PixelFormat(redBits, greenBits, blueBits, alphaBits), depthBits, stencilBits, numSamples); }
InstructionInformation *DeviceInformation::getInstructionInfo(std::string opcodeName) { size_t pos; if (InstructionInformation *ii = getValueOrDefault(*instrInfoMap, opcodeName)) return ii; else if ((pos = opcodeName.find('#')) != std::string::npos) { std::string opcodePrefix = opcodeName.substr(0, pos); assert(contains(*instrInfoMap, opcodePrefix)); return (*instrInfoMap)[opcodePrefix]; } else { assert(false); return NULL; } }