for (int y = 0; y < gridSizeY; y++)
for (int x = 0; x < gridSizeX; x++)
{
- float sx0 = (x+0) / (float)gridSizeX;
- float sy0 = (y+0) / (float)gridSizeY;
- float sx1 = (x+1) / (float)gridSizeX;
- float sy1 = (y+1) / (float)gridSizeY;
+ float sx0 = (float)(x+0) / (float)gridSizeX;
+ float sy0 = (float)(y+0) / (float)gridSizeY;
+ float sx1 = (float)(x+1) / (float)gridSizeX;
+ float sy1 = (float)(y+1) / (float)gridSizeY;
float fx0 = 2.0f * sx0 - 1.0f;
float fy0 = 2.0f * sy0 - 1.0f;
float fx1 = 2.0f * sx1 - 1.0f;
for (int y = 0; y < VERIFY_QUAD_SIZE; y++)
for (int x = 0; x < VERIFY_QUAD_SIZE; x++)
{
- float fx = (float)(x+0.5f) / (float)VERIFY_QUAD_SIZE;
- float fy = (float)(y+0.5f) / (float)VERIFY_QUAD_SIZE;
+ float fx = ((float)x+0.5f) / (float)VERIFY_QUAD_SIZE;
+ float fy = ((float)y+0.5f) / (float)VERIFY_QUAD_SIZE;
bool tri = fx + fy <= 1.0f;
float tx = tri ? fx : (1.0f-fx);
int maxQuadsPerBatch = maxQuadsX*maxQuadsY;
int numVerified = 0;
deUint32 program = m_program->getProgram();
- tcu::RGBA threshold = renderTarget.getPixelFormat().getColorThreshold() + tcu::RGBA(3,3,3,3);
+ tcu::RGBA threshold = renderTarget.getPixelFormat().getColorThreshold() + tcu::RGBA(4,4,4,4);
bool isOk = true;
vector<tcu::Vec2> positions;
const int viewportY = rnd.getInt(0, m_context.getRenderTarget().getHeight()-height);
tcu::Surface renderedImg (width, height);
+ tcu::Surface referenceImg (width, height);
const Vec4 clearColor = CLEAR_COLOR;
const float clearDepth = CLEAR_DEPTH;
cmd->quad, refState);
}
+ // Expand reference color buffer to RGBA8
+ copy(referenceImg.getAccess(), m_refColorBuffer->getAccess());
+
// Read rendered image.
glu::readPixels(m_context.getRenderContext(), viewportX, viewportY, renderedImg.getAccess());
compareOk = tcu::bilinearCompare(m_testCtx.getLog(),
"CompareResult",
"Image Comparison Result",
- m_refColorBuffer->getAccess(),
+ referenceImg.getAccess(),
renderedImg.getAccess(),
tcu::RGBA(threshold.x(), threshold.y(), threshold.z(), threshold.w()),
tcu::COMPARE_LOG_RESULT);
compareOk = tcu::intThresholdCompare(m_testCtx.getLog(),
"CompareResult",
"Image Comparison Result",
- m_refColorBuffer->getAccess(),
+ referenceImg.getAccess(),
renderedImg.getAccess(),
threshold,
tcu::COMPARE_LOG_RESULT);
tcu::PixelFormat format = m_context.getRenderTarget().getPixelFormat();
if (format == tcu::PixelFormat(8, 8, 8, 8) || format == tcu::PixelFormat(8, 8, 8, 0))
- return format.getColorThreshold().toIVec().asUint() + tcu::UVec4(2); // Default threshold.
+ return format.getColorThreshold().toIVec().asUint() + tcu::UVec4(6); // Default threshold.
else
return format.getColorThreshold().toIVec().asUint()
* tcu::UVec4(5) + tcu::UVec4(2); // \note Non-scientific ad hoc formula. Need big threshold when few color bits; especially multiple blendings bring extra inaccuracy.