Fix -Wconversion warnings in GLES31 module.
authorJarkko Pöyry <jpoyry@google.com>
Wed, 20 May 2015 03:44:07 +0000 (20:44 -0700)
committerJarkko Pöyry <jpoyry@google.com>
Fri, 22 May 2015 00:25:09 +0000 (17:25 -0700)
Bug: 21161908
Change-Id: I43f95dc010f9977aeb1f658b9d67a9aa946c6fff

22 files changed:
modules/gles31/functional/es31fCopyImageTests.cpp
modules/gles31/functional/es31fDrawTests.cpp
modules/gles31/functional/es31fGeometryShaderTests.cpp
modules/gles31/functional/es31fMultisampleTests.cpp
modules/gles31/functional/es31fPrimitiveBoundingBoxTests.cpp
modules/gles31/functional/es31fSSBOLayoutCase.cpp
modules/gles31/functional/es31fSampleShadingTests.cpp
modules/gles31/functional/es31fSampleVariableTests.cpp
modules/gles31/functional/es31fSeparateShaderTests.cpp
modules/gles31/functional/es31fShaderMultisampleInterpolationTests.cpp
modules/gles31/functional/es31fShaderPackingFunctionTests.cpp
modules/gles31/functional/es31fStencilTexturingTests.cpp
modules/gles31/functional/es31fSynchronizationTests.cpp
modules/gles31/functional/es31fTessellationGeometryInteractionTests.cpp
modules/gles31/functional/es31fTessellationTests.cpp
modules/gles31/functional/es31fTextureBorderClampTests.cpp
modules/gles31/functional/es31fTextureGatherTests.cpp
modules/gles31/functional/es31fTextureMultisampleTests.cpp
modules/gles31/functional/es31fUniformLocationTests.cpp
modules/gles31/functional/es31fVertexAttributeBindingTests.cpp
modules/gles31/stress/es31sDrawTests.cpp
modules/gles31/stress/es31sVertexAttributeBindingTests.cpp

index 84be605..e8e0588 100644 (file)
@@ -1046,7 +1046,7 @@ void verifyTexture3DView (tcu::TestContext&                       testContext,
                for (int slice = 0; slice < levelSize.z(); slice++)
                {
                        const RandomViewport    viewport                (renderContext.getRenderTarget(), levelSize.x(), levelSize.y(), rng.getUint32());
-                       const float                             r                               = (float(slice) + 0.5f) / levelSize.z();
+                       const float                             r                               = (float(slice) + 0.5f) / (float)levelSize.z();
                        tcu::Surface                    renderedFrame   (viewport.width, viewport.height);
                        tcu::Surface                    referenceFrame  (viewport.width, viewport.height);
                        vector<float>                   texCoord;
index 0664137..f8c4f5b 100644 (file)
@@ -820,8 +820,8 @@ void InstancedGridRenderTest::renderTo (sglr::Context& ctx, sglr::ShaderProgram&
        deInt32 offsetLocation  = ctx.getAttribLocation(programID, "a_offset");
        deInt32 colorLocation   = ctx.getAttribLocation(programID, "a_color");
 
-       float cellW     = 2.0f / m_gridSide;
-       float cellH     = 2.0f / m_gridSide;
+       float cellW     = 2.0f / (float)m_gridSide;
+       float cellH     = 2.0f / (float)m_gridSide;
        const tcu::Vec4 vertexPositions[] =
        {
                tcu::Vec4(0,            0,              0, 1),
@@ -842,7 +842,7 @@ void InstancedGridRenderTest::renderTo (sglr::Context& ctx, sglr::ShaderProgram&
        std::vector<tcu::Vec4> offsets;
        for (int x = 0; x < m_gridSide; ++x)
        for (int y = 0; y < m_gridSide; ++y)
-               offsets.push_back(tcu::Vec4(x * cellW - 1.0f, y * cellW - 1.0f, 0, 0));
+               offsets.push_back(tcu::Vec4((float)x * cellW - 1.0f, (float)y * cellW - 1.0f, 0, 0));
 
        std::vector<tcu::Vec4> colors;
        for (int x = 0; x < m_gridSide; ++x)
@@ -1034,7 +1034,7 @@ ComputeShaderGeneratedCase::ComputeShaderGeneratedCase (Context& context, const
        , m_computeCmd          (computeCmd)
        , m_computeData         (computeData)
        , m_computeIndices      (computeIndices)
-       , m_commandSize         ((method==DRAWMETHOD_DRAWARRAYS) ? (sizeof(DrawArraysCommand)) : (sizeof(DrawElementsCommand)))
+       , m_commandSize         ((method==DRAWMETHOD_DRAWARRAYS) ? ((int)sizeof(DrawArraysCommand)) : ((int)sizeof(DrawElementsCommand)))
        , m_numDrawCmds         (drawCallCount)
        , m_gridSize            (gridSize)
        , m_cmdBufferID         (0)
@@ -1410,8 +1410,8 @@ void ComputeShaderGeneratedCase::createDrawData (void)
                for (int y = 0; y < m_gridSize; ++y)
                for (int x = 0; x < m_gridSize; ++x)
                {
-                       const float             posX            = (x / (float)m_gridSize) * 2.0f - 1.0f;
-                       const float             posY            = (y / (float)m_gridSize) * 2.0f - 1.0f;
+                       const float             posX            = ((float)x / (float)m_gridSize) * 2.0f - 1.0f;
+                       const float             posY            = ((float)y / (float)m_gridSize) * 2.0f - 1.0f;
                        const float                     cellSize        = 2.0f / (float)m_gridSize;
                        const tcu::Vec4&        color           = ((x + y)%2) ? (yellow) : (green);
 
@@ -1444,8 +1444,8 @@ void ComputeShaderGeneratedCase::createDrawData (void)
                for (int y = 0; y < m_gridSize+1; ++y)
                for (int x = 0; x < m_gridSize+1; ++x)
                {
-                       const float             posX            = (x / (float)m_gridSize) * 2.0f - 1.0f;
-                       const float             posY            = (y / (float)m_gridSize) * 2.0f - 1.0f;
+                       const float             posX            = ((float)x / (float)m_gridSize) * 2.0f - 1.0f;
+                       const float             posY            = ((float)y / (float)m_gridSize) * 2.0f - 1.0f;
 
                        buffer[(y * (m_gridSize+1) + x) * 4 + 0] = tcu::Vec4(posX, posY, 0.0f, 1.0f);
                        buffer[(y * (m_gridSize+1) + x) * 4 + 1] = green;
@@ -1502,8 +1502,8 @@ void ComputeShaderGeneratedCase::renderTo (tcu::Surface& dst)
        // Setup buffers
 
        gl.bindBuffer(GL_ARRAY_BUFFER, m_dataBufferID);
-       gl.vertexAttribPointer(positionLoc, 4, GL_FLOAT, GL_FALSE, 8 * sizeof(float), DE_NULL);
-       gl.vertexAttribPointer(colorLoc,    4, GL_FLOAT, GL_FALSE, 8 * sizeof(float), ((const deUint8*)DE_NULL) + 4*sizeof(float));
+       gl.vertexAttribPointer(positionLoc, 4, GL_FLOAT, GL_FALSE, 8 * (int)sizeof(float), DE_NULL);
+       gl.vertexAttribPointer(colorLoc,    4, GL_FLOAT, GL_FALSE, 8 * (int)sizeof(float), ((const deUint8*)DE_NULL) + 4*sizeof(float));
        gl.enableVertexAttribArray(positionLoc);
        gl.enableVertexAttribArray(colorLoc);
 
index e75eb28..ae92528 100644 (file)
@@ -835,8 +835,8 @@ void OutputCountShader::shadePrimitives (rr::GeometryEmitter& output, int vertic
 
                for (int ndx = 0; ndx < emitCount / 2; ++ndx)
                {
-                       output.EmitVertex(vertex->position + tcu::Vec4(2 * ndx * colWidth, 0.0,       0.0, 0.0), vertex->pointSize, vertex->outputs, packets[packetNdx].primitiveIDIn);
-                       output.EmitVertex(vertex->position + tcu::Vec4(2 * ndx * colWidth, rowHeight, 0.0, 0.0), vertex->pointSize, vertex->outputs, packets[packetNdx].primitiveIDIn);
+                       output.EmitVertex(vertex->position + tcu::Vec4(2 * (float)ndx * colWidth, 0.0,       0.0, 0.0), vertex->pointSize, vertex->outputs, packets[packetNdx].primitiveIDIn);
+                       output.EmitVertex(vertex->position + tcu::Vec4(2 * (float)ndx * colWidth, rowHeight, 0.0, 0.0), vertex->pointSize, vertex->outputs, packets[packetNdx].primitiveIDIn);
                }
                output.EndPrimitive();
        }
@@ -1283,7 +1283,7 @@ void VaryingOutputCountShader::shadePrimitives (rr::GeometryEmitter& output, int
                else if (m_test == READ_TEXTURE)
                {
                        const int                       primitiveNdx    = (m_instanced) ? (invocationID) : ((int)vertex->outputs[0].get<float>().x());
-                       const tcu::Vec2         texCoord                = tcu::Vec2(1.0f / 8.0f + primitiveNdx / 4.0f, 0.5f);
+                       const tcu::Vec2         texCoord                = tcu::Vec2(1.0f / 8.0f + (float)primitiveNdx / 4.0f, 0.5f);
                        const tcu::Vec4         texColor                = m_sampler.sampler.tex2D->sample(texCoord.x(), texCoord.y(), 0.0f);
 
                        DE_ASSERT(primitiveNdx >= 0);
@@ -2456,7 +2456,7 @@ void OutputCountCase::genVertexAttribData (void)
 
        for (int ndx = 0; ndx < m_primitiveCount; ++ndx)
        {
-               m_vertexPosData[ndx] = tcu::Vec4(-1.0f, ((float)ndx) / m_primitiveCount * 2.0f - 1.0f, 0.0f, 1.0f);
+               m_vertexPosData[ndx] = tcu::Vec4(-1.0f, ((float)ndx) / (float)m_primitiveCount * 2.0f - 1.0f, 0.0f, 1.0f);
                m_vertexAttrData[ndx] = (ndx % 2 == 0) ? tcu::Vec4(1, 1, 1, 1) : tcu::Vec4(1, 0, 0, 1);
        }
 
@@ -3346,7 +3346,7 @@ bool LayeredRenderCase::verifyLayerContent (const tcu::Surface& layer, int layer
                        if (layerNdx == 0)
                                return verifyEmptyImage(layer);
                        else
-                               return verifyImageSingleColoredRow(layer, layerNdx / (float)m_numLayers, white);
+                               return verifyImageSingleColoredRow(layer, (float)layerNdx / (float)m_numLayers, white);
 
                case TEST_LAYER_ID:
                {
@@ -3388,7 +3388,7 @@ bool LayeredRenderCase::verifyImageSingleColoredRow (const tcu::Surface& layer,
 {
        DE_ASSERT(rowWidthRatio > 0.0f);
 
-       const int               barLength                       = (int)(rowWidthRatio*layer.getWidth());
+       const int               barLength                       = (int)(rowWidthRatio * (float)layer.getWidth());
        const int               barLengthThreshold      = 1;
        tcu::Surface    errorMask                       (layer.getWidth(), layer.getHeight());
        bool                    allPixelsOk                     = true;
@@ -4589,12 +4589,12 @@ PrimitivesGeneratedQueryCase::IterateResult PrimitivesGeneratedQueryCase::iterat
                gl.bindBuffer(GL_ARRAY_BUFFER, *buffer);
                gl.bufferData(GL_ARRAY_BUFFER, (int)sizeof(vertexData), vertexData, GL_STATIC_DRAW);
 
-               gl.vertexAttribPointer(positionLocation, 4, GL_FLOAT, GL_FALSE, 2 * sizeof(tcu::Vec4), DE_NULL);
+               gl.vertexAttribPointer(positionLocation, 4, GL_FLOAT, GL_FALSE, 2 * (int)sizeof(tcu::Vec4), DE_NULL);
                gl.enableVertexAttribArray(positionLocation);
 
                if (oneLocation != -1)
                {
-                       gl.vertexAttribPointer(oneLocation, 4, GL_FLOAT, GL_FALSE, 2 * sizeof(tcu::Vec4), (const tcu::Vec4*)DE_NULL + 1);
+                       gl.vertexAttribPointer(oneLocation, 4, GL_FLOAT, GL_FALSE, 2 * (int)sizeof(tcu::Vec4), (const tcu::Vec4*)DE_NULL + 1);
                        gl.enableVertexAttribArray(oneLocation);
                }
 
@@ -5360,7 +5360,7 @@ void VertexFeedbackCase::init (void)
                };
 
                const glw::Functions&   gl                              = m_context.getRenderContext().getFunctions();
-               const int                               feedbackSize    = 8 * sizeof(float[4]);
+               const int                               feedbackSize    = 8 * (int)sizeof(float[4]);
 
                m_vao = new glu::VertexArray(m_context.getRenderContext());
                gl.bindVertexArray(**m_vao);
index 028eef2..4a77f95 100644 (file)
@@ -101,7 +101,7 @@ static std::vector<deUint32> genAllSetToNthBitSampleMask (int nthBit)
        for (int ndx = 0; ndx < numWords - 1; ++ndx)
                mask[ndx] = 0xFFFFFFFF;
 
-       mask[numWords - 1] = (deUint32)((1ULL << topWordBits) - (deUint32)1);
+       mask[numWords - 1] = deBitMask32(0, (int)topWordBits);
        return mask;
 }
 
@@ -490,7 +490,7 @@ void MaskInvertCase::drawPattern (bool invert) const
        for (int triNdx = 0; triNdx < numTriangles; triNdx++)
        {
                const float     angle0  = 2.0f*DE_PI * (float)triNdx                    / (float)numTriangles;
-               const float     angle1  = 2.0f*DE_PI * (float)(triNdx + 0.5f)   / (float)numTriangles;
+               const float     angle1  = 2.0f*DE_PI * ((float)triNdx + 0.5f)   / (float)numTriangles;
                const Vec4      color   = Vec4(0.4f + (float)triNdx/(float)numTriangles*0.6f,
                                           0.5f + (float)triNdx/(float)numTriangles*0.3f,
                                           0.6f - (float)triNdx/(float)numTriangles*0.5f,
@@ -499,7 +499,7 @@ void MaskInvertCase::drawPattern (bool invert) const
 
                const int                       wordCount               = getEffectiveSampleMaskWordCount(m_numSamples - 1);
                const GLbitfield        finalWordBits   = m_numSamples - 32 * ((m_numSamples-1) / 32);
-               const GLbitfield        finalWordMask   = (GLbitfield)(1ULL << finalWordBits) - 1UL;
+               const GLbitfield        finalWordMask   = (GLbitfield)deBitMask32(0, (int)finalWordBits);
 
                for (int wordNdx = 0; wordNdx < wordCount; ++wordNdx)
                {
@@ -809,7 +809,7 @@ MaskConstancyCase::IterateResult MaskConstancyCase::iterate (void)
                        {
                                const int                       wordCount               = getEffectiveSampleMaskWordCount(m_numSamples - 1);
                                const GLbitfield        finalWordBits   = m_numSamples - 32 * ((m_numSamples-1) / 32);
-                               const GLbitfield        finalWordMask   = (GLbitfield)(1ULL << finalWordBits) - 1UL;
+                               const GLbitfield        finalWordMask   = (GLbitfield)deBitMask32(0, (int)finalWordBits);
 
                                for (int wordNdx = 0; wordNdx < wordCount; ++wordNdx)
                                {
@@ -936,7 +936,7 @@ SampleMaskHighBitsCase::IterateResult SampleMaskHighBitsCase::iterate (void)
 
                        const int                       wordCount               = getEffectiveSampleMaskWordCount(m_numSamples - 1);
                        const GLbitfield        finalWordBits   = m_numSamples - 32 * ((m_numSamples-1) / 32);
-                       const GLbitfield        finalWordMask   = (GLbitfield)(1ULL << finalWordBits) - 1UL;
+                       const GLbitfield        finalWordMask   = (GLbitfield)deBitMask32(0, (int)finalWordBits);
 
                        for (int wordNdx = 0; wordNdx < wordCount; ++wordNdx)
                        {
index ea8109a..d25314e 100644 (file)
@@ -108,10 +108,10 @@ static tcu::IVec4 getViewportBoundingBoxArea (const ProjectedBBox& bbox, const t
        tcu::Vec4       vertexBox;
        tcu::IVec4      pixelBox;
 
-       vertexBox.x() = (bbox.min.x() * 0.5f + 0.5f) * viewportSize.x();
-       vertexBox.y() = (bbox.min.y() * 0.5f + 0.5f) * viewportSize.y();
-       vertexBox.z() = (bbox.max.x() * 0.5f + 0.5f) * viewportSize.x();
-       vertexBox.w() = (bbox.max.y() * 0.5f + 0.5f) * viewportSize.y();
+       vertexBox.x() = (bbox.min.x() * 0.5f + 0.5f) * (float)viewportSize.x();
+       vertexBox.y() = (bbox.min.y() * 0.5f + 0.5f) * (float)viewportSize.y();
+       vertexBox.z() = (bbox.max.x() * 0.5f + 0.5f) * (float)viewportSize.x();
+       vertexBox.w() = (bbox.max.y() * 0.5f + 0.5f) * (float)viewportSize.y();
 
        pixelBox.x() = deFloorFloatToInt32(vertexBox.x() - size/2.0f);
        pixelBox.y() = deFloorFloatToInt32(vertexBox.y() - size/2.0f);
@@ -775,10 +775,10 @@ tcu::IVec4 BBoxRenderCase::getViewportPatternArea (const tcu::Vec2& patternPos,
        tcu::Vec4       vertexBox;
        tcu::IVec4      pixelBox;
 
-       vertexBox.x() = (patternPos.x() * 0.5f + 0.5f) * viewportSize.x();
-       vertexBox.y() = (patternPos.y() * 0.5f + 0.5f) * viewportSize.y();
-       vertexBox.z() = ((patternPos.x() + patternSize.x()) * 0.5f + 0.5f) * viewportSize.x();
-       vertexBox.w() = ((patternPos.y() + patternSize.y()) * 0.5f + 0.5f) * viewportSize.y();
+       vertexBox.x() = (patternPos.x() * 0.5f + 0.5f) * (float)viewportSize.x();
+       vertexBox.y() = (patternPos.y() * 0.5f + 0.5f) * (float)viewportSize.y();
+       vertexBox.z() = ((patternPos.x() + patternSize.x()) * 0.5f + 0.5f) * (float)viewportSize.x();
+       vertexBox.w() = ((patternPos.y() + patternSize.y()) * 0.5f + 0.5f) * (float)viewportSize.y();
 
        if (roundDir == ROUND_INWARDS)
        {
@@ -1230,17 +1230,17 @@ void GridRenderCase::getAttributeData (std::vector<tcu::Vec4>& data) const
                const int                       cellY           = cellNdx / m_gridSize;
                const tcu::Vec4&        cellColor       = ((cellX+cellY)%2 == 0) ? (green) : (yellow);
 
-               data[(ndx * 6 + 0) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4((cellX+0) / float(m_gridSize), (cellY+0) / float(m_gridSize), 0.0f, 1.0f);
+               data[(ndx * 6 + 0) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(float(cellX+0) / float(m_gridSize), float(cellY+0) / float(m_gridSize), 0.0f, 1.0f);
                data[(ndx * 6 + 0) * VA_NUM_ATTRIB_VECS + VA_COL_VEC_NDX] = cellColor;
-               data[(ndx * 6 + 1) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4((cellX+1) / float(m_gridSize), (cellY+1) / float(m_gridSize), 0.0f, 1.0f);
+               data[(ndx * 6 + 1) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(float(cellX+1) / float(m_gridSize), float(cellY+1) / float(m_gridSize), 0.0f, 1.0f);
                data[(ndx * 6 + 1) * VA_NUM_ATTRIB_VECS + VA_COL_VEC_NDX] = cellColor;
-               data[(ndx * 6 + 2) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4((cellX+0) / float(m_gridSize), (cellY+1) / float(m_gridSize), 0.0f, 1.0f);
+               data[(ndx * 6 + 2) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(float(cellX+0) / float(m_gridSize), float(cellY+1) / float(m_gridSize), 0.0f, 1.0f);
                data[(ndx * 6 + 2) * VA_NUM_ATTRIB_VECS + VA_COL_VEC_NDX] = cellColor;
-               data[(ndx * 6 + 3) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4((cellX+0) / float(m_gridSize), (cellY+0) / float(m_gridSize), 0.0f, 1.0f);
+               data[(ndx * 6 + 3) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(float(cellX+0) / float(m_gridSize), float(cellY+0) / float(m_gridSize), 0.0f, 1.0f);
                data[(ndx * 6 + 3) * VA_NUM_ATTRIB_VECS + VA_COL_VEC_NDX] = cellColor;
-               data[(ndx * 6 + 4) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4((cellX+1) / float(m_gridSize), (cellY+0) / float(m_gridSize), 0.0f, 1.0f);
+               data[(ndx * 6 + 4) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(float(cellX+1) / float(m_gridSize), float(cellY+0) / float(m_gridSize), 0.0f, 1.0f);
                data[(ndx * 6 + 4) * VA_NUM_ATTRIB_VECS + VA_COL_VEC_NDX] = cellColor;
-               data[(ndx * 6 + 5) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4((cellX+1) / float(m_gridSize), (cellY+1) / float(m_gridSize), 0.0f, 1.0f);
+               data[(ndx * 6 + 5) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(float(cellX+1) / float(m_gridSize), float(cellY+1) / float(m_gridSize), 0.0f, 1.0f);
                data[(ndx * 6 + 5) * VA_NUM_ATTRIB_VECS + VA_COL_VEC_NDX] = cellColor;
        }
 }
@@ -1702,8 +1702,8 @@ LineRenderCase::IterationConfig LineRenderCase::generateConfig (int iteration, c
        {
                const IterationConfig& config = generateRandomConfig((0xDEDEDEu * (deUint32)iteration) ^ (0xABAB13 * attemptNdx), renderTargetSize);
 
-               if (config.viewportSize.x() * (config.patternSize.x() * 0.5f) > 2.5f * m_patternSide * m_wideLineLineWidth &&
-                       config.viewportSize.y() * (config.patternSize.y() * 0.5f) > 2.5f * m_patternSide * m_wideLineLineWidth)
+               if ((float)config.viewportSize.x() * (config.patternSize.x() * 0.5f) > 2.5f * (float)m_patternSide * (float)m_wideLineLineWidth &&
+                       (float)config.viewportSize.y() * (config.patternSize.y() * 0.5f) > 2.5f * (float)m_patternSide * (float)m_wideLineLineWidth)
                {
                        return config;
                }
@@ -1735,16 +1735,16 @@ void LineRenderCase::getAttributeData (std::vector<tcu::Vec4>& data) const
 
                if (direction)
                {
-                       data[(ndx * 2 + 0) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(minorCoord / float(m_patternSide), majorCoord / float(m_patternSide), 0.0f, 1.0f);
+                       data[(ndx * 2 + 0) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(float(minorCoord) / float(m_patternSide), float(majorCoord) / float(m_patternSide), 0.0f, 1.0f);
                        data[(ndx * 2 + 0) * VA_NUM_ATTRIB_VECS + VA_COL_VEC_NDX] = green;
-                       data[(ndx * 2 + 1) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(minorCoord / float(m_patternSide), (majorCoord + 1) / float(m_patternSide), 0.0f, 1.0f);
+                       data[(ndx * 2 + 1) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(float(minorCoord) / float(m_patternSide), float(majorCoord + 1) / float(m_patternSide), 0.0f, 1.0f);
                        data[(ndx * 2 + 1) * VA_NUM_ATTRIB_VECS + VA_COL_VEC_NDX] = green;
                }
                else
                {
-                       data[(ndx * 2 + 0) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(majorCoord / float(m_patternSide), minorCoord / float(m_patternSide), 0.0f, 1.0f);
+                       data[(ndx * 2 + 0) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(float(majorCoord) / float(m_patternSide), float(minorCoord) / float(m_patternSide), 0.0f, 1.0f);
                        data[(ndx * 2 + 0) * VA_NUM_ATTRIB_VECS + VA_COL_VEC_NDX] = blue;
-                       data[(ndx * 2 + 1) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4((majorCoord + 1) / float(m_patternSide), minorCoord / float(m_patternSide), 0.0f, 1.0f);
+                       data[(ndx * 2 + 1) * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(float(majorCoord + 1) / float(m_patternSide), float(minorCoord) / float(m_patternSide), 0.0f, 1.0f);
                        data[(ndx * 2 + 1) * VA_NUM_ATTRIB_VECS + VA_COL_VEC_NDX] = blue;
                }
        }
@@ -1773,7 +1773,7 @@ void LineRenderCase::renderTestPattern (const IterationConfig& config)
        if (m_isWideLineCase)
                gl.lineWidth((float)m_wideLineLineWidth);
 
-       gl.uniform1f(gl.getUniformLocation(m_program->getProgram(), "u_lineWidth"), (m_isWideLineCase) ? (m_wideLineLineWidth) : (1.0f));
+       gl.uniform1f(gl.getUniformLocation(m_program->getProgram(), "u_lineWidth"), (m_isWideLineCase) ? ((float)m_wideLineLineWidth) : (1.0f));
 
        m_testCtx.getLog() << tcu::TestLog::Message << "Rendering pattern." << tcu::TestLog::EndMessage;
 
@@ -1790,7 +1790,7 @@ void LineRenderCase::verifyRenderResult (const IterationConfig& config)
        const glw::Functions&   gl                                              = m_context.getRenderContext().getFunctions();
        const bool                              isMsaa                                  = m_context.getRenderTarget().getNumSamples() > 1;
        const ProjectedBBox             projectedBBox                   = projectBoundingBox(config.bbox);
-       const float                             lineWidth                               = (m_isWideLineCase) ? (m_wideLineLineWidth) : (1.0f);
+       const float                             lineWidth                               = (m_isWideLineCase) ? ((float)m_wideLineLineWidth) : (1.0f);
        const tcu::IVec4                viewportBBoxArea                = getViewportBoundingBoxArea(projectedBBox, config.viewportSize, lineWidth);
        const tcu::IVec4                viewportPatternArea             = getViewportPatternArea(config.patternPos, config.patternSize, config.viewportSize, ROUND_INWARDS);
        const tcu::IVec2                expectedHorizontalLines = getNumberOfLinesRange(viewportBBoxArea.y(), viewportBBoxArea.w(), config.patternPos.y(), config.patternSize.y(), config.viewportSize.y(), DIRECTION_VERTICAL);
@@ -1926,18 +1926,18 @@ tcu::IVec2 LineRenderCase::getNumberOfLinesRange (int queryAreaBegin, int queryA
 
        for (int lineNdx = patternStartNdx; lineNdx < patternEndNdx; ++lineNdx)
        {
-               const float linePos             = (patternStart + (lineNdx / float(m_patternSide)) * patternSize) * 0.5f + 0.5f;
-               const float lineWidth   = (m_isWideLineCase) ? (m_wideLineLineWidth) : (1.0f);
+               const float linePos             = (patternStart + (float(lineNdx) / float(m_patternSide)) * patternSize) * 0.5f + 0.5f;
+               const float lineWidth   = (m_isWideLineCase) ? ((float)m_wideLineLineWidth) : (1.0f);
 
-               if (linePos * viewportArea > queryAreaBegin + 1.0f &&
-                       linePos * viewportArea < queryAreaEnd   - 1.0f)
+               if (linePos * (float)viewportArea > (float)queryAreaBegin + 1.0f &&
+                       linePos * (float)viewportArea < (float)queryAreaEnd   - 1.0f)
                {
                        // line center is within the area
                        ++numLinesMin;
                        ++numLinesMax;
                }
-               else if (linePos * viewportArea > queryAreaBegin - lineWidth*0.5f - 1.0f &&
-                        linePos * viewportArea < queryAreaEnd   + lineWidth*0.5f + 1.0f)
+               else if (linePos * (float)viewportArea > (float)queryAreaBegin - lineWidth*0.5f - 1.0f &&
+                        linePos * (float)viewportArea < (float)queryAreaEnd   + lineWidth*0.5f + 1.0f)
                {
                        // line could leak into area
                        ++numLinesMax;
@@ -1952,8 +1952,8 @@ deUint8 LineRenderCase::scanRow (const tcu::ConstPixelBufferAccess& access, int
        const bool numLinesOk   = checkAreaNumLines(access, tcu::IVec4(rowBegin, row, rowEnd - rowBegin, 1), messageLimitCounter, SCAN_ROW_COMPONENT_NDX, numLines);
        const bool lineWidthOk  = checkLineWidths(access, tcu::IVec2(rowBegin, row), tcu::IVec2(rowEnd, row), SCAN_ROW_COMPONENT_NDX, messageLimitCounter);
 
-       return  (numLinesOk             ? (deUint8)SCANRESULT_NUM_LINES_OK_BIT  : 0u) |
-                       (lineWidthOk    ? (deUint8)SCANRESULT_LINE_WIDTH_OK_BIT : 0u);
+       return  (deUint8)((numLinesOk   ? (deUint8)SCANRESULT_NUM_LINES_OK_BIT  : 0u) |
+                                         (lineWidthOk  ? (deUint8)SCANRESULT_LINE_WIDTH_OK_BIT : 0u));
 }
 
 deUint8 LineRenderCase::scanColumn (const tcu::ConstPixelBufferAccess& access, int column, int columnBegin, int columnEnd, const tcu::IVec2& numLines, int& messageLimitCounter) const
@@ -1961,8 +1961,8 @@ deUint8 LineRenderCase::scanColumn (const tcu::ConstPixelBufferAccess& access, i
        const bool numLinesOk   = checkAreaNumLines(access, tcu::IVec4(column, columnBegin, 1, columnEnd - columnBegin), messageLimitCounter, SCAN_COL_COMPONENT_NDX, numLines);
        const bool lineWidthOk  = checkLineWidths(access, tcu::IVec2(column, columnBegin), tcu::IVec2(column, columnEnd), SCAN_COL_COMPONENT_NDX, messageLimitCounter);
 
-       return  (numLinesOk             ? (deUint8)SCANRESULT_NUM_LINES_OK_BIT  : 0u) |
-                       (lineWidthOk    ? (deUint8)SCANRESULT_LINE_WIDTH_OK_BIT : 0u);
+       return  (deUint8)((numLinesOk   ? (deUint8)SCANRESULT_NUM_LINES_OK_BIT  : 0u) |
+                                         (lineWidthOk  ? (deUint8)SCANRESULT_LINE_WIDTH_OK_BIT : 0u));
 }
 
 bool LineRenderCase::checkAreaNumLines (const tcu::ConstPixelBufferAccess& access, const tcu::IVec4& area, int& messageLimitCounter, int componentNdx, const tcu::IVec2& numLines) const
@@ -2567,12 +2567,12 @@ void PointRenderCase::generateAttributeData (void)
 
                if (direction)
                {
-                       m_attribData[ndx * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(minorCoord / float(m_numStripes), majorCoord / float(m_numStripes), 0.0f, 1.0f);
+                       m_attribData[ndx * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(float(minorCoord) / float(m_numStripes), float(majorCoord) / float(m_numStripes), 0.0f, 1.0f);
                        m_attribData[ndx * VA_NUM_ATTRIB_VECS + VA_COL_VEC_NDX] = green;
                }
                else
                {
-                       m_attribData[ndx * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4((majorCoord + 0.5f) / float(m_numStripes), (minorCoord + 0.5f) / float(m_numStripes), 0.0f, 1.0f);
+                       m_attribData[ndx * VA_NUM_ATTRIB_VECS + VA_POS_VEC_NDX] = tcu::Vec4(((float)majorCoord + 0.5f) / float(m_numStripes), ((float)minorCoord + 0.5f) / float(m_numStripes), 0.0f, 1.0f);
                        m_attribData[ndx * VA_NUM_ATTRIB_VECS + VA_COL_VEC_NDX] = blue;
                }
        }
@@ -2791,7 +2791,8 @@ bool PointRenderCase::verifyNarrowPointPattern (const tcu::Surface& viewport, co
                else
                {
                        // transform to viewport coords
-                       const tcu::IVec2 pixelCenter(deRoundFloatToInt32((refPoint.center.x() * 0.5f + 0.5f) * viewport.getWidth()), deRoundFloatToInt32((refPoint.center.y() * 0.5f + 0.5f) * viewport.getHeight()));
+                       const tcu::IVec2 pixelCenter(deRoundFloatToInt32((refPoint.center.x() * 0.5f + 0.5f) * (float)viewport.getWidth()),
+                                                                                deRoundFloatToInt32((refPoint.center.y() * 0.5f + 0.5f) * (float)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)
@@ -2850,10 +2851,10 @@ bool PointRenderCase::verifyWidePointPattern (const tcu::Surface& viewport, cons
                        // point fully in the bounding box
                        anyError |= !verifyWidePoint(viewport, refPoint, bbox, POINT_FULL, logFloodCounter);
                }
-               else if (refPoint.center.x() >= bbox.min.x() + refPoint.size / 2.0f &&
-                                refPoint.center.y() >= bbox.min.y() - refPoint.size / 2.0f &&
-                                refPoint.center.x() <= bbox.max.x() + refPoint.size / 2.0f &&
-                                refPoint.center.y() <= bbox.max.y() - refPoint.size / 2.0f)
+               else if (refPoint.center.x() >= bbox.min.x() + (float)refPoint.size / 2.0f &&
+                                refPoint.center.y() >= bbox.min.y() - (float)refPoint.size / 2.0f &&
+                                refPoint.center.x() <= bbox.max.x() + (float)refPoint.size / 2.0f &&
+                                refPoint.center.y() <= bbox.max.y() - (float)refPoint.size / 2.0f)
                {
                        // point leaks into bounding box
                        anyError |= !verifyWidePoint(viewport, refPoint, bbox, POINT_PARTIAL, logFloodCounter);
@@ -2873,8 +2874,8 @@ bool PointRenderCase::verifyWidePoint (const tcu::Surface& viewport, const Gener
                                                                                                                 de::max(viewportBBoxArea.y(), 0),
                                                                                                                 de::min(viewportBBoxArea.z(), viewport.getWidth()),
                                                                                                                 de::min(viewportBBoxArea.w(), 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()));
+       const tcu::IVec2        pointPos                        = tcu::IVec2(deRoundFloatToInt32((refPoint.center.x()*0.5f + 0.5f) * (float)viewport.getWidth()),
+                                                                                                                deRoundFloatToInt32((refPoint.center.y()*0.5f + 0.5f) * (float)viewport.getHeight()));
 
        // find any fragment within the point that is inside the bbox, start search at the center
 
@@ -3604,8 +3605,8 @@ void DepthDrawCase::init (void)
                m_layers.resize(m_numLayers);
                for (int layerNdx = 0; layerNdx < m_numLayers; ++layerNdx)
                {
-                       m_layers[layerNdx].zOffset      = ((float)layerNdx / m_numLayers) * 2.0f - 1.0f;
-                       m_layers[layerNdx].zScale       = (2.0f / m_numLayers);
+                       m_layers[layerNdx].zOffset      = ((float)layerNdx / (float)m_numLayers) * 2.0f - 1.0f;
+                       m_layers[layerNdx].zScale       = (2.0f / (float)m_numLayers);
                        m_layers[layerNdx].color1       = (layerNdx == 0) ? (tcu::Vec4(0.0f, 1.0f, 0.0f, 1.0f)) : (tcu::Vec4(0.0f, 0.0f, 1.0f, 1.0f));
                        m_layers[layerNdx].color2       = (layerNdx == 0) ? (tcu::Vec4(1.0f, 1.0f, 0.0f, 1.0f)) : (tcu::Vec4(1.0f, 0.0f, 1.0f, 1.0f));
                }
@@ -3861,12 +3862,12 @@ void DepthDrawCase::generateAttributeData (std::vector<tcu::Vec4>& data) const
                const int                       cellY           = cellNdx / m_gridSize;
                const tcu::Vec4&        cellColor       = ((cellX+cellY)%2 == 0) ? (color1) : (color2);
 
-               data[ndx * 6 * 2 +  0] = tcu::Vec4((cellX+0) / float(m_gridSize) * 2.0f - 1.0f, (cellY+0) / float(m_gridSize) * 2.0f - 1.0f, 0.0f, 0.0f);       data[ndx * 6 * 2 +  1] = cellColor;
-               data[ndx * 6 * 2 +  2] = tcu::Vec4((cellX+1) / float(m_gridSize) * 2.0f - 1.0f, (cellY+1) / float(m_gridSize) * 2.0f - 1.0f, 0.0f, 0.0f);       data[ndx * 6 * 2 +  3] = cellColor;
-               data[ndx * 6 * 2 +  4] = tcu::Vec4((cellX+0) / float(m_gridSize) * 2.0f - 1.0f, (cellY+1) / float(m_gridSize) * 2.0f - 1.0f, 0.0f, 0.0f);       data[ndx * 6 * 2 +  5] = cellColor;
-               data[ndx * 6 * 2 +  6] = tcu::Vec4((cellX+0) / float(m_gridSize) * 2.0f - 1.0f, (cellY+0) / float(m_gridSize) * 2.0f - 1.0f, 0.0f, 0.0f);       data[ndx * 6 * 2 +  7] = cellColor;
-               data[ndx * 6 * 2 +  8] = tcu::Vec4((cellX+1) / float(m_gridSize) * 2.0f - 1.0f, (cellY+0) / float(m_gridSize) * 2.0f - 1.0f, 0.0f, 0.0f);       data[ndx * 6 * 2 +  9] = cellColor;
-               data[ndx * 6 * 2 + 10] = tcu::Vec4((cellX+1) / float(m_gridSize) * 2.0f - 1.0f, (cellY+1) / float(m_gridSize) * 2.0f - 1.0f, 0.0f, 0.0f);       data[ndx * 6 * 2 + 11] = cellColor;
+               data[ndx * 6 * 2 +  0] = tcu::Vec4(float(cellX+0) / float(m_gridSize) * 2.0f - 1.0f, float(cellY+0) / float(m_gridSize) * 2.0f - 1.0f, 0.0f, 0.0f);     data[ndx * 6 * 2 +  1] = cellColor;
+               data[ndx * 6 * 2 +  2] = tcu::Vec4(float(cellX+1) / float(m_gridSize) * 2.0f - 1.0f, float(cellY+1) / float(m_gridSize) * 2.0f - 1.0f, 0.0f, 0.0f);     data[ndx * 6 * 2 +  3] = cellColor;
+               data[ndx * 6 * 2 +  4] = tcu::Vec4(float(cellX+0) / float(m_gridSize) * 2.0f - 1.0f, float(cellY+1) / float(m_gridSize) * 2.0f - 1.0f, 0.0f, 0.0f);     data[ndx * 6 * 2 +  5] = cellColor;
+               data[ndx * 6 * 2 +  6] = tcu::Vec4(float(cellX+0) / float(m_gridSize) * 2.0f - 1.0f, float(cellY+0) / float(m_gridSize) * 2.0f - 1.0f, 0.0f, 0.0f);     data[ndx * 6 * 2 +  7] = cellColor;
+               data[ndx * 6 * 2 +  8] = tcu::Vec4(float(cellX+1) / float(m_gridSize) * 2.0f - 1.0f, float(cellY+0) / float(m_gridSize) * 2.0f - 1.0f, 0.0f, 0.0f);     data[ndx * 6 * 2 +  9] = cellColor;
+               data[ndx * 6 * 2 + 10] = tcu::Vec4(float(cellX+1) / float(m_gridSize) * 2.0f - 1.0f, float(cellY+1) / float(m_gridSize) * 2.0f - 1.0f, 0.0f, 0.0f);     data[ndx * 6 * 2 + 11] = cellColor;
 
                // Fill Z with random values (fake Z)
                for (int vtxNdx = 0; vtxNdx < 6; ++vtxNdx)
@@ -4580,15 +4581,15 @@ void ViewportCallOrderCase::genVbo (void)
 
                if (cellSide)
                {
-                       data[ndx * 3 + 0] = tcu::Vec4((cellX+0) / float(gridSize), ((cellY+0) / float(gridSize)) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       data[ndx * 3 + 1] = tcu::Vec4((cellX+1) / float(gridSize), ((cellY+1) / float(gridSize)) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       data[ndx * 3 + 2] = tcu::Vec4((cellX+0) / float(gridSize), ((cellY+1) / float(gridSize)) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       data[ndx * 3 + 0] = tcu::Vec4(float(cellX+0) / float(gridSize), (float(cellY+0) / float(gridSize)) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       data[ndx * 3 + 1] = tcu::Vec4(float(cellX+1) / float(gridSize), (float(cellY+1) / float(gridSize)) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       data[ndx * 3 + 2] = tcu::Vec4(float(cellX+0) / float(gridSize), (float(cellY+1) / float(gridSize)) * 2.0f - 1.0f, 0.0f, 1.0f);
                }
                else
                {
-                       data[ndx * 3 + 0] = tcu::Vec4((cellX+0) / float(gridSize), ((cellY+0) / float(gridSize)) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       data[ndx * 3 + 1] = tcu::Vec4((cellX+1) / float(gridSize), ((cellY+0) / float(gridSize)) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       data[ndx * 3 + 2] = tcu::Vec4((cellX+1) / float(gridSize), ((cellY+1) / float(gridSize)) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       data[ndx * 3 + 0] = tcu::Vec4(float(cellX+0) / float(gridSize), (float(cellY+0) / float(gridSize)) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       data[ndx * 3 + 1] = tcu::Vec4(float(cellX+1) / float(gridSize), (float(cellY+0) / float(gridSize)) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       data[ndx * 3 + 2] = tcu::Vec4(float(cellX+1) / float(gridSize), (float(cellY+1) / float(gridSize)) * 2.0f - 1.0f, 0.0f, 1.0f);
                }
        }
 
@@ -4620,8 +4621,8 @@ void ViewportCallOrderCase::genProgram (void)
 
 bool ViewportCallOrderCase::verifyImage (const tcu::PixelBufferAccess& result)
 {
-       const tcu::IVec2        insideBorder    (deCeilFloatToInt32(0.25f * result.getWidth()) + 1, deFloorFloatToInt32(0.5f * result.getWidth()) - 1);
-       const tcu::IVec2        outsideBorder   (deFloorFloatToInt32(0.25f * result.getWidth()) - 1, deCeilFloatToInt32(0.5f * result.getWidth()) + 1);
+       const tcu::IVec2        insideBorder    (deCeilFloatToInt32(0.25f * (float)result.getWidth()) + 1, deFloorFloatToInt32(0.5f * (float)result.getWidth()) - 1);
+       const tcu::IVec2        outsideBorder   (deFloorFloatToInt32(0.25f * (float)result.getWidth()) - 1, deCeilFloatToInt32(0.5f * (float)result.getWidth()) + 1);
        tcu::Surface            errorMask               (result.getWidth(), result.getHeight());
        bool                            anyError                = false;
 
index 4741fe4..b265614 100644 (file)
@@ -329,7 +329,7 @@ int findBlockIndex (const BufferLayout& layout, const string& name)
 
 int getDataTypeByteSize (glu::DataType type)
 {
-       return glu::getDataTypeScalarSize(type)*sizeof(deUint32);
+       return glu::getDataTypeScalarSize(type)*(int)sizeof(deUint32);
 }
 
 int getDataTypeByteAlignment (glu::DataType type)
@@ -339,12 +339,12 @@ int getDataTypeByteAlignment (glu::DataType type)
                case glu::TYPE_FLOAT:
                case glu::TYPE_INT:
                case glu::TYPE_UINT:
-               case glu::TYPE_BOOL:            return 1*sizeof(deUint32);
+               case glu::TYPE_BOOL:            return 1*(int)sizeof(deUint32);
 
                case glu::TYPE_FLOAT_VEC2:
                case glu::TYPE_INT_VEC2:
                case glu::TYPE_UINT_VEC2:
-               case glu::TYPE_BOOL_VEC2:       return 2*sizeof(deUint32);
+               case glu::TYPE_BOOL_VEC2:       return 2*(int)sizeof(deUint32);
 
                case glu::TYPE_FLOAT_VEC3:
                case glu::TYPE_INT_VEC3:
@@ -354,7 +354,7 @@ int getDataTypeByteAlignment (glu::DataType type)
                case glu::TYPE_FLOAT_VEC4:
                case glu::TYPE_INT_VEC4:
                case glu::TYPE_UINT_VEC4:
-               case glu::TYPE_BOOL_VEC4:       return 4*sizeof(deUint32);
+               case glu::TYPE_BOOL_VEC4:       return 4*(int)sizeof(deUint32);
 
                default:
                        DE_ASSERT(false);
@@ -370,7 +370,7 @@ static inline int deRoundUp32 (int a, int b)
 
 int computeStd140BaseAlignment (const VarType& type, deUint32 layoutFlags)
 {
-       const int vec4Alignment = sizeof(deUint32)*4;
+       const int vec4Alignment = (int)sizeof(deUint32)*4;
 
        if (type.isBasicType())
        {
@@ -597,7 +597,7 @@ int computeReferenceLayout (BufferLayout& layout, int curBlockNdx, const std::st
                const int               topLevelArraySize       = varType.getArraySize() == VarType::UNSIZED_ARRAY ? 0 : varType.getArraySize();
                const string    prefix                          = blockPrefix + bufVar.getName() + "[0]";
                const bool              isStd140                        = (blockLayoutFlags & LAYOUT_STD140) != 0;
-               const int               vec4Align                       = sizeof(deUint32)*4;
+               const int               vec4Align                       = (int)sizeof(deUint32)*4;
                const int               baseAlignment           = isStd140 ? computeStd140BaseAlignment(varType, combinedFlags)
                                                                                                           : computeStd430BaseAlignment(varType, combinedFlags);
                int                             curOffset                       = deAlign32(baseOffset, baseAlignment);
index a05b968..f8926b3 100644 (file)
@@ -312,7 +312,7 @@ void SampleShadingRenderingCase::setShadingValue (int sampleCount)
                // Minimum number of samples is max(ceil(<mss> * <samples>),1). Decrease mss with epsilon to prevent
                // ceiling to a too large sample count.
                const float epsilon     = 0.25f / (float)m_numTargetSamples;
-               const float ratio       = (sampleCount / (float)m_numTargetSamples) - epsilon;
+               const float ratio       = ((float)sampleCount / (float)m_numTargetSamples) - epsilon;
 
                gl.enable(GL_SAMPLE_SHADING);
                gl.minSampleShading(ratio);
@@ -321,8 +321,8 @@ void SampleShadingRenderingCase::setShadingValue (int sampleCount)
                m_testCtx.getLog()
                        << tcu::TestLog::Message
                        << "Setting MIN_SAMPLE_SHADING_VALUE = " << ratio << "\n"
-                       << "Requested sample count: shadingValue * numSamples = " << ratio << " * " << m_numTargetSamples << " = " << (ratio * m_numTargetSamples) << "\n"
-                       << "Minimum sample count: ceil(shadingValue * numSamples) = ceil(" << (ratio * m_numTargetSamples) << ") = " << sampleCount
+                       << "Requested sample count: shadingValue * numSamples = " << ratio << " * " << m_numTargetSamples << " = " << (ratio * (float)m_numTargetSamples) << "\n"
+                       << "Minimum sample count: ceil(shadingValue * numSamples) = ceil(" << (ratio * (float)m_numTargetSamples) << ") = " << sampleCount
                        << tcu::TestLog::EndMessage;
 
                // can't fail with reasonable values of numSamples
index 3172a5e..14b2c31 100644 (file)
@@ -154,7 +154,7 @@ SampleAverageVerifier::SampleAverageVerifier (int _numSamples)
        , m_distanceThreshold                   (0.0f)
 {
        // approximate Bates distribution as normal
-       const float variance                    = (1.0f / (12.0f * m_numSamples));
+       const float variance                    = (1.0f / (12.0f * (float)m_numSamples));
        const float standardDeviation   = deFloatSqrt(variance);
 
        // 95% of means of sample positions are within 2 standard deviations if
@@ -168,7 +168,7 @@ bool SampleAverageVerifier::verify (const tcu::RGBA& testColor, const tcu::IVec2
        DE_UNREF(position);
        DE_ASSERT(m_isStatisticallySignificant);
 
-       const tcu::Vec2 avgPosition                             (testColor.getGreen() / 255.0f, testColor.getBlue() / 255.0f);
+       const tcu::Vec2 avgPosition                             ((float)testColor.getGreen() / 255.0f, (float)testColor.getBlue() / 255.0f);
        const tcu::Vec2 distanceFromCenter              = tcu::abs(avgPosition - tcu::Vec2(0.5f, 0.5f));
 
        return distanceFromCenter.x() < m_distanceThreshold && distanceFromCenter.y() < m_distanceThreshold;
@@ -557,7 +557,7 @@ bool SampleIDCase::verifySampleBuffers (const std::vector<tcu::Surface>& resultB
        {
                // sample id should be sample index
                const int threshold = 255 / 4 / m_numTargetSamples + 1;
-               const float sampleIdColor = sampleNdx / (float)m_numTargetSamples;
+               const float sampleIdColor = (float)sampleNdx / (float)m_numTargetSamples;
 
                m_testCtx.getLog() << tcu::TestLog::Message << "Verifying sample " << (sampleNdx+1) << "/" << (int)resultBuffers.size() << tcu::TestLog::EndMessage;
                allOk &= verifyImageWithVerifier(resultBuffers[sampleNdx], m_testCtx.getLog(), ColorVerifier(tcu::Vec3(0.0f, sampleIdColor, 1.0f), tcu::IVec3(1, threshold, 1)), false);
@@ -737,7 +737,7 @@ bool SamplePosDistributionCase::verifySampleBuffers (const std::vector<tcu::Surf
                        for (int sampleNdx = 0; sampleNdx < (int)resultBuffers.size(); ++sampleNdx)
                        {
                                const tcu::RGBA color = resultBuffers[sampleNdx].getPixel(x, y);
-                               samplePositions[sampleNdx] = tcu::Vec2(color.getGreen() / 255.0f, color.getBlue() / 255.0f);
+                               samplePositions[sampleNdx] = tcu::Vec2((float)color.getGreen() / 255.0f, (float)color.getBlue() / 255.0f);
                        }
 
                        // Just check there are no two samples with same positions
@@ -1534,7 +1534,7 @@ bool SampleMaskUniqueCase::verifySampleBuffers (const std::vector<tcu::Surface>&
                        for (int sampleNdx = 0; sampleNdx < (int)resultBuffers.size(); ++sampleNdx)
                        {
                                const tcu::RGBA color = resultBuffers[sampleNdx].getPixel(x, y);
-                               maskBitIndices[sampleNdx] = (int)deFloatRound(color.getGreen() / 255.0f * m_numTargetSamples);
+                               maskBitIndices[sampleNdx] = (int)deFloatRound((float)color.getGreen() / 255.0f * (float)m_numTargetSamples);
                        }
 
                        // just check there are no two invocations with the same bit index
@@ -1748,16 +1748,16 @@ void SampleMaskUniqueSetCase::postTest (void)
                        deUint16                        high;
 
                        {
-                               int redBits             = (int)deFloatRound(lowColor.getRed() / 255.0f * 31);
-                               int greenBits   = (int)deFloatRound(lowColor.getGreen() / 255.0f * 63);
-                               int blueBits    = (int)deFloatRound(lowColor.getBlue() / 255.0f * 31);
+                               int redBits             = (int)deFloatRound((float)lowColor.getRed() / 255.0f * 31);
+                               int greenBits   = (int)deFloatRound((float)lowColor.getGreen() / 255.0f * 63);
+                               int blueBits    = (int)deFloatRound((float)lowColor.getBlue() / 255.0f * 31);
 
                                low = (deUint16)(redBits | (greenBits << 5) | (blueBits << 11));
                        }
                        {
-                               int redBits             = (int)deFloatRound(highColor.getRed() / 255.0f * 31);
-                               int greenBits   = (int)deFloatRound(highColor.getGreen() / 255.0f * 63);
-                               int blueBits    = (int)deFloatRound(highColor.getBlue() / 255.0f * 31);
+                               int redBits             = (int)deFloatRound((float)highColor.getRed() / 255.0f * 31);
+                               int greenBits   = (int)deFloatRound((float)highColor.getGreen() / 255.0f * 63);
+                               int blueBits    = (int)deFloatRound((float)highColor.getBlue() / 255.0f * 31);
 
                                high = (deUint16)(redBits | (greenBits << 5) | (blueBits << 11));
                        }
index 71c7be2..2f89604 100644 (file)
@@ -671,9 +671,9 @@ struct ProgramParams
 ProgramParams genProgramParams (Random& rnd)
 {
        const deUint32  vtxSeed         = rnd.getUint32();
-       const GLfloat   vtxScale        = rnd.getInt(8, 16) / 16.0f;
+       const GLfloat   vtxScale        = (float)rnd.getInt(8, 16) / 16.0f;
        const deUint32  frgSeed         = rnd.getUint32();
-       const GLfloat   frgScale        = rnd.getInt(0, 16) / 16.0f;
+       const GLfloat   frgScale        = (float)rnd.getInt(0, 16) / 16.0f;
 
        return ProgramParams(vtxSeed, vtxScale, frgSeed, frgScale);
 }
index f9ef47b..aea088f 100644 (file)
@@ -781,26 +781,26 @@ void CentroidRenderCase::setupRenderData (void)
        m_renderSceneDescription = "triangle fan of narrow triangles";
 
        m_renderAttribs["a_position"].offset = 0;
-       m_renderAttribs["a_position"].stride = sizeof(float[4]) * 3;
-       m_renderAttribs["a_barycentricsA"].offset = sizeof(float[4]);
-       m_renderAttribs["a_barycentricsA"].stride = sizeof(float[4]) * 3;
-       m_renderAttribs["a_barycentricsB"].offset = sizeof(float[4]) * 2;
-       m_renderAttribs["a_barycentricsB"].stride = sizeof(float[4]) * 3;
+       m_renderAttribs["a_position"].stride = (int)sizeof(float[4]) * 3;
+       m_renderAttribs["a_barycentricsA"].offset = (int)sizeof(float[4]);
+       m_renderAttribs["a_barycentricsA"].stride = (int)sizeof(float[4]) * 3;
+       m_renderAttribs["a_barycentricsB"].offset = (int)sizeof(float[4]) * 2;
+       m_renderAttribs["a_barycentricsB"].stride = (int)sizeof(float[4]) * 3;
 
        for (int triangleNdx = 0; triangleNdx < numTriangles; ++triangleNdx)
        {
-               const float angle               = ((float)triangleNdx) / numTriangles * 2.0f * DE_PI;
-               const float nextAngle   = ((float)triangleNdx + 1.0f) / numTriangles * 2.0f * DE_PI;
+               const float angle               = ((float)triangleNdx) / (float)numTriangles * 2.0f * DE_PI;
+               const float nextAngle   = ((float)triangleNdx + 1.0f) / (float)numTriangles * 2.0f * DE_PI;
 
                data[(triangleNdx * 3 + 0) * 3 + 0] = tcu::Vec4(0.2f, -0.3f, 0.0f, 1.0f);
                data[(triangleNdx * 3 + 0) * 3 + 1] = tcu::Vec4(1.0f,  0.0f, 0.0f, 0.0f);
                data[(triangleNdx * 3 + 0) * 3 + 2] = tcu::Vec4(1.0f,  0.0f, 0.0f, 0.0f);
 
-               data[(triangleNdx * 3 + 1) * 3 + 0] = tcu::Vec4(2.0f * cos(angle), 2.0f * sin(angle), 0.0f, 1.0f);
+               data[(triangleNdx * 3 + 1) * 3 + 0] = tcu::Vec4(2.0f * deFloatCos(angle), 2.0f * deFloatSin(angle), 0.0f, 1.0f);
                data[(triangleNdx * 3 + 1) * 3 + 1] = tcu::Vec4(0.0f,  1.0f, 0.0f, 0.0f);
                data[(triangleNdx * 3 + 1) * 3 + 2] = tcu::Vec4(0.0f,  1.0f, 0.0f, 0.0f);
 
-               data[(triangleNdx * 3 + 2) * 3 + 0] = tcu::Vec4(2.0f * cos(nextAngle), 2.0f * sin(nextAngle), 0.0f, 1.0f);
+               data[(triangleNdx * 3 + 2) * 3 + 0] = tcu::Vec4(2.0f * deFloatCos(nextAngle), 2.0f * deFloatSin(nextAngle), 0.0f, 1.0f);
                data[(triangleNdx * 3 + 2) * 3 + 1] = tcu::Vec4(0.0f,  0.0f, 1.0f, 0.0f);
                data[(triangleNdx * 3 + 2) * 3 + 2] = tcu::Vec4(0.0f,  0.0f, 1.0f, 0.0f);
        }
index c8129e5..deaf761 100644 (file)
@@ -672,7 +672,7 @@ public:
                                        const int               s                       = rnd.getBool() ? 1 : -1;
                                        const int               exp                     = rnd.getInt(minExp, maxExp);
                                        const deUint32  mantissa        = rnd.getUint32() & ((1<<mantBits)-1);
-                                       const deUint16  value           = tcu::Float16::construct(s, exp ? exp : 1 /* avoid denorm */, (1u<<10) | mantissa).bits();
+                                       const deUint16  value           = tcu::Float16::construct(s, exp ? exp : 1 /* avoid denorm */, (deUint16)((1u<<10) | mantissa)).bits();
 
                                        inVal |= value << (16*c);
                                }
index 80cc264..6e41437 100644 (file)
@@ -111,12 +111,12 @@ static void rectsToTriangles (const vector<IVec4>& rects, int width, int height,
                positions[rectNdx*4 + 2] = Vec2(x0, y1);
                positions[rectNdx*4 + 3] = Vec2(x1, y1);
 
-               indices[rectNdx*6 + 0] = rectNdx*4 + 0;
-               indices[rectNdx*6 + 1] = rectNdx*4 + 1;
-               indices[rectNdx*6 + 2] = rectNdx*4 + 2;
-               indices[rectNdx*6 + 3] = rectNdx*4 + 2;
-               indices[rectNdx*6 + 4] = rectNdx*4 + 1;
-               indices[rectNdx*6 + 5] = rectNdx*4 + 3;
+               indices[rectNdx*6 + 0] = (deUint16)(rectNdx*4 + 0);
+               indices[rectNdx*6 + 1] = (deUint16)(rectNdx*4 + 1);
+               indices[rectNdx*6 + 2] = (deUint16)(rectNdx*4 + 2);
+               indices[rectNdx*6 + 3] = (deUint16)(rectNdx*4 + 2);
+               indices[rectNdx*6 + 4] = (deUint16)(rectNdx*4 + 1);
+               indices[rectNdx*6 + 5] = (deUint16)(rectNdx*4 + 3);
        }
 }
 
index 7c13068..d84b6cb 100644 (file)
@@ -207,7 +207,7 @@ void InterInvocationTestCase::init (void)
        if (m_storage == STORAGE_BUFFER)
        {
                const int                               bufferElements  = m_workWidth * m_workHeight * m_elementsPerInvocation;
-               const int                               bufferSize              = bufferElements * sizeof(deUint32);
+               const int                               bufferSize              = bufferElements * (int)sizeof(deUint32);
                std::vector<deUint32>   zeroBuffer              (bufferElements, 0);
 
                m_testCtx.getLog() << tcu::TestLog::Message << "Allocating zero-filled buffer for storage, size " << bufferElements << " elements, " << bufferSize << " bytes." << tcu::TestLog::EndMessage;
@@ -220,7 +220,7 @@ void InterInvocationTestCase::init (void)
        else if (m_storage == STORAGE_IMAGE)
        {
                const int                               bufferElements  = m_workWidth * m_workHeight * m_elementsPerInvocation;
-               const int                               bufferSize              = bufferElements * sizeof(deUint32);
+               const int                               bufferSize              = bufferElements * (int)sizeof(deUint32);
 
                m_testCtx.getLog() << tcu::TestLog::Message << "Allocating image for storage, size " << m_workWidth << "x" << m_workHeight * m_elementsPerInvocation << ", " << bufferSize << " bytes." << tcu::TestLog::EndMessage;
 
@@ -247,7 +247,7 @@ void InterInvocationTestCase::init (void)
 
        {
                const int                               bufferElements  = m_workWidth * m_workHeight;
-               const int                               bufferSize              = bufferElements * sizeof(deUint32);
+               const int                               bufferSize              = bufferElements * (int)sizeof(deUint32);
                std::vector<deInt32>    negativeBuffer  (bufferElements, -1);
 
                m_testCtx.getLog() << tcu::TestLog::Message << "Allocating -1 filled buffer for results, size " << bufferElements << " elements, " << bufferSize << " bytes." << tcu::TestLog::EndMessage;
@@ -1628,7 +1628,7 @@ glw::GLuint InterCallTestCase::genStorage (int friendlyName)
        if (m_storage == STORAGE_BUFFER)
        {
                const int               numElements             = m_invocationGridSize * m_invocationGridSize * m_perInvocationSize;
-               const int               bufferSize              = numElements * ((m_formatInteger) ? (sizeof(deInt32)) : (sizeof(glw::GLfloat)));
+               const int               bufferSize              = numElements * (int)((m_formatInteger) ? (sizeof(deInt32)) : (sizeof(glw::GLfloat)));
                glw::GLuint             retVal                  = 0;
 
                m_testCtx.getLog() << tcu::TestLog::Message << "Creating buffer #" << friendlyName << ", size " << bufferSize << " bytes." << tcu::TestLog::EndMessage;
index 4fbcaaf..5fcb276 100644 (file)
@@ -1233,7 +1233,7 @@ void FeedbackPrimitiveTypeCase::verifyRenderedImage (const tcu::Surface& image,
                // This minimal error could result in a difference in rounding => allow one additional pixel in deviation
 
                const int                       rasterDeviation = 2;
-               const tcu::IVec2        rasterPos               ((int)deFloatRound((vertices[ndx].x() * 0.5f + 0.5f) * image.getWidth()), (int)deFloatRound((vertices[ndx].y() * 0.5f + 0.5f) * image.getHeight()));
+               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()));
 
                // Find produced rasterization results
                bool                            found                   = false;
index 7c08f7d..c9c5dbf 100644 (file)
@@ -1062,7 +1062,7 @@ static void drawTessCoordPoint (tcu::Surface& dst, TessPrimitiveType primitiveTy
 
                                          : Vec2(-1.0f);
 
-       drawPoint(dst, (int)(dstPos.x()*dst.getWidth()), (int)(dstPos.y()*dst.getHeight()), color, size);
+       drawPoint(dst, (int)(dstPos.x() * (float)dst.getWidth()), (int)(dstPos.y() * (float)dst.getHeight()), color, size);
 }
 
 static void drawTessCoordVisualization (tcu::Surface& dst, TessPrimitiveType primitiveType, const vector<Vec3>& coords)
@@ -1431,8 +1431,8 @@ static bool verifyFractionalSpacingMultiple (TestLog& log, SpacingMode spacingMo
                        if (curFinalLevel != prevFinalLevel)
                                continue;
 
-                       const float                     curFraction             = curFinalLevel - curClampedLevel;
-                       const float                     prevFraction    = prevFinalLevel - prevClampedLevel;
+                       const float                     curFraction             = (float)curFinalLevel - curClampedLevel;
+                       const float                     prevFraction    = (float)prevFinalLevel - prevClampedLevel;
 
                        if (curData.additionalSegmentLength < prevData.additionalSegmentLength ||
                                (curClampedLevel == prevClampedLevel && curData.additionalSegmentLength != prevData.additionalSegmentLength))
@@ -1736,12 +1736,12 @@ CommonEdgeCase::IterateResult CommonEdgeCase::iterate (void)
                for (int i = 0; i < gridHeight; i++)
                for (int j = 0; j < gridWidth; j++)
                {
-                       const int corners[4] =
+                       const deUint16 corners[4] =
                        {
-                               (i+0)*(gridWidth+1) + j+0,
-                               (i+0)*(gridWidth+1) + j+1,
-                               (i+1)*(gridWidth+1) + j+0,
-                               (i+1)*(gridWidth+1) + j+1
+                               (deUint16)((i+0)*(gridWidth+1) + j+0),
+                               (deUint16)((i+0)*(gridWidth+1) + j+1),
+                               (deUint16)((i+1)*(gridWidth+1) + j+0),
+                               (deUint16)((i+1)*(gridWidth+1) + j+1)
                        };
 
                        const int secondTriangleVertexIndexOffset = m_caseType == CASETYPE_BASIC        ? 0
@@ -1764,7 +1764,7 @@ CommonEdgeCase::IterateResult CommonEdgeCase::iterate (void)
                        //               share a vertices, it's at the same index for everyone.
                        for (int m = 0; m < 2; m++)
                        for (int n = 0; n < 2; n++)
-                               gridIndices.push_back((i+(i+m)%2)*(gridWidth+1) + j+(j+n)%2);
+                               gridIndices.push_back((deUint16)((i+(i+m)%2)*(gridWidth+1) + j+(j+n)%2));
 
                        if(m_caseType == CASETYPE_PRECISE && (i+j) % 2 == 0)
                                std::reverse(gridIndices.begin() + (gridIndices.size() - 4),
@@ -6006,7 +6006,7 @@ void UserDefinedIOCase::init (void)
                                tcsDeclarations += outMaybePatch + output.declare();
 
                        if (!isPerPatchIO)
-                               tcsStatements += "\t\tv += float(gl_InvocationID)*" + de::floatToString(0.4f*output.numBasicSubobjectsInElementType(), 1) + ";\n";
+                               tcsStatements += "\t\tv += float(gl_InvocationID)*" + de::floatToString(0.4f * (float)output.numBasicSubobjectsInElementType(), 1) + ";\n";
 
                        tcsStatements += "\n\t\t// Assign values to output " + output.name() + "\n";
                        if (isArray)
@@ -6015,7 +6015,7 @@ void UserDefinedIOCase::init (void)
                                tcsStatements += output.glslTraverseBasicType(2, glslAssignBasicTypeObject);
 
                        if (!isPerPatchIO)
-                               tcsStatements += "\t\tv += float(" + de::toString(int(NUM_OUTPUT_VERTICES)) + "-gl_InvocationID-1)*" + de::floatToString(0.4f*output.numBasicSubobjectsInElementType(), 1) + ";\n";
+                               tcsStatements += "\t\tv += float(" + de::toString(int(NUM_OUTPUT_VERTICES)) + "-gl_InvocationID-1)*" + de::floatToString(0.4f * (float)output.numBasicSubobjectsInElementType(), 1) + ";\n";
                }
                tcsStatements += "\t}\n";
 
index 9df2ea5..5ceb433 100644 (file)
@@ -428,10 +428,10 @@ rr::GenericVec4 mapToFormatColorRepresentable (const tcu::TextureFormat& texForm
                                                                                                         tcu::floatToU8(sRGB[1]),
                                                                                                         tcu::floatToU8(sRGB[2]),
                                                                                                         tcu::floatToU8(sRGB[3]));
-               const tcu::Vec4         linearized      = tcu::sRGBToLinear(tcu::Vec4(sRGB8[0] / 255.0f,
-                                                                                                                                         sRGB8[1] / 255.0f,
-                                                                                                                                         sRGB8[2] / 255.0f,
-                                                                                                                                         sRGB8[3] / 255.0f));
+               const tcu::Vec4         linearized      = tcu::sRGBToLinear(tcu::Vec4((float)sRGB8[0] / 255.0f,
+                                                                                                                                         (float)sRGB8[1] / 255.0f,
+                                                                                                                                         (float)sRGB8[2] / 255.0f,
+                                                                                                                                         (float)sRGB8[3] / 255.0f));
 
                return rr::GenericVec4(tcu::select(linearized, tcu::Vec4(0.0f), channelMask));
        }
index f5a5540..440c003 100644 (file)
@@ -641,7 +641,7 @@ public:
 
        float operator() (const IVec2& pixCoord) const
        {
-               return (float)(pixCoord.x() + 0.5f) / (float)m_renderSize.x();
+               return ((float)pixCoord.x() + 0.5f) / (float)m_renderSize.x();
        }
 
 private:
index 7f8a786..385eb8c 100644 (file)
@@ -666,12 +666,12 @@ void SampleMaskCase::init (void)
                for (int y = 0; y < m_gridsize; ++y)
                for (int x = 0; x < m_gridsize; ++x)
                {
-                       gridData[(y * m_gridsize + x)*6 + 0] = tcu::Vec4(((float)(x+0) / m_gridsize) * 2.0f - 1.0f, ((float)(y+0) / m_gridsize) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       gridData[(y * m_gridsize + x)*6 + 1] = tcu::Vec4(((float)(x+0) / m_gridsize) * 2.0f - 1.0f, ((float)(y+1) / m_gridsize) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       gridData[(y * m_gridsize + x)*6 + 2] = tcu::Vec4(((float)(x+1) / m_gridsize) * 2.0f - 1.0f, ((float)(y+1) / m_gridsize) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       gridData[(y * m_gridsize + x)*6 + 3] = tcu::Vec4(((float)(x+0) / m_gridsize) * 2.0f - 1.0f, ((float)(y+0) / m_gridsize) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       gridData[(y * m_gridsize + x)*6 + 4] = tcu::Vec4(((float)(x+1) / m_gridsize) * 2.0f - 1.0f, ((float)(y+1) / m_gridsize) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       gridData[(y * m_gridsize + x)*6 + 5] = tcu::Vec4(((float)(x+1) / m_gridsize) * 2.0f - 1.0f, ((float)(y+0) / m_gridsize) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       gridData[(y * m_gridsize + x)*6 + 0] = tcu::Vec4(((float)(x+0) / (float)m_gridsize) * 2.0f - 1.0f, ((float)(y+0) / (float)m_gridsize) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       gridData[(y * m_gridsize + x)*6 + 1] = tcu::Vec4(((float)(x+0) / (float)m_gridsize) * 2.0f - 1.0f, ((float)(y+1) / (float)m_gridsize) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       gridData[(y * m_gridsize + x)*6 + 2] = tcu::Vec4(((float)(x+1) / (float)m_gridsize) * 2.0f - 1.0f, ((float)(y+1) / (float)m_gridsize) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       gridData[(y * m_gridsize + x)*6 + 3] = tcu::Vec4(((float)(x+0) / (float)m_gridsize) * 2.0f - 1.0f, ((float)(y+0) / (float)m_gridsize) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       gridData[(y * m_gridsize + x)*6 + 4] = tcu::Vec4(((float)(x+1) / (float)m_gridsize) * 2.0f - 1.0f, ((float)(y+1) / (float)m_gridsize) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       gridData[(y * m_gridsize + x)*6 + 5] = tcu::Vec4(((float)(x+1) / (float)m_gridsize) * 2.0f - 1.0f, ((float)(y+0) / (float)m_gridsize) * 2.0f - 1.0f, 0.0f, 1.0f);
                }
 
                gl.bufferData                   (GL_ARRAY_BUFFER, (int)(gridData.size() * sizeof(tcu::Vec4)), gridData[0].getPtr(), GL_STATIC_DRAW);
@@ -911,7 +911,7 @@ void SampleMaskCase::updateTexture (int sample)
        for (int x = 0; x < m_gridsize; ++x)
        {
                if (m_flags & FLAGS_SAMPLE_COVERAGE)
-                       gl.sampleCoverage((y*m_gridsize + x) / float(m_gridsize*m_gridsize), GL_FALSE);
+                       gl.sampleCoverage((float)(y*m_gridsize + x) / float(m_gridsize*m_gridsize), GL_FALSE);
 
                gl.drawArrays                           (GL_TRIANGLES, (y*m_gridsize + x) * 6, 6);
                GLU_EXPECT_NO_ERROR                     (gl.getError(), "drawArrays");
@@ -1661,8 +1661,8 @@ NegativeFramebufferCase::IterateResult NegativeFramebufferCase::iterate (void)
 {
        const bool                              colorAttachmentTexture  = (m_caseType == CASE_DIFFERENT_N_SAMPLES_TEX) || (m_caseType == CASE_DIFFERENT_FIXED_TEX);
        const bool                              colorAttachmentRbo              = (m_caseType == CASE_DIFFERENT_N_SAMPLES_RBO) || (m_caseType == CASE_DIFFERENT_FIXED_RBO);
-       const glw::GLenum               fixedSampleLocations0   = (m_caseType == CASE_DIFFERENT_N_SAMPLES_RBO) ? (GL_TRUE) : (GL_FALSE);
-       const glw::GLenum               fixedSampleLocations1   = ((m_caseType == CASE_DIFFERENT_FIXED_TEX) || (m_caseType == CASE_DIFFERENT_FIXED_RBO)) ? (GL_TRUE) : (GL_FALSE);
+       const glw::GLboolean    fixedSampleLocations0   = (m_caseType == CASE_DIFFERENT_N_SAMPLES_RBO) ? (GL_TRUE) : (GL_FALSE);
+       const glw::GLboolean    fixedSampleLocations1   = ((m_caseType == CASE_DIFFERENT_FIXED_TEX) || (m_caseType == CASE_DIFFERENT_FIXED_RBO)) ? (GL_TRUE) : (GL_FALSE);
        glu::CallLogWrapper             gl                                              (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
        glw::GLuint                             fboId                                   = 0;
        glw::GLuint                             rboId                                   = 0;
index 9d7fc8b..8fe0ee1 100644 (file)
@@ -204,7 +204,7 @@ float UniformLocationCase::getExpectedValue (glu::DataType type, int id, const c
        else if (glu::isDataTypeUintOrUVec(adjustedType))
                return float(hash%255);
        else if (glu::isDataTypeFloatOrVec(adjustedType))
-               return (hash%255)/255.0f;
+               return float(hash%255)/255.0f;
        else if (glu::isDataTypeBoolOrBVec(adjustedType))
                return float(hash%2);
        else
index 3136137..765d553 100644 (file)
@@ -456,12 +456,12 @@ void SingleBindingCase::createBuffers (void)
                const tcu::Vec4&        color = ((x + y) % 2 == 0) ? (colorA) : (colorB);
                const tcu::Vec4         positions[6] =
                {
-                       tcu::Vec4((x+0) / float(GRID_SIZE) * 2.0f - 1.0f, (y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
-                       tcu::Vec4((x+0) / float(GRID_SIZE) * 2.0f - 1.0f, (y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
-                       tcu::Vec4((x+1) / float(GRID_SIZE) * 2.0f - 1.0f, (y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
-                       tcu::Vec4((x+0) / float(GRID_SIZE) * 2.0f - 1.0f, (y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
-                       tcu::Vec4((x+1) / float(GRID_SIZE) * 2.0f - 1.0f, (y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
-                       tcu::Vec4((x+1) / float(GRID_SIZE) * 2.0f - 1.0f, (y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
+                       tcu::Vec4(float(x+0) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
+                       tcu::Vec4(float(x+0) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
+                       tcu::Vec4(float(x+1) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
+                       tcu::Vec4(float(x+0) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
+                       tcu::Vec4(float(x+1) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
+                       tcu::Vec4(float(x+1) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
                };
 
                // copy cell vertices to the buffer.
@@ -748,12 +748,12 @@ void MultipleBindingCase::createBuffers (void)
                for (int y = 0; y < GRID_SIZE; ++y)
                for (int x = 0; x < GRID_SIZE; ++x)
                {
-                       primitiveData[(y * GRID_SIZE + x) * 6 + 0] = tcu::Vec4((x+0) / float(GRID_SIZE) * 2.0f - 1.0f, (y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       primitiveData[(y * GRID_SIZE + x) * 6 + 1] = tcu::Vec4((x+0) / float(GRID_SIZE) * 2.0f - 1.0f, (y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       primitiveData[(y * GRID_SIZE + x) * 6 + 2] = tcu::Vec4((x+1) / float(GRID_SIZE) * 2.0f - 1.0f, (y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       primitiveData[(y * GRID_SIZE + x) * 6 + 3] = tcu::Vec4((x+0) / float(GRID_SIZE) * 2.0f - 1.0f, (y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       primitiveData[(y * GRID_SIZE + x) * 6 + 4] = tcu::Vec4((x+1) / float(GRID_SIZE) * 2.0f - 1.0f, (y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
-                       primitiveData[(y * GRID_SIZE + x) * 6 + 5] = tcu::Vec4((x+1) / float(GRID_SIZE) * 2.0f - 1.0f, (y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       primitiveData[(y * GRID_SIZE + x) * 6 + 0] = tcu::Vec4(float(x+0) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       primitiveData[(y * GRID_SIZE + x) * 6 + 1] = tcu::Vec4(float(x+0) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       primitiveData[(y * GRID_SIZE + x) * 6 + 2] = tcu::Vec4(float(x+1) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       primitiveData[(y * GRID_SIZE + x) * 6 + 3] = tcu::Vec4(float(x+0) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       primitiveData[(y * GRID_SIZE + x) * 6 + 4] = tcu::Vec4(float(x+1) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
+                       primitiveData[(y * GRID_SIZE + x) * 6 + 5] = tcu::Vec4(float(x+1) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
                }
        }
 
@@ -772,7 +772,7 @@ void MultipleBindingCase::createBuffers (void)
                        const tcu::Vec4& color = ((x + y) % 2 == 0) ? (green) : (yellow);
 
                        colorOffsetWritePtr[(y * GRID_SIZE + x) * 2 + 0] = color;
-                       colorOffsetWritePtr[(y * GRID_SIZE + x) * 2 + 1] = tcu::Vec4(x / float(GRID_SIZE) * 2.0f - 1.0f, y / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 0.0f);
+                       colorOffsetWritePtr[(y * GRID_SIZE + x) * 2 + 1] = tcu::Vec4(float(x) / float(GRID_SIZE) * 2.0f - 1.0f, float(y) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 0.0f);
                }
        }
        else
@@ -1031,7 +1031,7 @@ void MixedBindingCase::createBuffers (void)
                        const tcu::Vec4& color = ((x + y) % 2 == 0) ? (green) : (yellow);
 
                        colorOffsetData[((y * GRID_SIZE + x) * numInstanceElementsPerCell + v) * 2 + 0] = color;
-                       colorOffsetData[((y * GRID_SIZE + x) * numInstanceElementsPerCell + v) * 2 + 1] = tcu::Vec4(x / float(GRID_SIZE) * 2.0f - 1.0f, y / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 0.0f);
+                       colorOffsetData[((y * GRID_SIZE + x) * numInstanceElementsPerCell + v) * 2 + 1] = tcu::Vec4(float(x) / float(GRID_SIZE) * 2.0f - 1.0f, float(y) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 0.0f);
                }
        }
 
@@ -1246,17 +1246,17 @@ void MixedApiCase::createBuffers (void)
        {
                const tcu::Vec4& color = ((x + y) % 2 == 0) ? (green) : (yellow);
 
-               vertexData[(y * GRID_SIZE + x) * 12 +  0] = tcu::Vec4((x+0) / float(GRID_SIZE) * 2.0f - 1.0f, (y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
+               vertexData[(y * GRID_SIZE + x) * 12 +  0] = tcu::Vec4(float(x+0) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
                vertexData[(y * GRID_SIZE + x) * 12 +  1] = color;
-               vertexData[(y * GRID_SIZE + x) * 12 +  2] = tcu::Vec4((x+0) / float(GRID_SIZE) * 2.0f - 1.0f, (y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
+               vertexData[(y * GRID_SIZE + x) * 12 +  2] = tcu::Vec4(float(x+0) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
                vertexData[(y * GRID_SIZE + x) * 12 +  3] = color;
-               vertexData[(y * GRID_SIZE + x) * 12 +  4] = tcu::Vec4((x+1) / float(GRID_SIZE) * 2.0f - 1.0f, (y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
+               vertexData[(y * GRID_SIZE + x) * 12 +  4] = tcu::Vec4(float(x+1) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
                vertexData[(y * GRID_SIZE + x) * 12 +  5] = color;
-               vertexData[(y * GRID_SIZE + x) * 12 +  6] = tcu::Vec4((x+0) / float(GRID_SIZE) * 2.0f - 1.0f, (y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
+               vertexData[(y * GRID_SIZE + x) * 12 +  6] = tcu::Vec4(float(x+0) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
                vertexData[(y * GRID_SIZE + x) * 12 +  7] = color;
-               vertexData[(y * GRID_SIZE + x) * 12 +  8] = tcu::Vec4((x+1) / float(GRID_SIZE) * 2.0f - 1.0f, (y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
+               vertexData[(y * GRID_SIZE + x) * 12 +  8] = tcu::Vec4(float(x+1) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
                vertexData[(y * GRID_SIZE + x) * 12 +  9] = color;
-               vertexData[(y * GRID_SIZE + x) * 12 + 10] = tcu::Vec4((x+1) / float(GRID_SIZE) * 2.0f - 1.0f, (y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
+               vertexData[(y * GRID_SIZE + x) * 12 + 10] = tcu::Vec4(float(x+1) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f);
                vertexData[(y * GRID_SIZE + x) * 12 + 11] = color;
        }
 
index 7af5c2a..0a0c427 100644 (file)
@@ -197,7 +197,7 @@ InvalidDrawCase::IterateResult InvalidDrawCase::iterate (void)
                std::vector<deUint16>   indices                 (indexBufferSize);
 
                for (int ndx = 0; ndx < (int)indices.size(); ++ndx)
-                       indices[ndx] = (m_op == INVALID_INDEX) ? (overBoundDrawCount + ndx) : (ndx);
+                       indices[ndx] = (deUint16)((m_op == INVALID_INDEX) ? (overBoundDrawCount + ndx) : (ndx));
 
                gl.glGenBuffers(1, &m_indexBufferID);
                gl.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_indexBufferID);
index 5622297..3a285a5 100644 (file)
@@ -450,12 +450,12 @@ void SingleBindingCase::createBuffers (void)
                const tcu::Vec4&        color = ((x + y) % 2 == 0) ? (colorA) : (colorB);
                const tcu::Vec4         positions[6] =
                {
-                       tcu::Vec4((x+0) / float(GRID_SIZE) * 2.0f - 1.0f, (y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
-                       tcu::Vec4((x+0) / float(GRID_SIZE) * 2.0f - 1.0f, (y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
-                       tcu::Vec4((x+1) / float(GRID_SIZE) * 2.0f - 1.0f, (y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
-                       tcu::Vec4((x+0) / float(GRID_SIZE) * 2.0f - 1.0f, (y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
-                       tcu::Vec4((x+1) / float(GRID_SIZE) * 2.0f - 1.0f, (y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
-                       tcu::Vec4((x+1) / float(GRID_SIZE) * 2.0f - 1.0f, (y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
+                       tcu::Vec4(float(x+0) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
+                       tcu::Vec4(float(x+0) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
+                       tcu::Vec4(float(x+1) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
+                       tcu::Vec4(float(x+0) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
+                       tcu::Vec4(float(x+1) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+1) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
+                       tcu::Vec4(float(x+1) / float(GRID_SIZE) * 2.0f - 1.0f, float(y+0) / float(GRID_SIZE) * 2.0f - 1.0f, 0.0f, 1.0f),
                };
 
                // copy cell vertices to the buffer.