From: Pyry Haulos Date: Tue, 14 Jul 2015 00:06:06 +0000 (-0700) Subject: DO NOT MERGE: Fix undefined arg eval order issue in fuzzy compare X-Git-Tag: upstream/0.1.0~1309^2~61^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=269e5ebecbc1d9e910a7bd46b3d1355ea18b4294;p=platform%2Fupstream%2FVK-GL-CTS.git DO NOT MERGE: Fix undefined arg eval order issue in fuzzy compare compareToNeighbor can give slightly different metrics based on internal state of rnd parameter, and thus it is not safe to call that from function call argument list. This code has been refactored in master and a different patch is needed there. Bug: 22405868 Change-Id: Ida91ce6fe2895b6c38f29be7ab943c3773feb085 --- diff --git a/framework/common/tcuFuzzyImageCompare.cpp b/framework/common/tcuFuzzyImageCompare.cpp index cfcd576..7d4eda1 100644 --- a/framework/common/tcuFuzzyImageCompare.cpp +++ b/framework/common/tcuFuzzyImageCompare.cpp @@ -319,8 +319,9 @@ float fuzzyCompare (const FuzzyCompareParams& params, const ConstPixelBufferAcce { for (int x = 1; x < width-1; x += params.maxSampleSkip > 0 ? (int)rnd.getInt(0, params.maxSampleSkip) : 1) { - float err = deFloatMin(compareToNeighbor<4>(params, rnd, readUnorm8<4>(refAccess, x, y), cmpAccess, x, y), - compareToNeighbor<4>(params, rnd, readUnorm8<4>(cmpAccess, x, y), refAccess, x, y)); + const float err0 = compareToNeighbor<4>(params, rnd, readUnorm8<4>(refAccess, x, y), cmpAccess, x, y); + const float err1 = compareToNeighbor<4>(params, rnd, readUnorm8<4>(cmpAccess, x, y), refAccess, x, y); + float err = deFloatMin(err0, err1); err = deFloatPow(err, params.errExp);