Lines Matching refs:glu

72 const char* getSimpleShaderSource (const glu::ShaderType shaderType)
79 case glu::SHADERTYPE_VERTEX:
81 case glu::SHADERTYPE_FRAGMENT:
90 void setShaderSources (glu::Shader& shader, const ShaderSources& sources)
131 void queryShaderInfo (glu::RenderContext& renderCtx, deUint32 shader, glu::ShaderInfo& info)
176 virtual std::string next (const glu::ShaderType shaderType) = 0;
177 virtual bool finished (const glu::ShaderType shaderType) const = 0;
186 bool finished (const glu::ShaderType shaderType) const { DE_UNREF(shaderType); return false; }
188 std::string next (const glu::ShaderType shaderType);
194 std::string ConstantShaderGenerator::next (const glu::ShaderType shaderType)
196 DE_ASSERT(shaderType == glu::SHADERTYPE_VERTEX || shaderType == glu::SHADERTYPE_FRAGMENT);
200 const std::string outputName = (shaderType == glu::SHADERTYPE_VERTEX) ? "gl_Position" : "gl_FragColor";
214 ShaderAllocator (glu::RenderContext& context, SourceGenerator& generator);
217 bool hasShader (const glu::ShaderType shaderType);
219 void setSource (const glu::ShaderType shaderType);
221 glu::Shader& createShader (const glu::ShaderType shaderType);
222 void deleteShader (const glu::ShaderType shaderType);
224 glu::Shader& get (const glu::ShaderType shaderType) { DE_ASSERT(hasShader(shaderType)); return *m_shaders[shaderType]; }
227 const glu::RenderContext& m_context;
229 std::map<glu::ShaderType, glu::Shader*> m_shaders;
232 ShaderAllocator::ShaderAllocator (glu::RenderContext& context, SourceGenerator& generator)
240 for (std::map<glu::ShaderType, glu::Shader*>::iterator shaderIter = m_shaders.begin(); shaderIter != m_shaders.end(); shaderIter++)
245 bool ShaderAllocator::hasShader (const glu::ShaderType shaderType)
253 glu::Shader& ShaderAllocator::createShader (const glu::ShaderType shaderType)
257 glu::Shader* const shader = new glu::Shader(m_context, shaderType);
265 void ShaderAllocator::deleteShader (const glu::ShaderType shaderType)
273 void ShaderAllocator::setSource (const glu::ShaderType shaderType)
286 void logShader (TestLog& log, glu::RenderContext& renderCtx, glu::Shader& shader)
288 glu::ShaderInfo info;
294 void logProgram (TestLog& log, glu::RenderContext& renderCtx, glu::Program& program, ShaderAllocator& shaders)
298 for (int shaderTypeInt = 0; shaderTypeInt < glu::SHADERTYPE_LAST; shaderTypeInt++)
300 const glu::ShaderType shaderType = (glu::ShaderType)shaderTypeInt;
309 void logVertexFragmentProgram (TestLog& log, glu::RenderContext& renderCtx, glu::Program& program, glu::Shader& vertShader, glu::Shader& fragShader)
311 DE_ASSERT(vertShader.getType() == glu::SHADERTYPE_VERTEX && fragShader.getType() == glu::SHADERTYPE_FRAGMENT);
328 CreateShaderCase (Context& context, const char* name, const char* desc, glu::ShaderType shaderType)
336 const GLuint shaderObject = glCreateShader(glu::getGLShaderType(m_shaderType));
344 const glu::ShaderType m_shaderType;
352 CompileShaderCase (Context& context, const char* name, const char* desc, glu::ShaderType shaderType)
370 const GLuint shaderObject = glCreateShader(glu::getGLShaderType(m_shaderType));
383 const glu::ShaderType m_shaderType;
405 const char* vertSource = getSimpleShaderSource(glu::SHADERTYPE_VERTEX);
406 const char* fragSource = getSimpleShaderSource(glu::SHADERTYPE_FRAGMENT);
530 ShaderSourceReplaceCase (Context& context, const char* name, const char* desc, glu::ShaderType shaderType)
552 if (m_shaderType == glu::SHADERTYPE_VERTEX) str += " gl_Position = vec4(variable);\n";
553 else if (m_shaderType == glu::SHADERTYPE_FRAGMENT) str += " gl_FragColor = vec4(variable);\n";
560 GLint getSourceLength (glu::Shader& shader)
569 std::string readSource (glu::Shader& shader)
579 void verifyShaderSourceReplaced (glu::Shader& shader, const std::string& firstSource, const std::string& secondSource)
600 glu::Shader shader (m_context.getRenderContext(), m_shaderType);
622 glu::ShaderType m_shaderType;
630 ShaderSourceSplitCase (Context& context, const char* name, const char* desc, glu::ShaderType shaderType, const int numSlices, const deUint32 flags = 0)
638 DE_ASSERT(m_shaderType == glu::SHADERTYPE_VERTEX || m_shaderType == glu::SHADERTYPE_FRAGMENT);
656 if (m_shaderType == glu::SHADERTYPE_VERTEX) str += " gl_Position = vec4(variable);\n";
657 else if (m_shaderType == glu::SHADERTYPE_FRAGMENT) str += " gl_FragColor = vec4(variable);\n";
699 void buildProgram (glu::Shader& shader)
702 glu::RenderContext& renderCtx = m_context.getRenderContext();
704 const glu::ShaderType supportShaderType = (m_shaderType == glu::SHADERTYPE_FRAGMENT ? glu::SHADERTYPE_VERTEX : glu::SHADERTYPE_FRAGMENT);
706 glu::Shader supportShader (renderCtx, supportShaderType);
708 glu::Program program (renderCtx);
718 if (m_shaderType == glu::SHADERTYPE_VERTEX)
727 glu::RenderContext& renderCtx = m_context.getRenderContext();
730 glu::Shader shader (renderCtx, m_shaderType);
748 glu::ShaderType m_shaderType;
760 ProgramStateCase (Context& context, const char* name, const char* desc, glu::ShaderType shaderType);
763 void buildProgram (glu::Program& program, ShaderAllocator& shaders);
764 void verify (glu::Program& program, const glu::ProgramInfo& reference);
768 virtual void executeForProgram (glu::Program& program, ShaderAllocator& shaders) = 0;
772 const glu::ShaderType m_shaderType;
775 ProgramStateCase::ProgramStateCase (Context& context, const char* name, const char* desc, glu::ShaderType shaderType)
780 DE_ASSERT(m_shaderType == glu::SHADERTYPE_VERTEX || m_shaderType == glu::SHADERTYPE_FRAGMENT);
783 void ProgramStateCase::buildProgram (glu::Program& program, ShaderAllocator& shaders)
787 glu::Shader& vertShader = shaders.createShader(glu::SHADERTYPE_VERTEX);
788 glu::Shader& fragShader = shaders.createShader(glu::SHADERTYPE_FRAGMENT);
800 void ProgramStateCase::verify (glu::Program& program, const glu::ProgramInfo& reference)
803 const glu::ProgramInfo& programInfo = program.getInfo();
827 glu::RenderContext& renderCtx = m_context.getRenderContext();
832 glu::Program program (renderCtx);
838 glu::ProgramInfo programInfo = program.getInfo();
863 const glu::ShaderType shaderType = (shaderTypeInt == 1) ? glu::SHADERTYPE_FRAGMENT : glu::SHADERTYPE_VERTEX;
880 ProgramStateDetachShaderCase (Context& context, const char* name, const char* desc, glu::ShaderType shaderType)
889 void executeForProgram (glu::Program& program, ShaderAllocator& shaders)
892 glu::Shader& caseShader = shaders.get(m_shaderType);
902 ProgramStateReattachShaderCase (Context& context, const char* name, const char* desc, glu::ShaderType shaderType)
911 void executeForProgram (glu::Program& program, ShaderAllocator& shaders)
914 glu::Shader& caseShader = shaders.get(m_shaderType);
925 ProgramStateDeleteShaderCase (Context& context, const char* name, const char* desc, glu::ShaderType shaderType)
934 void executeForProgram (glu::Program& program, ShaderAllocator& shaders)
937 glu::Shader& caseShader = shaders.get(m_shaderType);
948 ProgramStateReplaceShaderCase (Context& context, const char* name, const char* desc, glu::ShaderType shaderType)
957 void executeForProgram (glu::Program& program, ShaderAllocator& shaders)
960 glu::Shader& caseShader = shaders.get(m_shaderType);
972 ProgramStateRecompileShaderCase (Context& context, const char* name, const char* desc, glu::ShaderType shaderType)
981 void executeForProgram (glu::Program& program, ShaderAllocator& shaders)
984 glu::Shader& caseShader = shaders.get(m_shaderType);
995 ProgramStateReplaceSourceCase (Context& context, const char* name, const char* desc, glu::ShaderType shaderType)
1004 void executeForProgram (glu::Program& program, ShaderAllocator& shaders)
1007 glu::Shader& caseShader = shaders.get(m_shaderType);
1034 createDeleteGroup->addChild(new CreateShaderCase(m_context, "create_vertex_shader", "Create vertex shader object", glu::SHADERTYPE_VERTEX));
1035 createDeleteGroup->addChild(new CreateShaderCase(m_context, "create_fragment_shader", "Create fragment shader object", glu::SHADERTYPE_FRAGMENT));
1045 compileLinkGroup->addChild(new CompileShaderCase(m_context, "compile_vertex_shader", "Compile vertex shader", glu::SHADERTYPE_VERTEX));
1046 compileLinkGroup->addChild(new CompileShaderCase(m_context, "compile_fragment_shader", "Compile fragment shader", glu::SHADERTYPE_FRAGMENT));
1058 const glu::ShaderType shaderType = (shaderTypeInt == 1) ? glu::SHADERTYPE_FRAGMENT : glu::SHADERTYPE_VERTEX;
1060 const std::string caseName = std::string("replace_source") + ((shaderType == glu::SHADERTYPE_FRAGMENT) ? "_fragment" : "_vertex");
1061 const std::string caseDesc = std::string("Replace source code of ") + ((shaderType == glu::SHADERTYPE_FRAGMENT) ? "fragment" : "vertex") + " shader.";
1071 const glu::ShaderType shaderType = (shaderTypeInt == 1) ? glu::SHADERTYPE_FRAGMENT : glu::SHADERTYPE_VERTEX;
1082 + ((shaderType == glu::SHADERTYPE_FRAGMENT) ? "_fragment" : "_vertex");
1084 const std::string caseDesc = std::string((shaderType == glu::SHADERTYPE_FRAGMENT) ? "Fragment" : "Vertex")