-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More clang-format (this time, testrender and liboslnoise) #1511
Conversation
any objections? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, I marked a few places that could benefit from
//clang-format off
//clang-format on
protections.
bench(" vhashnoise(v)", | ||
[&]() { DoNotOptimize(vhashnoise<const Vec3&>(vval)); }); | ||
bench(" vhashnoise(v,f)", | ||
[&]() { DoNotOptimize(vhashnoise<const Vec3&, float>(vval, fval)); }); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was more readable prior to clang-format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixing
src/liboslnoise/simplexnoise.cpp
Outdated
{ -1.0f, 1.0f, 1.0f, 0.0f }, | ||
{ -1.0f, 1.0f, -1.0f, 0.0f }, | ||
{ -1.0f, -1.0f, 1.0f, 0.0f }, | ||
{ -1.0f, -1.0f, -1.0f, 0.0f } }; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was more readable prior to clang-format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixing
k1 = 0; | ||
i2 = 1; | ||
j2 = 1; | ||
k2 = 0; /* Y X Z order */ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was more readable prior to clang-format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixing
sphere_intersect = m_optix_ctx->createProgramFromPTXString(sphere_ptx, | ||
"intersect"); | ||
quad_intersect = m_optix_ctx->createProgramFromPTXString(quad_ptx, | ||
"intersect"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was more readable prior to clang-format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meh, gonna leave
Vec3 N, U; | ||
float xalpha, yalpha, eta; | ||
int refract; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was more readable prior to clang-format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all about to be rewritten anyway
{ CLOSURE_VECTOR_PARAM(RefractionParams, N), | ||
CLOSURE_FLOAT_PARAM(RefractionParams, eta), | ||
CLOSURE_FINISH_PARAM(RefractionParams) } }, | ||
{ "transparent", TRANSPARENT_ID, { CLOSURE_FINISH_PARAM(EmptyParams) } }, | ||
// mark end of the array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was more readable prior to clang-format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not going to bother reverting because this is on the verge of being rewritten anyway as we synchronize all the closures with MaterialX
} | ||
break; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was more readable prior to clang-format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
about to get rewritten anyway
m_attr_getters[ustring("camera:shutter_open")] | ||
= &SimpleRaytracer::get_camera_shutter_open; | ||
m_attr_getters[ustring("camera:shutter_close")] | ||
= &SimpleRaytracer::get_camera_shutter_close; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was more readable prior to clang-format.
<< OIIO::Strutil::timeintervalformat(runtime, 4) << "\n"; | ||
std::cout << "Write : " | ||
<< OIIO::Strutil::timeintervalformat(writetime, 4) | ||
<< "\n"; | ||
std::cout << "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was more readable prior to clang-format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be rewritten anyway as I switch all this stream output to the new format style, so will leave for now.
Signed-off-by: Larry Gritz <[email protected]>
Thanks for looking over, @sfriedmapixar I fixed a few where I thought you were definitely right. I left a few that I know is in sections of code we're going to rewrite shortly anyway (out with the old closures, in with the new). And I left a few where I thought you were correct that it looked better before, but the practical value of being "better" was minimal. After clang-formatting a few code bases, I've come to accept that a few areas being slightly less beautiful than I could have made it by hand is actually a reasonable price to pay for the benefit of having it all automatic and minimizing the number of places littered with clang-format on/off comments. I do use them to make exceptions, but I try to do it only in the places where it really makes the code significantly more understandable. |
Signed-off-by: Larry Gritz [email protected]