1e5c31af7Sopenharmony_ci/*------------------------------------------------------------------------- 2e5c31af7Sopenharmony_ci * drawElements Quality Program OpenGL (ES) Module 3e5c31af7Sopenharmony_ci * ----------------------------------------------- 4e5c31af7Sopenharmony_ci * 5e5c31af7Sopenharmony_ci * Copyright 2014 The Android Open Source Project 6e5c31af7Sopenharmony_ci * 7e5c31af7Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 8e5c31af7Sopenharmony_ci * you may not use this file except in compliance with the License. 9e5c31af7Sopenharmony_ci * You may obtain a copy of the License at 10e5c31af7Sopenharmony_ci * 11e5c31af7Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 12e5c31af7Sopenharmony_ci * 13e5c31af7Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 14e5c31af7Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 15e5c31af7Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16e5c31af7Sopenharmony_ci * See the License for the specific language governing permissions and 17e5c31af7Sopenharmony_ci * limitations under the License. 18e5c31af7Sopenharmony_ci * 19e5c31af7Sopenharmony_ci *//*! 20e5c31af7Sopenharmony_ci * \file 21e5c31af7Sopenharmony_ci * \brief Compiler test case. 22e5c31af7Sopenharmony_ci *//*--------------------------------------------------------------------*/ 23e5c31af7Sopenharmony_ci 24e5c31af7Sopenharmony_ci#include "glsShaderLibrary.hpp" 25e5c31af7Sopenharmony_ci#include "glsShaderLibraryCase.hpp" 26e5c31af7Sopenharmony_ci 27e5c31af7Sopenharmony_cinamespace deqp 28e5c31af7Sopenharmony_ci{ 29e5c31af7Sopenharmony_cinamespace gls 30e5c31af7Sopenharmony_ci{ 31e5c31af7Sopenharmony_ci 32e5c31af7Sopenharmony_cinamespace 33e5c31af7Sopenharmony_ci{ 34e5c31af7Sopenharmony_ci 35e5c31af7Sopenharmony_ciclass CaseFactory : public glu::sl::ShaderCaseFactory 36e5c31af7Sopenharmony_ci{ 37e5c31af7Sopenharmony_cipublic: 38e5c31af7Sopenharmony_ci CaseFactory (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const glu::ContextInfo& contextInfo) 39e5c31af7Sopenharmony_ci : m_testCtx (testCtx) 40e5c31af7Sopenharmony_ci , m_renderCtx (renderCtx) 41e5c31af7Sopenharmony_ci , m_contextInfo (contextInfo) 42e5c31af7Sopenharmony_ci { 43e5c31af7Sopenharmony_ci } 44e5c31af7Sopenharmony_ci 45e5c31af7Sopenharmony_ci tcu::TestCaseGroup* createGroup (const std::string& name, const std::string& description, const std::vector<tcu::TestNode*>& children) 46e5c31af7Sopenharmony_ci { 47e5c31af7Sopenharmony_ci return new tcu::TestCaseGroup(m_testCtx, name.c_str(), description.c_str(), children); 48e5c31af7Sopenharmony_ci } 49e5c31af7Sopenharmony_ci 50e5c31af7Sopenharmony_ci tcu::TestCase* createCase (const std::string& name, const std::string& description, const glu::sl::ShaderCaseSpecification& spec) 51e5c31af7Sopenharmony_ci { 52e5c31af7Sopenharmony_ci return new ShaderLibraryCase(m_testCtx, m_renderCtx, m_contextInfo, name.c_str(), description.c_str(), spec); 53e5c31af7Sopenharmony_ci } 54e5c31af7Sopenharmony_ci 55e5c31af7Sopenharmony_ciprivate: 56e5c31af7Sopenharmony_ci tcu::TestContext& m_testCtx; 57e5c31af7Sopenharmony_ci glu::RenderContext& m_renderCtx; 58e5c31af7Sopenharmony_ci const glu::ContextInfo& m_contextInfo; 59e5c31af7Sopenharmony_ci}; 60e5c31af7Sopenharmony_ci 61e5c31af7Sopenharmony_ci} // anonymous 62e5c31af7Sopenharmony_ci 63e5c31af7Sopenharmony_ciShaderLibrary::ShaderLibrary (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const glu::ContextInfo& contextInfo) 64e5c31af7Sopenharmony_ci : m_testCtx (testCtx) 65e5c31af7Sopenharmony_ci , m_renderCtx (renderCtx) 66e5c31af7Sopenharmony_ci , m_contextInfo (contextInfo) 67e5c31af7Sopenharmony_ci{ 68e5c31af7Sopenharmony_ci} 69e5c31af7Sopenharmony_ci 70e5c31af7Sopenharmony_ciShaderLibrary::~ShaderLibrary (void) 71e5c31af7Sopenharmony_ci{ 72e5c31af7Sopenharmony_ci} 73e5c31af7Sopenharmony_ci 74e5c31af7Sopenharmony_cistd::vector<tcu::TestNode*> ShaderLibrary::loadShaderFile (const char* fileName) 75e5c31af7Sopenharmony_ci{ 76e5c31af7Sopenharmony_ci CaseFactory caseFactory (m_testCtx, m_renderCtx, m_contextInfo); 77e5c31af7Sopenharmony_ci 78e5c31af7Sopenharmony_ci return glu::sl::parseFile(m_testCtx.getArchive(), fileName, &caseFactory); 79e5c31af7Sopenharmony_ci} 80e5c31af7Sopenharmony_ci 81e5c31af7Sopenharmony_ci} // gls 82e5c31af7Sopenharmony_ci} // deqp 83