The tests setup triangles with a depth slope and then call
glPolygonOffset(factor, units) with variable units and
always 0 slope scaled factor.
According to the GLES 3.2 spec 13.7.2 Depth Offset:
"void PolygonOffset( float factor, float units );
factor scales the maximum depth slope of the polygon, and units scales an
implementation-dependent constant that relates to the usable resolution of the
depth buffer."
If the polygon has a depth slope,
the depth slope factor has to be not equal to zero.
The rationale of the slope scaled factor is to ensure that the offset
(equation 13.11) is greater than max(dz/dx, dz/dy) for all resolutions,
which may not be the case for the constant offset since it doesn't take
the screen resolution into account.
Changed tests:
dEQP-GLES2.functional.polygon_offset.*_displacement_with_units
dEQP-GLES3.functional.polygon_offset.*_displacement_with_units
Bug:
34386628
Change-Id: Ie8009ba1766eb50c3c5a750122aa8bb231144210
retVal.x() = rnd.getFloat(-1, 1);
retVal.y() = rnd.getFloat(-1, 1);
- retVal.z() = rnd.getFloat(-0.9f, 0.9f);
+ retVal.z() = 0.5f;
retVal.w() = 1.0f + rnd.getFloat();
return retVal;
retVal.x() = rnd.getFloat(-1, 1);
retVal.y() = rnd.getFloat(-1, 1);
- retVal.z() = rnd.getFloat(-0.9f, 0.9f);
+ retVal.z() = 0.5f;
retVal.w() = 1.0f + rnd.getFloat();
return retVal;