Rasterizer: Pre-divide vertex attributes by W

Execute the division-by-W for perspective-correct interpolation of
values in the clipper, moving them out of the rasterization inner loop.
This commit is contained in:
Yuri Kunde Schlesner 2014-12-23 13:05:51 -02:00
parent fe186d3a59
commit 8369ee5803
3 changed files with 32 additions and 8 deletions

View file

@ -757,6 +757,26 @@ struct float24 {
return float24::FromFloat32(ToFloat32() - flt.ToFloat32());
}
float24& operator *= (const float24& flt) {
value *= flt.ToFloat32();
return *this;
}
float24& operator /= (const float24& flt) {
value /= flt.ToFloat32();
return *this;
}
float24& operator += (const float24& flt) {
value += flt.ToFloat32();
return *this;
}
float24& operator -= (const float24& flt) {
value -= flt.ToFloat32();
return *this;
}
float24 operator - () const {
return float24::FromFloat32(-ToFloat32());
}