Lines Matching defs:const
57 static std::string specializeShader (const std::string& shaderSource, const glu::ContextType& contextType)
59 const bool supportsES32orGL45 = glu::contextSupports(contextType, glu::ApiType::es(3, 2)) ||
62 const bool supportsGL45 = glu::contextSupports(contextType, glu::ApiType::core(4, 5));
75 static const char* const s_positionVertexShader = "${VERSION_DECL}\n"
81 static const char* const s_whiteOutputFragmentShader = "${VERSION_DECL}\n"
88 static bool isBlack (const tcu::RGBA& c)
96 IdentityShaderCase (Context& context, const char* name, const char* description);
99 std::string getVertexSource (void) const;
100 std::string getFragmentSource (void) const;
103 IdentityShaderCase::IdentityShaderCase (Context& context, const char* name, const char* description)
108 std::string IdentityShaderCase::getVertexSource (void) const
122 std::string IdentityShaderCase::getFragmentSource (void) const
145 IdentityGeometryShaderCase (Context& context, const char* name, const char* description, CaseType caseType);
153 std::string getTessellationControlSource (void) const;
154 std::string getTessellationEvaluationSource (bool geometryActive) const;
155 std::string getGeometrySource (void) const;
162 const CaseType m_case;
166 IdentityGeometryShaderCase::IdentityGeometryShaderCase (Context& context, const char* name, const char* description, CaseType caseType)
181 const bool supportsES32orGL45 = glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)) ||
205 static const tcu::Vec4 patchBufferData[4] =
213 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
233 const float innerTessellationLevel = 14.0f;
234 const float outerTessellationLevel = 14.0f;
235 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
239 const struct
241 const char* name;
242 const char* description;
265 const tcu::ScopedLogSection section (m_testCtx.getLog(), renderTargets[renderNdx].name, renderTargets[renderNdx].description);
277 const glu::ShaderProgram program (m_context.getRenderContext(), sources);
278 const glu::VertexArray vao (m_context.getRenderContext());
279 const int posLocation = gl.getAttribLocation(program.getProgram(), "a_position");
280 const int innerTessellationLoc = gl.getUniformLocation(program.getProgram(), "u_innerTessellationLevel");
281 const int outerTessellationLoc = gl.getUniformLocation(program.getProgram(), "u_outerTessellationLevel");
335 std::string IdentityGeometryShaderCase::getTessellationControlSource (void) const
377 std::string IdentityGeometryShaderCase::getTessellationEvaluationSource (bool geometryActive) const
379 const char* const colorOutputName = ((geometryActive) ? ("v_evaluated_color") : ("v_fragment_color"));
415 std::string IdentityGeometryShaderCase::getGeometrySource (void) const
417 const char* const geometryInputPrimitive = (m_case == CASE_ISOLINES) ? ("lines") : ("triangles");
418 const char* const geometryOutputPrimitive = (m_case == CASE_ISOLINES) ? ("line_strip") : ("triangle_strip");
419 const int numEmitVertices = (m_case == CASE_ISOLINES) ? (2) : (3);
452 IdentityTessellationShaderCase (Context& context, const char* name, const char* description, CaseType caseType);
460 std::string getTessellationControlSource (void) const;
461 std::string getTessellationEvaluationSource (void) const;
462 std::string getGeometrySource (bool tessellationActive) const;
469 const CaseType m_case;
473 IdentityTessellationShaderCase::IdentityTessellationShaderCase (Context& context, const char* name, const char* description, CaseType caseType)
488 const bool supportsES32orGL45 = glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)) ||
512 static const tcu::Vec4 pointData[] =
518 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
538 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
541 const int numPrimitiveVertices = (m_case == CASE_TRIANGLES) ? (3) : (2);
543 const struct
545 const char* name;
546 const char* description;
567 const tcu::ScopedLogSection section (m_testCtx.getLog(), renderTargets[renderNdx].name, renderTargets[renderNdx].description);
579 const glu::ShaderProgram program (m_context.getRenderContext(), sources);
580 const glu::VertexArray vao (m_context.getRenderContext());
581 const int posLocation = gl.getAttribLocation(program.getProgram(), "a_position");
652 std::string IdentityTessellationShaderCase::getTessellationControlSource (void) const
685 std::string IdentityTessellationShaderCase::getTessellationEvaluationSource (void) const
716 std::string IdentityTessellationShaderCase::getGeometrySource (bool tessellationActive) const
718 const char* const colorSourceName = (tessellationActive) ? ("v_evaluated_color") : ("v_vertex_color");
719 const char* const geometryInputPrimitive = (m_case == CASE_ISOLINES) ? ("lines") : ("triangles");
720 const char* const geometryOutputPrimitive = (m_case == CASE_ISOLINES) ? ("line_strip") : ("triangle_strip");
721 const int numEmitVertices = (m_case == CASE_ISOLINES) ? (11) : (8);
799 const char* name,
800 const char* description,
813 void verifyFeedbackResults (const std::vector<tcu::Vec4>& feedbackResult);
814 void verifyRenderedImage (const tcu::Surface& image, const std::vector<tcu::Vec4>& vertices);
817 int getNumGeneratedElementsPerPrimitive (void) const;
818 int getNumGeneratedPrimitives (void) const;
819 int getNumTessellatedPrimitives (void) const;
820 int getGeometryAmplification (void) const;
822 std::string getVertexSource (void) const;
823 std::string getFragmentSource (void) const;
824 std::string getTessellationControlSource (void) const;
825 std::string getTessellationEvaluationSource (void) const;
826 std::string getGeometrySource (void) const;
828 static const char* getTessellationOutputDescription (TessellationOutputType tessellationOutput,
830 static const char* getGeometryInputDescription (TessellationOutputType tessellationOutput,
832 static const char* getGeometryOutputDescription (GeometryOutputType geometryOutput);
833 glw::GLenum getOutputPrimitiveGLType (void) const;
840 const TessellationOutputType m_tessellationOutput;
841 const TessellationPointMode m_tessellationPointMode;
842 const GeometryOutputType m_geometryOutputType;
852 const char* name,
853 const char* description,
879 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
882 const bool supportsES32orGL45 = glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)) ||
916 static const tcu::Vec4 patchBufferData[4] =
1037 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1038 const glu::VertexArray vao (m_context.getRenderContext());
1039 const glu::Query primitivesGeneratedQuery (m_context.getRenderContext());
1040 const int posLocation = gl.getAttribLocation(m_feedbackProgram->getProgram(), "a_position");
1041 const glw::GLenum feedbackPrimitiveMode = getOutputPrimitiveGLType();
1107 const void* mappedPtr = gl.mapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, (glw::GLsizeiptr)(feedbackResults.size() * sizeof(tcu::Vec4)), GL_MAP_READ_BIT);
1134 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1135 const glu::VertexArray vao (m_context.getRenderContext());
1136 const int posLocation = gl.getAttribLocation(m_nonFeedbackProgram->getProgram(), "a_position");
1169 void FeedbackPrimitiveTypeCase::verifyFeedbackResults (const std::vector<tcu::Vec4>& feedbackResult)
1171 const int geometryAmplification = getGeometryAmplification();
1172 const int elementsPerPrimitive = getNumGeneratedElementsPerPrimitive();
1173 const int errorFloodThreshold = 8;
1181 const tcu::Vec4 primitiveVertex = feedbackResult[readNdx];
1185 const float equalThreshold = 1.0e-6f;
1186 const bool centroidOk = (primitiveVertex.x() >= -0.4f - equalThreshold) &&
1213 const tcu::Vec4 generatedElementVertex = feedbackResult[readNdx];
1214 const tcu::Vec4 equalThreshold (1.0e-6f);
1240 static bool feedbackResultCompare (const tcu::Vec4& a, const tcu::Vec4& b)
1250 void FeedbackPrimitiveTypeCase::verifyRenderedImage (const tcu::Surface& image, const std::vector<tcu::Vec4>& tfVertices)
1267 const int rasterDeviation = 2;
1268 const tcu::IVec2 rasterPos ((int)deFloatRound((vertices[ndx].x() * 0.5f + 0.5f) * (float)image.getWidth()), (int)deFloatRound((vertices[ndx].y() * 0.5f + 0.5f) * (float)image.getHeight()));
1282 const tcu::RGBA result = image.getPixel(rasterPos.x() + dx, rasterPos.y() + dy);
1305 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1306 const int elementsPerPrimitive = getNumGeneratedElementsPerPrimitive();
1307 const int feedbackPrimitives = getNumGeneratedPrimitives();
1308 const int feedbackElements = elementsPerPrimitive * feedbackPrimitives;
1309 const std::vector<tcu::Vec4> initialBuffer (feedbackElements, tcu::Vec4(-1.0f, -1.0f, -1.0f, -1.0f));
1344 int FeedbackPrimitiveTypeCase::getNumGeneratedElementsPerPrimitive (void) const
1359 int FeedbackPrimitiveTypeCase::getNumGeneratedPrimitives (void) const
1364 int FeedbackPrimitiveTypeCase::getNumTessellatedPrimitives (void) const
1366 const int tessellationLevel = 3;
1391 int FeedbackPrimitiveTypeCase::getGeometryAmplification (void) const
1393 const int outputAmplification = (m_geometryOutputType == GEOMETRY_OUTPUT_LINES) ? (2) : (1);
1394 const int numInputVertices = (m_tessellationPointMode) ? (1) : (m_tessellationOutput == TESSELLATION_OUT_ISOLINES) ? (2) : (3);
1399 glw::GLenum FeedbackPrimitiveTypeCase::getOutputPrimitiveGLType (void) const
1414 std::string FeedbackPrimitiveTypeCase::getVertexSource (void) const
1419 std::string FeedbackPrimitiveTypeCase::getFragmentSource (void) const
1424 std::string FeedbackPrimitiveTypeCase::getTessellationControlSource (void) const
1473 std::string FeedbackPrimitiveTypeCase::getTessellationEvaluationSource (void) const
1500 " const vec3 tessDirX = vec3( 0.4, 0.4, 0.0);\n"
1501 " const vec3 tessDirY = vec3( 0.0, -0.4, 0.0);\n"
1502 " const vec3 tessDirZ = vec3(-0.4, 0.4, 0.0);\n"
1515 std::string FeedbackPrimitiveTypeCase::getGeometrySource (void) const
1517 const char* const geometryInputPrimitive = (m_tessellationPointMode) ? ("points") : (m_tessellationOutput == TESSELLATION_OUT_ISOLINES) ? ("lines") : ("triangles");
1518 const char* const geometryOutputPrimitive = (m_geometryOutputType == GEOMETRY_OUTPUT_POINTS) ? ("points") : (m_geometryOutputType == GEOMETRY_OUTPUT_LINES) ? ("line_strip") : ("triangle_strip");
1519 const int numInputVertices = (m_tessellationPointMode) ? (1) : (m_tessellationOutput == TESSELLATION_OUT_ISOLINES) ? (2) : (3);
1520 const int numSingleVertexOutputVertices = (m_geometryOutputType == GEOMETRY_OUTPUT_POINTS) ? (1) : (m_geometryOutputType == GEOMETRY_OUTPUT_LINES) ? (4) : (3);
1521 const int numEmitVertices = numInputVertices * numSingleVertexOutputVertices;
1590 const char* FeedbackPrimitiveTypeCase::getTessellationOutputDescription (TessellationOutputType tessellationOutput, TessellationPointMode pointMode)
1603 const char* FeedbackPrimitiveTypeCase::getGeometryInputDescription (TessellationOutputType tessellationOutput, TessellationPointMode pointMode)
1616 const char* FeedbackPrimitiveTypeCase::getGeometryOutputDescription (GeometryOutputType geometryOutput)
1644 PointSizeCase (Context& context, const char* name, const char* description, int flags);
1655 void checkExtensions (void) const;
1656 void checkPointSizeRequirements (void) const;
1659 bool verifyImage (const tcu::Surface& src);
1660 int getExpectedPointSize (void) const;
1662 std::string genVertexSource (void) const;
1663 std::string genFragmentSource (void) const;
1664 std::string genTessellationControlSource (void) const;
1665 std::string genTessellationEvaluationSource (void) const;
1666 std::string genGeometrySource (void) const;
1673 const int m_flags;
1677 PointSizeCase::PointSizeCase (Context& context, const char* name, const char* description, int flags)
1799 void PointSizeCase::checkExtensions (void) const
1806 const bool supportsES32 = glu::contextSupports(contextType, glu::ApiType::es(3, 2));
1840 void PointSizeCase::checkPointSizeRequirements (void) const
1842 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1844 const int requiredSize = getExpectedPointSize();
1854 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1855 const bool tessellationActive = (m_flags & (FLAG_TESSELLATION_CONTROL_SET | FLAG_TESSELLATION_EVALUATION_SET | FLAG_TESSELLATION_ADD | FLAG_TESSELLATION_DONT_SET)) != 0;
1856 const int positionLocation = gl.getAttribLocation(m_program->getProgram(), "a_position");
1857 const glu::VertexArray vao (m_context.getRenderContext());
1894 bool PointSizeCase::verifyImage (const tcu::Surface& src)
1896 const bool MSAATarget = (m_context.getRenderTarget().getNumSamples() > 1);
1897 const int expectedSize = getExpectedPointSize();
1939 const tcu::IVec2 pointSize = resultArea.swizzle(2,3) - resultArea.swizzle(0, 1);
1957 const tcu::IVec2 pointSize = resultArea.swizzle(2,3) - resultArea.swizzle(0, 1);
1976 int PointSizeCase::getExpectedPointSize (void) const
2008 std::string PointSizeCase::genVertexSource (void) const
2026 std::string PointSizeCase::genFragmentSource (void) const
2031 std::string PointSizeCase::genTessellationControlSource (void) const
2059 std::string PointSizeCase::genTessellationEvaluationSource (void) const
2089 std::string PointSizeCase::genGeometrySource (void) const
2120 AllowedRenderFailureException (const char* message) : std::runtime_error(message) { }
2143 GridRenderCase (Context& context, const char* name, const char* description, int flags);
2152 bool verifyResultLayer (int layerNdx, const tcu::Surface& dst);
2167 const int m_flags;
2174 GridRenderCase::GridRenderCase (Context& context, const char* name, const char* description, int flags)
2195 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2197 const bool supportsES32orGL45 = glu::contextSupports(contextType, glu::ApiType::es(3, 2)) ||
2347 const bool separatePrimitives = (m_flags & FLAG_GEOMETRY_SEPARATE_PRIMITIVES) != 0;
2348 const int numComponentsPerVertex = 8; // vec4 pos, vec4 color
2356 const int numComponentLimit = geometryTotalOutputComponents / (4 * numComponentsPerVertex);
2357 const int numOutputLimit = geometryOutputVertices / 4;
2371 const int numSliceNodesComponentLimit = geometryTotalOutputComponents / (2 * numComponentsPerVertex); // each node 2 vertices
2372 const int numSliceNodesOutputLimit = geometryOutputVertices / 2; // each node 2 vertices
2373 const int numSliceNodes = de::min(numSliceNodesComponentLimit, numSliceNodesOutputLimit);
2436 catch (const AllowedRenderFailureException& ex)
2461 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2462 const int positionLocation = gl.getAttribLocation(m_program->getProgram(), "a_position");
2463 const glu::VertexArray vao (m_context.getRenderContext());
2548 bool GridRenderCase::verifyResultLayer (int layerNdx, const tcu::Surface& image)
2560 const int threshold = 8;
2561 const tcu::RGBA color = image.getPixel(x, y);
2599 const char* source = "${VERSION_DECL}\n"
2674 " const float equalThreshold = 0.001;\n"
2675 " const float gapOffset = 0.0001; // subdivision performed by the geometry shader might produce gaps. Fill potential gaps by enlarging the output slice a little.\n"
2834 FeedbackRecordVariableSelectionCase (Context& context, const char* name, const char* description);
2852 FeedbackRecordVariableSelectionCase::FeedbackRecordVariableSelectionCase (Context& context, const char* name, const char* description)
2866 const bool supportsES32 = glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2));
2867 const bool supportsCore40 = glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 0));
2878 static const tcu::Vec4 initialData[3] =
2885 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2924 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2925 const int posLoc = gl.getAttribLocation(m_program->getProgram(), "a_position");
2926 const glu::VertexArray vao (m_context.getRenderContext());
2971 const void* mapPtr = gl.mapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, (int)sizeof(feedbackValues), GL_MAP_READ_BIT);
3081 tcu::TestCaseGroup* const renderGroup = new tcu::TestCaseGroup(m_testCtx, "render", "Various render tests");
3082 tcu::TestCaseGroup* const feedbackGroup = new tcu::TestCaseGroup(m_testCtx, "feedback", "Test transform feedback");
3083 tcu::TestCaseGroup* const pointSizeGroup = new tcu::TestCaseGroup(m_testCtx, "point_size", "Test point size");
3091 tcu::TestCaseGroup* const passthroughGroup = new tcu::TestCaseGroup(m_testCtx, "passthrough", "Render various types with either passthrough geometry or tessellation shader");
3092 tcu::TestCaseGroup* const limitGroup = new tcu::TestCaseGroup(m_testCtx, "limits", "Render with properties near their limits");
3093 tcu::TestCaseGroup* const scatterGroup = new tcu::TestCaseGroup(m_testCtx, "scatter", "Scatter output primitives");
3116 static const struct LimitCaseDef
3118 const char* name;
3119 const char* desc;
3179 static const struct PrimitiveCaseConfig
3181 const char* name;
3182 const char* description;
3258 static const struct PointSizeCaseConfig
3260 const int caseMask;
3261 const bool isSupportedInGL; // is this case supported in OpenGL
3282 const std::string name = PointSizeCase::genTestCaseName(caseConfigs[ndx].caseMask);
3283 const std::string desc = PointSizeCase::genTestCaseDescription(caseConfigs[ndx].caseMask);