return ret;
}
-Interval FloatFormat::roundOut (const Interval& x) const
+double FloatFormat::roundOut (double d, bool upward, bool roundUnderOverflow) const
+{
+ int exp = 0;
+ deFractExp(d, &exp);
+
+ if (roundUnderOverflow && exp > m_maxExp && (upward == (d < 0.0)))
+ return deSign(d) * getMaxValue();
+ else
+ return round(d, upward);
+}
+
+//! Round output of an operation.
+//! \param roundUnderOverflow Can +/-inf rounded to min/max representable;
+//! should be false if any of operands was inf, true otherwise.
+Interval FloatFormat::roundOut (const Interval& x, bool roundUnderOverflow) const
{
Interval ret = x.nan();
if (!x.empty())
- ret |= Interval(round(x.lo(), false), round(x.hi(), true));
+ ret |= Interval(roundOut(x.lo(), false, roundUnderOverflow),
+ roundOut(x.hi(), true, roundUnderOverflow));
return ret;
}
YesNoMaybe hasSubnormal (void) const { return m_hasSubnormal; }
double ulp (double x, double count = 1.0) const;
- Interval roundOut (const Interval& x) const;
+ Interval roundOut (const Interval& x, bool roundUnderOverflow) const;
double round (double d, bool upward) const;
+ double roundOut (double d, bool upward, bool roundUnderOverflow) const;
Interval convert (const Interval& x) const;
std::string floatToHex (double x) const;
}
else if (oldSize > newSize)
{
- (m_gl.*m_traits.genFunc)(glw::GLsizei(oldSize - newSize), &m_objects[newSize]);
+ (m_gl.*m_traits.deleteFunc)(glw::GLsizei(oldSize - newSize), &m_objects[newSize]);
m_objects.resize(newSize);
}
}
void ObjectVector::clear (void)
{
- (m_gl.*m_traits.genFunc)(glw::GLsizei(m_objects.size()), &m_objects.front());
+ (m_gl.*m_traits.deleteFunc)(glw::GLsizei(m_objects.size()), &m_objects.front());
m_objects.clear();
}
float levelStep = isAutoLod ? 0.0f : 1.0f / (float)de::max(1, m_textureSpec.numLevels-1);
Vec4 cScale = fmtInfo.valueMax-fmtInfo.valueMin;
Vec4 cBias = fmtInfo.valueMin;
+ Vec4 cCorner = cBias + cScale*0.5f;
int baseCellSize = de::min(m_textureSpec.width/4, m_textureSpec.height/4);
DE_ASSERT(m_textureSpec.width == m_textureSpec.height);
tcu::fillWithGrid(access, de::max(1, baseCellSize>>level), colorA, colorB);
// Ensure all corners have identical colors in order to avoid dealing with ambiguous corner texel filtering
- access.setPixel(colorA, 0, 0);
- access.setPixel(colorA, 0, lastPix);
- access.setPixel(colorA, lastPix, 0);
- access.setPixel(colorA, lastPix, lastPix);
+ access.setPixel(cCorner, 0, 0);
+ access.setPixel(cCorner, 0, lastPix);
+ access.setPixel(cCorner, lastPix, 0);
+ access.setPixel(cCorner, lastPix, lastPix);
}
}
}
static Interval doRound (const FloatFormat& fmt, T value)
{
- return fmt.roundOut(double(value));
+ return fmt.roundOut(double(value), false);
}
};
// Allow either representable number on both sides of the exact value,
// but require exactly representable values to be preserved.
- return ctx.format.roundOut(exact);
+ return ctx.format.roundOut(exact, !deIsInf(x) && !deIsInf(y));
}
double precision (const EvalContext&, double, double, double) const
TCU_SET_INTERVAL_BOUNDS(ret, sum,
sum = iargs.a.lo() + iargs.b.lo(),
sum = iargs.a.hi() + iargs.b.hi());
- return ctx.format.convert(ctx.format.roundOut(ret));
+ return ctx.format.convert(ctx.format.roundOut(ret, true));
}
return this->applyMonotone(ctx, iargs.a, iargs.b);
}
TCU_SET_INTERVAL_BOUNDS(ret, prod,
prod = iargs.a.lo() * iargs.b.lo(),
prod = iargs.a.hi() * iargs.b.hi());
- return ctx.format.convert(ctx.format.roundOut(ret));
+ return ctx.format.convert(ctx.format.roundOut(ret, true));
}
if (a.lo() >= 0 && b.hi() <= 0)
{
TCU_SET_INTERVAL_BOUNDS(ret, prod,
prod = iargs.a.hi() * iargs.b.lo(),
prod = iargs.a.lo() * iargs.b.hi());
- return ctx.format.convert(ctx.format.roundOut(ret));
+ return ctx.format.convert(ctx.format.roundOut(ret, true));
}
}
return this->applyMonotone(ctx, iargs.a, iargs.b);
TCU_SET_INTERVAL_BOUNDS(ret, diff,
diff = iargs.a.lo() - iargs.b.hi(),
diff = iargs.a.hi() - iargs.b.lo());
- return ctx.format.convert(ctx.format.roundOut(ret));
+ return ctx.format.convert(ctx.format.roundOut(ret, true));
}
else
message("*** Using X11 GLX target")
set(DEQP_TARGET_NAME "X11 GLX")
-set(DEQP_RUNTIME_LINK ON)
set(DEQP_SUPPORT_GLES2 ON)
set(DEQP_SUPPORT_GLES3 ON)
set(DEQP_SUPPORT_OPENGL ON)