13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*-------------------------------------------------------------------------
23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * drawElements Internal Test Module
33c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * ---------------------------------
43c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
53c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Copyright 2014 The Android Open Source Project
63c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
73c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Licensed under the Apache License, Version 2.0 (the "License");
83c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * you may not use this file except in compliance with the License.
93c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * You may obtain a copy of the License at
103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *      http://www.apache.org/licenses/LICENSE-2.0
123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Unless required by applicable law or agreed to in writing, software
143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * distributed under the License is distributed on an "AS IS" BASIS,
153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * See the License for the specific language governing permissions and
173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * limitations under the License.
183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*!
203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \file
213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief Image comparison tests.
223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "ditImageCompareTests.hpp"
253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuResource.hpp"
263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuImageCompare.hpp"
273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuFuzzyImageCompare.hpp"
283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuImageIO.hpp"
293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuTexture.hpp"
303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuTestLog.hpp"
313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuTextureUtil.hpp"
323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuRGBA.hpp"
333c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "deFilePath.hpp"
343c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "deClock.h"
353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
363c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace dit
373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
383c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
393c827367444ee418f129b2c238299f49d3264554Jarkko Poyryusing tcu::TestLog;
403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
413c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystatic const char*	BASE_DIR			= "data/imagecompare";
423c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
433c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystatic void loadImageRGBA8 (tcu::TextureLevel& dst, const tcu::Archive& archive, const char* path)
443c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
453c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	tcu::TextureLevel tmp;
463c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	tcu::ImageIO::loadImage(tmp, archive, path);
473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	dst.setStorage(tcu::TextureFormat(tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8), tmp.getWidth(), tmp.getHeight());
493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	tcu::copy(dst, tmp);
503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}
513c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
523c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass FuzzyComparisonMetricCase : public tcu::TestCase
533c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
543c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
553c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	FuzzyComparisonMetricCase (tcu::TestContext& testCtx, const char* name, const char* refImg, const char* cmpImg, const float minBound, const float maxBound)
563c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		: tcu::TestCase	(testCtx, name, "")
573c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, m_refImg		(refImg)
583c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, m_cmpImg		(cmpImg)
593c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, m_minBound	(minBound)
603c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, m_maxBound	(maxBound)
613c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
633c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	IterateResult iterate (void)
653c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
663c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		tcu::TextureLevel		refImg;
673c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		tcu::TextureLevel		cmpImg;
683c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		tcu::TextureLevel		errorMask;
693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		tcu::FuzzyCompareParams	params;
703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		float					result		= 0.0f;
713c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		deUint64				compareTime	= 0;
723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
733c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		params.maxSampleSkip = 0;
743c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
753c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		tcu::ImageIO::loadImage(refImg, m_testCtx.getArchive(), de::FilePath::join(BASE_DIR, m_refImg).getPath());
763c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		tcu::ImageIO::loadImage(cmpImg, m_testCtx.getArchive(), de::FilePath::join(BASE_DIR, m_cmpImg).getPath());
773c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
783c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		errorMask.setStorage(refImg.getFormat(), refImg.getWidth(), refImg.getHeight(), refImg.getDepth());
793c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
803c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		{
813c827367444ee418f129b2c238299f49d3264554Jarkko Poyry			const deUint64 startTime = deGetMicroseconds();
823c827367444ee418f129b2c238299f49d3264554Jarkko Poyry			result = tcu::fuzzyCompare(params, refImg, cmpImg, errorMask);
833c827367444ee418f129b2c238299f49d3264554Jarkko Poyry			compareTime = deGetMicroseconds()-startTime;
843c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		}
853c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
863c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		m_testCtx.getLog() << TestLog::Float("Result", "Result metric", "", QP_KEY_TAG_NONE, result)
873c827367444ee418f129b2c238299f49d3264554Jarkko Poyry						   << TestLog::Float("MinBound", "Minimum bound", "", QP_KEY_TAG_NONE, m_minBound)
883c827367444ee418f129b2c238299f49d3264554Jarkko Poyry						   << TestLog::Float("MaxBound", "Maximum bound", "", QP_KEY_TAG_NONE, m_maxBound)
893c827367444ee418f129b2c238299f49d3264554Jarkko Poyry						   << TestLog::Integer("CompareTime", "Comparison time", "us", QP_KEY_TAG_TIME, compareTime);
903c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
913c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		{
923c827367444ee418f129b2c238299f49d3264554Jarkko Poyry			const bool isOk = de::inRange(result, m_minBound, m_maxBound);
933c827367444ee418f129b2c238299f49d3264554Jarkko Poyry			m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS	: QP_TEST_RESULT_FAIL,
943c827367444ee418f129b2c238299f49d3264554Jarkko Poyry									isOk ? "Pass"				: "Metric out of bounds");
953c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		}
963c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
973c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		return STOP;
983c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
993c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1003c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprivate:
1013c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const std::string	m_refImg;
1023c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const std::string	m_cmpImg;
1033c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const float			m_minBound;
1043c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const float			m_maxBound;
1053c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
1063c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1073c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass BilinearCompareCase : public tcu::TestCase
1083c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
1093c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
1103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	BilinearCompareCase (tcu::TestContext& testCtx, const char* name, const char* refImg, const char* cmpImg, const tcu::RGBA& threshold, bool expectedResult)
1113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		: tcu::TestCase		(testCtx, name, "")
1123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, m_refImg			(refImg)
1133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, m_cmpImg			(cmpImg)
1143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, m_threshold		(threshold)
1153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, m_expectedResult	(expectedResult)
1163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
1183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	IterateResult iterate (void)
1203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		tcu::TextureLevel		refImg;
1223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		tcu::TextureLevel		cmpImg;
1233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		bool					result;
1243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		deUint64				compareTime	= 0;
1253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		loadImageRGBA8(refImg, m_testCtx.getArchive(), de::FilePath::join(BASE_DIR, m_refImg).getPath());
1273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		loadImageRGBA8(cmpImg, m_testCtx.getArchive(), de::FilePath::join(BASE_DIR, m_cmpImg).getPath());
1283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		{
1303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry			const deUint64 startTime = deGetMicroseconds();
1313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry			result = tcu::bilinearCompare(m_testCtx.getLog(), "CompareResult", "Image comparison result", refImg, cmpImg, m_threshold, tcu::COMPARE_LOG_EVERYTHING);
1323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry			compareTime = deGetMicroseconds()-startTime;
1333c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		}
1343c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		m_testCtx.getLog() << TestLog::Integer("CompareTime", "Comparison time", "us", QP_KEY_TAG_TIME, compareTime);
1363c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		{
1383c827367444ee418f129b2c238299f49d3264554Jarkko Poyry			const bool isOk = result == m_expectedResult;
1393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry			m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS	: QP_TEST_RESULT_FAIL,
1403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry									isOk ? "Pass"				: "Wrong comparison result");
1413c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		}
1423c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1433c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		return STOP;
1443c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
1453c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1463c827367444ee418f129b2c238299f49d3264554Jarkko Poyryprivate:
1473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const std::string		m_refImg;
1483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const std::string		m_cmpImg;
1493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const tcu::RGBA			m_threshold;
1503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	const bool				m_expectedResult;
1513c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
1523c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1533c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass FuzzyComparisonMetricTests : public tcu::TestCaseGroup
1543c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
1553c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
1563c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	FuzzyComparisonMetricTests (tcu::TestContext& testCtx)
1573c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		: tcu::TestCaseGroup(testCtx, "fuzzy_metric", "Fuzzy comparison metrics")
1583c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1593c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
1603c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1613c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void init (void)
1623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1633c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "identical",		"cube_ref.png",				"cube_ref.png",				0.0f,			0.000001f));
1643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "cube",			"cube_ref.png",				"cube_cmp.png",				0.0029f,		0.0031f));
1653c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "cube_2",			"cube_2_ref.png",			"cube_2_cmp.png",			0.0134f,		0.0140f));
1663c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "cube_sphere",	"cube_sphere_ref.png",		"cube_sphere_cmp.png",		0.0730f,		0.0801f));
1673c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "cube_nmap",		"cube_nmap_ref.png",		"cube_nmap_cmp.png",		0.0024f,		0.0025f));
1683c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "cube_nmap_2",	"cube_nmap_2_ref.png",		"cube_nmap_2_cmp.png",		0.0172f,		0.0189f));
1693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "earth_diffuse",	"earth_diffuse_ref.png",	"earth_diffuse_cmp.png",	0.0f,			0.00002f));
1703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "eath_texture",	"earth_texture_ref.png",	"earth_texture_cmp.png",	0.0002f,		0.0003f));
1713c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "earth_spot",		"earth_spot_ref.png",		"earth_spot_cmp.png",		0.0015f,		0.0018f));
1723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "earth_light",	"earth_light_ref.png",		"earth_light_cmp.png",		1.7050f,		1.7070f));
1733c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "lessThan0",		"lessThan0-reference.png",	"lessThan0-result.png",		0.0003f,		0.0004f));
1743c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "cube_sphere_2",	"cube_sphere_2_ref.png",	"cube_sphere_2_cmp.png",	0.0207f,		0.0230f));
1753c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new FuzzyComparisonMetricCase(m_testCtx, "earth_to_empty",	"earth_spot_ref.png",		"empty_256x256.png",		77074.0f,		77076.0f));
1763c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
1773c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
1783c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1793c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass BilinearCompareTests : public tcu::TestCaseGroup
1803c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
1813c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypublic:
1823c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	BilinearCompareTests (tcu::TestContext& testCtx)
1833c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		: tcu::TestCaseGroup(testCtx, "bilinear_compare", "Bilinear Image Comparison Tests")
1843c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1853c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
1863c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1873c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	void init (void)
1883c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
1893c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "identical",				"cube_ref.png",						"cube_ref.png",						tcu::RGBA(0,0,0,0),			true));
1903c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "empty_to_white",			"empty_256x256.png",				"white_256x256.png",				tcu::RGBA(7,7,7,2),			false));
1913c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "white_to_empty",			"white_256x256.png",				"empty_256x256.png",				tcu::RGBA(7,7,7,2),			false));
1923c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "cube",						"cube_ref.png",						"cube_cmp.png",						tcu::RGBA(7,7,7,2),			false));
1933c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "cube_2",					"cube_2_ref.png",					"cube_2_cmp.png",					tcu::RGBA(7,7,7,2),			false));
1943c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "cube_sphere",				"cube_sphere_ref.png",				"cube_sphere_cmp.png",				tcu::RGBA(7,7,7,2),			false));
1953c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "cube_nmap",				"cube_nmap_ref.png",				"cube_nmap_cmp.png",				tcu::RGBA(7,7,7,2),			false));
1963c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "cube_nmap_2",				"cube_nmap_2_ref.png",				"cube_nmap_2_cmp.png",				tcu::RGBA(7,7,7,2),			false));
1973c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "earth_diffuse",			"earth_diffuse_ref.png",			"earth_diffuse_cmp.png",			tcu::RGBA(20,20,20,2),		true));
1983c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "eath_texture",				"earth_texture_ref.png",			"earth_texture_cmp.png",			tcu::RGBA(7,7,7,2),			false));
1993c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "earth_spot",				"earth_spot_ref.png",				"earth_spot_cmp.png",				tcu::RGBA(7,7,7,2),			false));
2003c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "earth_light",				"earth_light_ref.png",				"earth_light_cmp.png",				tcu::RGBA(7,7,7,2),			false));
2013c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "lessThan0",				"lessThan0-reference.png",			"lessThan0-result.png",				tcu::RGBA(36,36,36,2),		true));
2023c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "cube_sphere_2",			"cube_sphere_2_ref.png",			"cube_sphere_2_cmp.png",			tcu::RGBA(7,7,7,2),			false));
2033c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "earth_to_empty",			"earth_spot_ref.png",				"empty_256x256.png",				tcu::RGBA(7,7,7,2),			false));
2043c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "texfilter",				"texfilter_ref.png",				"texfilter_cmp.png",				tcu::RGBA(7,7,7,2),			true));
2053c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "refract_vtx",				"refract_vtx_ref.png",				"refract_vtx_cmp.png",				tcu::RGBA(7,7,7,2),			true));
2063c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "refract_frag",				"refract_frag_ref.png",				"refract_frag_cmp.png",				tcu::RGBA(7,7,7,2),			true));
2073c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "lessthan_vtx",				"lessthan_vtx_ref.png",				"lessthan_vtx_cmp.png",				tcu::RGBA(7,7,7,2),			true));
2083c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "2_units_2d",				"2_units_2d_ref.png",				"2_units_2d_cmp.png",				tcu::RGBA(7,7,7,2),			false));
2093c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "4_units_cube_vtx",			"4_units_cube_ref.png",				"4_units_cube_cmp.png",				tcu::RGBA(7,7,7,2),			false));
2103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "texfilter_vtx_nearest",	"texfilter_vtx_nearest_ref.png",	"texfilter_vtx_nearest_cmp.png",	tcu::RGBA(7,7,7,2),			false));
2113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "texfilter_vtx_linear",		"texfilter_vtx_linear_ref.png",		"texfilter_vtx_linear_cmp.png",		tcu::RGBA(7,7,7,2),			false));
2123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		addChild(new BilinearCompareCase(m_testCtx, "readpixels_msaa",			"readpixels_ref.png",				"readpixels_msaa.png",				tcu::RGBA(1,1,1,1),			true));
2133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
2143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry};
2153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2163c827367444ee418f129b2c238299f49d3264554Jarkko PoyryImageCompareTests::ImageCompareTests (tcu::TestContext& testCtx)
2173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	: tcu::TestCaseGroup(testCtx, "image_compare", "Image comparison tests")
2183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
2193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}
2203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2213c827367444ee418f129b2c238299f49d3264554Jarkko PoyryImageCompareTests::~ImageCompareTests (void)
2223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
2233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}
2243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2253c827367444ee418f129b2c238299f49d3264554Jarkko Poyryvoid ImageCompareTests::init (void)
2263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
2273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	addChild(new FuzzyComparisonMetricTests	(m_testCtx));
2283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	addChild(new BilinearCompareTests		(m_testCtx));
2293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}
2303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
2313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // dit
232