Lines Matching full:shader
2 * drawElements Quality Program Random Shader Generator
21 * \brief Shader generator.
92 void genVertexPassthrough (GeneratorState& state, Shader& shader)
94 // Create copies from shader inputs to outputs
116 // Update value range. This will be stored into shader input info.
120 createAssignment(shader.getMain().getBody(), entry->getVariable(), inVar);
124 void genFragmentPassthrough (GeneratorState& state, Shader& shader)
133 createAssignment(shader.getMain().getBody(), fragColorEntry->getVariable(), inColorVariable);
136 // Sets undefined (-inf..inf) components to some meaningful values. Used for sanitizing final shader input value ranges.
173 void ShaderGenerator::generate (const ShaderParameters& shaderParams, Shader& shader, const vector<ShaderInput*>& outputs)
176 VariableScope& globalVariableScope = shader.getGlobalScope();
180 m_state.setShader(shaderParams, shader);
185 if (shader.getType() == Shader::TYPE_VERTEX)
192 // Init shader outputs.
202 if (shader.getType() == Shader::TYPE_FRAGMENT)
205 // \todo [2011-11-22 pyry] Multiple outputs from fragment shader!
218 // Construct shader code.
220 Function& main = shader.getMain();
227 // Mandate assignment into to all shader outputs in main()
240 if (shader.getType() == Shader::TYPE_VERTEX)
241 genVertexPassthrough(m_state, shader);
244 DE_ASSERT(shader.getType() == Shader::TYPE_FRAGMENT);
245 genFragmentPassthrough(m_state, shader);
249 if (shader.getType() == Shader::TYPE_VERTEX)
282 vector<ShaderInput*>& inputs = shader.getInputs();
283 vector<ShaderInput*>& uniforms = shader.getUniforms();
325 shader.getGlobalStatements().reserve(shader.getGlobalStatements().size());
326 shader.getGlobalStatements().push_back(new DeclarationStatement(m_state, *i));
337 fillUndefinedShaderInputs(shader.getInputs());
338 fillUndefinedShaderInputs(shader.getUniforms());
340 // Tokenize shader and write source
343 shader.tokenize(m_state, tokenStr);
353 shader.setSource(str.str().c_str());