1 #ifndef _RSGPROGRAMEXECUTOR_HPP
2 #define _RSGPROGRAMEXECUTOR_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program Random Shader Generator
5 * ----------------------------------------------------
7 * Copyright 2014 The Android Open Source Project
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief Program Executor.
24 *//*--------------------------------------------------------------------*/
26 #include "rsgDefs.hpp"
27 #include "rsgShader.hpp"
28 #include "rsgVariableValue.hpp"
29 #include "tcuTexture.hpp"
30 #include "rsgSamplers.hpp"
45 ProgramExecutor (const tcu::PixelBufferAccess& dst, int gridWidth, int gridHeight);
46 ~ProgramExecutor (void);
48 void setTexture (int samplerNdx, const tcu::Texture2D* texture, const tcu::Sampler& sampler);
49 void setTexture (int samplerNdx, const tcu::TextureCube* texture, const tcu::Sampler& sampler);
51 void execute (const Shader& vertexShader, const Shader& fragmentShader, const std::vector<VariableValue>& uniforms);
54 tcu::PixelBufferAccess m_dst;
58 Sampler2DMap m_samplers2D;
59 SamplerCubeMap m_samplersCube;
62 inline void getVertexInterpolationCoords (float& xd, float& yd, float x, float y, int inputElementNdx)
64 if (inputElementNdx % 4 < 2)
69 if (inputElementNdx % 2 == 0)
77 #endif // _RSGPROGRAMEXECUTOR_HPP