Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/src/include/Diderot/inline-vec4.h
ViewVC logotype

Diff of /trunk/src/include/Diderot/inline-vec4.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1115, Thu May 5 04:42:18 2011 UTC revision 1295, Thu Jun 9 06:42:54 2011 UTC
# Line 41  Line 41 
41      return vec4f(s, s, s, s) * v;      return vec4f(s, s, s, s) * v;
42  }  }
43    
44    STATIC_INLINE vec4f_t clamp4f (vec4f_t lo, vec4f_t hi, vec4f_t v)
45    {
46      // FIXME: there is probably a vectorized way to compute this
47        union4f_t a, b, c;
48        a.v = lo; b.v = hi; c.v = v;
49        return vec4f(
50            clampf(a.r[0], b.r[0], c.r[0]),
51            clampf(a.r[1], b.r[1], c.r[1]),
52            clampf(a.r[2], b.r[2], c.r[2]),
53            clampf(a.r[3], b.r[3], c.r[3]));
54    }
55    
56  STATIC_INLINE vec4f_t lerp4f (vec4f_t a, vec4f_t b, float t)  STATIC_INLINE vec4f_t lerp4f (vec4f_t a, vec4f_t b, float t)
57  {  {
58      return a + scale4f(t, b - a);      return a + scale4f(t, b - a);

Legend:
Removed from v.1115  
changed lines
  Added in v.1295

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0