if (m_func == DERIVATE_DFDX || m_func == DERIVATE_DFDY)
{
- const bool isX = m_func == DERIVATE_DFDX;
- const float div = isX ? float(result.getWidth()) : float(result.getHeight());
- const tcu::Vec4 scale = isX ? xScale : yScale;
- tcu::Vec4 reference = ((m_coordMax - m_coordMin) / div);
- const tcu::Vec4 opThreshold = getDerivateThreshold(m_precision, m_coordMin, m_coordMax, reference);
- const tcu::Vec4 threshold = max(surfaceThreshold, opThreshold);
- const int numComps = glu::getDataTypeFloatScalars(m_dataType);
+ const bool isX = m_func == DERIVATE_DFDX;
+ const float div = isX ? float(result.getWidth()) : float(result.getHeight());
+ const tcu::Vec4 scale = isX ? xScale : yScale;
- const tcu::Vec4 reference = ((m_coordMax - m_coordMin) / div) * scale;
- const tcu::Vec4 opThreshold = getDerivateThreshold(m_precision, m_coordMin*scale, m_coordMax*scale, reference);
- const tcu::Vec4 opThresholdW = getDerivateThresholdWarning(m_precision, m_coordMin*scale, m_coordMax*scale, reference);
++ tcu::Vec4 reference = ((m_coordMax - m_coordMin) / div);
++ const tcu::Vec4 opThreshold = getDerivateThreshold(m_precision, m_coordMin, m_coordMax, reference);
++ const tcu::Vec4 opThresholdW = getDerivateThresholdWarning(m_precision, m_coordMin, m_coordMax, reference);
+ const tcu::Vec4 threshold = max(surfaceThreshold, opThreshold);
+ const tcu::Vec4 thresholdW = max(surfaceThreshold, opThresholdW);
+ const int numComps = glu::getDataTypeFloatScalars(m_dataType);
+ /* adjust the reference value for the correct dfdx or dfdy sample adjacency */
+ reference = reference * scale;
+
m_testCtx.getLog()
<< tcu::TestLog::Message
<< "Verifying result image.\n"
if (m_func == DERIVATE_DFDX || m_func == DERIVATE_DFDY)
{
- const bool isX = m_func == DERIVATE_DFDX;
- const float div = isX ? w : h;
- const tcu::Vec4 scale = isX ? xScale : yScale;
- tcu::Vec4 reference = ((m_texValueMax - m_texValueMin) / div);
- const tcu::Vec4 opThreshold = getDerivateThreshold(m_precision, m_texValueMin, m_texValueMax, reference);
- const tcu::Vec4 threshold = max(surfaceThreshold, opThreshold);
- const int numComps = glu::getDataTypeFloatScalars(m_dataType);
+ const bool isX = m_func == DERIVATE_DFDX;
+ const float div = isX ? w : h;
+ const tcu::Vec4 scale = isX ? xScale : yScale;
- const tcu::Vec4 reference = ((m_texValueMax - m_texValueMin) / div) * scale;
- const tcu::Vec4 opThreshold = getDerivateThreshold(m_precision, m_texValueMin*scale, m_texValueMax*scale, reference);
- const tcu::Vec4 opThresholdW = getDerivateThresholdWarning(m_precision, m_texValueMin*scale, m_texValueMax*scale, reference);
++ tcu::Vec4 reference = ((m_texValueMax - m_texValueMin) / div);
++ const tcu::Vec4 opThreshold = getDerivateThreshold(m_precision, m_texValueMin, m_texValueMax, reference);
++ const tcu::Vec4 opThresholdW = getDerivateThresholdWarning(m_precision, m_texValueMin, m_texValueMax, reference);
+ const tcu::Vec4 threshold = max(surfaceThreshold, opThreshold);
+ const tcu::Vec4 thresholdW = max(surfaceThreshold, opThresholdW);
+ const int numComps = glu::getDataTypeFloatScalars(m_dataType);
+ /* adjust the reference value for the correct dfdx or dfdy sample adjacency */
+ reference = reference * scale;
+
m_testCtx.getLog()
<< tcu::TestLog::Message
<< "Verifying result image.\n"