Skip to content

Commit

Permalink
Merge pull request #9635 from unknownbrackets/softgpu
Browse files Browse the repository at this point in the history
SoftGPU: Rasterize triangles in chunks of 4 pixels
  • Loading branch information
hrydgard authored Apr 23, 2017
2 parents 2c6161c + 4fb7e43 commit 4f0e1a0
Show file tree
Hide file tree
Showing 2 changed files with 219 additions and 128 deletions.
10 changes: 10 additions & 0 deletions GPU/Math3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,10 @@ class Vec4
{
return Vec4(x*other.x, y*other.y, z*other.z, w*other.w);
}
Vec4 operator | (const Vec4 &other) const
{
return Vec4(x | other.x, y | other.y, z | other.z, w | other.w);
}
template<typename V>
Vec4 operator * (const V& f) const
{
Expand Down Expand Up @@ -630,6 +634,12 @@ class Vec4
return Vec4(VecClamp(x, l, h), VecClamp(y, l, h), VecClamp(z, l, h), VecClamp(w, l, h));
}

Vec4 Reciprocal() const
{
const T one = 1.0f;
return Vec4(one / x, one / y, one / z, one / w);
}

// Only implemented for T=float
float Length() const;
void SetLength(const float l);
Expand Down
Loading

0 comments on commit 4f0e1a0

Please sign in to comment.