Fix couple of implicit conversion warnings reported by MSVC
authorPyry Haulos <phaulos@google.com>
Tue, 3 Feb 2015 18:41:01 +0000 (10:41 -0800)
committerPyry Haulos <phaulos@google.com>
Tue, 3 Feb 2015 19:31:08 +0000 (11:31 -0800)
Change-Id: If6dd153b8927e4f8e0cc5629d4dd051a9a96dcdf

modules/gles3/functional/es3fShaderDerivateTests.cpp
modules/gles31/functional/es31fPrimitiveBoundingBoxTests.cpp

index 97a948f..a5144f5 100644 (file)
@@ -508,12 +508,12 @@ static bool reverifyConstantDerivateWithFlushRelaxations (tcu::TestLog&                                                   lo
                        const int                       nominatorLoBits                 = de::max(0, numBits - nominatorLoBitsLost);
                        const int                       nominatorHiBits                 = de::max(0, numBits - nominatorHiBitsLost);
 
-                       const tcu::Interval     nominatorRange                  (convertFloorFlushToZero(nominator.lo(), minExponent, nominatorLoBits),
-                                                                                                                convertCeilFlushToZero(nominator.hi(), minExponent, nominatorHiBits));
+                       const tcu::Interval     nominatorRange                  (convertFloorFlushToZero((float)nominator.lo(), minExponent, nominatorLoBits),
+                                                                                                                convertCeilFlushToZero((float)nominator.hi(), minExponent, nominatorHiBits));
 
                        const tcu::Interval     divisionRange                   = nominatorRange / 3.0f; // legal sample area is anywhere within this and neighboring pixels (i.e. size = 3)
-                       const tcu::Interval     divisionResultRange             (convertFloorFlushToZero(addErrorUlp(divisionRange.lo(), -divisionErrorUlps, numBits), minExponent, numBits),
-                                                                                                                convertCeilFlushToZero(addErrorUlp(divisionRange.hi(), +divisionErrorUlps, numBits), minExponent, numBits));
+                       const tcu::Interval     divisionResultRange             (convertFloorFlushToZero(addErrorUlp((float)divisionRange.lo(), -divisionErrorUlps, numBits), minExponent, numBits),
+                                                                                                                convertCeilFlushToZero(addErrorUlp((float)divisionRange.hi(), +divisionErrorUlps, numBits), minExponent, numBits));
                        const tcu::Interval     finalResultRange                (divisionResultRange.lo() - surfaceThreshold[c], divisionResultRange.hi() + surfaceThreshold[c]);
 
                        if (resultDerivative[c] >= finalResultRange.lo() && resultDerivative[c] <= finalResultRange.hi())
index 6cccfb9..e5e5067 100644 (file)
@@ -1989,7 +1989,7 @@ tcu::IVec2 LineRenderCase::getNumMinimaMaxima (const tcu::ConstPixelBufferAccess
 bool LineRenderCase::checkLineWidths (const tcu::ConstPixelBufferAccess& access, const tcu::IVec2& begin, const tcu::IVec2& end, int componentNdx, int& messageLimitCounter) const
 {
        const bool                      multisample             = m_context.getRenderTarget().getNumSamples() > 1;
-       const int                       lineRenderWidth = (m_isWideLineCase) ? (m_wideLineLineWidth) : (1.0);
+       const int                       lineRenderWidth = (m_isWideLineCase) ? (m_wideLineLineWidth) : 1;
        const tcu::IVec2        lineWidthRange  = (multisample)
                                                                                        ? (tcu::IVec2(lineRenderWidth, lineRenderWidth+1))      // multisampled "smooth" lines may spread to neighboring pixel
                                                                                        : (tcu::IVec2(lineRenderWidth, lineRenderWidth));
@@ -2629,7 +2629,7 @@ void PointRenderCase::genReferencePointData (const IterationConfig& config, std:
        {
                currentPoints[ndx].center       = m_attribData[ndx*2].swizzle(0, 1);
                currentPoints[ndx].even         = (m_attribData[ndx*2 + 1].y() == 1.0f); // is green
-               currentPoints[ndx].size         = ((m_isWidePointCase) ? ((currentPoints[ndx].even) ? (5.0f) : (3.0f)) : (1.0));
+               currentPoints[ndx].size         = ((m_isWidePointCase) ? ((currentPoints[ndx].even) ? 5 : 3) : 1);
        }
 
        // tessellation
@@ -2717,7 +2717,7 @@ bool PointRenderCase::verifyNarrowPointPattern (const tcu::Surface& viewport, co
                else
                {
                        // transform to viewport coords
-                       const tcu::IVec2 pixelCenter(deFloatRound((refPoint.center.x() * 0.5f + 0.5f) * viewport.getWidth()), deFloatRound((refPoint.center.y() * 0.5f + 0.5f) * viewport.getHeight()));
+                       const tcu::IVec2 pixelCenter(deRoundFloatToInt32((refPoint.center.x() * 0.5f + 0.5f) * viewport.getWidth()), deRoundFloatToInt32((refPoint.center.y() * 0.5f + 0.5f) * viewport.getHeight()));
 
                        // find rasterized point in the result
                        if (pixelCenter.x() < 1 || pixelCenter.y() < 1 || pixelCenter.x() >= viewport.getWidth()-1 || pixelCenter.y() >= viewport.getHeight()-1)
@@ -2794,13 +2794,13 @@ bool PointRenderCase::verifyWidePoint (const tcu::Surface& viewport, const Gener
        const int                       componentNdx            = (refPoint.even) ? (1) : (2);
        const int                       halfPointSizeCeil       = (refPoint.size + 1) / 2;
        const int                       halfPointSizeFloor      = (refPoint.size + 1) / 2;
-       const tcu::IVec4        viewportBBoxArea        = getViewportBoundingBoxArea(bbox, tcu::IVec2(viewport.getWidth(), viewport.getHeight()), refPoint.size);
+       const tcu::IVec4        viewportBBoxArea        = getViewportBoundingBoxArea(bbox, tcu::IVec2(viewport.getWidth(), viewport.getHeight()), (float)refPoint.size);
        const tcu::IVec4        verificationArea        = tcu::IVec4(de::max(viewportBBoxArea.x(), 0),
                                                                                                                 de::max(viewportBBoxArea.y(), 0),
                                                                                                                 de::min(viewportBBoxArea.z(), viewport.getWidth()),
                                                                                                                 de::min(viewportBBoxArea.w(), viewport.getHeight()));
-       const tcu::IVec2        pointPos                        = tcu::IVec2(deFloatRound((refPoint.center.x()*0.5f + 0.5f) * viewport.getWidth()),
-                                                                                                                deFloatRound((refPoint.center.y()*0.5f + 0.5f) * viewport.getHeight()));
+       const tcu::IVec2        pointPos                        = tcu::IVec2(deRoundFloatToInt32((refPoint.center.x()*0.5f + 0.5f) * viewport.getWidth()),
+                                                                                                                deRoundFloatToInt32((refPoint.center.y()*0.5f + 0.5f) * viewport.getHeight()));
 
        // find any fragment within the point that is inside the bbox, start search at the center