mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
![]() This is an interesting quirk that occurs due to us using the x87 FPU when Serenity is compiled for the i386 target. When we calculate our depth value to be stored in the buffer, it is an 80-bit x87 floating point number, however, when stored into the DepthBuffer, this is truncated to 32 bits. This 38 bit loss of precision means that when x87 `FCOMP` is eventually used here the comparison fails. This could be solved by using a `long double` for the depth buffer, however this would take up significantly more space and is completely overkill for a depth buffer. As such, comparing the first 32-bits of this depth value is "good enough" that if we get a hit on it being equal, we can pretty much guarantee that it's actually equal. |
||
---|---|---|
.. | ||
GL | ||
Tex | ||
Clipper.cpp | ||
Clipper.h | ||
CMakeLists.txt | ||
DepthBuffer.cpp | ||
DepthBuffer.h | ||
GLBlend.cpp | ||
GLColor.cpp | ||
GLContext.cpp | ||
GLContext.h | ||
GLLights.cpp | ||
GLLists.cpp | ||
GLMat.cpp | ||
GLStruct.h | ||
GLTexture.cpp | ||
GLUtils.cpp | ||
GLVert.cpp | ||
GLVertexArrays.cpp | ||
SoftwareGLContext.cpp | ||
SoftwareGLContext.h | ||
SoftwareRasterizer.cpp | ||
SoftwareRasterizer.h |