Lines Matching defs:const
71 const float& getComponentAccess (int ndx) const;
83 const float& BoundingBox::getComponentAccess (int ndx) const
94 static ProjectedBBox projectBoundingBox (const BoundingBox& bbox)
96 const float wMin = de::max(0.0f, bbox.min.w()); // clamp to w=0 as extension requires
97 const float wMax = de::max(0.0f, bbox.max.w());
107 static tcu::IVec4 getViewportBoundingBoxArea (const ProjectedBBox& bbox, const tcu::IVec2& viewportSize, float size = 0.0f)
124 static std::string specializeShader(Context& context, const char* code)
126 const glu::GLSLVersion glslVersion = glu::getContextTypeGLSLVersion(context.getRenderContext().getType());
172 const glw::Functions& funcs = context.getRenderContext().getFunctions();
208 InitialValueCase (Context& context, const char* name, const char* desc);
214 InitialValueCase::InitialValueCase (Context& context, const char* name, const char* desc)
277 QueryCase (Context& context, const char* name, const char* desc, QueryMethod method);
283 bool verifyState (glu::CallLogWrapper& gl, const BoundingBox& bbox) const;
285 const QueryMethod m_method;
288 QueryCase::QueryCase (Context& context, const char* name, const char* desc, QueryMethod method)
303 static const BoundingBox fixedCases[] =
313 const int numRandomCases = 9;
337 const tcu::ScopedLogSection section (m_testCtx.getLog(), "Iteration", "Iteration " + de::toString(caseNdx+1));
338 const BoundingBox& boundingBox = cases[caseNdx];
357 bool QueryCase::verifyState (glu::CallLogWrapper& gl, const BoundingBox& bbox) const
425 const glw::GLint roundDown = StateQueryUtil::roundGLfloatToNearestIntegerHalfDown<glw::GLint>(bbox.getComponentAccess(ndx));
426 const glw::GLint roundUp = StateQueryUtil::roundGLfloatToNearestIntegerHalfUp<glw::GLint>(bbox.getComponentAccess(ndx));
474 const glw::GLint64 roundDown = StateQueryUtil::roundGLfloatToNearestIntegerHalfDown<glw::GLint64>(bbox.getComponentAccess(ndx));
475 const glw::GLint64 roundUp = StateQueryUtil::roundGLfloatToNearestIntegerHalfUp<glw::GLint64>(bbox.getComponentAccess(ndx));
565 BBoxRenderCase (Context& context, const char* name, const char* description, int numIterations, deUint32 flags);
616 virtual std::string genVertexSource (void) const = 0;
617 virtual std::string genFragmentSource (void) const = 0;
618 virtual std::string genTessellationControlSource (void) const = 0;
619 virtual std::string genTessellationEvaluationSource (void) const = 0;
620 virtual std::string genGeometrySource (void) const = 0;
622 virtual IterationConfig generateConfig (int iteration, const tcu::IVec2& renderTargetSize) const = 0;
623 virtual void getAttributeData (std::vector<tcu::Vec4>& data) const = 0;
624 virtual void renderTestPattern (const IterationConfig& config) = 0;
625 virtual void verifyRenderResult (const IterationConfig& config) = 0;
627 IterationConfig generateRandomConfig (int seed, const tcu::IVec2& renderTargetSize) const;
628 tcu::IVec4 getViewportPatternArea (const tcu::Vec2& patternPos, const tcu::Vec2& patternSize, const tcu::IVec2& viewportSize, AABBRoundDirection roundDir) const;
630 void setupRender (const IterationConfig& config);
639 const char* genShaderFunction (ShaderFunction func) const;
641 const RenderTarget m_renderTarget;
642 const BBoxSize m_bboxSize;
643 const bool m_hasTessellationStage;
644 const bool m_hasGeometryStage;
645 const bool m_useGlobalState;
646 const bool m_calcPerPrimitiveBBox;
647 const int m_numIterations;
661 BBoxRenderCase::BBoxRenderCase (Context& context, const char* name, const char* description, int numIterations, deUint32 flags)
702 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
703 const tcu::IVec2 renderTargetSize = (m_renderTarget == RENDERTARGET_DEFAULT) ?
706 const bool hasES32OrGL45 = supportsES32OrGL45(m_context);
755 const tcu::ScopedLogSection section(m_testCtx.getLog(), "ShaderProgram", "Shader program");
819 const tcu::ScopedLogSection section (m_testCtx.getLog(),
822 const IterationConfig& config = m_iterationConfigs[m_iteration];
837 BBoxRenderCase::IterationConfig BBoxRenderCase::generateRandomConfig (int seed, const tcu::IVec2& renderTargetSize) const
882 tcu::IVec4 BBoxRenderCase::getViewportPatternArea (const tcu::Vec2& patternPos, const tcu::Vec2& patternSize, const tcu::IVec2& viewportSize, AABBRoundDirection roundDir) const
884 const float halfPixel = 0.5f;
911 void BBoxRenderCase::setupRender (const IterationConfig& config)
913 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
914 const glw::GLint posLocation = gl.getAttribLocation(m_program->getProgram(), "a_position");
915 const glw::GLint colLocation = gl.getAttribLocation(m_program->getProgram(), "a_color");
916 const glw::GLint posScaleLocation = gl.getUniformLocation(m_program->getProgram(), "u_posScale");
966 const glw::GLint bboxMinPos = gl.getUniformLocation(m_program->getProgram(), "u_primitiveBBoxMin");
967 const glw::GLint bboxMaxPos = gl.getUniformLocation(m_program->getProgram(), "u_primitiveBBoxMax");
979 const char* BBoxRenderCase::genShaderFunction (ShaderFunction func) const
1017 " const highp float dEpsilon = 0.001;\n"
1031 GridRenderCase (Context& context, const char* name, const char* description, deUint32 flags);
1037 std::string genVertexSource (void) const;
1038 std::string genFragmentSource (void) const;
1039 std::string genTessellationControlSource (void) const;
1040 std::string genTessellationEvaluationSource (void) const;
1041 std::string genGeometrySource (void) const;
1043 IterationConfig generateConfig (int iteration, const tcu::IVec2& renderTargetSize) const;
1044 void getAttributeData (std::vector<tcu::Vec4>& data) const;
1045 void renderTestPattern (const IterationConfig& config);
1046 void verifyRenderResult (const IterationConfig& config);
1048 const int m_gridSize;
1051 GridRenderCase::GridRenderCase (Context& context, const char* name, const char* description, deUint32 flags)
1073 std::string GridRenderCase::genVertexSource (void) const
1120 std::string GridRenderCase::genFragmentSource (void) const
1122 const char* const colorInputName = (m_hasGeometryStage) ? ("geo_color") : (m_hasTessellationStage) ? ("tess_color") : ("vtx_color");
1144 std::string GridRenderCase::genTessellationControlSource (void) const
1226 std::string GridRenderCase::genTessellationEvaluationSource (void) const
1263 std::string GridRenderCase::genGeometrySource (void) const
1265 const char* const colorInputName = (m_hasTessellationStage) ? ("tess_color") : ("vtx_color");
1319 GridRenderCase::IterationConfig GridRenderCase::generateConfig (int iteration, const tcu::IVec2& renderTargetSize) const
1324 void GridRenderCase::getAttributeData (std::vector<tcu::Vec4>& data) const
1326 const tcu::Vec4 green (0.0f, 1.0f, 0.0f, 1.0f);
1327 const tcu::Vec4 yellow (1.0f, 1.0f, 0.0f, 1.0f);
1339 const int cellNdx = cellOrder[ndx];
1340 const int cellX = cellNdx % m_gridSize;
1341 const int cellY = cellNdx / m_gridSize;
1342 const tcu::Vec4& cellColor = ((cellX+cellY)%2 == 0) ? (green) : (yellow);
1359 void GridRenderCase::renderTestPattern (const IterationConfig& config)
1361 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1367 const glw::GLint tessLevelPos = gl.getUniformLocation(m_program->getProgram(), "u_tessellationLevel");
1368 const glw::GLfloat tessLevel = 2.8f; // will be rounded up
1385 void GridRenderCase::verifyRenderResult (const IterationConfig& config)
1387 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1388 const ProjectedBBox projectedBBox = projectBoundingBox(config.bbox);
1389 const tcu::IVec4 viewportBBoxArea = getViewportBoundingBoxArea(projectedBBox, config.viewportSize);
1390 const tcu::IVec4 viewportGridOuterArea = getViewportPatternArea(config.patternPos, config.patternSize, config.viewportSize, ROUND_OUTWARDS);
1391 const tcu::IVec4 viewportGridInnerArea = getViewportPatternArea(config.patternPos, config.patternSize, config.viewportSize, ROUND_INWARDS);
1423 const tcu::RGBA pixel = viewportSurface.getPixel(x, y);
1424 const bool outsideGrid = x < viewportGridOuterArea.x() ||
1428 const bool insideGrid = x > viewportGridInnerArea.x() &&
1493 LineRenderCase (Context& context, const char* name, const char* description, deUint32 flags);
1525 std::string genVertexSource (void) const;
1526 std::string genFragmentSource (void) const;
1527 std::string genTessellationControlSource (void) const;
1528 std::string genTessellationEvaluationSource (void) const;
1529 std::string genGeometrySource (void) const;
1531 IterationConfig generateConfig (int iteration, const tcu::IVec2& renderTargetSize) const;
1532 void getAttributeData (std::vector<tcu::Vec4>& data) const;
1533 void renderTestPattern (const IterationConfig& config);
1534 void verifyRenderResult (const IterationConfig& config);
1536 tcu::IVec2 getNumberOfLinesRange (int queryAreaBegin, int queryAreaEnd, float patternStart, float patternSize, int viewportArea, QueryDirection queryDir) const;
1537 deUint8 scanRow (const tcu::ConstPixelBufferAccess& access, int row, int rowBegin, int rowEnd, int rowViewportBegin, int rowViewportEnd, const tcu::IVec2& numLines, int& floodCounter) const;
1538 deUint8 scanColumn (const tcu::ConstPixelBufferAccess& access, int column, int columnBegin, int columnEnd, int columnViewportBegin, int columnViewportEnd, const tcu::IVec2& numLines, int& floodCounter) const;
1539 bool checkAreaNumLines (const tcu::ConstPixelBufferAccess& access, const tcu::IVec4& area, int& floodCounter, int componentNdx, const tcu::IVec2& numLines) const;
1540 deUint8 checkLineContinuity (const tcu::ConstPixelBufferAccess& access, const tcu::IVec2& begin, const tcu::IVec2& end, int componentNdx, int& messageLimitCounter) const;
1541 tcu::IVec2 getNumMinimaMaxima (const tcu::ConstPixelBufferAccess& access, int componentNdx) const;
1542 deUint8 checkLineWidths (const tcu::ConstPixelBufferAccess& access, const tcu::IVec2& begin, const tcu::IVec2& end, int componentNdx, int& floodCounter) const;
1543 void printLineWidthError (const tcu::IVec2& pos, int detectedLineWidth, const tcu::IVec2& lineWidthRange, bool isHorizontal, int& floodCounter) const;
1545 const int m_patternSide;
1546 const bool m_isWideLineCase;
1547 const int m_wideLineLineWidth;
1550 LineRenderCase::LineRenderCase (Context& context, const char* name, const char* description, deUint32 flags)
1584 std::string LineRenderCase::genVertexSource (void) const
1629 std::string LineRenderCase::genFragmentSource (void) const
1631 const char* const colorInputName = (m_hasGeometryStage) ? ("geo_color") : (m_hasTessellationStage) ? ("tess_color") : ("vtx_color");
1653 std::string LineRenderCase::genTessellationControlSource (void) const
1732 std::string LineRenderCase::genTessellationEvaluationSource (void) const
1764 std::string LineRenderCase::genGeometrySource (void) const
1766 const char* const colorInputName = (m_hasTessellationStage) ? ("tess_color") : ("vtx_color");
1814 LineRenderCase::IterationConfig LineRenderCase::generateConfig (int iteration, const tcu::IVec2& renderTargetSize) const
1816 const int numMaxAttempts = 128;
1821 const IterationConfig& config = generateRandomConfig((0xDEDEDEu * (deUint32)iteration) ^ (0xABAB13 * attemptNdx), renderTargetSize);
1834 void LineRenderCase::getAttributeData (std::vector<tcu::Vec4>& data) const
1836 const tcu::Vec4 green (0.0f, 1.0f, 0.0f, 1.0f);
1837 const tcu::Vec4 blue (0.0f, 0.0f, 1.0f, 1.0f);
1849 const int segmentID = cellOrder[ndx];
1850 const int direction = segmentID & 0x01;
1851 const int majorCoord = (segmentID >> 1) / m_patternSide;
1852 const int minorCoord = (segmentID >> 1) % m_patternSide;
1871 void LineRenderCase::renderTestPattern (const IterationConfig& config)
1873 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1879 const glw::GLint tessLevelPos = gl.getUniformLocation(m_program->getProgram(), "u_tessellationLevel");
1880 const glw::GLfloat tessLevel = 2.8f; // will be rounded up
1906 void LineRenderCase::verifyRenderResult (const IterationConfig& config)
1908 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1909 const bool isMsaa = m_context.getRenderTarget().getNumSamples() > 1;
1910 const ProjectedBBox projectedBBox = projectBoundingBox(config.bbox);
1911 const float lineWidth = (m_isWideLineCase) ? ((float)m_wideLineLineWidth) : (1.0f);
1912 const tcu::IVec4 viewportBBoxArea = getViewportBoundingBoxArea(projectedBBox, config.viewportSize, lineWidth);
1913 const tcu::IVec4 viewportPatternArea = getViewportPatternArea(config.patternPos, config.patternSize, config.viewportSize, ROUND_INWARDS);
1914 const tcu::IVec2 expectedHorizontalLines = getNumberOfLinesRange(viewportBBoxArea.y(), viewportBBoxArea.w(), config.patternPos.y(), config.patternSize.y(), config.viewportSize.y(), DIRECTION_VERTICAL);
1915 const tcu::IVec2 expectedVerticalLines = getNumberOfLinesRange(viewportBBoxArea.x(), viewportBBoxArea.z(), config.patternPos.x(), config.patternSize.x(), config.viewportSize.x(), DIRECTION_HORIZONTAL);
1916 const tcu::IVec4 verificationArea = tcu::IVec4(de::max(viewportBBoxArea.x(), 0),
1973 const deUint8 result = scanRow(viewportSurface.getAccess(),
2011 const deUint8 result = scanColumn(viewportSurface.getAccess(),
2109 tcu::IVec2 LineRenderCase::getNumberOfLinesRange (int queryAreaBegin, int queryAreaEnd, float patternStart, float patternSize, int viewportArea, QueryDirection queryDir) const
2112 const int patternStartNdx = (queryDir == DIRECTION_HORIZONTAL) ? ((m_hasGeometryStage) ? (1) : (0)) : ((m_hasTessellationStage) ? (1) : (0));
2113 const int patternEndNdx = patternStartNdx + m_patternSide;
2120 const float linePos = (patternStart + (float(lineNdx) / float(m_patternSide)) * patternSize) * 0.5f + 0.5f;
2121 const float lineWidth = (m_isWideLineCase) ? ((float)m_wideLineLineWidth) : (1.0f);
2141 deUint8 LineRenderCase::scanRow (const tcu::ConstPixelBufferAccess& access, int row, int rowBegin, int rowEnd, int rowViewportBegin, int rowViewportEnd, const tcu::IVec2& numLines, int& messageLimitCounter) const
2143 const bool numLinesOk = checkAreaNumLines(access, tcu::IVec4(rowBegin, row, rowEnd - rowBegin, 1), messageLimitCounter, SCAN_ROW_COMPONENT_NDX, numLines);
2144 const deUint8 lineWidthRes = checkLineWidths(access, tcu::IVec2(rowBegin, row), tcu::IVec2(rowEnd, row), SCAN_ROW_COMPONENT_NDX, messageLimitCounter);
2145 const deUint8 lineContinuityRes = checkLineContinuity(access, tcu::IVec2(rowViewportBegin, row), tcu::IVec2(rowViewportEnd, row), SCAN_COL_COMPONENT_NDX, messageLimitCounter);
2164 deUint8 LineRenderCase::scanColumn (const tcu::ConstPixelBufferAccess& access, int column, int columnBegin, int columnEnd, int columnViewportBegin, int columnViewportEnd, const tcu::IVec2& numLines, int& messageLimitCounter) const
2166 const bool numLinesOk = checkAreaNumLines(access, tcu::IVec4(column, columnBegin, 1, columnEnd - columnBegin), messageLimitCounter, SCAN_COL_COMPONENT_NDX, numLines);
2167 const deUint8 lineWidthRes = checkLineWidths(access, tcu::IVec2(column, columnBegin), tcu::IVec2(column, columnEnd), SCAN_COL_COMPONENT_NDX, messageLimitCounter);
2168 const deUint8 lineContinuityRes = checkLineContinuity(access, tcu::IVec2(column, columnViewportBegin), tcu::IVec2(column, columnViewportEnd), SCAN_ROW_COMPONENT_NDX, messageLimitCounter);
2187 bool LineRenderCase::checkAreaNumLines (const tcu::ConstPixelBufferAccess& access, const tcu::IVec4& area, int& messageLimitCounter, int componentNdx, const tcu::IVec2& numLines) const
2190 const tcu::ConstPixelBufferAccess subAccess = tcu::getSubregion(access, area.x(), area.y(), 0, area.z(), area.w(), 1);
2191 const tcu::IVec2 numMinimaMaxima = getNumMinimaMaxima(subAccess, componentNdx);
2192 const int numMaxima = numMinimaMaxima.y();
2217 tcu::IVec2 LineRenderCase::getNumMinimaMaxima (const tcu::ConstPixelBufferAccess& access, int componentNdx) const
2229 const int componentValue = access.getPixelInt(x, y)[componentNdx];
2233 const int sign = (componentValue > previousValue) ? (+1) : (componentValue < previousValue) ? (-1) : (0);
2274 deUint8 LineRenderCase::checkLineContinuity (const tcu::ConstPixelBufferAccess& access, const tcu::IVec2& begin, const tcu::IVec2& end, int componentNdx, int& messageLimitCounter) const
2277 const tcu::IVec2 advance = (begin.x() == end.x()) ? (tcu::IVec2(0, 1)) : (tcu::IVec2(1, 0));
2284 const bool hit = (access.getPixelInt(cursor.x(), cursor.y())[componentNdx] != 0);
2291 const tcu::IVec2 advanceNeighbor = tcu::IVec2(1, 1) - advance;
2292 const tcu::IVec2 cursorNeighborPos = cursor + advanceNeighbor;
2293 const tcu::IVec2 cursorNeighborNeg = cursor - advanceNeighbor;
2321 deUint8 LineRenderCase::checkLineWidths (const tcu::ConstPixelBufferAccess& access, const tcu::IVec2& begin, const tcu::IVec2& end, int componentNdx, int& messageLimitCounter) const
2323 const bool multisample = m_context.getRenderTarget().getNumSamples() > 1;
2324 const int lineRenderWidth = (m_isWideLineCase) ? (m_wideLineLineWidth) : 1;
2325 const tcu::IVec2 lineWidthRange = (multisample)
2328 const tcu::IVec2 relaxedLineWidthRange = (tcu::IVec2(lineRenderWidth-1, lineRenderWidth+1));
2334 const tcu::IVec2 advance = (begin.x() == end.x()) ? (tcu::IVec2(0, 1)) : (tcu::IVec2(1, 0));
2358 const bool hit = (access.getPixelInt(cursor.x(), cursor.y())[componentNdx] != 0);
2365 const bool incorrectLineWidth = (lineWidth < lineWidthRange.x() && !bboxLimitedLine) || (lineWidth > lineWidthRange.y());
2369 const bool incorrectRelaxedLineWidth = (lineWidth < relaxedLineWidthRange.x() && !bboxLimitedLine) || (lineWidth > relaxedLineWidthRange.y());
2411 const bool incorrectLineWidth = (lineWidth > lineWidthRange.y());
2415 const bool incorrectRelaxedLineWidth = (lineWidth > relaxedLineWidthRange.y());
2433 void LineRenderCase::printLineWidthError (const tcu::IVec2& pos, int detectedLineWidth, const tcu::IVec2& lineWidthRange, bool isHorizontal, int& messageLimitCounter) const
2459 PointRenderCase (Context& context, const char* name, const char* description, deUint32 flags);
2472 std::string genVertexSource (void) const;
2473 std::string genFragmentSource (void) const;
2474 std::string genTessellationControlSource (void) const;
2475 std::string genTessellationEvaluationSource (void) const;
2476 std::string genGeometrySource (void) const;
2478 IterationConfig generateConfig (int iteration, const tcu::IVec2& renderTargetSize) const;
2480 void getAttributeData (std::vector<tcu::Vec4>& data) const;
2481 void renderTestPattern (const IterationConfig& config);
2482 void verifyRenderResult (const IterationConfig& config);
2484 void genReferencePointData (const IterationConfig& config, std::vector<GeneratedPoint>& data) const;
2485 bool verifyNarrowPointPattern (const tcu::Surface& viewport, const std::vector<GeneratedPoint>& refPoints, const ProjectedBBox& bbox, int& logFloodCounter);
2486 bool verifyWidePointPattern (const tcu::Surface& viewport, const std::vector<GeneratedPoint>& refPoints, const ProjectedBBox& bbox, int& logFloodCounter);
2487 bool verifyWidePoint (const tcu::Surface& viewport, const GeneratedPoint& refPoint, const ProjectedBBox& bbox, ResultPointType pointType, int& logFloodCounter);
2488 bool verifyWidePointAt (const tcu::IVec2& pointPos, const tcu::Surface& viewport, const GeneratedPoint& refPoint, const tcu::IVec4& bbox, ResultPointType pointType, int componentNdx, int& logFloodCounter);
2489 tcu::IVec2 scanPointWidthAt (const tcu::IVec2& pointPos, const tcu::Surface& viewport, int expectedPointSize, int componentNdx) const;
2491 const int m_numStripes;
2492 const bool m_isWidePointCase;
2496 PointRenderCase::PointRenderCase (Context& context, const char* name, const char* description, deUint32 flags)
2511 const bool supportsGL45 = glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 5));
2523 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2559 std::string PointRenderCase::genVertexSource (void) const
2609 std::string PointRenderCase::genFragmentSource (void) const
2611 const char* const colorInputName = (m_hasGeometryStage) ? ("geo_color") : (m_hasTessellationStage) ? ("tess_color") : ("vtx_color");
2633 std::string PointRenderCase::genTessellationControlSource (void) const
2635 const bool tessellationWidePoints = (m_isWidePointCase) && (!m_hasGeometryStage);
2691 buf << " const vec2 minExpansion = vec2(0.07 + 0.05, 0.07 + 0.02); // eval and geometry shader\n"
2692 " const vec2 maxExpansion = vec2(0.07 + 0.05, 0.07 + 0.03); // eval and geometry shader\n";
2694 buf << " const vec2 minExpansion = vec2(0.07, 0.07); // eval shader\n"
2695 " const vec2 maxExpansion = vec2(0.07, 0.07); // eval shader\n";
2721 std::string PointRenderCase::genTessellationEvaluationSource (void) const
2723 const bool tessellationWidePoints = (m_isWidePointCase) && (!m_hasGeometryStage);
2762 std::string PointRenderCase::genGeometrySource (void) const
2764 const char* const colorInputName = (m_hasTessellationStage) ? ("tess_color") : ("vtx_color");
2819 PointRenderCase::IterationConfig PointRenderCase::generateConfig (int iteration, const tcu::IVec2& renderTargetSize) const
2826 const tcu::Vec2 patternScale = config.patternSize;
2845 const tcu::Vec4 green (0.0f, 1.0f, 0.0f, 1.0f);
2846 const tcu::Vec4 blue (0.0f, 0.0f, 1.0f, 1.0f);
2857 const int pointID = cellOrder[ndx];
2858 const int direction = pointID & 0x01;
2859 const int majorCoord = (pointID >> 1) / m_numStripes;
2860 const int minorCoord = (pointID >> 1) % m_numStripes;
2875 void PointRenderCase::getAttributeData (std::vector<tcu::Vec4>& data) const
2880 void PointRenderCase::renderTestPattern (const IterationConfig& config)
2882 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2888 const glw::GLint tessLevelPos = gl.getUniformLocation(m_program->getProgram(), "u_tessellationLevel");
2889 const glw::GLfloat tessLevel = 0.8f; // will be rounded up
2910 void PointRenderCase::verifyRenderResult (const IterationConfig& config)
2912 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2913 const ProjectedBBox projectedBBox = projectBoundingBox(config.bbox);
2914 const tcu::IVec4 viewportBBoxArea = getViewportBoundingBoxArea(projectedBBox, config.viewportSize);
2979 bool operator() (const PointRenderCase::GeneratedPoint& a, const PointRenderCase::GeneratedPoint& b) const
2990 void PointRenderCase::genReferencePointData (const IterationConfig& config, std::vector<GeneratedPoint>& data) const
3011 const tcu::Vec2 position = tcu::Vec2(currentPoints[ndx].center.x(), 1.0f - currentPoints[ndx].center.y()); // mirror Y
3041 const tcu::Vec2 position = tcu::Vec2(1.0f - currentPoints[ndx].center.x(), currentPoints[ndx].center.y()); // mirror X
3069 bool PointRenderCase::verifyNarrowPointPattern (const tcu::Surface& viewport, const std::vector<GeneratedPoint>& refPoints, const ProjectedBBox& bbox, int& logFloodCounter)
3076 const float epsilon = 1.0e-6f;
3077 const GeneratedPoint& refPoint = refPoints[pointNdx];
3088 const tcu::IVec2 pixelCenter(deRoundFloatToInt32((refPoint.center.x() * 0.5f + 0.5f) * (float)viewport.getWidth()),
3098 const int componentNdx = (refPoint.even) ? (1) : (2); // analyze either green or blue channel
3105 const tcu::IVec2 testPos (pixelCenter.x() + dx, pixelCenter.y() + dy);
3106 const tcu::RGBA color = viewport.getPixel(testPos.x(), testPos.y());
3131 bool PointRenderCase::verifyWidePointPattern (const tcu::Surface& viewport, const std::vector<GeneratedPoint>& refPoints, const ProjectedBBox& bbox, int& logFloodCounter)
3138 const GeneratedPoint& refPoint = refPoints[pointNdx];
3161 bool PointRenderCase::verifyWidePoint (const tcu::Surface& viewport, const GeneratedPoint& refPoint, const ProjectedBBox& bbox, ResultPointType pointType, int& logFloodCounter)
3163 const int componentNdx = (refPoint.even) ? (1) : (2);
3164 const int halfPointSizeCeil = (refPoint.size + 1) / 2;
3165 const int halfPointSizeFloor = (refPoint.size + 1) / 2;
3166 const tcu::IVec4 viewportBBoxArea = getViewportBoundingBoxArea(bbox, tcu::IVec2(viewport.getWidth(), viewport.getHeight()), (float)refPoint.size);
3167 const tcu::IVec4 verificationArea = tcu::IVec4(de::max(viewportBBoxArea.x(), 0),
3171 const tcu::IVec2 pointPos = tcu::IVec2(deRoundFloatToInt32((refPoint.center.x()*0.5f + 0.5f) * (float)viewport.getWidth()),
3188 const tcu::IVec2 testPos = pointPos + tcu::IVec2(dx, dy);
3221 bool PointRenderCase::verifyWidePointAt (const tcu::IVec2& pointPos, const tcu::Surface& viewport, const GeneratedPoint& refPoint, const tcu::IVec4& bbox, ResultPointType pointType, int componentNdx, int& logFloodCounter)
3223 const int expectedPointSize = refPoint.size;
3261 const tcu::IVec2& range = widthsUpwards.back();
3262 const bool squareFits = (range.y() - range.x() + 1) >= expectedPointSize;
3263 const bool widthClipped = (pointType == POINT_PARTIAL) && (range.x() <= bbox.x() || range.y() >= bbox.z());
3298 const tcu::IVec2& range = (widthsDownwards.empty()) ? (widthsUpwards.front()) : (widthsDownwards.back());
3299 const bool squareFits = (range.y() - range.x() + 1) >= expectedPointSize;
3300 const bool bboxClipped = (pointType == POINT_PARTIAL) && (range.x() <= bbox.x() || range.y() >= bbox.z()-1);
3301 const bool viewportClipped = range.x() <= 0 || range.y() >= viewport.getWidth()-1;
3327 const bool squareFits = (unionRange.y() - unionRange.x() + 1) >= expectedPointSize;
3328 const bool bboxClipped = (pointType == POINT_PARTIAL) && (unionRange.x() <= bbox.x() || unionRange.y() >= bbox.z()-1);
3329 const bool viewportClipped = unionRange.x() <= 0 || unionRange.y() >= viewport.getWidth()-1;
3346 tcu::IVec2 PointRenderCase::scanPointWidthAt (const tcu::IVec2& pointPos, const tcu::Surface& viewport, int expectedPointSize, int componentNdx) const
3389 BlitFboCase (Context& context, const char* name, const char* description, RenderTarget src, RenderTarget dst);
3412 bool verifyImage (const BlitArgs& args);
3414 const RenderTarget m_src;
3415 const RenderTarget m_dst;
3428 BlitFboCase::BlitFboCase (Context& context, const char* name, const char* description, RenderTarget src, RenderTarget dst)
3446 const int numIterations = 12;
3447 const bool defaultFBMultisampled = (m_context.getRenderTarget().getNumSamples() > 1);
3448 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3498 const char* const vertexSource = "${GLSL_VERSION_DECL}\n"
3506 const char* const fragmentSource = "${GLSL_VERSION_DECL}\n"
3511 " const mediump vec4 green = vec4(0.0, 1.0, 0.0, 1.0);\n"
3512 " const mediump vec4 yellow = vec4(1.0, 1.0, 0.0, 1.0);\n"
3534 static const tcu::Vec4 s_quadCoords[] =
3552 const tcu::IVec2 srcSize = (m_src == TARGET_DEFAULT) ? (tcu::IVec2(m_context.getRenderTarget().getWidth(), m_context.getRenderTarget().getHeight())) : (tcu::IVec2(FBO_SIZE, FBO_SIZE));
3553 const tcu::IVec2 dstSize = (m_dst == TARGET_DEFAULT) ? (tcu::IVec2(m_context.getRenderTarget().getWidth(), m_context.getRenderTarget().getHeight())) : (tcu::IVec2(FBO_SIZE, FBO_SIZE));
3567 const tcu::IVec2 unionSize = tcu::IVec2(de::min(srcSize.x(), dstSize.x()), de::min(srcSize.y(), dstSize.y()));
3568 const int srcWidth = rnd.getInt(1, unionSize.x());
3569 const int srcHeight = rnd.getInt(1, unionSize.y());
3570 const int srcX = rnd.getInt(0, unionSize.x() - srcWidth);
3571 const int srcY = rnd.getInt(0, unionSize.y() - srcHeight);
3582 const int srcWidth = rnd.getInt(1, srcSize.x());
3583 const int srcHeight = rnd.getInt(1, srcSize.y());
3584 const int srcX = rnd.getInt(0, srcSize.x() - srcWidth);
3585 const int srcY = rnd.getInt(0, srcSize.y() - srcHeight);
3586 const int dstWidth = rnd.getInt(1, dstSize.x());
3587 const int dstHeight = rnd.getInt(1, dstSize.y());
3588 const int dstX = rnd.getInt(-(dstWidth / 2), dstSize.x() - (dstWidth+1) / 2); // allow dst go out of bounds
3589 const int dstY = rnd.getInt(-(dstHeight / 2), dstSize.y() - (dstHeight+1) / 2);
3643 const tcu::ScopedLogSection section (m_testCtx.getLog(), "Iteration" + de::toString(m_iteration), "Iteration " + de::toString(m_iteration+1) + " / " + de::toString((int)m_iterations.size()));
3644 const BlitArgs& blitCfg = m_iterations[m_iteration];
3645 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3686 bool BlitFboCase::verifyImage (const BlitArgs& args)
3688 const int colorThreshold = 4; //!< this test case is not about how color is preserved, allow almost anything
3689 const tcu::IVec2 dstSize = (m_dst == TARGET_DEFAULT) ? (tcu::IVec2(m_context.getRenderTarget().getWidth(), m_context.getRenderTarget().getHeight())) : (tcu::IVec2(FBO_SIZE, FBO_SIZE));
3690 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3708 const tcu::RGBA color = viewport.getPixel(x, y);
3709 const bool inside = (x >= args.dst.x() && x < args.dst.z() && y >= args.dst.y() && y < args.dst.w());
3710 const bool error = (inside) ? (color.getGreen() < 255 - colorThreshold || color.getBlue() > colorThreshold)
3747 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3748 const tcu::IVec2 srcSize = (m_src == TARGET_DEFAULT) ? (tcu::IVec2(m_context.getRenderTarget().getWidth(), m_context.getRenderTarget().getHeight())) : (tcu::IVec2(FBO_SIZE, FBO_SIZE));
3749 const int posLocation = gl.getAttribLocation(m_program->getProgram(), "a_position");
3789 DepthDrawCase (Context& context, const char* name, const char* description, DepthType depthType, BBoxState state, BBoxSize bboxSize);
3797 std::string genVertexSource (void) const;
3798 std::string genFragmentSource (void) const;
3799 std::string genTessellationControlSource (void) const;
3800 std::string genTessellationEvaluationSource (void) const;
3801 void generateAttributeData (std::vector<tcu::Vec4>& data) const;
3802 bool verifyImage (const tcu::Surface& viewport) const;
3817 const int m_numLayers;
3818 const int m_gridSize;
3820 const DepthType m_depthType;
3821 const BBoxState m_state;
3822 const BBoxSize m_bboxSize;
3830 DepthDrawCase::DepthDrawCase (Context& context, const char* name, const char* description, DepthType depthType, BBoxState state, BBoxSize bboxSize)
3851 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3852 const bool hasES32OrGL45 = supportsES32OrGL45(m_context);
3896 const tcu::ScopedLogSection section(m_testCtx.getLog(), "ShaderProgram", "Shader program");
3952 const bool hasTessellation = (m_state == STATE_PER_PRIMITIVE);
3953 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3954 const glw::GLint posLocation = gl.getAttribLocation(m_program->getProgram(), "a_position");
3955 const glw::GLint colLocation = gl.getAttribLocation(m_program->getProgram(), "a_colorMix");
3956 const glw::GLint depthBiasLocation = gl.getUniformLocation(m_program->getProgram(), "u_depthBias");
3957 const glw::GLint depthScaleLocation = gl.getUniformLocation(m_program->getProgram(), "u_depthScale");
3958 const glw::GLint color1Location = gl.getUniformLocation(m_program->getProgram(), "u_color1");
3959 const glw::GLint color2Location = gl.getUniformLocation(m_program->getProgram(), "u_color2");
4001 const float negPadding = (m_bboxSize == BBOX_EQUAL) ? (0.0f) : (rnd.getFloat() * 0.3f);
4002 const float posPadding = (m_bboxSize == BBOX_EQUAL) ? (0.0f) : (rnd.getFloat() * 0.3f);
4022 std::string DepthDrawCase::genVertexSource (void) const
4024 const bool hasTessellation = (m_state == STATE_PER_PRIMITIVE);
4060 std::string DepthDrawCase::genFragmentSource (void) const
4062 const bool hasTessellation = (m_state == STATE_PER_PRIMITIVE);
4063 const char* const colorMixName = (hasTessellation) ? ("tess_eval_colorMix") : ("vtx_colorMix");
4088 std::string DepthDrawCase::genTessellationControlSource (void) const
4136 std::string DepthDrawCase::genTessellationEvaluationSource (void) const
4175 void DepthDrawCase::generateAttributeData (std::vector<tcu::Vec4>& data) const
4177 const tcu::Vec4 color1 (0.0f, 0.0f, 0.0f, 0.0f); // mix weights
4178 const tcu::Vec4 color2 (1.0f, 1.0f, 1.0f, 1.0f);
4190 const int cellNdx = cellOrder[ndx];
4191 const int cellX = cellNdx % m_gridSize;
4192 const int cellY = cellNdx / m_gridSize;
4193 const tcu::Vec4& cellColor = ((cellX+cellY)%2 == 0) ? (color1) : (color2);
4212 bool DepthDrawCase::verifyImage (const tcu::Surface& viewport) const
4222 const tcu::RGBA pixel = viewport.getPixel(x, y);
4268 ClearCase (Context& context, const char* name, const char* description, deUint32 flags);
4285 bool verifyImagesEqual (const tcu::PixelBufferAccess& withoutBBox, const tcu::PixelBufferAccess& withBBox);
4286 bool verifyImageResultValid (const tcu::PixelBufferAccess& result);
4288 std::string genVertexSource (void) const;
4289 std::string genFragmentSource (void) const;
4290 std::string genTessellationControlSource (bool setBBox) const;
4291 std::string genTessellationEvaluationSource (void) const;
4293 const bool m_scissoredClear;
4294 const bool m_fullscreenScissor;
4295 const bool m_drawTriangles;
4296 const bool m_useGlobalState;
4305 ClearCase::ClearCase (Context& context, const char* name, const char* description, deUint32 flags)
4323 const bool hasES32OrGL45 = supportsES32OrGL45(m_context);
4365 const tcu::IVec2 renderTargetSize (m_context.getRenderTarget().getWidth(), m_context.getRenderTarget().getHeight());
4372 const bool useBBox = (passNdx == 1);
4408 const int numObjects = 16;
4409 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
4416 const int numTriangles = rnd.getInt(1, 4);
4417 const float minX = rnd.getFloat(-1.2f, 0.8f);
4418 const float minY = rnd.getFloat(-1.2f, 0.8f);
4419 const float maxX = minX + rnd.getFloat(0.2f, 1.0f);
4420 const float maxY = minY + rnd.getFloat(0.2f, 1.0f);
4431 const float posX = rnd.getFloat(minX, maxX);
4432 const float posY = rnd.getFloat(minY, maxY);
4433 const float posZ = rnd.getFloat(-0.7f, 0.7f);
4434 const float posW = rnd.getFloat(0.9f, 1.1f);
4483 const int numOps = 45;
4484 const tcu::Vec4 yellow (1.0f, 1.0f, 0.0f, 1.0f);
4485 const tcu::Vec4 green (0.0f, 1.0f, 0.0f, 1.0f);
4486 const tcu::IVec2 renderTargetSize (m_context.getRenderTarget().getWidth(), m_context.getRenderTarget().getHeight());
4487 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
4504 const deUint32 programHandle = (m_useGlobalState || !useBBox) ? (m_basicProgram->getProgram()) : (m_perPrimitiveProgram->getProgram());
4505 const int positionAttribLoc = gl.getAttribLocation(programHandle, "a_position");
4519 const int drawObjNdx = (m_drawTriangles) ? (rnd.getInt(0, (int)m_drawObjects.size() - 1)) : (0);
4520 const int objectVertexStartNdx = (m_drawTriangles) ? (m_drawObjects[drawObjNdx].firstNdx) : (0);
4521 const int objectVertexLength = (m_drawTriangles) ? (m_drawObjects[drawObjNdx].numVertices) : (0);
4553 const int scissorX = (m_fullscreenScissor) ? (0) : rnd.getInt(0, renderTargetSize.x()-1);
4554 const int scissorY = (m_fullscreenScissor) ? (0) : rnd.getInt(0, renderTargetSize.y()-1);
4555 const int scissorW = (m_fullscreenScissor) ? (renderTargetSize.x()) : rnd.getInt(0, renderTargetSize.x()-scissorX);
4556 const int scissorH = (m_fullscreenScissor) ? (renderTargetSize.y()) : rnd.getInt(0, renderTargetSize.y()-scissorY);
4562 const tcu::Vec4 color = tcu::mix(green, yellow, rnd.getFloat() * 0.4f); // greenish
4585 bool ClearCase::verifyImagesEqual (const tcu::PixelBufferAccess& withoutBBox, const tcu::PixelBufferAccess& withBBox)
4621 bool ClearCase::verifyImageResultValid (const tcu::PixelBufferAccess& result)
4631 const tcu::IVec4 pixel = result.getPixelInt(x, y);
4656 static const char* const s_yellowishPosOnlyVertexSource = "${GLSL_VERSION_DECL}\n"
4667 static const char* const s_basicColorFragmentSource = "${GLSL_VERSION_DECL}\n"
4676 static const char* const s_basicColorTessEvalSource = "${GLSL_VERSION_DECL}\n"
4693 std::string ClearCase::genVertexSource (void) const
4698 std::string ClearCase::genFragmentSource (void) const
4703 std::string ClearCase::genTessellationControlSource (bool setBBox) const
4741 std::string ClearCase::genTessellationEvaluationSource (void) const
4757 ViewportCallOrderCase (Context& context, const char* name, const char* description, CallOrder callOrder);
4767 bool verifyImage (const tcu::PixelBufferAccess& result);
4769 std::string genVertexSource (void) const;
4770 std::string genFragmentSource (void) const;
4771 std::string genTessellationControlSource (void) const;
4772 std::string genTessellationEvaluationSource (void) const;
4774 const CallOrder m_callOrder;
4782 ViewportCallOrderCase::ViewportCallOrderCase (Context& context, const char* name, const char* description, CallOrder callOrder)
4798 const bool hasES32OrGL45 = supportsES32OrGL45(m_context);
4838 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
4839 const tcu::IVec2 viewportSize = tcu::IVec2(m_context.getRenderTarget().getWidth(), m_context.getRenderTarget().getHeight());
4840 const glw::GLint posLocation = gl.getAttribLocation(m_program->getProgram(), "a_position");
4880 gl.vertexAttribPointer(posLocation, 4, GL_FLOAT, GL_FALSE, sizeof(float[4]), (const float*)DE_NULL);
4912 const int gridSize = 6;
4913 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
4926 const int cellNdx = cellOrder[ndx];
4927 const bool cellSide = ((cellNdx % 2) == 0);
4928 const int cellX = (cellNdx / 2) % gridSize;
4929 const int cellY = (cellNdx / 2) / gridSize;
4977 bool ViewportCallOrderCase::verifyImage (const tcu::PixelBufferAccess& result)
4979 const tcu::IVec2 insideBorder (deCeilFloatToInt32(0.25f * (float)result.getWidth()) + 1, deFloorFloatToInt32(0.5f * (float)result.getWidth()) - 1);
4980 const tcu::IVec2 outsideBorder (deFloorFloatToInt32(0.25f * (float)result.getWidth()) - 1, deCeilFloatToInt32(0.5f * (float)result.getWidth()) + 1);
4994 const tcu::IVec4 pixel = result.getPixelInt(x, y);
4995 const bool insideMeshArea = x >= insideBorder.x() && x <= insideBorder.y();
4996 const bool outsideMeshArea = x <= outsideBorder.x() && x >= outsideBorder.y();
5024 std::string ViewportCallOrderCase::genVertexSource (void) const
5029 std::string ViewportCallOrderCase::genFragmentSource (void) const
5034 std::string ViewportCallOrderCase::genTessellationControlSource (void) const
5053 std::string ViewportCallOrderCase::genTessellationEvaluationSource (void) const
5071 static const struct
5073 const char* name;
5074 const char* description;
5094 static const struct
5096 const char* name;
5097 const char* description;
5122 static const struct
5124 const char* name;
5125 const char* description;
5194 const struct
5196 const char* name;
5197 const char* description;
5236 tcu::TestCaseGroup* const stateQueryGroup = new tcu::TestCaseGroup(m_testCtx, "state_query", "State queries");
5251 tcu::TestCaseGroup* const primitiveGroup = new tcu::TestCaseGroup(m_testCtx, primitiveTypes[primitiveTypeNdx].name, primitiveTypes[primitiveTypeNdx].description);
5256 tcu::TestCaseGroup* const methodGroup = new tcu::TestCaseGroup(m_testCtx, stateSetMethods[stateSetMethodNdx].name, stateSetMethods[stateSetMethodNdx].description);
5268 tcu::TestCaseGroup* const pipelineGroup = new tcu::TestCaseGroup(m_testCtx, pipelineConfigs[pipelineConfigNdx].name, pipelineConfigs[pipelineConfigNdx].description);
5273 const deUint32 flags = primitiveTypes[primitiveTypeNdx].flags |
5305 static const struct
5307 const char* name;
5308 const char* description;
5323 static const struct
5325 const char* name;
5326 const char* description;
5357 tcu::TestCaseGroup* const depthGroup = new tcu::TestCaseGroup(m_testCtx, "depth", "Test bounding box depth component");
5364 tcu::TestCaseGroup* const group = new tcu::TestCaseGroup(m_testCtx, depthMethods[depthNdx].name, depthMethods[depthNdx].description);
5374 tcu::TestCaseGroup* const blitFboGroup = new tcu::TestCaseGroup(m_testCtx, "blit_fbo", "Test bounding box does not affect blitting");
5384 tcu::TestCaseGroup* const clearGroup = new tcu::TestCaseGroup(m_testCtx, "clear", "Test bounding box does not clears");
5400 tcu::TestCaseGroup* const callOrderGroup = new tcu::TestCaseGroup(m_testCtx, "call_order", "Test viewport and bounding box calls have no effect");