Lines Matching defs:const

80 void requireFeatures (const InstanceInterface& vki, const VkPhysicalDevice physDevice, const FeatureFlags flags)
82 const VkPhysicalDeviceFeatures features = getPhysicalDeviceFeatures(vki, physDevice);
118 std::vector<Vec4> genVertices (const VkPrimitiveTopology topology, const Vec4& offset, const float slope)
120 const float p = 1.0f;
121 const float hp = 0.5f;
122 const float z = 0.0f;
123 const float w = 1.0f;
239 bool inline isColorInRange (const Vec4& color, const Vec4& minColor, const Vec4& maxColor)
248 int countPixels (const tcu::ConstPixelBufferAccess pixels, const IVec2& regionOffset, const IVec2& regionSize, const Vec4& color, const Vec4& colorThreshold)
250 const Vec4 minColor = color - colorThreshold;
251 const Vec4 maxColor = color + colorThreshold;
252 const int xEnd = regionOffset.x() + regionSize.x();
253 const int yEnd = regionOffset.y() + regionSize.y();
269 int countPixels (const tcu::ConstPixelBufferAccess pixels, const Vec4& color, const Vec4& colorThreshold)
275 bool checkFragColors (const tcu::ConstPixelBufferAccess pixels, IVec2 clipRegion, int barIdx, bool hasCullDistance)
283 const tcu::Vec4 color = pixels.getPixel(x, y);
284 const int barWidth = pixels.getWidth() / 8;
285 const bool insideBar = x >= barWidth * barIdx && x < barWidth* (barIdx + 1);
286 const float expectedClipDistance = insideBar ? (((((float)y + 0.5f) / (float)pixels.getHeight()) - 0.5f) * 2.0f) : 0.0f;
288 const float clipDistance = color.y();
289 const float cullDistance = color.z();
290 const float height = (float)pixels.getHeight();
331 const VkPointClippingBehavior invalidClippingBehavior = VK_POINT_CLIPPING_BEHAVIOR_LAST;
333 VkPointClippingBehavior getClippingBehavior (const InstanceInterface& vk, VkPhysicalDevice physicalDevice)
355 void addSimplePrograms (SourceCollections& programCollection, const float pointSize = 0.0f)
359 const bool usePointSize = pointSize > 0.0f;
396 void initPrograms (SourceCollections& programCollection, const VkPrimitiveTopology topology)
398 const float pointSize = (topology == VK_PRIMITIVE_TOPOLOGY_POINT_LIST ? 1.0f : 0.0f);
402 void initPrograms (SourceCollections& programCollection, const LineOrientation lineOrientation)
414 tcu::TestStatus testPrimitivesInside (Context& context, const VkPrimitiveTopology topology)
458 static const struct
460 const char* const desc;
473 const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 0.0f);
483 const int numBlackPixels = countPixels(drawContext.getColorPixels(), Vec4(0.0f, 0.0f, 0.0f, 1.0f), Vec4());
492 tcu::TestStatus testPrimitivesOutside (Context& context, const VkPrimitiveTopology topology)
513 static const struct
515 const char* const desc;
529 const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 0.0f);
540 const int numBlackPixels = countPixels(drawContext.getColorPixels(), Vec4(0.0f, 0.0f, 0.0f, 1.0f), Vec4());
549 tcu::TestStatus testPrimitivesDepthClamp (Context& context, const VkPrimitiveTopology topology)
557 const int numCases = 4;
558 const IVec2 regionSize = IVec2(RENDER_SIZE/2, RENDER_SIZE); //! size of the clamped region
559 const int regionPixels = regionSize.x() * regionSize.y();
563 static const struct
565 const char* const desc;
619 const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
630 const int numPixels = countPixels(drawContext.getColorPixels(), cases[caseNdx].regionOffset, regionSize, cases[caseNdx].color, Vec4());
640 tcu::TestStatus testPrimitivesDepthClip (Context& context, const VkPrimitiveTopology topology)
649 const int numCases = 4;
650 const IVec2 regionSize = IVec2(RENDER_SIZE/2, RENDER_SIZE); //! size of the clamped region
651 const int regionPixels = regionSize.x() * regionSize.y();
655 static const struct
657 const char* const desc;
713 const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
726 const int numPixels = countPixels(drawContext.getColorPixels(), cases[caseNdx].regionOffset, regionSize, cases[caseNdx].color, Vec4());
748 const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
761 const int numPixels = countPixels(drawContext.getColorPixels(), cases[caseNdx].regionOffset, regionSize, cases[caseNdx].color, Vec4());
805 const float delta = 0.1f; // much smaller than the point size
806 const float p = 1.0f + delta;
832 const int numBlackPixels = countPixels(drawContext.getColorPixels(), Vec4(0.0f, 0.0f, 0.0f, 1.0f), Vec4());
866 void shadeVertices (const rr::VertexAttrib* inputs, rr::VertexPacket* const* packets, const int numPackets) const
870 const tcu::Vec4 position = rr::readVertexAttribFloat(inputs[0], packets[packetNdx]->instanceNdx, packets[packetNdx]->vertexNdx);
888 void shadeFragments (rr::FragmentPacket* packets, const int numPackets, const rr::FragmentShadingContext& context) const
894 const float depth = rr::readVarying<float>(packets[packetNdx], context, 0, fragNdx).z();
901 tcu::TestStatus testWideLines (Context& context, const LineOrientation lineOrientation)
909 const float delta = 0.1f; // much smaller than the line width
915 const float p = 1.0f + delta;
916 const float q = 0.9f;
930 const float p = 2.0f + delta;
944 const VkPhysicalDeviceLimits limits = getPhysicalDeviceProperties(context.getInstanceInterface(), context.getPhysicalDevice()).limits;
946 const float lineWidth = std::min(static_cast<float>(RENDER_SIZE), limits.lineWidthRange[1]);
947 const bool strictLines = limits.strictLines;
971 const float halfWidth = lineWidth / float(RENDER_SIZE);
977 const deUint32 vertexNdx0 = 2 * lineNdx;
978 const deUint32 vertexNdx1 = 2 * lineNdx + 1;
980 const bool xMajorAxis = deFloatAbs(vertices[vertexNdx1].x() - vertices[vertexNdx0].x()) >= deFloatAbs(vertices[vertexNdx1].y() - vertices[vertexNdx0].y());
981 const tcu::Vec2 lineDir = tcu::normalize(tcu::Vec2(vertices[vertexNdx1].x() - vertices[vertexNdx0].x(), vertices[vertexNdx1].y() - vertices[vertexNdx0].y()));
982 const tcu::Vec4 lineNormalDir = (strictLines) ? tcu::Vec4(lineDir.y(), -lineDir.x(), 0.0f, 0.0f) // Line caps are perpendicular to the direction of the line segment.
985 const tcu::Vec4 wideLineVertices[] =
1028 const VkPrimitiveTopology topology;
1029 const bool dynamicIndexing;
1030 const bool enableTessellation;
1031 const bool enableGeometry;
1032 const int numClipDistances;
1033 const int numCullDistances;
1034 const bool readInFragmentShader;
1036 CaseDefinition (const VkPrimitiveTopology topology_,
1037 const int numClipDistances_,
1038 const int numCullDistances_,
1039 const bool enableTessellation_,
1040 const bool enableGeometry_,
1041 const bool dynamicIndexing_,
1042 const bool readInFragmentShader_)
1054 void initPrograms (SourceCollections& programCollection, const CaseDefinition caseDef)
1086 << " const int barNdx = gl_VertexIndex / 6;\n";
1377 tcu::TestStatus testClipDistance (Context& context, const CaseDefinition caseDef)
1381 const InstanceInterface& vki = context.getInstanceInterface();
1382 const VkPhysicalDevice physDevice = context.getPhysicalDevice();
1383 const VkPhysicalDeviceLimits limits = getPhysicalDeviceProperties(vki, physDevice).limits;
1419 const int numBars = MAX_COMBINED_CLIP_AND_CULL_DISTANCES;
1423 const float dx = 2.0f / numBars;
1426 const float x = -1.0f + dx * static_cast<float>(i);
1456 const int numBlackPixels = countPixels(drawContext.getColorPixels(), Vec4(0.0f, 0.0f, 0.0f, 1.0f), Vec4());
1457 const IVec2 clipRegion = IVec2(caseDef.numClipDistances * RENDER_SIZE / numBars, RENDER_SIZE / 2);
1459 const int barsCulled = (int)deFloor((0.25f) / (1.0f / numBars));
1460 const IVec2 cullRegion = (caseDef.readInFragmentShader || caseDef.numCullDistances == 0) ? IVec2(0.0f, 0.0f) : IVec2(barsCulled, RENDER_SIZE);
1461 const int expectedClippedPixels = clipRegion.x() * clipRegion.y() + cullRegion.x() * cullRegion.y();
1463 const int guardPixels = countPixels(drawContext.getColorPixels(), IVec2(0, RENDER_SIZE/2), clipRegion, Vec4(0.0f, 0.0f, 0.0f, 1.0f), Vec4());
1464 const bool fragColorsOk = caseDef.readInFragmentShader ? checkFragColors(drawContext.getColorPixels(), clipRegion, caseDef.numClipDistances / 2, caseDef.numCullDistances > 0) : true;
1475 void initPrograms (SourceCollections& programCollection, const int numClipDistances)
1480 const int clipDistanceLastNdx = numClipDistances - 1;
1519 tcu::TestStatus testComplementarity (Context& context, const int numClipDistances)
1523 const InstanceInterface& vki = context.getInstanceInterface();
1524 const VkPhysicalDevice physDevice = context.getPhysicalDevice();
1536 const int numSections = 16;
1537 const int numVerticesPerSection = 4; // logical verticies, due to triangle list topology we actually use 6 per section
1548 const float sign = (setNdx == 0 ? 1.0f : -1.0f);
1549 const float dx = 2.0f / static_cast<float>(numSections);
1553 const int ndxBase = numVerticesPerSection * i;
1554 const float x = -1.0f + dx * static_cast<float>(i);
1555 const Vec4 p0 = Vec4(x, -1.0f, 0.0f, sign * clipDistances[ndxBase + 0]);
1556 const Vec4 p1 = Vec4(x, 1.0f, 0.0f, sign * clipDistances[ndxBase + 1]);
1557 const Vec4 p2 = Vec4(x + dx, 1.0f, 0.0f, sign * clipDistances[ndxBase + 2]);
1558 const Vec4 p3 = Vec4(x + dx, -1.0f, 0.0f, sign * clipDistances[ndxBase + 3]);
1587 const int numGrayPixels = countPixels(drawContext.getColorPixels(), Vec4(0.5f, 0.5f, 0.5f, 1.0f), Vec4(0.02f, 0.02f, 0.02f, 0.0f));
1588 const int numExpectedPixels = RENDER_SIZE_LARGE * RENDER_SIZE_LARGE;
1599 const InstanceInterface& vki = context.getInstanceInterface();
1600 const VkPhysicalDevice physDevice = context.getPhysicalDevice();
1662 const int numDrawnPixels = countPixels(drawContext.getColorPixels(), Vec4(1.0f, 0.0f, 0.0f, 1.0f), Vec4(0.02f, 0.02f, 0.02f, 0.0f));
1663 const int numExpectedPixels = RENDER_SIZE * RENDER_SIZE / 2;
1674 void checkTopologySupport(Context& context, const VkPrimitiveTopology topology)
1697 static const VkPrimitiveTopology cases[] =
1783 static const struct
1785 const char* const groupName;
1793 static const struct
1795 const char* const name;
1804 const deUint32 flagTessellation = 1u << 0;
1805 const deUint32 flagGeometry = 1u << 1;
1810 const bool dynamicIndexing = (indexingMode == 1);
1811 const std::string mainGroupName = de::toString(caseGroups[groupNdx].groupName) + (dynamicIndexing ? "_dynamic_index" : "");
1817 const bool useTessellation = (shaderMask & flagTessellation) != 0;
1818 const bool useGeometry = (shaderMask & flagGeometry) != 0;
1819 const std::string shaderGroupName = std::string("vert") + (useTessellation ? "_tess" : "") + (useGeometry ? "_geom" : "");
1826 const int numCullPlanes = (caseGroups[groupNdx].useCullDistance
1829 const std::string caseName = de::toString(numClipPlanes) + (numCullPlanes > 0 ? "_" + de::toString(numCullPlanes) : "") + de::toString(fragmentShaderReads[fragmentShaderReadNdx].name);
1830 const VkPrimitiveTopology topology = (useTessellation ? VK_PRIMITIVE_TOPOLOGY_PATCH_LIST : VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST);
1869 tcu::TestCaseGroup* createTests (tcu::TestContext& testCtx, const std::string& name)