Using IROUND() to convert a float depth value to a 32-bit uint Z value.
didn't work (it returns a signed value). Just use a cast instead
Fixes piglit fbo-depth-array failure with swrast.
Note: this is a candidate for the 7.11 branch.
else if (depth >= 1.0)
span->array->z[i] = ctx->DrawBuffer->_DepthMax;
else
- span->array->z[i] = IROUND(depth * ctx->DrawBuffer->_DepthMaxF);
+ span->array->z[i] =
+ (GLuint) (depth * ctx->DrawBuffer->_DepthMaxF + 0.5F);
}
}
else {