Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(44)

Unified Diff: src/liboslexec/opderivs.cpp

Issue 206045: Pre-review: run state overhaul (Closed) Base URL: http://openshadinglanguage.googlecode.com/svn/trunk/
Patch Set: Update patch set to sync with trunk Created 14 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/liboslexec/opderivs.cpp
===================================================================
--- src/liboslexec/opderivs.cpp (revision 583)
+++ src/liboslexec/opderivs.cpp (working copy)
@@ -63,13 +63,13 @@
VaryingRef<T> result ((T *)Result.data(), Result.step());
VaryingRef<Dual2<T> > src ((Dual2<T> *)Src.data(), Src.step());
if (whichd == 0) {
- for (int i = beginpoint; i < endpoint; ++i)
- if (runflags[i])
- result[i] = src[i].dx ();
+ SHADE_LOOP_BEGIN
+ result[i] = src[i].dx ();
+ SHADE_LOOP_END
} else {
- for (int i = beginpoint; i < endpoint; ++i)
- if (runflags[i])
- result[i] = src[i].dy ();
+ SHADE_LOOP_BEGIN
+ result[i] = src[i].dy ();
+ SHADE_LOOP_END
}
if (Result.has_derivs())
exec->zero_derivs (Result); // 2nd order derivs are always zero
@@ -95,7 +95,7 @@
impl = specialized_Dxy<Vec3, 0>;
if (impl) {
- impl (exec, nargs, args, runflags, beginpoint, endpoint);
+ impl (exec, nargs, args);
// Use the specialized one for next time! Never have to check the
// types or do the other sanity checks again.
// FIXME -- is this thread-safe?
@@ -122,7 +122,7 @@
impl = specialized_Dxy<Vec3, 1>;
if (impl) {
- impl (exec, nargs, args, runflags, beginpoint, endpoint);
+ impl (exec, nargs, args);
// Use the specialized one for next time! Never have to check the
// types or do the other sanity checks again.
// FIXME -- is this thread-safe?
@@ -152,14 +152,14 @@
VaryingRef<Dual2<Vec3> > p ((Dual2<Vec3> *)P.data(), P.step());
if (exec->context()->globals()->flipHandedness) {
// flip the default rule: Y ^ X = Normal
- for (int i = beginpoint; i < endpoint; ++i)
- if (runflags[i])
- result[i] = p[i].dy().cross(p[i].dx());
+ SHADE_LOOP_BEGIN
+ result[i] = p[i].dy().cross(p[i].dx());
+ SHADE_LOOP_END
} else {
// regular rule: X ^ Y = Normal
- for (int i = beginpoint; i < endpoint; ++i)
- if (runflags[i])
- result[i] = p[i].dx().cross(p[i].dy());
+ SHADE_LOOP_BEGIN
+ result[i] = p[i].dx().cross(p[i].dy());
+ SHADE_LOOP_END
}
if (Result.has_derivs())
exec->zero_derivs (Result); // 2nd order derivs are always zero
@@ -185,9 +185,9 @@
DASSERT (Result.is_varying());
VaryingRef<Float> result ((Float *)Result.data(), Result.step());
VaryingRef<Dual2<Vec3> > p ((Dual2<Vec3> *)P.data(), P.step());
- for (int i = beginpoint; i < endpoint; ++i)
- if (runflags[i])
- result[i] = (p[i].dx().cross(p[i].dy())).length();
+ SHADE_LOOP_BEGIN
+ result[i] = (p[i].dx().cross(p[i].dy())).length();
+ SHADE_LOOP_END
if (Result.has_derivs())
exec->zero_derivs (Result); // 2nd order derivs are always zero
} else {
@@ -224,9 +224,9 @@
DASSERT (Result.is_varying());
VaryingRef<T> result ((T *)Result.data(), Result.step());
VaryingRef<Dual2<T> > src ((Dual2<T> *)Src.data(), Src.step());
- for (int i = beginpoint; i < endpoint; ++i)
- if (runflags[i])
- result[i] = filter_width(src[i].dx(), src[i].dy());
+ SHADE_LOOP_BEGIN
+ result[i] = filter_width(src[i].dx(), src[i].dy());
+ SHADE_LOOP_END
if (Result.has_derivs())
exec->zero_derivs (Result); // 2nd order derivs are always zero
} else {
@@ -250,7 +250,7 @@
impl = filterwidth_guts<Vec3>;
if (impl) {
- impl (exec, nargs, args, runflags, beginpoint, endpoint);
+ impl (exec, nargs, args);
// Use the specialized one for next time! Never have to check the
// types or do the other sanity checks again.
// FIXME -- is this thread-safe?

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b