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;
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),
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)
, 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)
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);
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;
// 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);
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();
}
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);
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);
}
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:
{
{
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;
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);
}
};
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);
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;
}
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,
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)
{
{
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)
{
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)
{
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);
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)
{
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;
}
}
{
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;
}
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;
}
}
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;
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);
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;
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
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
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;
}
}
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)
// 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);
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
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));
}
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)
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);
}
}
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;
int getDataTypeByteSize (glu::DataType type)
{
- return glu::getDataTypeScalarSize(type)*sizeof(deUint32);
+ return glu::getDataTypeScalarSize(type)*(int)sizeof(deUint32);
}
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:
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);
int computeStd140BaseAlignment (const VarType& type, deUint32 layoutFlags)
{
- const int vec4Alignment = sizeof(deUint32)*4;
+ const int vec4Alignment = (int)sizeof(deUint32)*4;
if (type.isBasicType())
{
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);
// 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);
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
, 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
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;
{
// 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);
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
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
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));
}
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);
}
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);
}
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);
}
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);
}
}
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;
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;
{
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;
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;
// 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;
: 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)
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))
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
// 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),
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)
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";
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));
}
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:
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);
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");
{
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;
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
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.
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);
}
}
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
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);
}
}
{
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;
}
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);
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.